YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
ContentManager.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_CONTENTMANAGER_HPP
2
# define YAPOG_CONTENTMANAGER_HPP
3
4
# include <SFML/Graphics/Image.hpp>
5
# include <SFML/Graphics/Texture.hpp>
6
# include <SFML/Graphics/Font.hpp>
7
# include <SFML/Audio/SoundBuffer.hpp>
8
# include <SFML/Audio/Music.hpp>
9
10
# include "
YAPOG/Macros.hpp
"
11
# include "
YAPOG/System/String.hpp
"
12
# include "
YAPOG/Collection/Map.hpp
"
13
# include "
YAPOG/System/Path.hpp
"
14
# include "
YAPOG/System/IOStream.hpp
"
15
16
namespace
yap
17
{
18
class
ID;
19
20
class
YAPOG_LIB
ContentManager
21
{
22
DISALLOW_COPY
(
ContentManager
);
23
24
public
:
25
26
static
ContentManager
& Instance ();
27
28
void
Init (
const
Path
& rootPath);
29
const
Path
& GetContentPath ()
const
;
30
31
void
SetImagePath (
const
Path
& path);
32
void
SetTexturePath (
const
Path
& path);
33
void
SetFontPath (
const
Path
& path);
34
void
SetSoundBufferPath (
const
Path
& path);
35
void
SetMusicPath (
const
Path
& path);
36
37
sf::Image& LoadImage (
const
String
& name);
38
sf::Texture& LoadTexture (
const
String
& name);
39
sf::Font& LoadFont (
const
String
& name);
40
sf::SoundBuffer& LoadSoundBuffer (
const
String
& name);
41
sf::Music& LoadMusic (
const
String
& name);
42
43
void
UnloadImage (
const
String
& name);
44
void
UnloadTexture (
const
String
& name);
45
void
UnloadFont (
const
String
& name);
46
void
UnloadSoundBuffer (
const
String
& name);
47
void
UnloadMusic (
const
String
& name);
48
49
IFStream
& LoadFile (
const
String
& name,
IFStream
& iFStream);
50
IFStream
& LoadFile (
51
const
Path
& rootPath,
52
const
ID
&
id
,
53
IFStream
& iFStream);
54
55
private
:
56
57
ContentManager
(
const
Path
& rootPath);
58
~
ContentManager
();
59
60
static
const
Path
DEFAULT_ROOT_PATH
;
61
static
const
Path
DEFAULT_IMAGE_PATH
;
62
static
const
Path
DEFAULT_TEXTURE_PATH
;
63
static
const
Path
DEFAULT_FONT_PATH
;
64
static
const
Path
DEFAULT_SOUND_BUFFER_PATH
;
65
static
const
Path
DEFAULT_MUSIC_PATH
;
66
67
static
const
String
DEFAULT_DATA_RESOURCE_FILE_EXTENSION
;
68
69
Path
rootPath_
;
70
71
Path
imagePath_
;
72
Path
texturePath_
;
73
Path
fontPath_
;
74
Path
soundBufferPath_
;
75
Path
musicPath_
;
76
77
collection::Map<String, sf::Image*>
images_
;
78
collection::Map<String, sf::Texture*>
textures_
;
79
collection::Map<String, sf::Font*>
fonts_
;
80
collection::Map<String, sf::SoundBuffer*>
soundBuffers_
;
81
collection::Map<String, sf::Music*>
musics_
;
82
};
83
}
// namespace yap
84
85
#endif // YAPOG_CONTENTMANAGER_HPP
YAPOG
include
YAPOG
Content
ContentManager.hpp
Generated on Mon Sep 17 2012 22:24:22 for YAPOG by
1.8.1.1