diff options
Diffstat (limited to 'engines/neverhood/module2800.cpp')
-rw-r--r-- | engines/neverhood/module2800.cpp | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/engines/neverhood/module2800.cpp b/engines/neverhood/module2800.cpp index 7c7c097696..214e65e62e 100644 --- a/engines/neverhood/module2800.cpp +++ b/engines/neverhood/module2800.cpp @@ -1734,7 +1734,7 @@ Scene2804::Scene2804(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule), _countdown1(0), _countdown2(0), _countdown3(0), _beamStatus(0), _isSolved(false), _isWorking(false) { - initCrystalColors(); + _vm->gameModule()->initCrystalColorsPuzzle(); SetMessageHandler(&Scene2804::handleMessage); SetUpdateHandler(&Scene2804::update); @@ -1841,46 +1841,6 @@ void Scene2804::update() { } -void Scene2804::initCrystalColors() { - // TODO Maybe move this into the GameModule so all puzzle init code is together - if (getGlobalVar(V_CRYSTAL_COLORS_INIT) == 0) { - TextResource textResource(_vm); - const char *textStart, *textEnd; - textResource.load(0x46691611); - textStart = textResource.getString(0, textEnd); - for (uint index = 0; index < 5; index++) { - char colorLetter = (byte)textStart[index]; - byte correctColorNum = 0, misalignedColorNum; - switch (colorLetter) { - case 'B': - correctColorNum = 4; - break; - case 'G': - correctColorNum = 3; - break; - case 'O': - correctColorNum = 1; - break; - case 'R': - correctColorNum = 0; - break; - case 'V': - correctColorNum = 5; - break; - case 'Y': - correctColorNum = 2; - break; - } - do { - misalignedColorNum = _vm->_rnd->getRandomNumber(6 - 1); - } while (misalignedColorNum == correctColorNum); - setSubVar(VA_GOOD_CRYSTAL_COLORS, index, correctColorNum); - setSubVar(VA_CURR_CRYSTAL_COLORS, index, misalignedColorNum); - } - setGlobalVar(V_CRYSTAL_COLORS_INIT, 1); - } -} - Scene2805::Scene2805(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule) { |