X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fresources.cpp;h=5267f4b8ac1ec0382eaeec1651ae9c38cd842689;hb=2d97548e5cded4b201bbc10d6cec6232df03e9a4;hp=d6e73647f525f9e8dacdb5a612bb0f33b7d443fb;hpb=d46c78c842ab4090a3f46e560c891234167f124b;p=supertux.git diff --git a/src/resources.cpp b/src/resources.cpp index d6e73647f..5267f4b8a 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -25,11 +25,9 @@ #include "gui/menu.h" #include "gui/button.h" #include "scene.h" -#include "player.h" -#include "badguy.h" -#include "gameobjs.h" #include "resources.h" -#include "badguy_specs.h" +#include "object/gameobjs.h" +#include "object/player.h" Surface* img_waves[3]; Surface* img_water; @@ -157,9 +155,6 @@ void loadshared() ice_tux->arms = sprite_manager->create("big-tux-arms"); ice_tux->feet = sprite_manager->create("big-tux-feet"); - /* Load Bad Guys resources */ - badguyspecs_manager = new BadGuySpecsManager(datadir + "/badguys.strf"); - /* Water: */ img_water = new Surface(datadir + "/images/shared/water.png", false); @@ -254,7 +249,7 @@ void loadshared() /* Herring song */ herring_song = SoundManager::get - ()->load_music(datadir + "/music/SALCON.MOD"); + ()->load_music(datadir + "/music/salcon.mod"); level_end_song = SoundManager::get ()->load_music(datadir + "/music/leveldone.mod"); } @@ -309,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 ""; +}