summaryrefslogtreecommitdiffhomepage
path: root/Stars45/Game.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-02-23 23:13:27 +0100
committerAki <please@ignore.pl>2022-02-23 23:13:27 +0100
commit8b778dda61c45f5d7a4dc416478c42ff4aa1de7f (patch)
tree004ea4bbe7dde92d4632b908de8450cb767549d3 /Stars45/Game.cpp
parent0052edae47d1e6ae613497c524719eff5838f52a (diff)
downloadstarshatter-8b778dda61c45f5d7a4dc416478c42ff4aa1de7f.zip
starshatter-8b778dda61c45f5d7a4dc416478c42ff4aa1de7f.tar.gz
starshatter-8b778dda61c45f5d7a4dc416478c42ff4aa1de7f.tar.bz2
Moved content management out to ContentBundle
Diffstat (limited to 'Stars45/Game.cpp')
-rw-r--r--Stars45/Game.cpp58
1 files changed, 2 insertions, 56 deletions
diff --git a/Stars45/Game.cpp b/Stars45/Game.cpp
index 4a2e8d8..5ec6c0c 100644
--- a/Stars45/Game.cpp
+++ b/Stars45/Game.cpp
@@ -46,7 +46,7 @@ Game::Game()
: world(0), video_factory(0), video(0), video_settings(0), soundcard(0),
gamma(128), max_tex_size(2048), screen(0), totaltime(0),
hInst(0), hwnd(0), frame_rate(0), frame_count(0), frame_count0(0),
- frame_time(0), frame_time0(0), gui_seconds(0), content(0),
+ frame_time(0), frame_time0(0), gui_seconds(0),
status(Game::OK), exit_code(0), window_style(0)
{
if (!game) {
@@ -87,7 +87,6 @@ Game::~Game()
if (game == this)
game = 0;
- delete content;
delete world;
delete screen;
delete video_factory;
@@ -127,17 +126,6 @@ bool Game::IsWindowed()
// +--------------------------------------------------------------------+
-Text
-Game::GetText(const char* key)
-{
- if (game && game->content && game->content->IsLoaded())
- return game->content->GetText(key);
-
- return key;
-}
-
-// +--------------------------------------------------------------------+
-
int
Game::GammaLevel()
{
@@ -276,7 +264,7 @@ Game::Init(HINSTANCE hi, HINSTANCE hpi, LPSTR cmdline, int nCmdShow)
if (status == OK) {
Print(" Initializing content...\n");
- InitContent();
+ ContentBundle::GetInstance()->Init();
Print(" Initializing game...\n");
if (!InitGame()) {
@@ -712,48 +700,6 @@ Game::InitGame()
return true;
}
-
-// +--------------------------------------------------------------------+
-
-bool
-Game::InitContent()
-{
- DataLoader* loader = DataLoader::GetLoader();
- List<Text> bundles;
-
- loader->SetDataPath("Content/");
- loader->ListFiles("content*", bundles);
-
- ListIter<Text> iter = bundles;
- while (++iter) {
- Text* filename = iter.value();
- int n = filename->indexOf('_');
-
- if (n > 0) {
- Locale::ParseLocale(filename->data() + n);
- }
- else {
- delete content;
- content = new(__FILE__,__LINE__) ContentBundle("content", 0);
- }
- }
-
- loader->SetDataPath(0);
- return true;
-}
-
-void
-Game::UseLocale(Locale* locale)
-{
- DataLoader* loader = DataLoader::GetLoader();
- loader->SetDataPath("Content/");
- delete content;
-
- content = new(__FILE__,__LINE__) ContentBundle("content", locale);
-
- loader->SetDataPath(0);
-}
-
// +--------------------------------------------------------------------+
bool