(svn r3184) GB/SB

This commit is contained in:
tron 2005-11-15 08:49:46 +00:00
parent ba9157fbbc
commit 84a16a0b30
7 changed files with 13 additions and 13 deletions

View File

@ -666,7 +666,7 @@ static void DisasterTick_5_and_6(Vehicle *v)
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)
{
int index = GB(Random(), 0, 4);
Industry *i;
int maxloop = 15;
int index = Random() & 0xF;
do {
FOR_ALL_INDUSTRIES(i) {

View File

@ -694,10 +694,10 @@ static void HandleEconomyFluctuations(void)
if (_opt.diff.economy == 0) return;
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);
} 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);
}
}

View File

@ -342,7 +342,7 @@ static void SelectPlayerFaceWndProc(Window *w, WindowEvent *e)
SetWindowDirty(w);
break;
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);
break;
}

View File

@ -2064,8 +2064,8 @@ static void TileLoop_Track(TileIndex tile)
modify_me:;
/* tile changed? */
if ( m2 != a2) {
_m[tile].m2 = (_m[tile].m2 & ~RAIL_MAP2LO_GROUND_MASK) | a2;
if (m2 != a2) {
SB(_m[tile].m2, 0, 4, a2);
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
if (st->train_tile != 0 && st->trainst_h == 0) {
int w = st->trainst_w >> 4;
int h = st->trainst_w & 0xF;
int w = GB(st->trainst_w, 4, 4);
int h = GB(st->trainst_w, 0, 4);
if (_m[st->train_tile].m5 & 1) intswap(w, h);
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
// (necessary for cantilever bridges)
image = b[12 + (ti->map5&0x01)];
image = b[12 + GB(ti->map5, 0, 1)];
piece = GetBridgePiece(ti->tile);
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);
}
image = b[(ti->map5&0x01)*6 + piece];
image = b[GB(ti->map5, 0, 1) * 6 + piece];
if (image != 0) {
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);
c = (wi->unkA&0xFF);
c = GB(wi->unkA, 0, 8);
amt1 = (wi->right - wi->left + 1) / c;
d = (wi->unkA >> 8);
d = GB(wi->unkA, 8, 8);
amt2 = (wi->bottom - wi->top + 1) / d;
color = _color_list[wi->color & 0xF].window_color_bgb;