1
0
Fork 0

(svn r3184) GB/SB

release/0.4.5
tron 2005-11-15 08:49:46 +00:00
parent 8658560229
commit 1b0091e0d2
7 changed files with 13 additions and 13 deletions

View File

@ -666,7 +666,7 @@ static void DisasterTick_5_and_6(Vehicle *v)
return; return;
} }
v->direction = (v->direction + ((Random()&1)?2:-2))&7; v->direction = (v->direction + (GB(Random(), 0, 1) ? 2 : -2)) & 7;
} }
@ -902,9 +902,9 @@ static void Disaster6_Init(void)
static void Disaster7_Init(void) static void Disaster7_Init(void)
{ {
int index = GB(Random(), 0, 4);
Industry *i; Industry *i;
int maxloop = 15; int maxloop = 15;
int index = Random() & 0xF;
do { do {
FOR_ALL_INDUSTRIES(i) { FOR_ALL_INDUSTRIES(i) {

View File

@ -694,10 +694,10 @@ static void HandleEconomyFluctuations(void)
if (_opt.diff.economy == 0) return; if (_opt.diff.economy == 0) return;
if (--_economy.fluct == 0) { if (--_economy.fluct == 0) {
_economy.fluct = - (int)(Random()&3); _economy.fluct = -(int)GB(Random(), 0, 2);
AddNewsItem(STR_7073_WORLD_RECESSION_FINANCIAL, NEWS_FLAGS(NM_NORMAL,0,NT_ECONOMY,0), 0, 0); AddNewsItem(STR_7073_WORLD_RECESSION_FINANCIAL, NEWS_FLAGS(NM_NORMAL,0,NT_ECONOMY,0), 0, 0);
} else if (_economy.fluct == -12) { } else if (_economy.fluct == -12) {
_economy.fluct = (Random()&255) + 312; _economy.fluct = GB(Random(), 0, 8) + 312;
AddNewsItem(STR_7074_RECESSION_OVER_UPTURN_IN, NEWS_FLAGS(NM_NORMAL,0,NT_ECONOMY,0), 0, 0); AddNewsItem(STR_7074_RECESSION_OVER_UPTURN_IN, NEWS_FLAGS(NM_NORMAL,0,NT_ECONOMY,0), 0, 0);
} }
} }

View File

@ -342,7 +342,7 @@ static void SelectPlayerFaceWndProc(Window *w, WindowEvent *e)
SetWindowDirty(w); SetWindowDirty(w);
break; break;
case 7: case 7:
WP(w,facesel_d).face = (InteractiveRandom() & 0x7FFFFFFF) + (WP(w,facesel_d).gender << 31); WP(w,facesel_d).face = (WP(w,facesel_d).gender << 31) + GB(InteractiveRandom(), 0, 31);
SetWindowDirty(w); SetWindowDirty(w);
break; break;
} }

View File

@ -2064,8 +2064,8 @@ static void TileLoop_Track(TileIndex tile)
modify_me:; modify_me:;
/* tile changed? */ /* tile changed? */
if ( m2 != a2) { if (m2 != a2) {
_m[tile].m2 = (_m[tile].m2 & ~RAIL_MAP2LO_GROUND_MASK) | a2; SB(_m[tile].m2, 0, 4, a2);
MarkTileDirtyByTile(tile); MarkTileDirtyByTile(tile);
} }
} }

View File

@ -3016,8 +3016,8 @@ static void Load_STNS(void)
// this means it's an oldstyle savegame without support for nonuniform stations // this means it's an oldstyle savegame without support for nonuniform stations
if (st->train_tile != 0 && st->trainst_h == 0) { if (st->train_tile != 0 && st->trainst_h == 0) {
int w = st->trainst_w >> 4; int w = GB(st->trainst_w, 4, 4);
int h = st->trainst_w & 0xF; int h = GB(st->trainst_w, 0, 4);
if (_m[st->train_tile].m5 & 1) intswap(w, h); if (_m[st->train_tile].m5 & 1) intswap(w, h);
st->trainst_w = w; st->trainst_w = w;

View File

@ -964,7 +964,7 @@ static void DrawBridgePillars(const TileInfo *ti, int x, int y, int z)
// Draw first piece // Draw first piece
// (necessary for cantilever bridges) // (necessary for cantilever bridges)
image = b[12 + (ti->map5&0x01)]; image = b[12 + GB(ti->map5, 0, 1)];
piece = GetBridgePiece(ti->tile); piece = GetBridgePiece(ti->tile);
if (image != 0 && piece != 0) { if (image != 0 && piece != 0) {
@ -972,7 +972,7 @@ static void DrawBridgePillars(const TileInfo *ti, int x, int y, int z)
DrawGroundSpriteAt(image, x, y, z); DrawGroundSpriteAt(image, x, y, z);
} }
image = b[(ti->map5&0x01)*6 + piece]; image = b[GB(ti->map5, 0, 1) * 6 + piece];
if (image != 0) { if (image != 0) {
int back_height, front_height, i=z; int back_height, front_height, i=z;

View File

@ -223,10 +223,10 @@ void DrawWindowWidgets(const Window *w)
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, (clicked) ? FR_LOWERED : 0); DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, (clicked) ? FR_LOWERED : 0);
c = (wi->unkA&0xFF); c = GB(wi->unkA, 0, 8);
amt1 = (wi->right - wi->left + 1) / c; amt1 = (wi->right - wi->left + 1) / c;
d = (wi->unkA >> 8); d = GB(wi->unkA, 8, 8);
amt2 = (wi->bottom - wi->top + 1) / d; amt2 = (wi->bottom - wi->top + 1) / d;
color = _color_list[wi->color & 0xF].window_color_bgb; color = _color_list[wi->color & 0xF].window_color_bgb;