~ubuntu-branches/ubuntu/maverick/btanks/maverick

« back to all changes in this revision

Viewing changes to engine/src/resource_manager.h

  • Committer: Bazaar Package Importer
  • Author(s): Ansgar Burchardt
  • Date: 2010-01-17 00:02:57 UTC
  • mfrom: (4.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100117000257-iw6esnvsz1rvp6kb
Tags: 0.9.8083-2
* Fix build failure when building only arch-specific package.
* debian/control: Add DM-Upload-Allowed: yes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#define __BT_RESOURCE_MANAGER_H__
3
3
 
4
4
/* Battle Tanks Game
5
 
 * Copyright (C) 2006-2008 Battle Tanks team
 
5
 * Copyright (C) 2006-2009 Battle Tanks team
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or
8
8
 * modify it under the terms of the GNU General Public License
49
49
class AnimationModel;
50
50
class Pose;
51
51
 
 
52
#define AUTOLOAD_SURFACE(surface, filename) if ((surface) == NULL) surface = ResourceManager->load_surface(filename)
 
53
 
52
54
class BTANKSAPI IResourceManager : public NotifyingXMLParser {
53
55
public:
54
56
        IResourceManager();
68
70
        const Animation *getAnimation(const std::string &id) const;
69
71
        const bool hasAnimation(const std::string &id) const;
70
72
 
71
 
        const sdlx::Surface *loadSurface(const std::string &id);
 
73
        const sdlx::Surface *load_surface(const std::string &id, int scale_to_w = 0, int scale_to_h = 0);
 
74
        void unload_surface(const std::string &id); //do not use it until you known what you're doing
72
75
        const sdlx::Surface *get_surface(const std::string &id) const;
73
76
        const sdlx::CollisionMap *getCollisionMap(const std::string &id) const;
74
77
        const sdlx::Font *loadFont(const std::string &id, const bool alpha);
86
89
private:
87
90
        void preload(const std::string &animation);
88
91
        Animation *getAnimation(const std::string &id);
 
92
        
 
93
        static sdlx::CollisionMap * create_cmap(const sdlx::Surface *s, const std::string &tile);
89
94
 
90
95
        //xml stuff
91
96
        std::string _base_dir;
126
131
        const IResourceManager& operator=(const IResourceManager &);
127
132
};
128
133
 
129
 
SINGLETON(BTANKSAPI, ResourceManager, IResourceManager);
 
134
PUBLIC_SINGLETON(BTANKSAPI, ResourceManager, IResourceManager);
130
135
 
131
136
#endif
132
137