Mercurial > mm7
comparison mm7_4.cpp @ 630:1b813023fcbd
Tilesets change according to current season
author | Nomad |
---|---|
date | Mon, 11 Mar 2013 03:37:48 +0200 |
parents | 8a0ec99a5177 |
children | 3d03a3a674bc |
comparison
equal
deleted
inserted
replaced
619:574cc56e05e9 | 630:1b813023fcbd |
---|---|
1681 result = this->pTiles; | 1681 result = this->pTiles; |
1682 else | 1682 else |
1683 result = &this->pTiles[uTileID]; | 1683 result = &this->pTiles[uTileID]; |
1684 return result;*/ | 1684 return result;*/ |
1685 | 1685 |
1686 if (uTileID < 0 || uTileID > this->uNumTiles - 1) | 1686 assert(uTileID < uNumTiles); |
1687 return this->pTiles; | 1687 return &pTiles[uTileID]; |
1688 else | |
1689 return &this->pTiles[uTileID]; | |
1690 } | 1688 } |
1691 | 1689 |
1692 //----- (00487E58) -------------------------------------------------------- | 1690 //----- (00487E58) -------------------------------------------------------- |
1693 void TileTable::InitializeTileset(int uTerrainType) | 1691 void TileTable::InitializeTileset(Tileset tileset) |
1694 { | 1692 { |
1695 TileTable *v2; // edi@1 | 1693 TileTable *v2; // edi@1 |
1696 int v3; // ebx@1 | 1694 int v3; // ebx@1 |
1697 TileDesc *v4; // eax@2 | 1695 TileDesc *v4; // eax@2 |
1698 signed int i; // [sp+8h] [bp-4h]@1 | 1696 signed int i; // [sp+8h] [bp-4h]@1 |
1700 v2 = this; | 1698 v2 = this; |
1701 v3 = 0; | 1699 v3 = 0; |
1702 for ( i = 0; i < (signed int)v2->uNumTiles; ++v3 ) | 1700 for ( i = 0; i < (signed int)v2->uNumTiles; ++v3 ) |
1703 { | 1701 { |
1704 v4 = &v2->pTiles[v3]; | 1702 v4 = &v2->pTiles[v3]; |
1705 if ( uTerrainType == v4->uTerrainType && v4->pTileName[0] ) | 1703 if (v4->tileset == tileset && v4->pTileName[0] ) |
1706 { | 1704 { |
1707 v2->pTiles[v3].uBitmapID = pBitmaps_LOD->LoadTexture(v4->pTileName); | 1705 v2->pTiles[v3].uBitmapID = pBitmaps_LOD->LoadTexture(v4->pTileName); |
1708 if ( v2->pTiles[v3].uBitmapID != -1 ) | 1706 if ( v2->pTiles[v3].uBitmapID != -1 ) |
1709 pBitmaps_LOD->pTextures[v2->pTiles[v3].uBitmapID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v2->pTiles[v3].uBitmapID].palette_id1); | 1707 pBitmaps_LOD->pTextures[v2->pTiles[v3].uBitmapID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v2->pTiles[v3].uBitmapID].palette_id1); |
1710 } | 1708 } |
1976 v7 = v84.pProperties[2]; | 1974 v7 = v84.pProperties[2]; |
1977 v2->pTiles[v2->uNumTiles].uTileID = v6; | 1975 v2->pTiles[v2->uNumTiles].uTileID = v6; |
1978 v8 = atoi(v7); | 1976 v8 = atoi(v7); |
1979 v9 = v84.pProperties[3]; | 1977 v9 = v84.pProperties[3]; |
1980 v2->pTiles[v2->uNumTiles].uBitmapID = v8; | 1978 v2->pTiles[v2->uNumTiles].uBitmapID = v8; |
1981 v2->pTiles[v2->uNumTiles].uTerrainType = 0; | 1979 v2->pTiles[v2->uNumTiles].tileset = Tileset_Grass; |
1982 if ( _strcmpi(v9, "TTtype_NULL") ) | 1980 if ( _strcmpi(v9, "TTtype_NULL") ) |
1983 { | 1981 { |
1984 if ( _strcmpi(v9, "TTtype_Start") ) | 1982 if ( _strcmpi(v9, "TTtype_Start") ) |
1985 { | 1983 { |
1986 if ( _strcmpi(v9, "TTtype_Grass") ) | 1984 if ( _strcmpi(v9, "TTtype_Grass") ) |
2031 { | 2029 { |
2032 if ( _strcmpi(v9, "TTtype_RoadSnowDirt") ) | 2030 if ( _strcmpi(v9, "TTtype_RoadSnowDirt") ) |
2033 { | 2031 { |
2034 if ( !_strcmpi(v9, "TTtype_RoadCityStone") ) | 2032 if ( !_strcmpi(v9, "TTtype_RoadCityStone") ) |
2035 { | 2033 { |
2036 v34 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2034 v34 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2037 *(char *)v34 |= 0x1Cu; | 2035 *(char *)v34 |= 0x1Cu; |
2038 } | 2036 } |
2039 } | 2037 } |
2040 else | 2038 else |
2041 { | 2039 { |
2042 v33 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2040 v33 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2043 *(char *)v33 |= 0xDu; | 2041 *(char *)v33 |= 0xDu; |
2044 } | 2042 } |
2045 } | 2043 } |
2046 else | 2044 else |
2047 { | 2045 { |
2048 v32 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2046 v32 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2049 *(char *)v32 |= 0xCu; | 2047 *(char *)v32 |= 0xCu; |
2050 } | 2048 } |
2051 } | 2049 } |
2052 else | 2050 else |
2053 { | 2051 { |
2054 v31 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2052 v31 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2055 *(char *)v31 |= 0x1Bu; | 2053 *(char *)v31 |= 0x1Bu; |
2056 } | 2054 } |
2057 } | 2055 } |
2058 else | 2056 else |
2059 { | 2057 { |
2060 v30 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2058 v30 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2061 *(char *)v30 |= 0x1Au; | 2059 *(char *)v30 |= 0x1Au; |
2062 } | 2060 } |
2063 } | 2061 } |
2064 else | 2062 else |
2065 { | 2063 { |
2066 v29 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2064 v29 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2067 *(char *)v29 |= 0x19u; | 2065 *(char *)v29 |= 0x19u; |
2068 } | 2066 } |
2069 } | 2067 } |
2070 else | 2068 else |
2071 { | 2069 { |
2072 v28 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2070 v28 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2073 *(char *)v28 |= 0x18u; | 2071 *(char *)v28 |= 0x18u; |
2074 } | 2072 } |
2075 } | 2073 } |
2076 else | 2074 else |
2077 { | 2075 { |
2078 v27 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2076 v27 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2079 *(char *)v27 |= 0x11u; | 2077 *(char *)v27 |= 0x11u; |
2080 } | 2078 } |
2081 } | 2079 } |
2082 else | 2080 else |
2083 { | 2081 { |
2084 v26 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2082 v26 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2085 *(char *)v26 |= 0x10u; | 2083 *(char *)v26 |= 0x10u; |
2086 } | 2084 } |
2087 } | 2085 } |
2088 else | 2086 else |
2089 { | 2087 { |
2090 v25 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2088 v25 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2091 *(char *)v25 |= 0xFu; | 2089 *(char *)v25 |= 0xFu; |
2092 } | 2090 } |
2093 } | 2091 } |
2094 else | 2092 else |
2095 { | 2093 { |
2096 v24 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2094 v24 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2097 *(char *)v24 |= 0xEu; | 2095 *(char *)v24 |= 0xEu; |
2098 } | 2096 } |
2099 } | 2097 } |
2100 else | 2098 else |
2101 { | 2099 { |
2102 v23 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2100 v23 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2103 *(char *)v23 |= 0x17u; | 2101 *(char *)v23 |= 0x17u; |
2104 } | 2102 } |
2105 } | 2103 } |
2106 else | 2104 else |
2107 { | 2105 { |
2108 v22 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2106 v22 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2109 *(char *)v22 |= 0x16u; | 2107 *(char *)v22 |= 0x16u; |
2110 } | 2108 } |
2111 } | 2109 } |
2112 else | 2110 else |
2113 { | 2111 { |
2114 v21 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2112 v21 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2115 *(char *)v21 |= 0xBu; | 2113 *(char *)v21 |= 0xBu; |
2116 } | 2114 } |
2117 } | 2115 } |
2118 else | 2116 else |
2119 { | 2117 { |
2120 v20 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2118 v20 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2121 *(char *)v20 |= 0xAu; | 2119 *(char *)v20 |= 0xAu; |
2122 } | 2120 } |
2123 } | 2121 } |
2124 else | 2122 else |
2125 { | 2123 { |
2126 v19 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2124 v19 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2127 *(char *)v19 |= 9u; | 2125 *(char *)v19 |= 9u; |
2128 } | 2126 } |
2129 } | 2127 } |
2130 else | 2128 else |
2131 { | 2129 { |
2132 v18 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2130 v18 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2133 *(char *)v18 |= 7u; | 2131 *(char *)v18 |= 7u; |
2134 } | 2132 } |
2135 } | 2133 } |
2136 else | 2134 else |
2137 { | 2135 { |
2138 v17 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2136 v17 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2139 *(char *)v17 |= 8u; | 2137 *(char *)v17 |= 8u; |
2140 } | 2138 } |
2141 } | 2139 } |
2142 else | 2140 else |
2143 { | 2141 { |
2144 v16 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2142 v16 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2145 *(char *)v16 |= 5u; | 2143 *(char *)v16 |= 5u; |
2146 } | 2144 } |
2147 } | 2145 } |
2148 else | 2146 else |
2149 { | 2147 { |
2150 v15 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2148 v15 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2151 *(char *)v15 |= 4u; | 2149 *(char *)v15 |= 4u; |
2152 } | 2150 } |
2153 } | 2151 } |
2154 else | 2152 else |
2155 { | 2153 { |
2156 v14 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2154 v14 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2157 *(char *)v14 |= 3u; | 2155 *(char *)v14 |= 3u; |
2158 } | 2156 } |
2159 } | 2157 } |
2160 else | 2158 else |
2161 { | 2159 { |
2162 v13 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2160 v13 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2163 *(char *)v13 |= 2u; | 2161 *(char *)v13 |= 2u; |
2164 } | 2162 } |
2165 } | 2163 } |
2166 else | 2164 else |
2167 { | 2165 { |
2168 v12 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2166 v12 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2169 *(char *)v12 |= 1u; | 2167 *(char *)v12 |= 1u; |
2170 } | 2168 } |
2171 } | 2169 } |
2172 else | 2170 else |
2173 { | 2171 { |
2174 v11 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType; | 2172 v11 = (int)&v2->pTiles[v2->uNumTiles].tileset; |
2175 *(char *)v11 |= 6u; | 2173 *(char *)v11 |= 6u; |
2176 } | 2174 } |
2177 } | 2175 } |
2178 } | 2176 } |
2179 else | 2177 else |
2182 *(char *)v10 |= 0xFEu; | 2180 *(char *)v10 |= 0xFEu; |
2183 } | 2181 } |
2184 } | 2182 } |
2185 else | 2183 else |
2186 { | 2184 { |
2187 LOBYTE(v2->pTiles[v2->uNumTiles].uTerrainType) = -1; | 2185 LOBYTE(v2->pTiles[v2->uNumTiles].tileset) = -1; |
2188 } | 2186 } |
2189 v35 = v84.pProperties[4]; | 2187 v35 = v84.pProperties[4]; |
2190 v2->pTiles[v2->uNumTiles].uSection = 0; | 2188 v2->pTiles[v2->uNumTiles].uSection = 0; |
2191 v2->pTiles[v2->uNumTiles].uAttributes = 0; | 2189 v2->pTiles[v2->uNumTiles].uAttributes = 0; |
2192 if ( !_strcmpi(v35, "TTsect_NULL") ) | 2190 if ( !_strcmpi(v35, "TTsect_NULL") ) |