Changeset - r15923:6550af31238a
[Not reviewed]
master
0 8 0
rubidium - 14 years ago 2010-08-26 14:36:00
rubidium@openttd.org
(svn r20621) -Codechange: move animation frames of houses, objects and industries to m7 (same as airports and stations)
8 files changed with 94 insertions and 62 deletions:
0 comments (0 inline, 0 general)
docs/landscape.html
Show inline comments
 
@@ -666,21 +666,21 @@
 
         <li>m5 bits 4..3 : construction stage</li>
 
         <li>m5 bits 2..0 : construction counter</li>
 
        </ul>
 
       </li>
 
      </ul>
 
     <li>m3 bit 6 : bit 8 of house type (m4), allowing 512 different types.</li>
 
     <li>m3 bit 5 : bit 6 of current animation frame (see m6)</li>
 
     <li>m3 bit 5 : free</li>
 
     <li>m3 bits 4..0 : triggers activated <a href="#newhouses">(newhouses)</a></li>
 
     <li>m4 : <a href="landscape_externals.html">town building type</a> (with m3[6] bit)</li>
 
     <li>m5 : see m3 bit 7</li>
 
     <li>m6 :
 
      <ul>
 
       <li>If <a href="#newhouses">newhouses</a> is activated
 
        <ul>
 
         <li>bits 7..2 : Current animation frame (bits 5..0); bit 6 in m3</li>
 
         <li>bits 7..2 : Periodic processing time remaining</li>
 
        </ul>
 
       </li>
 
       <li>Standard behaviour
 
        <ul>
 
         <li>bits 7..2 : lift position (for houses type 04 and 05)</li>
 
        </ul>
 
@@ -689,13 +689,13 @@
 
      </ul>
 
     </li>
 
     <li>m7 :
 
      <ul>
 
       <li>If <a href="#newhouses">newhouses</a> is activated
 
        <ul>
 
         <li>Periodic processing time remaining</li>
 
         <li>Current animation frame</li>
 
        </ul>
 
       </li>
 
       <li>Standard behaviour (only for houses type 04 and 05)
 
        <ul>
 
         <li>bits 7..4 : free</li>
 
         <li>bits 3..1 : lift destination.  Values can be 0..6, except 1.<br>
 
@@ -1087,13 +1087,13 @@
 
       <li>m1 bits 3..2: construction counter, for buildings under construction incremented on every periodic tile processing</li>
 
       <li>m1 bits 1..0: stage of construction (<tt>3</tt> = completed), incremented when the construction counter wraps around<br>
 
           the meaning is different for some animated tiles which are never under construction (types <tt>01</tt>, <tt>1E</tt>..<tt>20</tt>, <tt>30</tt>, <tt>58</tt>; see above)</li>
 
      </ul>
 
     </li>
 
     <li>m2: index into the array of industries</li>
 
     <li>m3: animation state</li>
 
     <li>m3: random bits (NewGRF)</li>
 
     <li>m4: animation loop</li>
 
     <li>m5: type (plus m6 bit 2):<br>
 
      <small>(note: this is not the same as the industry type, which is stored in the array of industries)</small>
 

	
 
      <table>
 
       <tr>
 
@@ -1104,13 +1104,13 @@
 
           <td nowrap valign=top><tt>00</tt>&nbsp; </td>
 
           <td align=left>wheel tower when not animated</td>
 
          </tr>
 
          <tr>
 
           <td nowrap valign=top><tt>01</tt>&nbsp; </td>
 
           <td align=left>wheel tower when animated<br>
 
            animation state in m3 bits 5..0; m3 bit 6 set = sound already generated</td>
 
            animation state in m7 bits 5..0; m7 bit 6 set = sound already generated</td>
 
          </tr>
 
         </table>
 
        </td>
 
       </tr>
 

	
 
       <tr>
 
@@ -1120,13 +1120,13 @@
 
          <tr>
 
           <td nowrap valign=top><tt>08</tt>&nbsp; </td>
 
           <td align=left>chimney</td>
 
          </tr>
 
          <tr>
 
           <td nowrap valign=top><tt>0A</tt>&nbsp; </td>
 
           <td align=left>transformer; animation progress in m3(valid range <tt>0</tt>..<tt>7</tt>)</td>
 
           <td align=left>transformer; animation progress in m7(valid range <tt>0</tt>..<tt>7</tt>)</td>
 
          </tr>
 
         </table>
 
        </td>
 
       </tr>
 

	
 
       <tr>
 
