xoreos  0.0.5
areaminimap.cpp
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #include "src/common/ustring.h"
26 #include "src/common/error.h"
27 #include "src/common/readstream.h"
28 
29 #include "src/aurora/resman.h"
30 
32 
36 
39 
40 namespace Engines {
41 
42 namespace Sonic {
43 
45  loadMiniMap(name);
46 }
47 
49  hide();
50 }
51 
53  if (_miniMap)
54  _miniMap->show();
55 }
56 
58  if (_miniMap)
59  _miniMap->hide();
60 }
61 
63  try {
65  if (!nbfs)
66  throw Common::Exception("No such NBFS");
67 
69  if (!nbfp)
70  throw Common::Exception("No such NBFP");
71 
73 
76 
77  image.release();
78 
80  0.0f, 1.0f, 1.0f, 0.0f));
81  _miniMap->setPosition(kTopScreenX, kTopScreenY, 0.0f);
82 
83  } catch (Common::Exception &e) {
84  e.add("Failed loading area minimap \"%s\"", name.c_str());
85  throw;
86  }
87 }
88 
89 } // End of namespace Sonic
90 
91 } // End of namespace Engines
static const float kScreenHeight
Definition: types.h:35
#define ResMan
Shortcut for accessing the sound manager.
Definition: resman.h:557
void add(const char *s,...) GCC_PRINTF(2
Definition: error.cpp:58
A class holding an UTF-8 string.
Definition: ustring.h:48
#define TextureMan
Shortcut for accessing the texture manager.
Definition: textureman.h:127
void reset(PointerType o=0)
Resets the pointer with the new value.
Definition: scopedptr.h:87
PointerType release()
Returns the plain pointer value and releases ScopedPtr.
Definition: scopedptr.h:103
Common::ScopedPtr< Graphics::Aurora::GUIQuad > _miniMap
Definition: areaminimap.h:53
static Texture * create(const Common::UString &name, bool deswizzle=false)
Create a texture from this image resource.
Definition: texture.cpp:323
The Aurora texture manager.
Exception that provides a stack of explanations.
Definition: error.h:36
Basic Sonic Chronicles: The Dark Brotherhood types and defines.
Basic exceptions to throw.
const char * c_str() const
Return the (utf8 encoded) string data.
Definition: ustring.cpp:249
The area mini map in Sonic Chronicles: The Dark Brotherhood.
static const float kScreenWidth
Definition: types.h:34
Image, Map, Nitro Basic File Screen.
Definition: types.h:264
StackException Exception
Definition: error.h:59
Basic reading stream interfaces.
Palette, Nitro Basic File Palette.
Definition: types.h:263
Unicode string handling.
PointerType get() const
Returns the plain pointer value.
Definition: scopedptr.h:96
void loadMiniMap(const Common::UString &name)
Definition: areaminimap.cpp:62
AreaMiniMap(const Common::UString &name)
Definition: areaminimap.cpp:44
A texture as used in the Aurora engines.
static const float kTopScreenX
Definition: types.h:37
Nitro Basic File Screen, a simple raw Nintendo DS image.
A textured quad for a GUI element.
A handle to a texture.
Definition: texturehandle.h:51
static const float kTopScreenY
Definition: types.h:38
The global resource manager for Aurora resources.