Changeset - r8681:353d2f20f310
[Not reviewed]
master
0 5 0
frosch - 16 years ago 2008-03-06 14:21:10
frosch@openttd.org
(svn r12347) -Feature(ette): Increase house animation frame number from 32 to 128.
5 files changed with 17 insertions and 7 deletions:
0 comments (0 inline, 0 general)
docs/landscape.html
Show inline comments
 
@@ -643,21 +643,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 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..3 : Current animation frame</li>
 
         <li>bit 2 : free</li>
 
         <li>bits 7..2 : Current animation frame (bits 5..0); bit 6 in m3</li>
 
        </ul>
 
       </li>
 
       <li>Standard behaviour
 
        <ul>
 
         <li>bits 7..2 : lift position (for houses type 04 and 05)</li>
 
        </ul>
docs/landscape_grid.html
Show inline comments
 
@@ -167,16 +167,16 @@ 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">XX<span class="free">O</span><span class="option">~ ~~</span>XX</td>
 
      <td class="bits">XXX<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 X</span>XXX</td>
 
      <td class="bits"><span class="abuse">XXXX XX</span>XX</td>
 
      <td class="bits">XXXX <span class="abuse">XXXX</span></td>
 
    </tr>
 
    <tr>
 
      <td>4</td>
 
      <td class="caption">trees</td>
 
      <td class="bits">XXXX XXXX</td>
src/openttd.cpp
Show inline comments
 
@@ -2428,12 +2428,21 @@ bool AfterLoadGame()
 
			v->profit_this_year <<= 8;
 
			v->profit_last_year <<= 8;
 
			v->running_ticks = 0;
 
		}
 
	}
 

	
 
	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));
 
			}
 
		}
 
	}
 

	
 
	return InitializeWindowsAndCaches();
 
}
 

	
 
/** Reload all NewGRF files during a running game. This is a cut-down
 
 * version of AfterLoadGame().
 
 * XXX - We need to reset the vehicle position hash because with a non-empty
src/saveload.cpp
Show inline comments
 
@@ -31,13 +31,13 @@
 
#include "vehicle_base.h"
 
#include "autoreplace_base.h"
 
#include <list>
 

	
 
#include "table/strings.h"
 

	
 
extern const uint16 SAVEGAME_VERSION = 90;
 
extern const uint16 SAVEGAME_VERSION = 91;
 
uint16 _sl_version;       ///< the major savegame version identifier
 
byte   _sl_minor_version; ///< the minor savegame version, DO NOT USE!
 

	
 
typedef void WriterProc(uint len);
 
typedef uint ReaderProc();
 

	
src/town_map.h
Show inline comments
 
@@ -142,25 +142,26 @@ 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, 3, 5);
 
	return GB(_m[t].m6, 2, 6) | (GB(_m[t].m3, 5, 1) << 6);
 
}
 

	
 
/**
 
 * 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, 3, 5, frame);
 
	SB(_m[t].m6, 2, 6, GB(frame, 0, 6));
 
	SB(_m[t].m3, 5, 1, GB(frame, 6, 1));
 
}
 

	
 
/**
 
 * Get the completion of this house
 
 * @param t the tile
 
 * @return true if it is, false if it is not
0 comments (0 inline, 0 general)