@@ -1163,13 +1163,13 @@
 
          <tr>
 
           <td nowrap valign=top><tt>1D</tt>&nbsp; </td>
 
           <td align=left>not animated</td>
 
          </tr>
 
          <tr>
 
           <td nowrap valign=top><tt>1E</tt>..<tt>20</tt>&nbsp; </td>
 
           <td align=left>various stages of animation; progress of animation in m3</td>
 
           <td align=left>various stages of animation; progress of animation in m7</td>
 
          </tr>
 
         </table>
 
        </td>
 
       </tr>
 

	
 
       <tr>
 
@@ -1194,13 +1194,13 @@
 
          <tr>
 
           <td nowrap valign=top><tt>2F</tt>&nbsp; </td>
 
           <td align=left>wheel tower when not animated</td>
 
          </tr>
 
          <tr>
 
           <td nowrap valign=top><tt>30</tt>&nbsp; </td>
 
           <td align=left>wheel tower when animated; animation state in m3 bits 5..0; m3 bit 6 set = sound already generated</td>
 
           <td align=left>wheel tower when animated; animation state in m7 bits 5..0; m7 bit 6 set = sound already generated</td>
 
          </tr>
 
          <tr>
 
           <td nowrap valign=top><tt>31</tt>&nbsp; </td>
 
           <td align=left>chimney</td>
 
          </tr>
 
         </table>
 
@@ -1234,13 +1234,13 @@
 
          <tr>
 
           <td nowrap valign=top><tt>4F</tt>&nbsp; </td>
 
           <td align=left>wheel tower when not animated</td>
 
          </tr>
 
          <tr>
 
           <td nowrap valign=top><tt>58</tt>&nbsp; </td>
 
           <td align=left>wheel tower when animated; animation state in m3 bits 5..0; m3 bit 6 set = sound already generated</td>
 
           <td align=left>wheel tower when animated; animation state in m7 bits 5..0; m7 bit 6 set = sound already generated</td>
 
          </tr>
 
         </table></td>
 
       </tr>
 

	
 
       <tr>
 
        <td nowrap valign=top><tt>59</tt>..<tt>5A</tt>&nbsp; </td>
 
@@ -1329,13 +1329,13 @@
 
       <tr>
 
        <td nowrap valign=top><tt>8E</tt>..<tt>93</tt>&nbsp; </td>
 
        <td align=left>toy factory
 
         <table>
 
          <tr>
 
           <td nowrap valign=top><tt>8F</tt>&nbsp; </td>
 
           <td align=left>Animated part; animation state in m3 (valid range <tt>00</tt>..<tt>31</tt>)<br>
 
           <td align=left>Animated part; animation state in m7 (valid range <tt>00</tt>..<tt>31</tt>)<br>
 
                        Tile animation is started (m4 zeroed) on the periodic processing.<br>
 
                        While the animation is in progress, m4 holds the number
 
                        of animation cycles that have already taken place.<br>
 
                        when this number reaches 8 the animation is stopped.</td>
 
          </tr>
 
         </table>
 
@@ -1359,13 +1359,13 @@
 
          <tr>
 
           <td nowrap valign=top><tt>A1</tt>&nbsp; </td>
 
           <td align=left>generators</td>
 
          </tr>
 
          <tr>
 
           <td nowrap valign=top><tt>A2</tt>&nbsp; </td>
 
           <td align=left>bubble capture facility; animation state in m3 (valid range <tt>00</tt>..<tt>27</tt>)</td>
 
           <td align=left>bubble capture facility; animation state in m7 (valid range <tt>00</tt>..<tt>27</tt>)</td>
 
          </tr>
 
         </table>
 
        </td>
 
       </tr>
 

	
 
       <tr>
 
@@ -1397,13 +1397,13 @@
 
       </tr>
 
      </table>
 
     </li>
 
     <li>m6 bits 5..3: random triggers (NewGRF)</li>
 
     <li>m6 bit 2: bit 8 of type (see m5)</li>
 
     <li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
 
     <li>m7: random bits (NewGRF)</li>
 
     <li>m7: animation frame</li>
 
    </ul>
 
   </td>
 
  </tr>
 

	
 
  <tr bgcolor="#CCCCCC">
 
   <td valign=top nowrap><strong><a name="Class9"><tt> 9</tt></a></strong></td>
