diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 22bdd210..c2762ab6 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -113,9 +113,9 @@ bool GetButtonFromString(const char *pText, SDL_GameControllerButton *button) } -Game::Game(void): - mutebutton(0) +void Game::init(void) { + mutebutton = 0; infocus = true; paused = false; muted = false; diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index 08ee639c..657d7582 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -17,7 +17,7 @@ class musicclass; class Game { public: - Game(void); + void init(void); ~Game(void); @@ -362,4 +362,6 @@ public: bool skipfakeload; }; +extern Game game; + #endif /* GAME_H */ diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index f40f0a33..bc5270c3 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -4,8 +4,10 @@ #include "Map.h" #include "Screen.h" -Graphics::Graphics() +void Graphics::init() { + grphx.init(); + flipmode = false; setRect(tiles_rect, 0,0,8,8); setRect(sprites_rect, 0,0,32,32); diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index a2b10d7c..2aa7c2ac 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -23,7 +23,7 @@ class map; class Graphics { public: - Graphics(); + void init(); ~Graphics(); GraphicsResources grphx; @@ -282,4 +282,6 @@ public: bool showmousecursor; }; +extern Graphics graphics; + #endif /* GRAPHICS_H */ diff --git a/desktop_version/src/GraphicsResources.cpp b/desktop_version/src/GraphicsResources.cpp index 379d1064..b7eb7c1b 100644 --- a/desktop_version/src/GraphicsResources.cpp +++ b/desktop_version/src/GraphicsResources.cpp @@ -80,7 +80,7 @@ SDL_Surface* LoadImage(const char *filename, bool noBlend = true, bool noAlpha = } } -GraphicsResources::GraphicsResources(void) +void GraphicsResources::init(void) { im_tiles = LoadImage("graphics/tiles.png"); im_tiles2 = LoadImage("graphics/tiles2.png"); diff --git a/desktop_version/src/GraphicsResources.h b/desktop_version/src/GraphicsResources.h index 67060c4c..16c694d7 100644 --- a/desktop_version/src/GraphicsResources.h +++ b/desktop_version/src/GraphicsResources.h @@ -6,7 +6,7 @@ class GraphicsResources { public: - GraphicsResources(void); + void init(void); ~GraphicsResources(void); SDL_Surface* im_tiles; diff --git a/desktop_version/src/KeyPoll.h b/desktop_version/src/KeyPoll.h index 2a21405c..56333461 100644 --- a/desktop_version/src/KeyPoll.h +++ b/desktop_version/src/KeyPoll.h @@ -81,5 +81,6 @@ private: Uint32 wasFullscreen; }; +extern KeyPoll key; #endif /* KEYPOLL_H */ diff --git a/desktop_version/src/Map.h b/desktop_version/src/Map.h index 604b296d..7287f188 100644 --- a/desktop_version/src/Map.h +++ b/desktop_version/src/Map.h @@ -179,4 +179,6 @@ public: int cursorstate, cursordelay; }; +extern mapclass map; + #endif /* MAPGAME_H */ diff --git a/desktop_version/src/Music.cpp b/desktop_version/src/Music.cpp index d162bf6e..04c6debf 100644 --- a/desktop_version/src/Music.cpp +++ b/desktop_version/src/Music.cpp @@ -3,7 +3,7 @@ #include "Music.h" #include "BinaryBlob.h" -musicclass::musicclass() +void musicclass::init() { soundTracks.push_back(SoundTrack( "sounds/jump.wav" )); soundTracks.push_back(SoundTrack( "sounds/jump2.wav" )); diff --git a/desktop_version/src/Music.h b/desktop_version/src/Music.h index dd081eae..9afffb2a 100644 --- a/desktop_version/src/Music.h +++ b/desktop_version/src/Music.h @@ -10,7 +10,7 @@ class musicclass { public: - musicclass(); + void init(); void play(int t); void loopmusic(); @@ -64,5 +64,6 @@ public: bool usingmmmmmm; }; +extern musicclass music; #endif /* MUSIC_H */ diff --git a/desktop_version/src/UtilityClass.h b/desktop_version/src/UtilityClass.h index 24e89885..600be5fc 100644 --- a/desktop_version/src/UtilityClass.h +++ b/desktop_version/src/UtilityClass.h @@ -43,4 +43,6 @@ public: std::vector splitseconds; }; +extern UtilityClass help; + #endif /* UTILITYCLASS_H */ diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index 3adf9ab3..4dba0fa4 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -34,6 +34,14 @@ scriptclass script; editorclass ed; +UtilityClass help; +Graphics graphics; +musicclass music; +Game game; +KeyPoll key; +mapclass map; +entityclass obj; + int main(int argc, char *argv[]) { if(!FILESYSTEM_init(argv[0])) @@ -90,16 +98,19 @@ int main(int argc, char *argv[]) - UtilityClass help; + //UtilityClass help; // Load Ini - Graphics graphics; + //Graphics graphics; + graphics.init(); - musicclass music; - Game game; + //musicclass music; + music.init(); + //Game game; + game.init(); game.infocus = true; graphics.MakeTileArray(); @@ -159,8 +170,8 @@ int main(int argc, char *argv[]) game.menustart = false; game.mainmenu = 0; - KeyPoll key; - mapclass map; + //KeyPoll key; + //mapclass map; map.ypos = (700-29) * 8; map.bypos = map.ypos / 2; @@ -217,7 +228,7 @@ int main(int argc, char *argv[]) if(game.bestrank[4]>=3) NETWORK_unlockAchievement("vvvvvvtimetrial_warp_fixed"); if(game.bestrank[5]>=3) NETWORK_unlockAchievement("vvvvvvtimetrial_final_fixed"); - entityclass obj; + //entityclass obj; obj.init(); //Quick hack to start in final level ---- //Might be useful to leave this commented in for testing