X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fresources.cpp;h=5267f4b8ac1ec0382eaeec1651ae9c38cd842689;hb=6f801c22d97251799740317fb1d0caf2e744b321;hp=ac23078d4d20deba7f9afa78dc279aa5f938c9b5;hpb=8b667c97ef73b811b75727febeeb6c7cc8c5ceec;p=supertux.git diff --git a/src/resources.cpp b/src/resources.cpp index ac23078d4..5267f4b8a 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -25,9 +25,9 @@ #include "gui/menu.h" #include "gui/button.h" #include "scene.h" -#include "player.h" -#include "gameobjs.h" #include "resources.h" +#include "object/gameobjs.h" +#include "object/player.h" Surface* img_waves[3]; Surface* img_water; @@ -304,3 +304,16 @@ void unloadshared(void) sprite_manager = 0; } +std::string get_resource_filename(const std::string& resource) +{ + std::string filepath = st_dir + resource; + if(access(filepath.c_str(), R_OK) == 0) + return filepath; + + filepath = datadir + resource; + if(access(filepath.c_str(), R_OK) == 0) + return filepath; + + std::cerr << "Couldn't find resource: '" << resource << "'." << std::endl; + return ""; +}