docs/landscape_grid.html
Show inline comments
 
@@ -156,13 +156,13 @@ the array so you can quickly see what is
 
    <tr>
 
      <td>3</td>
 
      <td class="caption">house</td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits">XXXX XXXX XXXX XXXX</td>
 
      <td class="bits">XXX<span class="option">~ ~~</span>XX</td>
 
      <td class="bits">XX<span class="free">O</span><span class="option">~ ~~</span>XX</td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits">XXX<span class="abuse">X XXXX</span></td>
 
      <td class="bits"><span class="abuse">XXXX XX</span>XX</td>
 
      <td class="bits">XXXX <span class="abuse">XXXX</span></td>
 
    </tr>
 
    <tr>
 
@@ -290,14 +290,13 @@ the array so you can quickly see what is
 
      <td class="bits"><span class="free">OOOO OOOO</span></td>
 
    </tr>
 
    <tr>
 
      <td>8</td>
 
      <td class="caption">industry</td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits">XXX<span class="free">O</span> <span class="abuse">
 
        XXXX</span></td>
 
      <td class="bits">XXX<span class="free">O</span> <span class="abuse">XXXX</span></td>
 
      <td class="bits">XXXX XXXX XXXX XXXX</td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits"><span class="free">OO</span>XX XXXX</td>
 
      <td class="bits">XXXX XXXX</td>
 
@@ -328,17 +327,17 @@ the array so you can quickly see what is
 
    <tr>
 
      <td rowspan=2>A</td>
 
      <td class="caption">objects</td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits"><span class="free">O</span>XXX XXXX</td>
 
      <td class="bits">XXXX XXXX XXXX XXXX</td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits"><span class="free">OOOO OOOO</span></td>
 
      <td class="bits"><span class="free">OOOO OOOO</span></td>
 
      <td class="bits">XXXX XXXX</td>
 
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
 
      <td class="bits"><span class="free">OOOO OOOO</span></td>
 
      <td class="bits">XXXX XXXX</td>
 
    </tr>
 
  </tbody>
 
</table>
 

	
 
</body>
 
</html>
src/industry_map.h
Show inline comments
 
@@ -233,51 +233,51 @@ static inline void SetIndustryAnimationL
 
 * @param tile the tile to get the animation state of
 
 * @pre IsTileType(tile, MP_INDUSTRY)
 
 */
 
static inline byte GetIndustryAnimationState(TileIndex tile)
 
{
 
	assert(IsTileType(tile, MP_INDUSTRY));
 
	return _m[tile].m3;
 
	return _me[tile].m7;
 
}
 

	
 
/**
 
 * Set the animation state
 
 * @param tile the tile to set the animation state of
 
 * @param state the new animation state
 
 * @pre IsTileType(tile, MP_INDUSTRY)
 
 */
 
static inline void SetIndustryAnimationState(TileIndex tile, byte state)
 
{
 
	assert(IsTileType(tile, MP_INDUSTRY));
 
	_m[tile].m3 = state;
 
	_me[tile].m7 = state;
 
}
 

	
 
/**
 
 * Get the random bits for this tile.
 
 * Used for grf callbacks
 
 * @param tile TileIndex of the tile to query
 
 * @pre IsTileType(tile, MP_INDUSTRY)
 
 * @return requested bits
 
 */
 
static inline byte GetIndustryRandomBits(TileIndex tile)
 
{
 
	assert(IsTileType(tile, MP_INDUSTRY));
 
	return _me[tile].m7;
 
	return _m[tile].m3;
 
}
 

	
 
/**
 
 * Set the random bits for this tile.
 
 * Used for grf callbacks
 
 * @param tile TileIndex of the tile to query
 
 * @param bits the random bits
 
 * @pre IsTileType(tile, MP_INDUSTRY)
 
 */
 
static inline void SetIndustryRandomBits(TileIndex tile, byte bits)
 
{
 
	assert(IsTileType(tile, MP_INDUSTRY));
 
	_me[tile].m7 = bits;
 
	_m[tile].m3 = bits;
 
}
 

	
 
