dungeon_crawler
view prototype/src/datapath.cc @ 51:d57df51f6b50
- fixed audio panning (listener direction)
- particles had no fog
- sound sources were not destroyed properly
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 18 Sep 2012 09:40:56 +0300 |
parents | 252a00508411 |
children | 7f52d6310317 |
line source
1 #include <stdio.h>
2 #include <vector>
3 #include <string>
4 #include "datapath.h"
6 static std::vector<std::string> pathlist;
8 void add_data_path(const char *path)
9 {
10 pathlist.push_back(path);
11 }
13 const char *datafile_path(const char *fname)
14 {
15 static std::string res;
17 if(!fname) {
18 return 0;
19 }
21 for(auto path : pathlist) {
22 res = path + "/" + std::string(fname);
23 FILE *fp = fopen(res.c_str(), "r");
24 if(fp) {
25 fclose(fp);
26 return res.c_str();
27 }
28 }
29 return 0;
30 }