From 2b78d5190b6b734fbf24ab533cef0c8f427cbe0f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 14 Jan 2015 00:20:45 -0500 Subject: XEEN: Implementing drawIndoors --- engines/xeen/interface.cpp | 896 ++++++++++++++++++++++++++++++++++++++++++++- engines/xeen/interface.h | 3 +- engines/xeen/map.cpp | 4 +- engines/xeen/map.h | 5 +- engines/xeen/resources.cpp | 14 + engines/xeen/resources.h | 4 + 6 files changed, 920 insertions(+), 6 deletions(-) diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 4bf9b1aa3b..12317da0ef 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -377,6 +377,7 @@ Interface::Interface(XeenEngine *vm) : ButtonContainer(), _vm(vm) { _hiliteChar = -1; _intrIndex1 = 0; _flipWtr = false; + _flipWall = false; _flag1 = false; _animCounter = 0; _isAnimReset = false; @@ -384,11 +385,11 @@ Interface::Interface(XeenEngine *vm) : ButtonContainer(), _vm(vm) { _tillMove = 0; _objNumber = 0; _thinWall = false; + _overallFrame = 0; Common::fill(&_combatCharIds[0], &_combatCharIds[8], 0); Common::fill(&_wp[0], &_wp[20], 0); Common::fill(&_wo[0], &_wo[308], 0); - Common::fill(&_charsArray1[0], &_charsArray1[12], 0); initDrawStructs(); } @@ -967,7 +968,7 @@ void Interface::draw3d(bool updateFlag) { ds1._sprites = nullptr; ds2._sprites = nullptr; - if (_charsArray1[idx]) { + if (combat._charsArray1[idx]) { int posIndex= combat._attackMon2 && !combat._attackMon3 ? 1 : 0; --combat._charsArray1[idx]; @@ -2842,8 +2843,897 @@ void Interface::setMazeBits() { void Interface::drawIndoors() { Map &map = *_vm->_map; + int surfaceId; + int idx; - map.getCell(36); + for (int cellIndex = 0; cellIndex < 25; ++cellIndex) { + map.getCell(DRAW_NUMBERS[cellIndex]); + + DrawStruct &drawStruct = _indoorList[3 + cellIndex]; + drawStruct._sprites = &map._surfaceSprites[map._currentSurfaceId]; + + surfaceId = map.mazeData()._surfaceTypes[map._currentSurfaceId]; + if (surfaceId == 5 || surfaceId == 12) { + drawStruct._flags = _flipWtr; + drawStruct._frame = DRAW_FRAMES[cellIndex][_flipWtr ? 1 : 0]; + } + else { + drawStruct._frame = DRAW_FRAMES[cellIndex][_flipWall ? 1 : 0]; + drawStruct._flags = _flipWall ? 0 : SPRFLAG_HORIZ_FLIPPED; + } + } + + if (!_wo[27] && !_wo[20] && !_wo[23] && !_wo[12] && !_wo[8] && !_wo[30]) { + if (_wo[39]) + _indoorList._swl_4F4L._frame = 22; + else if (_wo[83]) + _indoorList._swl_4F4L._frame = 46; + } + + if (!_wo[27] && !_wo[22] && !_wo[17] && !_wo[12] && !_wo[8]) { + if (_wo[38]) + _indoorList._swl_4F3L._frame = 20; + else if (_wo[82]) + _indoorList._swl_4F3L._frame = 44; + } + + if (!_wo[27] && !_wo[22] && !_wo[15] && !_wo[2] && !_wo[7]) { + if (_wo[37]) + _indoorList._swl_4F2L._frame = 18; + else if (_wo[81]) + _indoorList._swl_4F2L._frame = 42; + } + + if (!_wo[27] && !_wo[22] && !_wo[15] && !_wo[6]) { + if (_wo[36]) + _indoorList._swl_4F1L._frame = 16; + else if (_wo[80]) + _indoorList._swl_4F1L._frame = 40; + } + + if (!_wo[27] && !_wo[21] && !_wo[24] && !_wo[14] && !_wo[10] && !_wo[31]) { + if (_wo[43]) + _indoorList._swl_4F4R._frame = 23; + else if (_wo[87]) + _indoorList._swl_4F4R._frame = 47; + } + + if (!_wo[27] && !_wo[22] && !_wo[19] && !_wo[14] && !_wo[10]) { + if (_wo[42]) + _indoorList._swl_4F3R._frame = 21; + else if (_wo[86]) + _indoorList._swl_4F3R._frame = 45; + } + + if (!_wo[27] && !_wo[22] && !_wo[15] && !_wo[5] && !_wo[9]) { + if (_wo[41]) + _indoorList._swl_4F2R._frame = 19; + else if (_wo[85]) + _indoorList._swl_4F2R._frame = 43; + } + + if (!_wo[27] && !_wo[22] && !_wo[15] && !_wo[6]) { + if (_wo[40]) + _indoorList._swl_4F1R._frame = 17; + else if (_wo[84]) + _indoorList._swl_4F1R._frame = 41; + } + + if (!_wo[25] && !_wo[28] && !_wo[20] && !_wo[11] && + !_wo[16] && !_wo[30] && !_wo[32]) { + if (_wo[88]) + _indoorList._fwl_4F4L._frame = 7; + else if (_wo[78]) + _indoorList._fwl_4F4L._frame = 16; + else if (_wo[148]) + _indoorList._fwl_4F4L._frame = _overallFrame + 1; + else if (_wo[108]) + _indoorList._fwl_4F4L._frame = 8; + else if (_wo[168]) + _indoorList._fwl_4F4L._frame = 10; + else if (_wo[128]) + _indoorList._fwl_4F4L._frame = 9; + else if (_wo[34]) + _indoorList._fwl_4F4L._frame = 0; + else if (_wo[188]) + _indoorList._fwl_4F4L._frame = 15; + else if (_wo[208]) + _indoorList._fwl_4F4L._frame = 14; + else if (_wo[228]) + _indoorList._fwl_4F4L._frame = 6; + else if (_wo[248]) + _indoorList._fwl_4F4L._frame = 11; + else if (_wo[268]) + _indoorList._fwl_4F4L._frame = 12; + else if (_wo[288]) + _indoorList._fwl_4F4L._frame = 13; + } + + if (!_wo[26] && !_wo[29] && !_wo[21] && !_wo[13] && !_wo[18] && !_wo[31] && !_wo[33]) { + if (_wo[93]) + _indoorList._fwl_4F4R._frame = 7; + else if (_wo[79]) + _indoorList._fwl_4F4R._frame = 16; + else if (_wo[153]) + _indoorList._fwl_4F4R._frame = _overallFrame + 1; + else if (_wo[113]) + _indoorList._fwl_4F4R._frame = 8; + else if (_wo[173]) + _indoorList._fwl_4F4R._frame = 10; + else if (_wo[133]) + _indoorList._fwl_4F4R._frame = 9; + else if (_wo[35]) + _indoorList._fwl_4F4R._frame = 0; + else if (_wo[79]) + _indoorList._fwl_4F4R._frame = 15; + else if (_wo[213]) + _indoorList._fwl_4F4R._frame = 14; + else if (_wo[233]) + _indoorList._fwl_4F4R._frame = 6; + else if (_wo[253]) + _indoorList._fwl_4F4R._frame = 11; + else if (_wo[273]) + _indoorList._fwl_4F4R._frame = 12; + else if (_wo[293]) + _indoorList._fwl_4F4R._frame = 13; + } + + if (!_wo[25] && !_wo[28] && !_wo[20] && !_wo[11] && !_wo[16] && !_wo[30]) { + if (_wo[32]) + _indoorList._swl_3F4L._frame = 14; + else if (_wo[76]) + _indoorList._swl_3F4L._frame = 38; + } + + if (!_wo[26] && !_wo[29] && !_wo[21] && !_wo[13] && !_wo[18] && !_wo[31]) { + if (_wo[33]) + _indoorList._fwl_3F1R._frame = 15; + else if (_wo[77]) + _indoorList._swl_3F1R._frame = 39; + } + + if (_wo[28] && _wo[27]) { + } + else if (_wo[28] && _wo[12]) { + } + else if (_wo[28] && _wo[23]) { + } + else if (_wo[28] && _wo[8]) { + } + else if (_wo[25] && _wo[27]) { + } + else if (_wo[25] && _wo[12]) { + } + else if (_wo[25] && _wo[23]) { + } + else if (_wo[25] && _wo[8]) { + } + else if (_wo[11] && _wo[27]) { + } + else if (_wo[11] && _wo[12]) { + } + else if (_wo[11] && _wo[23]) { + } + else if (_wo[11] && _wo[8]) { + } + else if (_wo[17] && _wo[27]) { + } + else if (_wo[17] && _wo[12]) { + } + else if (_wo[17] && _wo[23]) { + } + else if (_wo[17] && _wo[8]) { + } + else if (_wo[20]) { + } + else if (_wo[30]) { + _indoorList._swl_3F3L._frame = 12; + } + else if (_wo[74]) { + _indoorList._swl_3F3L._frame = 36; + } + + if (_wo[29] && _wo[27]) { + } + else if (_wo[29] && _wo[14]) { + } + else if (_wo[29] && _wo[24]) { + } + else if (_wo[29] && _wo[10]) { + } + else if (_wo[26] && _wo[27]) { + } + else if (_wo[26] && _wo[14]) { + } + else if (_wo[26] && _wo[24]) { + } + else if (_wo[26] && _wo[10]) { + } + else if (_wo[13] && _wo[27]) { + } + else if (_wo[13] && _wo[14]) { + } + else if (_wo[13] && _wo[24]) { + } + else if (_wo[13] && _wo[10]) { + } + else if (_wo[19] && _wo[27]) { + } + else if (_wo[19] && _wo[24]) { + } + else if (_wo[19] && _wo[10]) { + } + else if (_wo[21]) { + } + else if (_wo[31]) { + _indoorList._swl_3F2R._frame = 13; + } + else if (_wo[75]) { + _indoorList._swl_3F2R._frame = 37; + } + + if (!_wo[27] && !_wo[20] && !_wo[12] && !_wo[23] && !_wo[8] && !_wo[30]) { + if (_wo[89]) + _indoorList._fwl_4F3L._frame = 7; + else if (_wo[44]) + _indoorList._fwl_4F3L._frame = 16; + else if (_wo[149]) + _indoorList._fwl_4F3L._frame = _overallFrame + 1; + else if (_wo[109]) + _indoorList._fwl_4F3L._frame = 8; + else if (_wo[169]) + _indoorList._fwl_4F3L._frame = 10; + else if (_wo[129]) + _indoorList._fwl_4F3L._frame = 9; + else if (_wo[0]) + _indoorList._fwl_4F3L._frame = 0; + else if (_wo[189]) + _indoorList._fwl_4F3L._frame = 15; + else if (_wo[209]) + _indoorList._fwl_4F3L._frame = 14; + else if (_wo[229]) + _indoorList._fwl_4F3L._frame = 6; + else if (_wo[249]) + _indoorList._fwl_4F3L._frame = 11; + else if (_wo[269]) + _indoorList._fwl_4F3L._frame = 12; + else if (_wo[289]) + _indoorList._fwl_4F3L._frame = 13; + } + + if (_wo[22] && _wo[20]) { + } + else if (_wo[22] && _wo[23]) { + } + else if (_wo[20] && _wo[17]) { + } + else if (_wo[23] && _wo[17]) { + } + else if (_wo[12]) { + } + else if (_wo[8]) { + } + else if (_wo[90]) { + _indoorList._fwl_4F2L._frame = 7; + } + else if (_wo[45]) { + _indoorList._fwl_4F2L._frame = 16; + } + else if (_wo[150]) { + _indoorList._fwl_4F2L._frame = _overallFrame + 1; + } + else if (_wo[110]) { + _indoorList._fwl_4F2L._frame = 8; + } + else if (_wo[170]) { + _indoorList._fwl_4F2L._frame = 10; + } + else if (_wo[130]) { + _indoorList._fwl_4F2L._frame = 9; + } + else if (_wo[1]) { + _indoorList._fwl_4F2L._frame = 0; + } + else if (_wo[190]) { + _indoorList._fwl_4F2L._frame = 15; + } + else if (_wo[210]) { + _indoorList._fwl_4F2L._frame = 14; + } + else if (_wo[230]) { + _indoorList._fwl_4F2L._frame = 6; + } + else if (_wo[250]) { + _indoorList._fwl_4F2L._frame = 11; + } + else if (_wo[270]) { + _indoorList._fwl_4F2L._frame = 12; + } + else if (_wo[290]) { + _indoorList._fwl_4F2L._frame = 13; + } + + if (_wo[15] && _wo[17]) { + } + else if (_wo[15] && _wo[12]) { + } + else if (_wo[12] && _wo[7]) { + } + else if (_wo[17] && _wo[7]) { + } + else if (_wo[91]) { + _indoorList._fwl_4F1L._frame = 7; + } + else if (_wo[46]) { + _indoorList._fwl_4F1L._frame = 16; + } + else if (_wo[151]) { + _indoorList._fwl_4F1L._frame = _overallFrame + 1; + } + else if (_wo[111]) { + _indoorList._fwl_4F1L._frame = 8; + } + else if (_wo[171]) { + _indoorList._fwl_4F1L._frame = 10; + } + else if (_wo[131]) { + _indoorList._fwl_4F1L._frame = 9; + } + else if (_wo[2]) { + _indoorList._fwl_4F1L._frame = 0; + } + else if (_wo[191]) { + _indoorList._fwl_4F1L._frame = 15; + } + else if (_wo[211]) { + _indoorList._fwl_4F1L._frame = 14; + } + else if (_wo[231]) { + _indoorList._fwl_4F1L._frame = 6; + } + else if (_wo[251]) { + _indoorList._fwl_4F1L._frame = 11; + } + else if (_wo[271]) { + _indoorList._fwl_4F1L._frame = 12; + } + else if (_wo[291]) { + _indoorList._fwl_4F1L._frame = 13; + } + + if (!_wo[27] && !_wo[21] && !_wo[14] && !_wo[24] && !_wo[10] && !_wo[31]) { + if (_wo[92]) { + _indoorList._fwl_4F3R._frame = 7; + } + else if (_wo[47]) { + _indoorList._fwl_4F3R._frame = 16; + } + else if (_wo[152]) { + _indoorList._fwl_4F3R._frame = _overallFrame + 1; + } + else if (_wo[112]) { + _indoorList._fwl_4F3R._frame = 8; + } + else if (_wo[172]) { + _indoorList._fwl_4F3R._frame = 10; + } + else if (_wo[132]) { + _indoorList._fwl_4F3R._frame = 9; + } + else if (_wo[3]) { + _indoorList._fwl_4F3R._frame = 0; + } + else if (_wo[192]) { + _indoorList._fwl_4F3R._frame = 15; + } + else if (_wo[212]) { + _indoorList._fwl_4F3R._frame = 14; + } + else if (_wo[232]) { + _indoorList._fwl_4F3R._frame = 6; + } + else if (_wo[252]) { + _indoorList._fwl_4F3R._frame = 11; + } + else if (_wo[272]) { + _indoorList._fwl_4F3R._frame = 12; + } + else if (_wo[292]) { + _indoorList._fwl_4F3R._frame = 13; + } + } + + if (_wo[22] && _wo[21]) { + } + else if (_wo[22] && _wo[24]) { + } + else if (_wo[21] && _wo[19]) { + } + else if (_wo[24] && _wo[19]) { + } + else if (_wo[14] || _wo[10]) { + } + else if (_wo[94]) { + _indoorList._fwl_4F2R._frame = 7; + } + else if (_wo[48]) { + _indoorList._fwl_4F2R._frame = 16; + } + else if (_wo[154]) { + _indoorList._fwl_4F2R._frame = _overallFrame + 1; + } + else if (_wo[114]) { + _indoorList._fwl_4F2R._frame = 8; + } + else if (_wo[174]) { + _indoorList._fwl_4F2R._frame = 10; + } + else if (_wo[134]) { + _indoorList._fwl_4F2R._frame = 9; + } + else if (_wo[4]) { + _indoorList._fwl_4F2R._frame = 0; + } + else if (_wo[194]) { + _indoorList._fwl_4F2R._frame = 15; + } + else if (_wo[214]) { + _indoorList._fwl_4F2R._frame = 14; + } + else if (_wo[234]) { + _indoorList._fwl_4F2R._frame = 6; + } + else if (_wo[254]) { + _indoorList._fwl_4F2R._frame = 11; + } + else if (_wo[274]) { + _indoorList._fwl_4F2R._frame = 12; + } + else if (_wo[294]) { + _indoorList._fwl_4F2R._frame = 13; + } + + if (_wo[15] && _wo[19]) { + } + else if (_wo[15] && _wo[14]) { + } + else if (_wo[14] && _wo[9]) { + } + else if (_wo[19] && _wo[9]) { + } + else if (_wo[95]) { + _indoorList._fwl_4F1R._frame = 7; + } + else if (_wo[49]) { + _indoorList._fwl_4F1R._frame = 16; + } + else if (_wo[155]) { + _indoorList._fwl_4F1R._frame = _overallFrame + 1; + } + else if (_wo[115]) { + _indoorList._fwl_4F1R._frame = 8; + } + else if (_wo[175]) { + _indoorList._fwl_4F1R._frame = 10; + } + else if (_wo[135]) { + _indoorList._fwl_4F1R._frame = 9; + } + else if (_wo[5]) { + _indoorList._fwl_4F1R._frame = 0; + } + else if (_wo[195]) { + _indoorList._fwl_4F1R._frame = 15; + } + else if (_wo[215]) { + _indoorList._fwl_4F1R._frame = 14; + } + else if (_wo[235]) { + _indoorList._fwl_4F1R._frame = 6; + } + else if (_wo[255]) { + _indoorList._fwl_4F1R._frame = 11; + } + else if (_wo[275]) { + _indoorList._fwl_4F1R._frame = 12; + } + else if (_wo[295]) { + _indoorList._fwl_4F1R._frame = 13; + } + + if (_wo[27] || _wo[22] || _wo[15] || _wo[96]) { + } + else if (_wo[50]) { + _indoorList._fwl_4F._frame = 16; + } + else if (_wo[156]) { + _indoorList._fwl_4F._frame = _overallFrame + 1; + } + else if (_wo[116]) { + _indoorList._fwl_4F._frame = 8; + } + else if (_wo[176]) { + _indoorList._fwl_4F._frame = 10; + } + else if (_wo[136]) { + _indoorList._fwl_4F._frame = 9; + } + else if (_wo[6]) { + _indoorList._fwl_4F._frame = 0; + } + else if (_wo[196]) { + _indoorList._fwl_4F._frame = 15; + } + else if (_wo[216]) { + _indoorList._fwl_4F._frame = 14; + } + else if (_wo[236]) { + _indoorList._fwl_4F._frame = 6; + } + else if (_wo[256]) { + _indoorList._fwl_4F._frame = 11; + } + else if (_wo[276]) { + _indoorList._fwl_4F._frame = 12; + } + else if (_wo[296]) { + _indoorList._fwl_4F._frame = 13; + } + + if (!_wo[27] && !_wo[22] && !_wo[15]) { + if (_wo[7]) + _indoorList._swl_3F1L._frame = 8; + else if (_wo[51]) + _indoorList._swl_3F1L._frame = 32; + } + + if (_wo[22] && _wo[23]) { + } + else if (_wo[22] && _wo[20]) { + } + else if (_wo[17] && _wo[23]) { + } + else if (_wo[17] && _wo[20]) { + } + else if (_wo[8]) { + _indoorList._swl_3F2L._frame = 10; + } + else if (_wo[52]) { + _indoorList._swl_3F2L._frame = 34; + } + + if (_wo[27] || _wo[22] || _wo[15]) { + } + else if (_wo[9]) { + _indoorList._swl_3F4R._frame = 9; + } + else if (_wo[53]) { + _indoorList._swl_3F4R._frame = 33; + } + + if (_wo[22] && _wo[24]) { + } + else if (_wo[22] && _wo[21]) { + } + else if (_wo[19] && _wo[24]) { + } + else if (_wo[19] && _wo[21]) { + } + else if (_wo[14]) { + } + else if (_wo[10]) { + _indoorList._swl_3F3R._frame = 11; + } + else if (_wo[54]) { + _indoorList._swl_3F3R._frame = 35; + } + + if (_wo[25] || _wo[28] || _wo[20] || _wo[16]) { + } + else if (_wo[97]) { + _indoorList._fwl_3F2L._frame = 24; + } + else if (_wo[55]) { + _indoorList._fwl_3F2L._frame = 33; + } + else if (_wo[137]) { + _indoorList._fwl_3F2L._frame = 26; + } + else if (_wo[157]) { + _indoorList._fwl_3F2L._frame = _overallFrame + 18; + } + else if (_wo[117]) { + _indoorList._fwl_3F2L._frame = 25; + } + else if (_wo[177]) { + _indoorList._fwl_3F2L._frame = 27; + } + else if (_wo[11]) { + _indoorList._fwl_3F2L._frame = 17; + } + else if (_wo[197]) { + _indoorList._fwl_3F2L._frame = 32; + } + else if (_wo[217]) { + _indoorList._fwl_3F2L._frame = 31; + } + else if (_wo[237]) { + _indoorList._fwl_3F2L._frame = 23; + } + else if (_wo[257]) { + _indoorList._fwl_3F2L._frame = 28; + } + else if (_wo[277]) { + _indoorList._fwl_3F2L._frame = 29; + } + else if (_wo[297]) { + _indoorList._fwl_3F2L._frame = 30; + } + + if (_wo[22] && _wo[23]) { + } + else if (_wo[22] && _wo[20]) { + } + else if (_wo[23] && _wo[17]) { + } + else if (_wo[20] && _wo[17]) { + } + else if (_wo[98]) { + _indoorList._fwl_3F1L._frame = 24; + } + else if (_wo[56]) { + _indoorList._fwl_3F1L._frame = 33; + } + else if (_wo[178]) { + _indoorList._fwl_3F1L._frame = 27; + } + else if (_wo[118]) { + _indoorList._fwl_3F1L._frame = 25; + } + else if (_wo[158]) { + _indoorList._fwl_3F1L._frame = _overallFrame + 18; + } + else if (_wo[138]) { + _indoorList._fwl_3F1L._frame = 26; + } + else if (_wo[12]) { + _indoorList._fwl_3F1L._frame = 17; + } + else if (_wo[198]) { + _indoorList._fwl_3F1L._frame = 32; + } + else if (_wo[218]) { + _indoorList._fwl_3F1L._frame = 31; + } + else if (_wo[238]) { + _indoorList._fwl_3F1L._frame = 23; + } + else if (_wo[258]) { + _indoorList._fwl_3F1L._frame = 28; + } + else if (_wo[278]) { + _indoorList._fwl_3F1L._frame = 29; + } + else if (_wo[298]) { + _indoorList._fwl_3F1L._frame = 30; + } + + if (_wo[26] || _wo[29] || _wo[21] || _wo[18]) { + } + else if (_wo[99]) { + _indoorList._fwl_3F2R._frame = 24; + } + else if (_wo[57]) { + _indoorList._fwl_3F2R._frame = 33; + } + else if (_wo[139]) { + _indoorList._fwl_3F2R._frame = 26; + } + else if (_wo[159]) { + _indoorList._fwl_3F2R._frame = _overallFrame + 18; + } + else if (_wo[119]) { + _indoorList._fwl_3F2R._frame = 25; + } + else if (_wo[179]) { + _indoorList._fwl_3F2R._frame = 27; + } + else if (_wo[13]) { + _indoorList._fwl_3F2R._frame = 17; + } + else if (_wo[199]) { + _indoorList._fwl_3F2R._frame = 32; + } + else if (_wo[219]) { + _indoorList._fwl_3F2R._frame = 31; + } + else if (_wo[239]) { + _indoorList._fwl_3F2R._frame = 23; + } + else if (_wo[259]) { + _indoorList._fwl_3F2R._frame = 28; + } + else if (_wo[279]) { + _indoorList._fwl_3F2R._frame = 29; + } + else if (_wo[299]) { + _indoorList._fwl_3F2R._frame = 30; + } + + if (_wo[22] && _wo[24]) { + } + else if (_wo[22] && _wo[21]) { + } + else if (_wo[24] && _wo[19]) { + } + else if (_wo[21] && _wo[19]) { + } + else if (_wo[100]) { + _indoorList._fwl_3F1R._frame = 24; + } + else if (_wo[58]) { + _indoorList._fwl_3F1R._frame = 33; + } + else if (_wo[140]) { + _indoorList._fwl_3F1R._frame = 26; + } + else if (_wo[160]) { + _indoorList._fwl_3F1R._frame = _overallFrame + 18; + } + else if (_wo[120]) { + _indoorList._fwl_3F1R._frame = 25; + } + else if (_wo[180]) { + _indoorList._fwl_3F1R._frame = 27; + } + else if (_wo[14]) { + _indoorList._fwl_3F1R._frame = 17; + } + else if (_wo[200]) { + _indoorList._fwl_3F1R._frame = 32; + } + else if (_wo[220]) { + _indoorList._fwl_3F1R._frame = 31; + } + else if (_wo[240]) { + _indoorList._fwl_3F1R._frame = 23; + } + else if (_wo[260]) { + _indoorList._fwl_3F1R._frame = 28; + } + else if (_wo[280]) { + _indoorList._fwl_3F1R._frame = 29; + } + else if (_wo[300]) { + _indoorList._fwl_3F1R._frame = 30; + } + + if (_wo[22] || _wo[27]) { + } + else if (_wo[101]) { + _indoorList._fwl_3F._frame = 24; + } + else if (_wo[59]) { + _indoorList._fwl_3F._frame = 33; + } + else if (_wo[141]) { + _indoorList._fwl_3F._frame = 26; + } + else if (_wo[161]) { + _indoorList._fwl_3F._frame = _overallFrame + 18; + } + else if (_wo[121]) { + _indoorList._fwl_3F._frame = 25; + } + else if (_wo[181]) { + _indoorList._fwl_3F._frame = 27; + } + else if (_wo[15]) { + _indoorList._fwl_3F._frame = 17; + } + else if (_wo[201]) { + _indoorList._fwl_3F._frame = 32; + } + else if (_wo[221]) { + _indoorList._fwl_3F._frame = 31; + } + else if (_wo[241]) { + _indoorList._fwl_3F._frame = 23; + } + else if (_wo[261]) { + _indoorList._fwl_3F._frame = 28; + } + else if (_wo[281]) { + _indoorList._fwl_3F._frame = 29; + } + else if (_wo[301]) { + _indoorList._fwl_3F._frame = 30; + } + + if (_wo[25] || _wo[28] || _wo[20]) { + } + else if (_wo[16]) { + _indoorList._swl_2F2L._frame = 6; + } + else if (_wo[60]) { + _indoorList._swl_2F2L._frame = 30; + } + + if (_wo[27] || _wo[22]) { + } + else if (_wo[17]) { + _indoorList._swl_2F1L._frame = 4; + } + else if (_wo[61]) { + _indoorList._swl_2F1L._frame = 28; + } + + if (_wo[26] || _wo[29] || _wo[21]) { + } + else if (_wo[18]) { + _indoorList._swl_2F2R._frame = 7; + } + else if (_wo[62]) { + _indoorList._swl_2F2R._frame = 31; + } + + if (_wo[27] || _wo[22]) { + } + else if (_wo[19]) { + _indoorList._swl_2F1R._frame = 5; + } + else if (_wo[63]) { + _indoorList._swl_2F1R._frame = 29; + } + + if (_wo[27] && _wo[25]) { + } + else if (_wo[27] && _wo[28]) { + } + else if (_wo[23] & _wo[25]) { + } + else if (_wo[23] && _wo[28]) { + } + else if (_wo[102]) { + _indoorList._fwl_2F1L._frame = 7; + } + else if (_wo[64]) { + _indoorList._fwl_2F1L._frame = 16; + } + else if (_wo[182]) { + _indoorList._fwl_2F1L._frame = 10; + } + else if (_wo[122]) { + _indoorList._fwl_2F1L._frame = 8; + } + else if (_wo[142]) { + _indoorList._fwl_2F1L._frame = 9; + } + else if (_wo[162]) { + _indoorList._fwl_2F1L._frame = _overallFrame + 1; + } + else if (_wo[20]) { + _indoorList._fwl_2F1L._frame = 0; + } + else if (_wo[202]) { + _indoorList._fwl_2F1L._frame = 15; + } + else if (_wo[222]) { + _indoorList._fwl_2F1L._frame = 14; + } + else if (_wo[242]) { + _indoorList._fwl_2F1L._frame = 6; + } + else if (_wo[262]) { + _indoorList._fwl_2F1L._frame = 11; + } + else if (_wo[282]) { + _indoorList._fwl_2F1L._frame = 12; + } + else if (_wo[302]) { + _indoorList._fwl_2F1L._frame = 13; + } + // TODO } diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h index 498de3c195..43b1f31bde 100644 --- a/engines/xeen/interface.h +++ b/engines/xeen/interface.h @@ -116,6 +116,7 @@ private: int _hiliteChar; int _intrIndex1; bool _flipWtr; + bool _flipWall; bool _flag1; int _animCounter; bool _isAnimReset; @@ -125,7 +126,7 @@ private: byte _wp[20]; byte _wo[308]; bool _thinWall; - int _charsArray1[12]; + int _overallFrame; void loadSprites(); diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index 1a01b441f6..3650c9d98b 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -1095,7 +1095,9 @@ void Map::load(int mapId) { _surfaceSprites[i].load(OUTDOOR_SURFACES[i]); } - _wallSprites._surfaces[0].clear(); + for (int i = 0; i < TOTAL_SURFACES; ++i) + _wallSprites._surfaces[i].clear(); + Common::String fwlName = Common::String::format("%s.til", TERRAIN_TYPES[_mazeData[0]._wallKind]); _wallSprites._fwl1.load(fwlName); diff --git a/engines/xeen/map.h b/engines/xeen/map.h index 37eba7074c..d68bc2b0b8 100644 --- a/engines/xeen/map.h +++ b/engines/xeen/map.h @@ -360,7 +360,6 @@ private: bool _stepped; int _mazeDataIndex; bool _currentSteppedOn; - int _currentSurfaceId; void loadEvents(int mapId); @@ -385,6 +384,7 @@ public: int _currentMonsterFlags; MazeWallLayers _currentWall; int _currentTile; + int _currentSurfaceId; public: Map(XeenEngine *vm); @@ -397,6 +397,9 @@ public: void saveMaze(); int getCell(int idx); + + MazeData mazeData() { return _mazeData[0]; } + }; } // End of namespace Xeen diff --git a/engines/xeen/resources.cpp b/engines/xeen/resources.cpp index 5740a419bd..e56ad1656e 100644 --- a/engines/xeen/resources.cpp +++ b/engines/xeen/resources.cpp @@ -432,4 +432,18 @@ const byte WALL_NUMBERS[4][96] = { } }; +const int DRAW_NUMBERS[25] = { + 36, 37, 38, 43, 42, 41, 39, 20, 22, 24, 33, 31, 29, 26, 10, 11, + 18, 16, 13, 5, 9, 6, 0, 4, 1 +}; + +const int DRAW_FRAMES[25][2] = { + { 18, 24 }, { 19, 23 }, { 20, 22 }, { 10, 24 }, { 19, 23 }, { 20, 22 }, + { 21, 21 }, { 11, 17 }, { 12, 16 }, { 13, 15 }, { 11, 17 }, { 12, 16 }, + { 13, 15 }, { 14, 14 }, { 6, 10 }, { 7, 9 }, { 6, 10 }, { 7, 9 }, + { 8, 8 }, { 3, 5 }, { 3, 5 }, { 4, 4 }, { 0, 2 }, { 0, 2 }, + { 1, 1 } +}; + + } // End of namespace Xeen diff --git a/engines/xeen/resources.h b/engines/xeen/resources.h index 71ac91f641..bed9569163 100644 --- a/engines/xeen/resources.h +++ b/engines/xeen/resources.h @@ -90,6 +90,10 @@ extern const int DIRECTION_ANIM_POSITIONS[4][4]; extern const byte WALL_NUMBERS[4][96]; +extern const int DRAW_NUMBERS[25]; + +extern const int DRAW_FRAMES[25][2]; + } // End of namespace Xeen #endif /* XEEN_RESOURCES_H */ -- cgit v1.2.3