diff options
author | Paul Gilbert | 2015-01-13 08:51:04 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-01-13 08:51:04 -0500 |
commit | 1a0a597ff8c02d103d56968bfd18de1908e219d6 (patch) | |
tree | cac19db2375e42d211a7e4da5b0ce86ddb36913b | |
parent | 747ca9eb2ff87b1205d41fcd0cf65a016ade8e0d (diff) | |
download | scummvm-rg350-1a0a597ff8c02d103d56968bfd18de1908e219d6.tar.gz scummvm-rg350-1a0a597ff8c02d103d56968bfd18de1908e219d6.tar.bz2 scummvm-rg350-1a0a597ff8c02d103d56968bfd18de1908e219d6.zip |
XEEN: Add indoor terrain loading and indoor list sprite setting to Map::load
-rw-r--r-- | engines/xeen/interface.cpp | 23 | ||||
-rw-r--r-- | engines/xeen/interface.h | 16 | ||||
-rw-r--r-- | engines/xeen/map.cpp | 34 | ||||
-rw-r--r-- | engines/xeen/map.h | 16 | ||||
-rw-r--r-- | engines/xeen/resources.cpp | 17 | ||||
-rw-r--r-- | engines/xeen/resources.h | 6 |
6 files changed, 109 insertions, 3 deletions
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 7bbe08e378..4bf9b1aa3b 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -164,11 +164,28 @@ OutdoorDrawList::OutdoorDrawList() : _skySprite(_data[1]), _groundSprite(_data[2 /*------------------------------------------------------------------------*/ -IndoorDrawList::IndoorDrawList() : _skySprite(_data[1]), _groundSprite(_data[2]), +IndoorDrawList::IndoorDrawList() : + _sky(_data[1]), _ground(_data[2]), _horizon(_data[28]), + _swl_0F1R(_data[ 46]), _swl_0F1L(_data[44]), _swl_1F1R(_data[134]), + _swl_1F1L(_data[133]), _swl_2F2R(_data[110]), _swl_2F1R(_data[109]), + _swl_2F1L(_data[108]), _swl_2F2L(_data[107]), _swl_3F1R(_data[ 78]), + _swl_3F2R(_data[ 77]), _swl_3F3R(_data[ 76]), _swl_3F4R(_data[ 75]), + _swl_3F1L(_data[ 74]), _swl_3F2L(_data[ 73]), _swl_3F3L(_data[ 72]), + _swl_3F4L(_data[ 71]), _swl_4F4R(_data[ 33]), _swl_4F3R(_data[ 34]), + _swl_4F2R(_data[ 35]), _swl_4F1R(_data[ 36]), _swl_4F1L(_data[ 32]), + _swl_4F2L(_data[ 31]), _swl_4F3L(_data[ 30]), _swl_4F4L(_data[ 29]), + _fwl_4F4R(_data[ 45]), _fwl_4F3R(_data[ 44]), _fwl_4F2R(_data[ 43]), + _fwl_4F1R(_data[ 42]), _fwl_4F( _data[ 41]), _fwl_4F1L(_data[ 40]), + _fwl_4F2L(_data[ 39]), _fwl_4F3L(_data[ 38]), _fwl_4F4L(_data[ 37]), + _fwl_2F1R(_data[121]), _fwl_2F( _data[120]), _fwl_2F1L(_data[119]), + _fwl_3F2R(_data[ 91]), _fwl_3F1R(_data[ 90]), _fwl_3F( _data[ 89]), + _fwl_3F1L(_data[ 88]), _fwl_3F2L(_data[ 87]), _fwl_1F( _data[147]), + _fwl_1F1R(_data[145]), _fwl_1F1L(_data[143]), _objects0(_data[149]), _objects1(_data[125]), _objects2(_data[126]), _objects3(_data[127]), _objects4(_data[97]), _objects5(_data[98]), _objects6(_data[99]), _objects7(_data[55]), _objects8(_data[56]), _objects9(_data[58]), _objects10(_data[57]), _objects11(_data[59]) { + // Setup draw structure positions _data[0] = DrawStruct(0, 8, 8); _data[1] = DrawStruct(1, 8, 25); _data[2] = DrawStruct(0, 8, 67); @@ -2824,6 +2841,10 @@ void Interface::setMazeBits() { } void Interface::drawIndoors() { + Map &map = *_vm->_map; + + map.getCell(36); + // TODO } diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h index ec8a384313..0c014f6032 100644 --- a/engines/xeen/interface.h +++ b/engines/xeen/interface.h @@ -51,8 +51,20 @@ public: class IndoorDrawList { public: DrawStruct _data[170]; - DrawStruct &_skySprite; - DrawStruct &_groundSprite; + DrawStruct &_sky; + DrawStruct &_ground; + DrawStruct &_horizon; + DrawStruct &_swl_0F1R, _swl_0F1L, _swl_1F1R, _swl_1F1L, + _swl_2F2R, _swl_2F1R, _swl_2F1L, _swl_2F2L, + _swl_3F1R, _swl_3F2R, _swl_3F3R, _swl_3F4R, + _swl_3F1L, _swl_3F2L, _swl_3F3L, _swl_3F4L, + _swl_4F4R, _swl_4F3R, _swl_4F2R, _swl_4F1R, + _swl_4F1L, _swl_4F2L, _swl_4F3L, _swl_4F4L; + DrawStruct &_fwl_4F4R, _fwl_4F3R, _fwl_4F2R, _fwl_4F1R, + _fwl_4F, _fwl_4F1L, _fwl_4F2L, _fwl_4F3L, _fwl_4F4L; + DrawStruct &_fwl_2F1R, _fwl_2F, _fwl_2F1L, _fwl_3F2R, + _fwl_3F1R, _fwl_3F, _fwl_3F1L, _fwl_3F2L; + DrawStruct &_fwl_1F, _fwl_1F1R, _fwl_1F1L; DrawStruct &_objects0, _objects1, _objects2, _objects3; DrawStruct &_objects4, _objects5, _objects6, _objects7; DrawStruct &_objects8, _objects9, _objects10, _objects11; diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index f9a687b6ee..07cb0d600d 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -1050,6 +1050,40 @@ void Map::load(int mapId) { filename = Common::String::format("%03d.pic", _mobData._wallItems[i]._spriteId); _mobData._wallItemSprites[i]._sprites.load(filename); } + + // Handle loading miscellaneous sprites for the map + if (_isOutdoors) { + warning("TODO"); + } else { + warning("TODO"); // Sound loading + + _skySprites.load(isDarkCc ? "sky.sky" : "night.sky"); + _mazeSkySprites.load(Common::String::format("%s.sky", + TERRAIN_TYPES[_mazeData[0]._wallKind])); + _groundSprites.load(Common::String::format("%s.gnd", + TERRAIN_TYPES[_mazeData[0]._wallKind])); + _tileSprites.load(Common::String::format("%s.til", + TERRAIN_TYPES[_mazeData[0]._wallKind])); + + for (int i = 0; i < TOTAL_SURFACES; ++i) { + _surfaceSprites[i].clear(); + + if (_mazeData[0]._surfaceTypes[i] != 0 || i == 4) + _surfaceSprites[i].load(OUTDOOR_SURFACES[i]); + } + + _wallSprites._wal.clear(); + Common::String fwlName = Common::String::format("%s.til", + TERRAIN_TYPES[_mazeData[0]._wallKind]); + _wallSprites._fwl1.load(fwlName); + _wallSprites._fwl2.load(fwlName); + _wallSprites._fwl3.load(fwlName); + _wallSprites._fwl4.load(fwlName); + _wallSprites._swl.load(Common::String::format("s%s.swl", + TERRAIN_TYPES[_mazeData[0]._wallKind])); + + + } } int Map::mazeLookup(const Common::Point &pt, int directionLayerIndex) { diff --git a/engines/xeen/map.h b/engines/xeen/map.h index 090619f6d0..d697243e0d 100644 --- a/engines/xeen/map.h +++ b/engines/xeen/map.h @@ -34,6 +34,7 @@ namespace Xeen { #define MAP_WIDTH 16 #define MAP_HEIGHT 16 +#define TOTAL_SURFACES 16 class XeenEngine; @@ -269,6 +270,15 @@ public: MazeWallItem(); }; +struct WallSprites { + SpriteResource _wal; + SpriteResource _fwl1; + SpriteResource _fwl2; + SpriteResource _fwl3; + SpriteResource _fwl4; + SpriteResource _swl; +}; + class Map; class MonsterObjectData { @@ -361,6 +371,12 @@ public: MazeEvents _events; HeadData _headData; AnimationInfo _animationInfo; + SpriteResource _skySprites; + SpriteResource _mazeSkySprites; + SpriteResource _groundSprites; + SpriteResource _tileSprites; + SpriteResource _surfaceSprites[TOTAL_SURFACES]; + WallSprites _wallSprites; bool _currentIsGrate; bool _currentCantRest; bool _currentIsDrain; diff --git a/engines/xeen/resources.cpp b/engines/xeen/resources.cpp index 352e59620c..d0f5d6a351 100644 --- a/engines/xeen/resources.cpp +++ b/engines/xeen/resources.cpp @@ -66,6 +66,23 @@ const char *const OPTIONS_TITLE = "\v117Copyright (c) 1993 NWC, Inc.\n" "All Rights Reserved\x01"; +const char *const TERRAIN_TYPES[6] = { + "town", "cave", "towr", "cstl", "dung", "scfi" +}; + +const char *const OUTDOOR_WALLS[15] = { + nullptr, "mount", "ltree", "dtree", "grass", "snotree", "snomnt", + "dedltree", "mount", "lavamnt", "palm", "dmount", "dedltree", + "dedltree", "dedltree" +}; + +const char *const OUTDOOR_SURFACES[16] = { + "water.srf", "dirt.srf", "grass.srf", "snow.srf", "swamp.srf", + "lava.srf", "desert.srf", "road.srf", "dwater.srf", "tflr.srf", + "sky.srf", "croad.srf", "sewer.srf", "cloud.srf", "scortch.srf", + "space.srf" +}; + const byte SYMBOLS[20][64] = { { // 0 0x00, 0x00, 0xA8, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0x00, 0xA8, 0x9E, 0x9C, 0x9C, 0x9E, 0x9E, 0x9E, diff --git a/engines/xeen/resources.h b/engines/xeen/resources.h index 2c537fd890..dbb00036ff 100644 --- a/engines/xeen/resources.h +++ b/engines/xeen/resources.h @@ -32,6 +32,12 @@ extern const char *const CREDITS; extern const char *const OPTIONS_TITLE; +extern const char *const TERRAIN_TYPES[6]; + +extern const char *const OUTDOOR_WALLS[15]; + +extern const char *const OUTDOOR_SURFACES[16]; + extern const byte SYMBOLS[20][64]; extern const byte TEXT_COLORS[40][4]; |