From dd2768a2e47dd54f055cf65b2212ee9dca395c18 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sun, 15 Jul 2012 17:06:56 +0200 Subject: GOB: Reorder a few things --- engines/gob/pregob/onceupon/onceupon.cpp | 8 ++--- engines/gob/pregob/onceupon/onceupon.h | 60 ++++++++++++++++---------------- engines/gob/pregob/onceupon/stork.h | 12 +++---- engines/gob/pregob/pregob.h | 13 +++---- 4 files changed, 47 insertions(+), 46 deletions(-) diff --git a/engines/gob/pregob/onceupon/onceupon.cpp b/engines/gob/pregob/onceupon/onceupon.cpp index 6ee391ea7f..9d32eaa356 100644 --- a/engines/gob/pregob/onceupon/onceupon.cpp +++ b/engines/gob/pregob/onceupon/onceupon.cpp @@ -135,7 +135,7 @@ const OnceUpon::MenuButton OnceUpon::kLanguageButtons[] = { {true, 234, 138, 284, 173, 265, 55, 315, 90, 234, 138, 2} }; -const char *OnceUpon::kSound[kSoundMAX] = { +const char *OnceUpon::kSound[kSoundCount] = { "diamant.snd", // kSoundClick "cigogne.snd", // kSoundStork "saute.snd" // kSoundJump @@ -216,7 +216,7 @@ void OnceUpon::init() { // Load all our sounds and init the screen - loadSounds(kSound, kSoundMAX); + loadSounds(kSound, kSoundCount); initScreen(); // We start with an invalid palette @@ -226,7 +226,7 @@ void OnceUpon::init() { _quit = false; // We start with no selected difficulty and at section 0 - _difficulty = kDifficultyMAX; + _difficulty = kDifficultyCount; _section = 0; // Default name @@ -926,7 +926,7 @@ void OnceUpon::drawIngameMenu() { } void OnceUpon::drawMenuDifficulty() { - if (_difficulty == kDifficultyMAX) + if (_difficulty == kDifficultyCount) return; TXTFile *difficulties = loadTXT(getLocFile("diffic.tx"), TXTFile::kFormatStringPositionColor); diff --git a/engines/gob/pregob/onceupon/onceupon.h b/engines/gob/pregob/onceupon/onceupon.h index 41a2f5668d..66ef877618 100644 --- a/engines/gob/pregob/onceupon/onceupon.h +++ b/engines/gob/pregob/onceupon/onceupon.h @@ -129,7 +129,7 @@ private: kDifficultyBeginner = 0, kDifficultyIntermediate = 1, kDifficultyAdvanced = 2, - kDifficultyMAX + kDifficultyCount }; /** The different sounds common in the game. */ @@ -137,7 +137,7 @@ private: kSoundClick = 0, kSoundStork , kSoundJump , - kSoundMAX + kSoundCount }; /** Action the character generation wants us to take. */ @@ -181,7 +181,7 @@ private: static const MenuButton kCharGenNameEntry[]; /** All general game sounds we know about. */ - static const char *kSound[kSoundMAX]; + static const char *kSound[kSoundCount]; static const AnimProperties kClownAnimations[]; @@ -196,6 +196,33 @@ private: static const SectionFunc kSectionFuncs[kSectionCount]; + /** Did we open the game archives? */ + bool _openedArchives; + + // Fonts + Font *_jeudak; + Font *_lettre; + Font *_plettre; + Font *_glettre; + + /** The current palette. */ + int _palette; + + bool _quit; ///< Did the user request a normal game quit? + + Difficulty _difficulty; ///< The current difficulty. + int _section; ///< The current game section. + + Common::String _name; ///< The name of the child. + + uint8 _house; + + uint8 _head; + uint8 _colorHair; + uint8 _colorJacket; + uint8 _colorTrousers; + + // -- General helpers -- void setGamePalette(uint palette); ///< Set a game palette. @@ -308,33 +335,6 @@ private: void charGenDrawName(); static bool enterString(Common::String &name, int16 key, uint maxLength, const Font &font); - - - /** Did we open the game archives? */ - bool _openedArchives; - - // Fonts - Font *_jeudak; - Font *_lettre; - Font *_plettre; - Font *_glettre; - - /** The current palette. */ - int _palette; - - bool _quit; ///< Did the user request a normal game quit? - - Difficulty _difficulty; ///< The current difficulty. - int _section; ///< The current game section. - - Common::String _name; ///< The name of the child. - - uint8 _house; - - uint8 _head; - uint8 _colorHair; - uint8 _colorJacket; - uint8 _colorTrousers; }; } // End of namespace OnceUpon diff --git a/engines/gob/pregob/onceupon/stork.h b/engines/gob/pregob/onceupon/stork.h index d26a887c97..756f5258c7 100644 --- a/engines/gob/pregob/onceupon/stork.h +++ b/engines/gob/pregob/onceupon/stork.h @@ -79,12 +79,6 @@ private: }; - void setState(State state, uint16 anim); - void setState(State state, uint16 anim, int16 x); - - void dropBundle(State state, uint16 anim); - - GobEngine *_vm; Surface *_frame; @@ -94,6 +88,12 @@ private: bool _shouldDrop; BundleDrop _bundleDrop; + + + void setState(State state, uint16 anim); + void setState(State state, uint16 anim, int16 x); + + void dropBundle(State state, uint16 anim); }; } // End of namespace OnceUpon diff --git a/engines/gob/pregob/pregob.h b/engines/gob/pregob/pregob.h index da0de60dd8..632f85b88e 100644 --- a/engines/gob/pregob/pregob.h +++ b/engines/gob/pregob/pregob.h @@ -68,6 +68,9 @@ protected: static const char *kLanguageSuffixLong [5]; + GobEngine *_vm; + + // -- Graphics -- /** Initialize the game screen. */ @@ -174,18 +177,16 @@ protected: GCTFile *loadGCT(const Common::String &gctFile) const; - GobEngine *_vm; - private: - /** Load a sound file. */ - bool loadSound(SoundDesc &sound, const Common::String &file) const; - - /** Did we fade out? */ bool _fadedOut; /** All loaded sounds. */ Common::Array _sounds; + + + /** Load a sound file. */ + bool loadSound(SoundDesc &sound, const Common::String &file) const; }; } // End of namespace Gob -- cgit v1.2.3