/**
 
 * Get the activated triggers bits for this industry tile
 
 * Used for grf callbacks
 
 * @param tile TileIndex of the tile to query
 
@@ -314,15 +314,15 @@ static inline void SetIndustryTriggers(T
 
 */
 
static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx, uint8 random, WaterClass wc)
 
{
 
	SetTileType(t, MP_INDUSTRY);
 
	_m[t].m1 = 0;
 
	_m[t].m2 = index;
 
	_m[t].m3 = 0;
 
	SetIndustryRandomBits(t, random); // m3
 
	_m[t].m4 = 0;
 
	SetIndustryGfx(t, gfx); // m5, part of m6
 
	SetIndustryTriggers(t, 0); // rest of m6
 
	SetIndustryRandomBits(t, random); // m7
 
	SetWaterClass(t, wc);
 
	_me[t].m7 = 0;
 
}
 

	
 
#endif /* INDUSTRY_MAP_H */
src/newgrf.cpp
Show inline comments
 
@@ -1681,13 +1681,13 @@ static ChangeInfoResult TownHouseChangeI
 

	
 
				_house_mngr.Add(hid + i, _cur_grffile->grfid, override);
 
				break;
 
			}
 

	
 
			case 0x16: // Periodic refresh multiplier
 
				housespec->processing_time = buf->ReadByte();
 
				housespec->processing_time = min(buf->ReadByte(), 63);
 
				break;
 

	
 
			case 0x17: // Four random colours to use
 
				for (uint j = 0; j < 4; j++) housespec->random_colour[j] = buf->ReadByte();
 
				break;
 

	
src/object_map.h
Show inline comments
 
@@ -112,25 +112,25 @@ static inline bool IsStatueTile(TileInde
 
 * @pre IsTileType(t, MP_OBJECT)
 
 * @return The animation 'stage' of the tile.
 
 */
 
static inline byte GetObjectAnimationStage(TileIndex t)
 
{
 
	assert(IsTileType(t, MP_OBJECT));
 
	return _m[t].m3;
 
	return _me[t].m7;
 
}
 

	
 
/**
 
 * Set animation stage/counter of this tile.
 
 * @param t     The tile to query.
 
 * @param stage The stage of this tile.
 
 * @pre IsTileType(t, MP_OBJECT)
 
 */
 
static inline void SetObjectAnimationStage(TileIndex t, uint8 stage)
 
{
 
	assert(IsTileType(t, MP_OBJECT));
 
	_m[t].m3 = stage;
 
	_me[t].m7 = stage;
 
}
 

	
 

	
 
/**
 
 * Make an Object tile.
 
 * @note do not use this function directly. Use one of the other Make* functions.
src/saveload/afterload.cpp
Show inline comments
 
@@ -1280,25 +1280,25 @@ bool AfterLoadGame()
 

	
 
	if (CheckSavegameVersion(43)) {
 
		for (TileIndex t = 0; t < map_size; t++) {
 
			if (IsTileType(t, MP_INDUSTRY)) {
 
				switch (GetIndustryGfx(t)) {
 
					case GFX_POWERPLANT_SPARKS:
 
						SetIndustryAnimationState(t, GB(_m[t].m1, 2, 5));
 
						_m[t].m3 = GB(_m[t].m1, 2, 5);
 
						break;
 

	
 
					case GFX_OILWELL_ANIMATED_1:
 
					case GFX_OILWELL_ANIMATED_2:
 
					case GFX_OILWELL_ANIMATED_3:
 
						SetIndustryAnimationState(t, GB(_m[t].m1, 0, 2));
 
						_m[t].m3 = GB(_m[t].m1, 0, 2);
 
						break;
 

	
 
					case GFX_COAL_MINE_TOWER_ANIMATED:
 
					case GFX_COPPER_MINE_TOWER_ANIMATED:
 
					case GFX_GOLD_MINE_TOWER_ANIMATED:
 
						 SetIndustryAnimationState(t, _m[t].m1);
 
						 _m[t].m3 = _m[t].m1;
 
						 break;
 

	
 
					default: // No animation states to change
 
						break;
 
				}
 
			}
 
@@ -1681,13 +1681,14 @@ bool AfterLoadGame()
 
	}
 

	
 
	if (CheckSavegameVersion(91)) {
 
		/* Increase HouseAnimationFrame from 5 to 7 bits */
 
		for (TileIndex t = 0; t < map_size; t++) {
 
			if (IsTileType(t, MP_HOUSE) && GetHouseType(t) >= NEW_HOUSE_OFFSET) {
 
				SetHouseAnimationFrame(t, GB(_m[t].m6, 3, 5));
 
				SB(_m[t].m6, 2, 6, GB(_m[t].m6, 3, 5));
 
				SB(_m[t].m3, 5, 1, 0);
 
			}
 
		}
 
	}
 

	
 
	if (CheckSavegameVersion(62)) {
 
		/* Remove all trams from savegames without tram support.
 
@@ -2246,12 +2247,44 @@ bool AfterLoadGame()
 
				/* get aircraft back on running altitude */
 
				if ((v->vehstatus & VS_CRASHED) == 0) SetAircraftPosition(v, v->x_pos, v->y_pos, GetAircraftFlyingAltitude(v));
 
			}
 
		}
 
	}
 

	
 
	/* Move the animation frame to the same location (m7) for all objects. */
 
	if (CheckSavegameVersion(147)) {
 
		for (TileIndex t = 0; t < map_size; t++) {
 
			switch (GetTileType(t)) {
 
				case MP_HOUSE:
 
					if (GetHouseType(t) >= NEW_HOUSE_OFFSET) {
 
						uint per_proc = _me[t].m7;
 
						_me[t].m7 = GB(_m[t].m6, 2, 6) | (GB(_m[t].m3, 5, 1) << 6);
 
						SB(_m[t].m3, 5, 1, 0);
 
						SB(_m[t].m6, 2, 6, min(per_proc, 63));
 
					}
 
					break;
 

	
 
				case MP_INDUSTRY: {
 
					uint rand = _me[t].m7;
 
					_me[t].m7 = _m[t].m3;
 
					_m[t].m3 = rand;
 
					break;
 
				}
 

	
 
				case MP_OBJECT:
 
					_me[t].m7 = _m[t].m3;
 
					_m[t].m3 = 0;
 
					break;
 

	
 
				default:
 
					/* For stations/airports it's already at m7 */
 
					break;
 
			}
 
		}
 
	}
 

	
 
	/* Road stops is 'only' updating some caches */
 
	AfterLoadRoadStops();
 
	AfterLoadLabelMaps();
 

	
 
	GamelogPrintDebug(1);
 

	
