dungeon_crawler
view prototype/src/datapath.cc @ 72:a27528035e20
- re-organized the renderer classes a bit wrt final render-target
- implemented identity color-grading palette for now
- broke particle systems....
- removed multipass renderer
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 19 Oct 2012 02:45:57 +0300 |
parents | 91180ee7b7d9 |
children |
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 std::string datafile_path(const char *fname)
14 {
15 std::string res;
16 if(!fname) {
17 return res;
18 }
20 for(auto path : pathlist) {
21 res = path + "/" + std::string(fname);
22 FILE *fp = fopen(res.c_str(), "r");
23 if(fp) {
24 fclose(fp);
25 return res;
26 }
27 }
28 return std::string(fname);
29 }