src/saveload/saveload.cpp
Show inline comments
 
@@ -207,14 +207,15 @@
 
 *  141   19799
 
 *  142   20003
 
 *  143   20048
 
 *  144   20334
 
 *  145   20376
 
 *  146   20446
 
 *  147   20621
 
 */
 
extern const uint16 SAVEGAME_VERSION = 146; ///< current savegame version of OpenTTD
 
extern const uint16 SAVEGAME_VERSION = 147; ///< current savegame version of OpenTTD
 

	
 
SavegameType _savegame_type; ///< type of savegame we are loading
 

	
 
uint32 _ttdp_version;     ///< version of TTDP savegame (if applicable)
 
uint16 _sl_version;       ///< the major savegame version identifier
 
byte   _sl_minor_version; ///< the minor savegame version, DO NOT USE!
src/town_map.h
Show inline comments
 
@@ -145,26 +145,25 @@ static inline void SetLiftPosition(TileI
 
 * @pre IsTileType(t, MP_HOUSE)
 
 * @return frame number
 
 */
 
static inline byte GetHouseAnimationFrame(TileIndex t)
 
{
 
	assert(IsTileType(t, MP_HOUSE));
 
	return GB(_m[t].m6, 2, 6) | (GB(_m[t].m3, 5, 1) << 6);
 
	return _me[t].m7;
 
}
 

	
 
/**
 
 * Set a new animation frame for this house
 
 * @param t the tile
 
 * @param frame the new frame number
 
 * @pre IsTileType(t, MP_HOUSE)
 
 */
 
static inline void SetHouseAnimationFrame(TileIndex t, byte frame)
 
{
 
	assert(IsTileType(t, MP_HOUSE));
 
	SB(_m[t].m6, 2, 6, GB(frame, 0, 6));
 
	SB(_m[t].m3, 5, 1, GB(frame, 6, 1));
 
	_me[t].m7 = frame;
 
}
 

	
 
/**
 
 * Get the completion of this house
 
 * @param t the tile
 
 * @return true if it is, false if it is not
 
@@ -184,37 +183,12 @@ static inline void SetHouseCompleted(Til
 
{
 
	assert(IsTileType(t, MP_HOUSE));
 
	SB(_m[t].m3, 7, 1, !!status);
 
}
 

	
 
/**
 
 * Make the tile a house.
 
 * @param t tile index
 
 * @param tid Town index
 
 * @param counter of construction step
 
 * @param stage of construction (used for drawing)
 
 * @param type of house.  Index into house specs array
 
 * @param random_bits required for newgrf houses
 
 * @pre IsTileType(t, MP_CLEAR)
 
 */
 
static inline void MakeHouseTile(TileIndex t, TownID tid, byte counter, byte stage, HouseID type, byte random_bits)
 
{
 
	assert(IsTileType(t, MP_CLEAR));
 

	
 
	SetTileType(t, MP_HOUSE);
 
	_m[t].m1 = random_bits;
 
	_m[t].m2 = tid;
 
	_m[t].m3 = 0;
 
	SetHouseType(t, type);
 
	SetHouseCompleted(t, stage == TOWN_HOUSE_COMPLETED);
 
	_m[t].m5 = IsHouseCompleted(t) ? 0 : (stage << 3 | counter);
 
	SetHouseAnimationFrame(t, 0);
 
	_me[t].m7 = HouseSpec::Get(type)->processing_time;
 
}
 

	
 
/**
 
 * House Construction Scheme.
 
 *  Construction counter, for buildings under construction. Incremented on every
 
 *  periodic tile processing.
 
 *  On wraparound, the stage of building in is increased.
 
 *  GetHouseBuildingStage is taking care of the real stages,
 
 *  (as the sprite for the next phase of house building)
 
@@ -362,33 +336,58 @@ static inline byte GetHouseTriggers(Tile
 
 * @pre IsTileType(t, MP_HOUSE)
 
 * @return time remaining
 
 */
 
static inline byte GetHouseProcessingTime(TileIndex t)
 
{
 
	assert(IsTileType(t, MP_HOUSE));
 
	return _me[t].m7;
 
	return GB(_m[t].m6, 2, 6);
 
}
 

	
 
/**
 
 * Set the amount of time remaining before the tile loop processes this tile.
 
 * @param t the house tile
 
 * @param time the time to be set
 
 * @pre IsTileType(t, MP_HOUSE)
 
 */
 
static inline void SetHouseProcessingTime(TileIndex t, byte time)
 
{
 
	assert(IsTileType(t, MP_HOUSE));
 
	_me[t].m7 = time;
 
	SB(_m[t].m6, 2, 6, time);
 
}
 

	
 
/**
 
 * Decrease the amount of time remaining before the tile loop processes this tile.
 
 * @param t the house tile
 
 * @pre IsTileType(t, MP_HOUSE)
 
 */
 
static inline void DecHouseProcessingTime(TileIndex t)
 
{
 
	assert(IsTileType(t, MP_HOUSE));
 
	_me[t].m7--;
 
	_m[t].m6 -= 1 << 2;
 
}
 

	
 
/**
 
 * Make the tile a house.
 
 * @param t tile index
 
 * @param tid Town index
 
 * @param counter of construction step
 
 * @param stage of construction (used for drawing)
 
 * @param type of house.  Index into house specs array
 
 * @param random_bits required for newgrf houses
 
 * @pre IsTileType(t, MP_CLEAR)
 
 */
 
static inline void MakeHouseTile(TileIndex t, TownID tid, byte counter, byte stage, HouseID type, byte random_bits)
 
{
 
	assert(IsTileType(t, MP_CLEAR));
 

	
 
	SetTileType(t, MP_HOUSE);
 
	_m[t].m1 = random_bits;
 
	_m[t].m2 = tid;
 
	_m[t].m3 = 0;
 
	SetHouseType(t, type);
 
	SetHouseCompleted(t, stage == TOWN_HOUSE_COMPLETED);
 
	_m[t].m5 = IsHouseCompleted(t) ? 0 : (stage << 3 | counter);
 
	SetHouseAnimationFrame(t, 0);
 
	SetHouseProcessingTime(t, HouseSpec::Get(type)->processing_time);
 
}
 

	
 
#endif /* TOWN_MAP_H */
0 comments (0 inline, 0 general)