[Scummvm-git-logs] scummvm master -> a18e803ea6cb7c0a6bf41561454e32f233f56da8
aquadran
aquadran at gmail.com
Sun Mar 7 08:56:41 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a18e803ea6 ICB: Cleanup types
Commit: a18e803ea6cb7c0a6bf41561454e32f233f56da8
https://github.com/scummvm/scummvm/commit/a18e803ea6cb7c0a6bf41561454e32f233f56da8
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2021-03-07T09:56:34+01:00
Commit Message:
ICB: Cleanup types
Changed paths:
engines/icb/actor.cpp
engines/icb/actor.h
engines/icb/actor_fx_pc.cpp
engines/icb/actor_pc.cpp
engines/icb/actor_pc.h
engines/icb/actor_view_pc.cpp
engines/icb/actor_view_pc.h
engines/icb/barriers.cpp
engines/icb/bone.cpp
engines/icb/bone.h
engines/icb/breath.cpp
engines/icb/breath.h
engines/icb/chi.cpp
engines/icb/cluster_manager_pc.cpp
engines/icb/cluster_manager_pc.h
engines/icb/common/datapacker.cpp
engines/icb/common/datapacker.h
engines/icb/common/pc_props.h
engines/icb/common/ptr_util.cpp
engines/icb/common/px_anims.h
engines/icb/common/px_array.h
engines/icb/common/px_bitmap_pc.h
engines/icb/common/px_bones.cpp
engines/icb/common/px_bones.h
engines/icb/common/px_camera.h
engines/icb/common/px_capri_maths.h
engines/icb/common/px_capri_maths_pc.cpp
engines/icb/common/px_capri_maths_pc.h
engines/icb/common/px_clu_api.h
engines/icb/common/px_common.h
engines/icb/common/px_game_object.h
engines/icb/common/px_globalvariables.cpp
engines/icb/common/px_globalvariables.h
engines/icb/common/px_list.h
engines/icb/common/px_rcutypes.h
engines/icb/common/px_scriptengine.cpp
engines/icb/common/px_scriptengine.h
engines/icb/common/px_staticlayers.h
engines/icb/common/px_string.cpp
engines/icb/common/px_string.h
engines/icb/common/px_walkarea_integer.h
engines/icb/common/revtex_api.h
engines/icb/configfile.cpp
engines/icb/debug.cpp
engines/icb/debug_pc.cpp
engines/icb/debug_pc.h
engines/icb/drawpoly_pc.cpp
engines/icb/drawpoly_pc.h
engines/icb/floors.cpp
engines/icb/fn_animation.cpp
engines/icb/fn_fx_pc.cpp
engines/icb/fn_interact.cpp
engines/icb/fn_sound.cpp
engines/icb/fn_sting_pc.cpp
engines/icb/footstep.cpp
engines/icb/function.cpp
engines/icb/game_script.cpp
engines/icb/general_npc_animation.cpp
engines/icb/gfx/gfxstub.cpp
engines/icb/gfx/gfxstub.h
engines/icb/gfx/gfxstub_dutch.cpp
engines/icb/gfx/gfxstub_dutch.h
engines/icb/gfx/gfxstub_rev.cpp
engines/icb/gfx/gfxstub_rev_dutch.h
engines/icb/gfx/psx_anims.h
engines/icb/gfx/psx_camera.h
engines/icb/gfx/psx_light.h
engines/icb/gfx/psx_pcdefines.h
engines/icb/gfx/psx_pcgpu.cpp
engines/icb/gfx/psx_pcgpu.h
engines/icb/gfx/psx_pchmd.h
engines/icb/gfx/psx_poly.h
engines/icb/gfx/psx_props.h
engines/icb/gfx/psx_pxactor.h
engines/icb/gfx/psx_scrn.h
engines/icb/gfx/psx_tman.cpp
engines/icb/gfx/psx_tman.h
engines/icb/gfx/rab_api.cpp
engines/icb/gfx/rab_api.h
engines/icb/gfx/rap_api.h
engines/icb/global_objects.cpp
engines/icb/global_objects.h
engines/icb/global_objects_psx.cpp
engines/icb/global_objects_psx.h
engines/icb/global_switches.h
engines/icb/graphic_prims.h
engines/icb/graphic_prims_pc.cpp
engines/icb/health_bar_pc.cpp
engines/icb/icon_menu.cpp
engines/icb/icon_menu.h
engines/icb/icon_menu_pc.cpp
engines/icb/jpeg.cpp
engines/icb/jpeg.h
engines/icb/light_pc.cpp
engines/icb/light_pc.h
engines/icb/line_of_sight.cpp
engines/icb/line_of_sight.h
engines/icb/loadscrn.h
engines/icb/loadscrn_pc.cpp
engines/icb/logic.cpp
engines/icb/main_menu_pc.cpp
engines/icb/mission.cpp
engines/icb/mission_functions.cpp
engines/icb/mission_functions.h
engines/icb/movie_pc.cpp
engines/icb/movie_pc.h
engines/icb/non_ad_module.cpp
engines/icb/non_ad_module.h
engines/icb/object_structs.h
engines/icb/options_manager_pc.cpp
engines/icb/options_manager_pc.h
engines/icb/p4.cpp
engines/icb/p4.h
engines/icb/p4_pc.cpp
engines/icb/player.cpp
engines/icb/player.h
engines/icb/player_pc.cpp
engines/icb/prim_route_builder.cpp
engines/icb/remora.cpp
engines/icb/remora.h
engines/icb/remora_pc.cpp
engines/icb/remora_pc.h
engines/icb/res_man.cpp
engines/icb/res_man.h
engines/icb/res_man_pc.cpp
engines/icb/session.cpp
engines/icb/session.h
engines/icb/set.cpp
engines/icb/set_pc.cpp
engines/icb/set_pc.h
engines/icb/shade.cpp
engines/icb/shade_pc.cpp
engines/icb/shade_pc.h
engines/icb/shadow_pc.cpp
engines/icb/shadow_pc.h
engines/icb/shake.cpp
engines/icb/shake.h
engines/icb/softskin_pc.cpp
engines/icb/softskin_pc.h
engines/icb/sound.cpp
engines/icb/sound.h
engines/icb/sound/fx_manager.cpp
engines/icb/sound/fx_manager.h
engines/icb/sound/music_manager.cpp
engines/icb/sound/music_manager.h
engines/icb/sound/sound_common.cpp
engines/icb/sound/sound_common.h
engines/icb/sound/speech_manager.cpp
engines/icb/sound/speech_manager.h
engines/icb/sound_logic.h
engines/icb/sound_lowlevel.h
engines/icb/sound_lowlevel_pc.cpp
engines/icb/speech.cpp
engines/icb/speech.h
engines/icb/stage_poly.cpp
engines/icb/stagedraw_pc_poly.cpp
engines/icb/surface_manager.cpp
engines/icb/surface_manager.h
engines/icb/text_pc.cpp
engines/icb/text_sprites.cpp
engines/icb/tracer.cpp
engines/icb/zsupport.cpp
engines/icb/zsupport.h
diff --git a/engines/icb/actor.cpp b/engines/icb/actor.cpp
index f5ea4d2245..05ecfc2be7 100644
--- a/engines/icb/actor.cpp
+++ b/engines/icb/actor.cpp
@@ -107,7 +107,7 @@ int QuickActorCull(psxCamera *camera, VECTOR *pos, SVECTOR *orient) {
for (i = 0; i < 8; i++, local++, scrn++) {
gte_RotTransPers(local, (int32 *)&(scrn->vx), &p, &flag, &z0);
- scrn->vz = (short)z0;
+ scrn->vz = (int16)z0;
}
// Find the minimum and maximum screen positions (plus z)
diff --git a/engines/icb/actor.h b/engines/icb/actor.h
index 6f4d941f0b..4918c9a6ef 100644
--- a/engines/icb/actor.h
+++ b/engines/icb/actor.h
@@ -32,7 +32,7 @@
namespace ICB {
-int QuickActorCull(psxCamera *camera, VECTOR *pos, SVECTOR *orient);
+int32 QuickActorCull(psxCamera *camera, VECTOR *pos, SVECTOR *orient);
} // End of namespace ICB
diff --git a/engines/icb/actor_fx_pc.cpp b/engines/icb/actor_fx_pc.cpp
index 92ac9ac494..be6422df00 100644
--- a/engines/icb/actor_fx_pc.cpp
+++ b/engines/icb/actor_fx_pc.cpp
@@ -39,17 +39,17 @@
namespace ICB {
-void DrawMuzzleFlashPC(SVECTOR *mfpos, int mfh, int mfw);
-void DrawCartridgeCasePC(SVECTOR *bulletOffset, int col);
+void DrawMuzzleFlashPC(SVECTOR *mfpos, int32 mfh, int32 mfw);
+void DrawCartridgeCasePC(SVECTOR *bulletOffset, int32 col);
void DrawBreathingPC(Breath *breath); // test function
#if _PSX_ON_PC == 1
-extern int minX, maxX, minY, maxY, minZ, maxZ;
+extern int32 minX, maxX, minY, maxY, minZ, maxZ;
#else // #if _PSX_ON_PC == 1
-int minX, maxX, minY, maxY, minZ, maxZ;
+int32 minX, maxX, minY, maxY, minZ, maxZ;
#endif // #if _PSX_ON_PC == 1
@@ -57,7 +57,7 @@ int minX, maxX, minY, maxY, minZ, maxZ;
#define NOT_VERY_BRIGHT 3000
// draw the special effects
-int DrawActorSpecialEffectsPC(int mflash, SVECTOR *mfpos, int mfh, int mfw, int bullet, SVECTOR *bulletPos, int bulletCol, Breath *breath, MATRIXPC *local2screen, int brightness,
+int32 DrawActorSpecialEffectsPC(int32 mflash, SVECTOR *mfpos, int32 mfh, int32 mfw, int32 bullet, SVECTOR *bulletPos, int32 bulletCol, Breath *breath, MATRIXPC *local2screen, int32 brightness,
SVECTOR *minBBox, SVECTOR *maxBBox) {
// Put the correct rot and trans matrix in place
// transform model from world space to screen space
@@ -77,8 +77,8 @@ int DrawActorSpecialEffectsPC(int mflash, SVECTOR *mfpos, int mfh, int mfw, int
}
if (bullet) {
- int col;
- int b;
+ int32 col;
+ int32 b;
// get difference between actual brightness and the min level
b = brightness - NOT_VERY_BRIGHT;
@@ -101,13 +101,13 @@ int DrawActorSpecialEffectsPC(int mflash, SVECTOR *mfpos, int mfh, int mfw, int
}
if ((minBBox) && (maxBBox)) {
- minBBox->vx = (short)minX;
- minBBox->vy = (short)minY;
- minBBox->vz = (short)minZ;
+ minBBox->vx = (int16)minX;
+ minBBox->vy = (int16)minY;
+ minBBox->vz = (int16)minZ;
- maxBBox->vx = (short)maxX;
- maxBBox->vy = (short)maxY;
- maxBBox->vz = (short)maxZ;
+ maxBBox->vx = (int16)maxX;
+ maxBBox->vy = (int16)maxY;
+ maxBBox->vz = (int16)maxZ;
}
if ((minX < maxX) && (minY < maxY))
@@ -118,22 +118,22 @@ int DrawActorSpecialEffectsPC(int mflash, SVECTOR *mfpos, int mfh, int mfw, int
#define CIRCLE_SEGMENTS 12
-void DrawBreathParticlePC(short x, short y, int z, uint8 col, short w, short h, int *rands) {
- int angle = 0;
- int da = 4096 / CIRCLE_SEGMENTS;
- int cx, cy;
- int nx, ny;
- int i;
+void DrawBreathParticlePC(short x, short y, int32 z, uint8 col, short w, short h, int32 *rands) {
+ int32 angle = 0;
+ int32 da = 4096 / CIRCLE_SEGMENTS;
+ int32 cx, cy;
+ int32 nx, ny;
+ int32 i;
TPOLY_G3 *poly;
-#define getCircleX(ang) ((int)(PXcos((float)ang / 4096.0f) * w))
-#define getCircleY(ang) ((int)(PXsin((float)ang / 4096.0f) * h))
+#define getCircleX(ang) ((int32)(PXcos((float)ang / 4096.0f) * w))
+#define getCircleY(ang) ((int32)(PXsin((float)ang / 4096.0f) * h))
// get top point
- nx = (int)getCircleX(angle);
- ny = (int)getCircleY(angle);
+ nx = (int32)getCircleX(angle);
+ ny = (int32)getCircleY(angle);
- int randPointer = (x & 7); // 0-7
+ int32 randPointer = (x & 7); // 0-7
// for every other point
for (i = 0; i < CIRCLE_SEGMENTS; i++) {
@@ -142,10 +142,10 @@ void DrawBreathParticlePC(short x, short y, int z, uint8 col, short w, short h,
angle = (angle + da) & 4095;
- nx = (int)(getCircleX(angle) + rands[randPointer]);
+ nx = (int32)(getCircleX(angle) + rands[randPointer]);
randPointer = (randPointer + 1) & 7;
- ny = (int)(getCircleY(angle) + rands[randPointer]);
+ ny = (int32)(getCircleY(angle) + rands[randPointer]);
randPointer = (randPointer + 1) & 7;
poly = (TPOLY_G3 *)drawpacket;
@@ -153,7 +153,7 @@ void DrawBreathParticlePC(short x, short y, int z, uint8 col, short w, short h,
setTSemiTrans(poly, 1);
setTABRMode(poly, 1);
- setXY3(poly, (short)x, (short)y, (short)(cx + x), (short)(cy + y), (short)(nx + x), (short)(ny + y));
+ setXY3(poly, (int16)x, (int16)y, (int16)(cx + x), (int16)(cy + y), (int16)(nx + x), (int16)(ny + y));
setRGB0(poly, col, col, col);
setRGB1(poly, col, col, col);
@@ -169,7 +169,7 @@ void DrawBreathParticlePC(short x, short y, int z, uint8 col, short w, short h,
// breathing test....
void DrawBreathingPC(Breath *breath) {
- int i;
+ int32 i;
uint8 col;
// to get z value etc
SVECTORPC local;
@@ -178,7 +178,7 @@ void DrawBreathingPC(Breath *breath) {
int32 p, flag;
int32 z0;
int32 size;
- int max;
+ int32 max;
// set maximum number of polys...
if (breath->on == BREATH_SMOKE)
@@ -186,18 +186,18 @@ void DrawBreathingPC(Breath *breath) {
else
max = MAX_DRAW_BREATH;
- int rands[8];
+ int32 rands[8];
for (i = 0; i < 8; i++)
rands[i] = g_icb->getRandomSource()->getRandomNumber(5 - 1) - 2;
// draw the polys
for (i = 0; i < max; i++) {
- if ((int)(breath->breathColour[i]) > 0) {
+ if ((int32)(breath->breathColour[i]) > 0) {
local.vx = breath->position.vx;
- local.vy = (short)(breath->position.vy + breath->breathY[i]);
- local.vz = (short)(breath->position.vz + breath->breathZ[i]);
+ local.vy = (int16)(breath->position.vy + breath->breathY[i]);
+ local.vz = (int16)(breath->position.vz + breath->breathZ[i]);
gte_RotTransPers_pc(&local, &out, &p, &flag, &z0);
@@ -206,15 +206,15 @@ void DrawBreathingPC(Breath *breath) {
short x, y;
- x = (short)(out.vx);
- y = (short)(out.vy);
+ x = (int16)(out.vx);
+ y = (int16)(out.vy);
col = (uint8)(2 * breath->breathColour[i]);
short w, h;
- w = (short)((size * 3) >> 1);
- h = (short)size;
+ w = (int16)((size * 3) >> 1);
+ h = (int16)size;
DrawBreathParticlePC(x, y, z0, col, w, h, rands);
@@ -226,16 +226,16 @@ void DrawBreathingPC(Breath *breath) {
minY = y;
if (y + w > maxX)
- maxX = (short)(x + w);
+ maxX = (int16)(x + w);
if (y + h > maxY)
- maxY = (short)(y + h);
+ maxY = (int16)(y + h);
if (z0 < minZ)
- minZ = (short)z0;
+ minZ = (int16)z0;
if (z0 > maxZ)
- maxZ = (short)z0;
+ maxZ = (int16)z0;
}
}
}
@@ -260,7 +260,7 @@ const short bulletOffsets[BULLET_POINTS][3] = {{-BULLET_RADIUS, BULLET_RADIUS, 0
{-BULLET_RADIUS, -BULLET_RADIUS, BULLET_LENGTH}};
// 6 sides for cube....
-const int bulletQuads[BULLET_QUADS][4] = {{1, 0, 2, 3}, {0, 1, 4, 5}, {1, 2, 5, 6}, {2, 3, 6, 7}, {3, 0, 7, 4}, {4, 5, 7, 6}};
+const int32 bulletQuads[BULLET_QUADS][4] = {{1, 0, 2, 3}, {0, 1, 4, 5}, {1, 2, 5, 6}, {2, 3, 6, 7}, {3, 0, 7, 4}, {4, 5, 7, 6}};
#define BULLET_RED_1 255
#define BULLET_GREEN_1 255
@@ -270,17 +270,17 @@ const int bulletQuads[BULLET_QUADS][4] = {{1, 0, 2, 3}, {0, 1, 4, 5}, {1, 2, 5,
#define BULLET_GREEN_2 100
#define BULLET_BLUE_2 100
-void DrawCartridgeCasePC(SVECTOR *bulletOffset, int col) {
+void DrawCartridgeCasePC(SVECTOR *bulletOffset, int32 col) {
SVECTORPC sxy[BULLET_POINTS];
int32 p, flag, z = 0;
SVECTORPC pos;
- int i;
+ int32 i;
for (i = 0; i < BULLET_POINTS; i++) {
- pos.vx = (short)(bulletOffset->vx + bulletOffsets[i][0]);
- pos.vy = (short)(bulletOffset->vy + bulletOffsets[i][1]);
- pos.vz = (short)(bulletOffset->vz + bulletOffsets[i][2]);
+ pos.vx = (int16)(bulletOffset->vx + bulletOffsets[i][0]);
+ pos.vy = (int16)(bulletOffset->vy + bulletOffsets[i][1]);
+ pos.vz = (int16)(bulletOffset->vz + bulletOffsets[i][2]);
gte_RotTransPers_pc(&pos, &sxy[i], &p, &flag, &z);
}
@@ -362,10 +362,10 @@ void DrawCartridgeCasePC(SVECTOR *bulletOffset, int col) {
// z
if (z < minZ)
- minZ = (short)z;
+ minZ = (int16)z;
if (z > maxZ)
- maxZ = (short)z;
+ maxZ = (int16)z;
// set colours (remember dark at back and light at front
@@ -403,20 +403,20 @@ void DrawCartridgeCasePC(SVECTOR *bulletOffset, int col) {
#define setRGB1Colour(prim, col) setRGB1(prim, (col >> 16) & 255, (col >> 8) & 255, col & 255)
#define setRGB2Colour(prim, col) setRGB2(prim, (col >> 16) & 255, (col >> 8) & 255, col & 255)
-void DrawMuzzleFlashPC(SVECTOR *mfpos, int mfh, int mfw) {
+void DrawMuzzleFlashPC(SVECTOR *mfpos, int32 mfh, int32 mfw) {
// X left of character
// Y upwards
// Z forwards
- int h = mfh;
- int w = mfw;
- int mz = 20;
+ int32 h = mfh;
+ int32 w = mfw;
+ int32 mz = 20;
int32 p, flag, z;
SVECTORPC origin;
SVECTORPC points[18];
SVECTORPC sxy0;
int32 z0;
SVECTORPC spoints[18];
- int i;
+ int32 i;
// The centre point
short mfx = mfpos->vx;
@@ -431,111 +431,111 @@ void DrawMuzzleFlashPC(SVECTOR *mfpos, int mfh, int mfw) {
i = 0;
// slightly out... (OUT MORE FOR TRIS)
- points[i].vx = (short)(mfx + 0);
- points[i].vy = (short)(mfy + w);
- points[i].vz = (short)(mfz + 2 * mz);
+ points[i].vx = (int16)(mfx + 0);
+ points[i].vy = (int16)(mfy + w);
+ points[i].vz = (int16)(mfz + 2 * mz);
// far...
i++;
- points[i].vx = (short)(mfx + 0);
- points[i].vy = (short)(mfy + 0);
- points[i].vz = (short)(mfz + 2 * mz);
+ points[i].vx = (int16)(mfx + 0);
+ points[i].vy = (int16)(mfy + 0);
+ points[i].vz = (int16)(mfz + 2 * mz);
// slightly out... (OUT MORE FOR TRIS)
i++;
- points[i].vx = (short)(mfx + 0);
- points[i].vy = (short)(mfy - w);
- points[i].vz = (short)(mfz + 2 * mz);
+ points[i].vx = (int16)(mfx + 0);
+ points[i].vy = (int16)(mfy - w);
+ points[i].vz = (int16)(mfz + 2 * mz);
// slightly out... (OUT MORE FOR TRIS)
i++;
- points[i].vx = (short)(mfx + w);
- points[i].vy = (short)(mfy + 0);
- points[i].vz = (short)(mfz + 2 * mz);
+ points[i].vx = (int16)(mfx + w);
+ points[i].vy = (int16)(mfy + 0);
+ points[i].vz = (int16)(mfz + 2 * mz);
// far...
i++;
- points[i].vx = (short)(mfx + 0);
- points[i].vy = (short)(mfy + 0);
- points[i].vz = (short)(mfz + 2 * mz);
+ points[i].vx = (int16)(mfx + 0);
+ points[i].vy = (int16)(mfy + 0);
+ points[i].vz = (int16)(mfz + 2 * mz);
// slightly out... (OUT MORE FOR TRIS)
i++;
- points[i].vx = (short)(mfx - w);
- points[i].vy = (short)(mfy + 0);
- points[i].vz = (short)(mfz + 2 * mz);
+ points[i].vx = (int16)(mfx - w);
+ points[i].vy = (int16)(mfy + 0);
+ points[i].vz = (int16)(mfz + 2 * mz);
// The top-left corner
i++;
- points[i].vx = (short)(mfx - w);
- points[i].vy = (short)(mfy + h);
- points[i].vz = (short)(mfz + mz);
+ points[i].vx = (int16)(mfx - w);
+ points[i].vy = (int16)(mfy + h);
+ points[i].vz = (int16)(mfz + mz);
// The top-middle corner
i++;
- points[i].vx = (short)(mfx + 0);
- points[i].vy = (short)(mfy + h + w);
- points[i].vz = (short)(mfz + mz);
+ points[i].vx = (int16)(mfx + 0);
+ points[i].vy = (int16)(mfy + h + w);
+ points[i].vz = (int16)(mfz + mz);
// The top-right corner
i++;
- points[i].vx = (short)(mfx + w);
- points[i].vy = (short)(mfy + h);
- points[i].vz = (short)(mfz + mz);
+ points[i].vx = (int16)(mfx + w);
+ points[i].vy = (int16)(mfy + h);
+ points[i].vz = (int16)(mfz + mz);
// The left-bottom corner
i++;
- points[i].vx = (short)(mfx - h);
- points[i].vy = (short)(mfy - w);
- points[i].vz = (short)(mfz + mz);
+ points[i].vx = (int16)(mfx - h);
+ points[i].vy = (int16)(mfy - w);
+ points[i].vz = (int16)(mfz + mz);
// The left-middle corner
i++;
- points[i].vx = (short)(mfx - h - w);
- points[i].vy = (short)(mfy + 0);
- points[i].vz = (short)(mfz + mz);
+ points[i].vx = (int16)(mfx - h - w);
+ points[i].vy = (int16)(mfy + 0);
+ points[i].vz = (int16)(mfz + mz);
// The left-top corner
i++;
- points[i].vx = (short)(mfx - h);
- points[i].vy = (short)(mfy + w);
- points[i].vz = (short)(mfz + mz);
+ points[i].vx = (int16)(mfx - h);
+ points[i].vy = (int16)(mfy + w);
+ points[i].vz = (int16)(mfz + mz);
// The bottom-left corner
i++;
- points[i].vx = (short)(mfx - w);
- points[i].vy = (short)(mfy - h);
- points[i].vz = (short)(mfz + mz);
+ points[i].vx = (int16)(mfx - w);
+ points[i].vy = (int16)(mfy - h);
+ points[i].vz = (int16)(mfz + mz);
// The bottom-middle corner
i++;
- points[i].vx = (short)(mfx + 0);
- points[i].vy = (short)(mfy - h - w);
- points[i].vz = (short)(mfz + mz);
+ points[i].vx = (int16)(mfx + 0);
+ points[i].vy = (int16)(mfy - h - w);
+ points[i].vz = (int16)(mfz + mz);
// The bottom-right corner
i++;
- points[i].vx = (short)(mfx + w);
- points[i].vy = (short)(mfy - h);
- points[i].vz = (short)(mfz + mz);
+ points[i].vx = (int16)(mfx + w);
+ points[i].vy = (int16)(mfy - h);
+ points[i].vz = (int16)(mfz + mz);
// The right-top corner
i++;
- points[i].vx = (short)(mfx + h);
- points[i].vy = (short)(mfy + w);
- points[i].vz = (short)(mfz + mz);
+ points[i].vx = (int16)(mfx + h);
+ points[i].vy = (int16)(mfy + w);
+ points[i].vz = (int16)(mfz + mz);
// The right-middle corner
i++;
- points[i].vx = (short)(mfx + h + w);
- points[i].vy = (short)(mfy - 0);
- points[i].vz = (short)(mfz + mz);
+ points[i].vx = (int16)(mfx + h + w);
+ points[i].vy = (int16)(mfy - 0);
+ points[i].vz = (int16)(mfz + mz);
// The right-bottom corner
i++;
- points[i].vx = (short)(mfx + h);
- points[i].vy = (short)(mfy - w);
- points[i].vz = (short)(mfz + mz);
+ points[i].vx = (int16)(mfx + h);
+ points[i].vy = (int16)(mfy - w);
+ points[i].vz = (int16)(mfz + mz);
SVECTORPC *ppoints = points;
SVECTORPC *pspoints = spoints;
@@ -548,7 +548,7 @@ void DrawMuzzleFlashPC(SVECTOR *mfpos, int mfh, int mfw) {
TPOLY_G3 *poly;
// Draw the four polygons
- int j = 0;
+ int32 j = 0;
for (i = 0; i < 6; i++) {
poly = (TPOLY_G3 *)drawpacket;
@@ -634,10 +634,10 @@ void DrawMuzzleFlashPC(SVECTOR *mfpos, int mfh, int mfw) {
// z
if (z0 < minZ)
- minZ = (short)z0;
+ minZ = (int16)z0;
if (z0 > maxZ)
- maxZ = (short)z0;
+ maxZ = (int16)z0;
// draw it
diff --git a/engines/icb/actor_pc.cpp b/engines/icb/actor_pc.cpp
index 3d4a8ce71f..ab4d983853 100644
--- a/engines/icb/actor_pc.cpp
+++ b/engines/icb/actor_pc.cpp
@@ -43,7 +43,7 @@
namespace ICB {
-int tutorialMode = 0;
+int32 tutorialMode = 0;
#define MAX_LW_MATRICES 64
@@ -53,12 +53,12 @@ int tutorialMode = 0;
#define MAX_VECTORS 512
#endif
-int littpc;
-int mattpc;
-int verttpc;
-int polytpc;
-int hiertpc;
-int shadtpc;
+int32 littpc;
+int32 mattpc;
+int32 verttpc;
+int32 polytpc;
+int32 hiertpc;
+int32 shadtpc;
// Local prototypes
#if CD_MODE == 0
@@ -66,7 +66,7 @@ void drawBboxPC(SVECTOR *scrn, CVECTOR colour);
void drawOutlinePC(SVECTOR *min, SVECTOR *max, CVECTOR colour);
#endif // #if CD_MODE == 0
-void DrawModel4PC(rap_API *mrap, int poseBone, MATRIXPC *lw, MATRIXPC *local2screen, int uvframe, uint debug, SVECTOR *bbox, SVECTOR *minbbox, SVECTOR *maxbbox);
+void DrawModel4PC(rap_API *mrap, int32 poseBone, MATRIXPC *lw, MATRIXPC *local2screen, int32 uvframe, uint32 debug, SVECTOR *bbox, SVECTOR *minbbox, SVECTOR *maxbbox);
// My home grown replacement for the DrawActor routine
// which uses home grown replacement to do the drawing
@@ -74,7 +74,7 @@ void DrawModel4PC(rap_API *mrap, int poseBone, MATRIXPC *lw, MATRIXPC *local2scr
// using soft-skinning specific data
void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API *mesh, rap_API *pose, rap_API *smesh, PSXrgb *ambient, PSXLampList *lamplist,
- PSXShadeList *shadelist, int nShadows, SVECTORPC *p_n, int *p_d, uint32 debug, int uvframe, BoneDeformation **boneDeforms, int *brightness,
+ PSXShadeList *shadelist, int32 nShadows, SVECTORPC *p_n, int32 *p_d, uint32 debug, int32 uvframe, BoneDeformation **boneDeforms, int32 *brightness,
MATRIXPC *local2screen // filled in
) {
@@ -130,7 +130,7 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
BoneLink *skelPiece = bones;
LinkedMatrix *angles = frame->bones;
SVECTOR rot;
- uint b;
+ uint32 b;
for (b = 0; b < mesh->nBones; bone++, angles++, skelPiece++, b++) {
// Make the translation part
@@ -141,11 +141,11 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
// Make the rotation part
ExpandSVECTOR(angles->crot, &rot);
- for (int d = 0; d < MAX_DEFORMABLE_BONES; d++) {
- if ((boneDeforms[d]) && ((int)b == boneDeforms[d]->boneNumber)) {
- rot.vx = (short)(rot.vx + boneDeforms[d]->boneValue.vx);
- rot.vy = (short)(rot.vy + boneDeforms[d]->boneValue.vy);
- rot.vz = (short)(rot.vz + boneDeforms[d]->boneValue.vz);
+ for (int32 d = 0; d < MAX_DEFORMABLE_BONES; d++) {
+ if ((boneDeforms[d]) && ((int32)b == boneDeforms[d]->boneNumber)) {
+ rot.vx = (int16)(rot.vx + boneDeforms[d]->boneValue.vx);
+ rot.vy = (int16)(rot.vy + boneDeforms[d]->boneValue.vy);
+ rot.vz = (int16)(rot.vz + boneDeforms[d]->boneValue.vz);
}
}
@@ -158,7 +158,7 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
bone->parent = 0x0;
}
- int hasUpperBodyDeform = 0;
+ int32 hasUpperBodyDeform = 0;
SVECTOR upperBodyDeform;
// no upper body deform
@@ -168,19 +168,19 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
// check for any bone transformations on bone 1 which will effect the gun position...
- for (int d = 0; d < MAX_DEFORMABLE_BONES; d++) {
+ for (int32 d = 0; d < MAX_DEFORMABLE_BONES; d++) {
// if this is the upper body twist... (bone 1)
if ((boneDeforms[d]) && (boneDeforms[d]->boneNumber == 1)) {
hasUpperBodyDeform = 1;
- upperBodyDeform.vx = (short)(upperBodyDeform.vx + boneDeforms[d]->boneValue.vx);
- upperBodyDeform.vy = (short)(upperBodyDeform.vy + boneDeforms[d]->boneValue.vy);
- upperBodyDeform.vz = (short)(upperBodyDeform.vz + boneDeforms[d]->boneValue.vz);
+ upperBodyDeform.vx = (int16)(upperBodyDeform.vx + boneDeforms[d]->boneValue.vx);
+ upperBodyDeform.vy = (int16)(upperBodyDeform.vy + boneDeforms[d]->boneValue.vy);
+ upperBodyDeform.vz = (int16)(upperBodyDeform.vz + boneDeforms[d]->boneValue.vz);
}
}
// Is there an accesory to draw ?
- uint nBones = mesh->nBones;
- int pb = 0;
+ uint32 nBones = mesh->nBones;
+ int32 pb = 0;
if (frame->poseBone.parent != mesh->nBones) {
pb = nBones;
// Make the translation part
@@ -202,7 +202,7 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
gun_rot.vx = upperBodyDeform.vx;
gun_rot.vy = upperBodyDeform.vy;
- gun_rot.vz = (short)(48 * upperBodyDeform.vz / 64);
+ gun_rot.vz = (int16)(48 * upperBodyDeform.vz / 64);
RotMatrix_gte_pc(&gun_rot, &matrix);
@@ -285,7 +285,7 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
// Make the rotation matrix
MATRIXPC cam_pc, act_pc;
- const int MSCALE = ONE_PC / ONE;
+ const int32 MSCALE = ONE_PC / ONE;
cam_pc.m[0][0] = camera->view.m[0][0] * MSCALE;
cam_pc.m[0][1] = camera->view.m[0][1] * MSCALE;
cam_pc.m[0][2] = camera->view.m[0][2] * MSCALE;
@@ -317,9 +317,9 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
// make the ls trans vector
// = world2screen * local2world_trans + world2screen_trans
SVECTORPC sv;
- sv.vx = (short)actor->lw.t[0];
- sv.vy = (short)actor->lw.t[1];
- sv.vz = (short)actor->lw.t[2];
+ sv.vx = (int16)actor->lw.t[0];
+ sv.vy = (int16)actor->lw.t[1];
+ sv.vz = (int16)actor->lw.t[2];
ApplyMatrixLV_pc(&cam_pc, (VECTOR *)&(actor->lw.t[0]), (VECTOR *)&(local2screen->t[0]));
local2screen->t[0] += cam_pc.t[0];
@@ -345,8 +345,8 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
// Ignore the hip.vy - which represents roll because the hips roll independently of the whole body movement
// e.g. when walking along rolling the hips !
- trot.vx = (short)(hip.vx + (ONE / 4));
- trot.vy = (short)(hip.vz);
+ trot.vx = (int16)(hip.vx + (ONE / 4));
+ trot.vy = (int16)(hip.vz);
trot.vz = 0;
// Make the rotation matrix to account for the hips orientation relative to the actor coords
@@ -376,27 +376,27 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
}
SVECTORPC ldirs[MAX_SHADOWS];
CVECTOR lcolours[MAX_SHADOWS];
- int l;
- int ns = 0;
- int work;
+ int32 l;
+ int32 ns = 0;
+ int32 work;
for (l = 0; l < nShadows; l++) {
// Only use lights which are on and point downwards
if ((linfo[l].intens != 0) && (linfo[l].direct.vy < 0)) {
- ldirs[ns].vx = (short)linfo[l].direct.vx;
- ldirs[ns].vy = (short)linfo[l].direct.vy;
- ldirs[ns].vz = (short)linfo[l].direct.vz;
+ ldirs[ns].vx = (int16)linfo[l].direct.vx;
+ ldirs[ns].vy = (int16)linfo[l].direct.vy;
+ ldirs[ns].vz = (int16)linfo[l].direct.vz;
work = (linfo[l].colour.vx >> 4);
if (work > 255)
work = 255;
- lcolours[ns].r = (u_char)work;
+ lcolours[ns].r = (uint8)work;
work = (linfo[l].colour.vy >> 4);
if (work > 255)
work = 255;
- lcolours[ns].g = (u_char)work;
+ lcolours[ns].g = (uint8)work;
work = (linfo[l].colour.vz >> 4);
if (work > 255)
work = 255;
- lcolours[ns].b = (u_char)work;
+ lcolours[ns].b = (uint8)work;
ns++;
}
}
@@ -470,11 +470,11 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
SVECTORPC sxy0;
gte_RotTransPers_pc(&origin, &sxy0, &p, &flag, (int32 *)&(actor->sPos.vz));
- actor->sPos.vx = (short)sxy0.vx;
- actor->sPos.vy = (short)sxy0.vy;
+ actor->sPos.vx = (int16)sxy0.vx;
+ actor->sPos.vy = (int16)sxy0.vy;
#if CD_MODE == 0
- CVECTOR bboxColour = {(u_char)bboxRed, (u_char)bboxGreen, (u_char)bboxBlue, 0};
+ CVECTOR bboxColour = {(uint8)bboxRed, (uint8)bboxGreen, (uint8)bboxBlue, 0};
if (_drawBbox)
drawBboxPC(actor->bboxScrn, bboxColour);
CVECTOR sbColour = {240, 240, 240, 0};
@@ -493,16 +493,16 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
// 2 LINE_F3's : e.g. a rectangle
CVECTOR slColour;
if (_drawSline) {
- slColour.r = (u_char)slineRed;
- slColour.g = (u_char)slineGreen;
- slColour.b = (u_char)slineBlue;
+ slColour.r = (uint8)slineRed;
+ slColour.g = (uint8)slineGreen;
+ slColour.b = (uint8)slineBlue;
drawOutlinePC(&actor->minBbox, &actor->maxBbox, slColour);
}
if (_drawShadowSline) {
for (b = 0; b < actor->nShadows; b++) {
- slColour.r = (u_char)180;
- slColour.g = (u_char)(20 + b * 70);
- slColour.b = (u_char)255;
+ slColour.r = (uint8)180;
+ slColour.g = (uint8)(20 + b * 70);
+ slColour.b = (uint8)255;
drawOutlinePC(actor->shadowMinBox + b, actor->shadowMaxBox + b, slColour);
}
}
@@ -531,7 +531,7 @@ void drawOutlinePC(SVECTOR *min, SVECTOR *max, CVECTOR colour) {
#endif
// New version using soft-skinning specific data-files
-void DrawModel4PC(rap_API *mrap, int poseBone, MATRIXPC *lw, MATRIXPC *local2screen, int uvframe, uint debug, SVECTOR *bbox, SVECTOR *minbbox, SVECTOR *maxbbox) {
+void DrawModel4PC(rap_API *mrap, int32 poseBone, MATRIXPC *lw, MATRIXPC *local2screen, int32 uvframe, uint32 debug, SVECTOR *bbox, SVECTOR *minbbox, SVECTOR *maxbbox) {
SVECTORPC local[MAX_VECTORS];
SVECTORPC screen[MAX_VECTORS];
@@ -543,8 +543,8 @@ void DrawModel4PC(rap_API *mrap, int poseBone, MATRIXPC *lw, MATRIXPC *local2scr
int16 zmaxLocal = -32767;
verttpc = g_system->getMillis();
- int screenScale = mrap->worldScaleShift;
- int nVertices = softskinPC(mrap, poseBone, lw, local, &xminLocal, &xmaxLocal, &yminLocal, &ymaxLocal, &zminLocal, &zmaxLocal, screenScale);
+ int32 screenScale = mrap->worldScaleShift;
+ int32 nVertices = softskinPC(mrap, poseBone, lw, local, &xminLocal, &xmaxLocal, &yminLocal, &ymaxLocal, &zminLocal, &zmaxLocal, screenScale);
// So all the local positions have been made
verttpc = g_system->getMillis() - verttpc;
@@ -560,7 +560,7 @@ void DrawModel4PC(rap_API *mrap, int poseBone, MATRIXPC *lw, MATRIXPC *local2scr
gte_SetScreenScaleShift_pc(screenScale);
int32 flag, p;
- int i;
+ int32 i;
SVECTORPC *v0;
SVECTOR *pbbox;
@@ -601,8 +601,8 @@ void DrawModel4PC(rap_API *mrap, int poseBone, MATRIXPC *lw, MATRIXPC *local2scr
SVECTORPC sxy0;
for (i = 0; i < 8; i++) {
gte_RotTransPers_pc(pbbox, &sxy0, &p, &flag, (int32 *)&(pbbox->vz));
- pbbox->vx = (short)sxy0.vx;
- pbbox->vy = (short)sxy0.vy;
+ pbbox->vx = (int16)sxy0.vx;
+ pbbox->vy = (int16)sxy0.vy;
pbbox++;
}
@@ -727,12 +727,12 @@ void DrawModel4PC(rap_API *mrap, int poseBone, MATRIXPC *lw, MATRIXPC *local2scr
}
// Now do the animating polygons
- uint nTypes = mrap->nAnimTypes;
+ uint32 nTypes = mrap->nAnimTypes;
if (nTypes != 0) {
- int nFrames = mrap->nFrames;
+ int32 nFrames = mrap->nFrames;
if (nFrames == 0)
nFrames = 1;
- int frm = uvframe % nFrames;
+ int32 frm = uvframe % nFrames;
// for dead things uvframe = -1 : and in that case draw the last frame of the animation
if (uvframe == -1) {
@@ -744,7 +744,7 @@ void DrawModel4PC(rap_API *mrap, int poseBone, MATRIXPC *lw, MATRIXPC *local2scr
uint32 *typePtr = mrap->GetAnimPolyPtr();
polyStart = mrap->GetAnimPolyFrame(frm);
- for (uint t = 0; t < nTypes; t++) {
+ for (uint32 t = 0; t < nTypes; t++) {
switch (*typePtr++) { // ++ skips the type field
case HMD_FUS3: {
nPolys = *typePtr++;
@@ -845,44 +845,44 @@ void DrawActorTiePC(psxCamera *camera, SVECTORPC *pos, uint32 size, CVECTOR *) {
SVECTORPC wcorners[8];
SVECTORPC scorners[8];
- wcorners[0].vx = (short)(pos->vx - size);
+ wcorners[0].vx = (int16)(pos->vx - size);
wcorners[0].vy = pos->vy;
- wcorners[0].vz = (short)(pos->vz + size / 2);
+ wcorners[0].vz = (int16)(pos->vz + size / 2);
- wcorners[1].vx = (short)(pos->vx - size);
+ wcorners[1].vx = (int16)(pos->vx - size);
wcorners[1].vy = pos->vy;
- wcorners[1].vz = (short)(pos->vz - size / 2);
+ wcorners[1].vz = (int16)(pos->vz - size / 2);
- wcorners[2].vx = (short)(pos->vx - size / 2);
+ wcorners[2].vx = (int16)(pos->vx - size / 2);
wcorners[2].vy = pos->vy;
- wcorners[2].vz = (short)(pos->vz - size);
+ wcorners[2].vz = (int16)(pos->vz - size);
- wcorners[3].vx = (short)(pos->vx + size / 2);
+ wcorners[3].vx = (int16)(pos->vx + size / 2);
wcorners[3].vy = pos->vy;
- wcorners[3].vz = (short)(pos->vz - size);
+ wcorners[3].vz = (int16)(pos->vz - size);
- wcorners[4].vx = (short)(pos->vx + size);
+ wcorners[4].vx = (int16)(pos->vx + size);
wcorners[4].vy = pos->vy;
- wcorners[4].vz = (short)(pos->vz - size / 2);
+ wcorners[4].vz = (int16)(pos->vz - size / 2);
- wcorners[5].vx = (short)(pos->vx + size);
+ wcorners[5].vx = (int16)(pos->vx + size);
wcorners[5].vy = pos->vy;
- wcorners[5].vz = (short)(pos->vz + size / 2);
+ wcorners[5].vz = (int16)(pos->vz + size / 2);
- wcorners[6].vx = (short)(pos->vx + size / 2);
+ wcorners[6].vx = (int16)(pos->vx + size / 2);
wcorners[6].vy = pos->vy;
- wcorners[6].vz = (short)(pos->vz + size);
+ wcorners[6].vz = (int16)(pos->vz + size);
- wcorners[7].vx = (short)(pos->vx - size / 2);
+ wcorners[7].vx = (int16)(pos->vx - size / 2);
wcorners[7].vy = pos->vy;
- wcorners[7].vz = (short)(pos->vz + size);
+ wcorners[7].vz = (int16)(pos->vz + size);
SVECTORPC *local = wcorners;
SVECTORPC *scrn;
// Make the rotation matrix
MATRIXPC cam_pc;
- const int MSCALE = ONE_PC / ONE;
+ const int32 MSCALE = ONE_PC / ONE;
cam_pc.m[0][0] = camera->view.m[0][0] * MSCALE;
cam_pc.m[0][1] = camera->view.m[0][1] * MSCALE;
cam_pc.m[0][2] = camera->view.m[0][2] * MSCALE;
@@ -897,7 +897,7 @@ void DrawActorTiePC(psxCamera *camera, SVECTORPC *pos, uint32 size, CVECTOR *) {
cam_pc.t[1] = camera->view.t[1];
cam_pc.t[2] = camera->view.t[2] * ZSCALE;
- int i;
+ int32 i;
int32 p, flag, z0;
gte_SetGeomScreen_pc(camera->focLen * ZSCALE);
gte_SetRotMatrix_pc(&cam_pc);
@@ -908,13 +908,13 @@ void DrawActorTiePC(psxCamera *camera, SVECTORPC *pos, uint32 size, CVECTOR *) {
scrn = &mine;
gte_RotTransPers_pc(pos, scrn, &p, &flag, &z0);
- scrn->vz = (short)z0;
+ scrn->vz = (int16)z0;
scrn = scorners;
for (i = 0; i < 8; i++, local++, scrn++) {
gte_RotTransPers_pc(local, scrn, &p, &flag, &z0);
- scrn->vz = (short)z0;
+ scrn->vz = (int16)z0;
}
TPOLY_G3 *tie;
@@ -927,7 +927,7 @@ void DrawActorTiePC(psxCamera *camera, SVECTORPC *pos, uint32 size, CVECTOR *) {
inz0 /= 8;
for (i = 0; i < 8; i++) {
- int next = i + 1;
+ int32 next = i + 1;
if (next == 8)
next = 0;
tie = (TPOLY_G3 *)drawpacket;
@@ -1008,8 +1008,8 @@ void drawBboxPC(SVECTOR *scrn, CVECTOR colour) {
}
#endif
-void ConvertToScreenCoords(SVECTORPC *local, SVECTORPC *screen, int nVertices) {
- int i;
+void ConvertToScreenCoords(SVECTORPC *local, SVECTORPC *screen, int32 nVertices) {
+ int32 i;
SVECTORPC *in = local;
SVECTORPC *out = screen;
int32 flag, p;
@@ -1019,14 +1019,14 @@ void ConvertToScreenCoords(SVECTORPC *local, SVECTORPC *screen, int nVertices) {
gte_RotTransPers_pc(in, out, &p, &flag, (int32 *)&(out->vz));
out->vz <<= 2; // multiply by 4 to cope with AverageZ later on dividing by 4
p = (flag & (1 << 31));
- out->pad = (short)(p >> 16);
+ out->pad = (int16)(p >> 16);
in++;
out++;
}
}
-void ConvertToScreenCoords(SVECTOR *local, SVECTOR *screen, int nVertices) {
- int i;
+void ConvertToScreenCoords(SVECTOR *local, SVECTOR *screen, int32 nVertices) {
+ int32 i;
SVECTOR *in = local;
SVECTOR *out = screen;
int32 flag, p;
@@ -1036,7 +1036,7 @@ void ConvertToScreenCoords(SVECTOR *local, SVECTOR *screen, int nVertices) {
gte_RotTransPers(in, (int32 *)out, &p, &flag, (int32 *)&(out->vz));
out->vz <<= 2; // multiply by 4 to cope with AverageZ later on dividing by 4
p = (flag & (1 << 31));
- out->pad = (short)(p >> 16);
+ out->pad = (int16)(p >> 16);
in++;
out++;
}
diff --git a/engines/icb/actor_pc.h b/engines/icb/actor_pc.h
index 49e03c148a..b5036d3cde 100644
--- a/engines/icb/actor_pc.h
+++ b/engines/icb/actor_pc.h
@@ -42,17 +42,17 @@
namespace ICB {
-void ConvertToScreenCoords(SVECTORPC *local, SVECTORPC *screen, int nVertices);
-void ConvertToScreenCoords(SVECTOR *local, SVECTOR *screen, int nVertices);
+void ConvertToScreenCoords(SVECTORPC *local, SVECTORPC *screen, int32 nVertices);
+void ConvertToScreenCoords(SVECTOR *local, SVECTOR *screen, int32 nVertices);
void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API *mesh, rap_API *pose, rap_API *smesh, PSXrgb *ambient, PSXLampList *lamplist,
- PSXShadeList *shadelist, int nShadows, SVECTORPC *p_n, int *p_d, uint32 debug, int uvframe, BoneDeformation **boneDeforms, int *brightness,
+ PSXShadeList *shadelist, int32 nShadows, SVECTORPC *p_n, int32 *p_d, uint32 debug, int32 uvframe, BoneDeformation **boneDeforms, int32 *brightness,
MATRIXPC *local2screen);
void DrawActorTiePC(psxCamera *camera, SVECTORPC *pos, uint32 size, CVECTOR *colour);
// return 1 if something drawn, else return 0
-int DrawActorSpecialEffectsPC(int mflash, SVECTOR *mfpos, int mfh, int mfw, int bullet, SVECTOR *bulletPos, int bulletCol, Breath *breath, MATRIXPC *local2screen, int brightness,
+int32 DrawActorSpecialEffectsPC(int32 mflash, SVECTOR *mfpos, int32 mfh, int32 mfw, int32 bullet, SVECTOR *bulletPos, int32 bulletCol, Breath *breath, MATRIXPC *local2screen, int32 brightness,
SVECTOR *minBBox, SVECTOR *maxBBox);
} // End of namespace ICB
diff --git a/engines/icb/actor_view_pc.cpp b/engines/icb/actor_view_pc.cpp
index 7b923b2922..41fa55a5f3 100644
--- a/engines/icb/actor_view_pc.cpp
+++ b/engines/icb/actor_view_pc.cpp
@@ -51,10 +51,10 @@ namespace ICB {
// Cute little puppies
extern char *pRGB;
extern char *pZa;
-extern int RGBWidth;
-extern int RGBHeight;
-extern int RGBPitch;
-extern int RGBBytesPerPixel;
+extern int32 RGBWidth;
+extern int32 RGBHeight;
+extern int32 RGBPitch;
+extern int32 RGBBytesPerPixel;
RevRenderDevice renderingDevice;
@@ -68,7 +68,7 @@ psxCamera camera;
PXanim *pxanim;
SVECTOR rot; // Actor rotation
SVECTOR _crot; // Camera rotation
-int uvframe = 0;
+int32 uvframe = 0;
// Actor structure
psxActor av_actor;
@@ -85,7 +85,7 @@ char *anim_name;
const char *weapon_name;
char *outfit_name;
-int framenum;
+int32 framenum;
int32 g_repeats;
// Do we allow keyboard input to affect the actor viewing
@@ -110,7 +110,7 @@ int16 av_x, av_y, av_z;
// Prototypes for functions used in this module
TextureHandle *GetRegisteredTexture(const char *, uint32, const char *, uint32, const char *, uint32);
-void DrawFrame(const int frame);
+void DrawFrame(const int32 frame);
void MakeCameraView();
void ResetCamera();
void ResetActor();
@@ -218,9 +218,9 @@ void ChangeAnimPlaying(const char *pose, const char *anim, bool8 forwards, int32
ResetCamera();
}
-int ActorViewDraw() {
+int32 ActorViewDraw() {
// Return value
- int returnStatus = MID_ANIMATION;
+ int32 returnStatus = MID_ANIMATION;
// Alters the light nicely
AutoCycleLight();
@@ -234,26 +234,26 @@ int ActorViewDraw() {
// from the initialised defaults.
if (g_av_userControlled) {
// Increment in degrees
- int dang = 5;
+ int32 dang = 5;
// Actor rotation
if (Read_DI_keys(Common::KEYCODE_LEFT)) {
- rot.vy = (short)(rot.vy + 4096 * dang / 360);
+ rot.vy = (int16)(rot.vy + 4096 * dang / 360);
}
if (Read_DI_keys(Common::KEYCODE_DOWN)) {
- rot.vy = (short)(rot.vy - 4096 * dang / 360);
+ rot.vy = (int16)(rot.vy - 4096 * dang / 360);
}
if (Read_DI_keys(Common::KEYCODE_UP)) {
- rot.vx = (short)(rot.vx + 4096 * dang / 360);
+ rot.vx = (int16)(rot.vx + 4096 * dang / 360);
}
if (Read_DI_keys(Common::KEYCODE_DOWN)) {
- rot.vx = (short)(rot.vx - 4096 * dang / 360);
+ rot.vx = (int16)(rot.vx - 4096 * dang / 360);
}
if (Read_DI_keys(Common::KEYCODE_PAGEUP)) {
- rot.vz = (short)(rot.vz + 4096 * dang / 360);
+ rot.vz = (int16)(rot.vz + 4096 * dang / 360);
}
if (Read_DI_keys(Common::KEYCODE_PAGEDOWN)) {
- rot.vz = (short)(rot.vz - 4096 * dang / 360);
+ rot.vz = (int16)(rot.vz - 4096 * dang / 360);
}
if (rot.vx > 4096)
@@ -340,9 +340,9 @@ int ActorViewDraw() {
uint32 *safe_ad = address;
- for (int y = SCREEN_DEPTH; y; y--) {
+ for (int32 y = SCREEN_DEPTH; y; y--) {
uint32 *ad = safe_ad;
- for (int x = SCREEN_WIDTH; x; x--) {
+ for (int32 x = SCREEN_WIDTH; x; x--) {
// If the z-map for this pixel is FFFF then this pixel doesn't contain actor
if (*zActor != 0xFFFF) {
*ad = *source;
@@ -362,7 +362,7 @@ int ActorViewDraw() {
return returnStatus;
}
-void DrawFrame(const int frame) {
+void DrawFrame(const int32 frame) {
// These structures are needed for the drawing code to accept our light
PSXLampList the_lights;
PSXShadeList the_shades;
@@ -386,7 +386,7 @@ void DrawFrame(const int frame) {
// Make the actors orientation matrix
av_actor.rot = rot;
- av_actor.rot.vy = (short)(av_actor.rot.vy);
+ av_actor.rot.vy = (int16)(av_actor.rot.vy);
// Make the root local-world matrix
RotMatrix_gte(&av_actor.rot, &av_actor.lw);
@@ -396,7 +396,7 @@ void DrawFrame(const int frame) {
PXmarker &marker = frm->markers[ORG_POS];
float mposx, mposy, mposz;
marker.GetXYZ(&mposx, &mposy, &mposz);
- int dy = (int)mposy;
+ int32 dy = (int32)mposy;
av_actor.lw.t[0] = 0;
av_actor.lw.t[1] = dy - 112;
@@ -427,19 +427,19 @@ void DrawFrame(const int frame) {
ConvertRAP(mesh);
// Some error checking
- if (*(int *)mesh->id != *(int *)const_cast<char *>(RAP_API_ID)) {
+ if (*(int32 *)mesh->id != *(int32 *)const_cast<char *>(RAP_API_ID)) {
Fatal_error("Wrong rap id value file %d api %d file:%s", mesh->id, RAP_API_ID, mesh_name);
}
if (mesh->schema != RAP_API_SCHEMA) {
Fatal_error("Wrong rap schema value file %d rap_api %d file:%s", mesh->schema, RAP_API_SCHEMA, mesh_name);
}
- if (*(int *)pose->id != *(int *)const_cast<char *>(RAP_API_ID)) {
+ if (*(int32 *)pose->id != *(int32 *)const_cast<char *>(RAP_API_ID)) {
Fatal_error("Wrong rap id value file %d api %d file:%s", pose->id, RAP_API_ID, pose_name);
}
if (pose->schema != RAP_API_SCHEMA) {
Fatal_error("Wrong rap schema value file %d rap_api %d file:%s", pose->schema, RAP_API_SCHEMA, pose_name);
}
- if (*(int *)rab->id != *(int *)const_cast<char *>(RAB_API_ID)) {
+ if (*(int32 *)rab->id != *(int32 *)const_cast<char *>(RAB_API_ID)) {
Fatal_error("Wrong rab id value file %d rab_api %d file:%s", rab->id, RAB_API_ID, bone_name);
}
if (rab->schema != RAB_API_SCHEMA) {
@@ -451,20 +451,20 @@ void DrawFrame(const int frame) {
// Pass in the linkage file and the bones file
Bone_Frame *bone_frame = rab->GetFrame(frame);
- int brightness;
+ int32 brightness;
- int debug = 1;
+ int32 debug = 1;
BoneDeformation *myBones[MAX_DEFORMABLE_BONES];
- for (int i = 0; i < MAX_DEFORMABLE_BONES; i++) {
+ for (int32 i = 0; i < MAX_DEFORMABLE_BONES; i++) {
myBones[i] = NULL;
}
// Shadow stuff to play with
- int nShadows = 0;
+ int32 nShadows = 0;
SVECTORPC p_n[3];
- int p_d[3];
+ int32 p_d[3];
p_n[0].vx = 0;
p_n[0].vy = -1;
@@ -484,15 +484,15 @@ void MakeCameraView() {
RotMatrix_gte(&_crot, &camera.view);
// Include the x,y,z scalings
- camera.view.m[0][0] = (short)(camera.view.m[0][0] * 1);
- camera.view.m[0][1] = (short)(camera.view.m[0][1] * 1);
- camera.view.m[0][2] = (short)(camera.view.m[0][2] * 1);
- camera.view.m[1][0] = (short)(camera.view.m[1][0] * 1);
- camera.view.m[1][1] = (short)(camera.view.m[1][1] * 1);
- camera.view.m[1][2] = (short)(camera.view.m[1][2] * 1);
- camera.view.m[2][0] = (short)(camera.view.m[2][0] * 4);
- camera.view.m[2][1] = (short)(camera.view.m[2][1] * 4);
- camera.view.m[2][2] = (short)(camera.view.m[2][2] * 4);
+ camera.view.m[0][0] = (int16)(camera.view.m[0][0] * 1);
+ camera.view.m[0][1] = (int16)(camera.view.m[0][1] * 1);
+ camera.view.m[0][2] = (int16)(camera.view.m[0][2] * 1);
+ camera.view.m[1][0] = (int16)(camera.view.m[1][0] * 1);
+ camera.view.m[1][1] = (int16)(camera.view.m[1][1] * 1);
+ camera.view.m[1][2] = (int16)(camera.view.m[1][2] * 1);
+ camera.view.m[2][0] = (int16)(camera.view.m[2][0] * 4);
+ camera.view.m[2][1] = (int16)(camera.view.m[2][1] * 4);
+ camera.view.m[2][2] = (int16)(camera.view.m[2][2] * 4);
}
void ResetCamera() {
@@ -564,19 +564,19 @@ void AutoCycleLight() {
double radians = (av_LightA * M_PI) / 180.0f;
// Now calculate z and x coordinates from this angle
- av_LightX = (short)(sin(radians) * LIGHT_DISTANCE_FROM_ACTOR);
- av_LightZ = (short)(cos(radians) * LIGHT_DISTANCE_FROM_ACTOR);
+ av_LightX = (int16)(sin(radians) * LIGHT_DISTANCE_FROM_ACTOR);
+ av_LightZ = (int16)(cos(radians) * LIGHT_DISTANCE_FROM_ACTOR);
// Now bouce the light height between two fixed limits
if (av_LightDir) {
- av_LightY = (short)(av_LightY + 10);
+ av_LightY = (int16)(av_LightY + 10);
if (av_LightY > LIGHT_HEIGHT_LIMIT) {
av_LightY = LIGHT_HEIGHT_LIMIT;
av_LightDir = FALSE8;
}
} else {
- av_LightY = (short)(av_LightY - 10);
+ av_LightY = (int16)(av_LightY - 10);
if (av_LightY < -LIGHT_HEIGHT_LIMIT) {
av_LightY = -LIGHT_HEIGHT_LIMIT;
@@ -644,9 +644,9 @@ void SetLight(int32 falloff) {
Fatal_error("ActorView light rgb %d,%d,%d out of range (0-255)", av_LightR, av_LightG, av_LightB);
// Set colours (scale 0-255 to 0-4095)
- av_Light.states[0].c.r = (short)((av_LightR * 4096) / 256);
- av_Light.states[0].c.g = (short)((av_LightG * 4096) / 256);
- av_Light.states[0].c.b = (short)((av_LightB * 4096) / 256);
+ av_Light.states[0].c.r = (int16)((av_LightR * 4096) / 256);
+ av_Light.states[0].c.g = (int16)((av_LightG * 4096) / 256);
+ av_Light.states[0].c.b = (int16)((av_LightB * 4096) / 256);
// Set the v field of colour to be the maximum of r,g,b
av_Light.states[0].c.v = av_Light.states[0].c.r; // Start at red
@@ -674,14 +674,14 @@ void SetLight(int32 falloff) {
}
}
-int my_sprintf(char *buf, const char *format...) {
+int32 my_sprintf(char *buf, const char *format...) {
char lbuf[256];
// Process the variable arguments
va_list arglist;
va_start(arglist, format);
- int slen = vsnprintf(lbuf, 256, const_cast<char *>(format), arglist);
+ int32 slen = vsnprintf(lbuf, 256, const_cast<char *>(format), arglist);
strncpy(buf, lbuf, slen);
buf[slen] = '\0';
diff --git a/engines/icb/actor_view_pc.h b/engines/icb/actor_view_pc.h
index 5e81139910..4e0c0fed45 100644
--- a/engines/icb/actor_view_pc.h
+++ b/engines/icb/actor_view_pc.h
@@ -45,7 +45,7 @@ void InitActorView(const char *name, // Character to draw (ie "cord")
int16 iy, // Initial render y coord
int16 iz); // Initial render z coord
-int ActorViewDraw(); // Call each cycle to draw
+int32 ActorViewDraw(); // Call each cycle to draw
void ChangeAnimPlaying(const char *pose, // Pose to swap to NULL if keep the same
const char *anim, // Anim to change to
diff --git a/engines/icb/barriers.cpp b/engines/icb/barriers.cpp
index e36000dcf0..5dbfcb6a4c 100644
--- a/engines/icb/barriers.cpp
+++ b/engines/icb/barriers.cpp
@@ -84,7 +84,7 @@ __barrier_result _game_session::Check_barrier_bump_and_bounce(PXreal newx, PXrea
uint32 j;
PXfloat barrier_tolerance = BARRIER_TOLERANCE; // 1/8 of a turn = 45 degress
PXfloat diff;
- int ignoreThis;
+ int32 ignoreThis;
// 1 = means don't do fort knox solution on this barrier
// 0 = means do fort knox solution on this barrier
@@ -192,7 +192,7 @@ __barrier_result _game_session::Check_barrier_bump_and_bounce(PXreal newx, PXrea
// check for collision with nudge barriers
for (j = 0; j < M->number_of_nudge; j++) {
- int b = Fetch_megas_nudge_barrier_number(j);
+ int32 b = Fetch_megas_nudge_barrier_number(j);
bar = session_barriers->Fetch_barrier(b);
pdist = ((newx * bar->bcm().lpx()) + (newz * bar->bcm().lpz())) - bar->bcm().linedist();
@@ -241,11 +241,11 @@ __barrier_result _game_session::Check_barrier_bump_and_bounce(PXreal newx, PXrea
adjusted_pan = FLOAT_ZERO;
made_adjust = FALSE8;
normalAngle = 3 * FULL_TURN; // place holder to mean not set
- int nFortKnox = 0;
- uint nBarriers = (M->number_of_barriers + M->number_of_animating);
+ int32 nFortKnox = 0;
+ uint32 nBarriers = (M->number_of_barriers + M->number_of_animating);
for (j = 0; j < nBarriers; j++) {
- int b = Fetch_megas_barrier_number(j);
+ int32 b = Fetch_megas_barrier_number(j);
bar = session_barriers->Fetch_barrier(b);
ignoreBarrier[j] = 1;
@@ -281,7 +281,7 @@ __barrier_result _game_session::Check_barrier_bump_and_bounce(PXreal newx, PXrea
}
// if we hit a single corectable barrier then we can make that adjustment now
- int repulsed = 0;
+ int32 repulsed = 0;
PXfloat destx = FLOAT_ZERO;
PXfloat destz = FLOAT_ZERO;
@@ -310,12 +310,12 @@ __barrier_result _game_session::Check_barrier_bump_and_bounce(PXreal newx, PXrea
// Right so finally do a line intersection between the old position and the "final" new position
// old position is : oldx, oldz
// new position is : destx, destz
- int hit = 0;
+ int32 hit = 0;
// Special treatment for the player
if (pl) {
for (j = 0; j < nBarriers; j++) {
- int b = Fetch_megas_barrier_number(j);
+ int32 b = Fetch_megas_barrier_number(j);
bar = session_barriers->Fetch_barrier(b);
// Ignore barriers which are in the ignore list
@@ -373,7 +373,7 @@ __barrier_result _game_session::Check_barrier_bump_and_bounce(PXreal newx, PXrea
// he is on the right-hand side of the line
*/
- static int total_adjusts = 0;
+ static int32 total_adjusts = 0;
if ((!total_adjusts) && (MS->player.interact_selected) && (logic_structs[MS->player.cur_interact_id]->image_type == VOXEL)) {
// player is highlighting a mega
@@ -420,7 +420,7 @@ __barrier_result _game_session::Check_barrier_bump_and_bounce(PXreal newx, PXrea
return (__OK);
}
-__barrier_result _game_session::Check_this_barrier(_route_barrier *bar, PXreal newx, PXreal newz, PXreal /* oldx */, PXreal /* oldz */, PXreal bar_close, int *ignoreThis) {
+__barrier_result _game_session::Check_this_barrier(_route_barrier *bar, PXreal newx, PXreal newz, PXreal /* oldx */, PXreal /* oldz */, PXreal bar_close, int32 *ignoreThis) {
PXreal lpan;
PXfloat delta;
PXfloat delta2;
diff --git a/engines/icb/bone.cpp b/engines/icb/bone.cpp
index ad793b86d1..a17bbe445e 100644
--- a/engines/icb/bone.cpp
+++ b/engines/icb/bone.cpp
@@ -75,11 +75,11 @@ void _mega::InitCartridgeCase(SVECTOR *initPos, short initialHeight) {
void _game_session::UpdateCartridgeCase() {
if (M->bulletOn) {
// gravity acceleration
- M->bulletDY = (short)(M->bulletDY + BULLET_G);
+ M->bulletDY = (int16)(M->bulletDY + BULLET_G);
// movement
- M->bulletPos.vx = (short)(M->bulletPos.vx + M->bulletDX);
- M->bulletPos.vy = (short)(M->bulletPos.vy + M->bulletDY);
+ M->bulletPos.vx = (int16)(M->bulletPos.vx + M->bulletDX);
+ M->bulletPos.vy = (int16)(M->bulletPos.vy + M->bulletDY);
// only reduce colour if >0
if (M->bulletColour)
@@ -88,9 +88,9 @@ void _game_session::UpdateCartridgeCase() {
if ((M->bulletPos.vy < -M->bulletInitialHeight) && (M->bulletBounced >= 1)) { // we are at ground height and have already bounced enough (1) times, turn us off
M->bulletOn = FALSE8;
} else if (M->bulletPos.vy < -M->bulletInitialHeight) { // otherwise if we are at floor height then bounce us back up...
- M->bulletPos.vy = (short)(-M->bulletInitialHeight); // clip
- M->bulletDY = (short)(-M->bulletDY / 2);
- M->bulletDX = (short)(M->bulletDX / 2);
+ M->bulletPos.vy = (int16)(-M->bulletInitialHeight); // clip
+ M->bulletDY = (int16)(-M->bulletDY / 2);
+ M->bulletDX = (int16)(M->bulletDX / 2);
M->bulletBounced++;
// this is where we make the bouncing sound...
@@ -120,32 +120,32 @@ void UpdateTalking(_logic *log, rap_API *rap) {
jawBone->boneSpeed = JAW_SPEED;
// set number of bone from rap file
- jawBone->boneNumber = (short)(rap->jawBone);
- neckBone->boneNumber = (short)(rap->neckBone);
+ jawBone->boneNumber = (int16)(rap->jawBone);
+ neckBone->boneNumber = (int16)(rap->neckBone);
// unless it's -1 (no bone) we want the bone above this...
- if (neckBone->boneNumber != (short)-1) {
+ if (neckBone->boneNumber != (int16)-1) {
neckBone->boneNumber++; // add one to the value
}
// random neck movement (all three planes)
if ((g_icb->getRandomSource()->getRandomNumber(100 - 1)) < NECK_PERCENT) {
- neckBone->boneTarget.vx = (short)((g_icb->getRandomSource()->getRandomNumber(2 * NECK_RANGE - 1)) - NECK_RANGE);
- neckBone->boneTarget.vz = (short)((g_icb->getRandomSource()->getRandomNumber(2 * NECK_RANGE - 1)) - NECK_RANGE);
- neckBone->boneTarget.vy = (short)((g_icb->getRandomSource()->getRandomNumber(2 * NECK_RANGE - 1)) - NECK_RANGE);
+ neckBone->boneTarget.vx = (int16)((g_icb->getRandomSource()->getRandomNumber(2 * NECK_RANGE - 1)) - NECK_RANGE);
+ neckBone->boneTarget.vz = (int16)((g_icb->getRandomSource()->getRandomNumber(2 * NECK_RANGE - 1)) - NECK_RANGE);
+ neckBone->boneTarget.vy = (int16)((g_icb->getRandomSource()->getRandomNumber(2 * NECK_RANGE - 1)) - NECK_RANGE);
}
// random jaw movement (just the v moves)
if ((g_icb->getRandomSource()->getRandomNumber(100 - 1)) < JAW_PERCENT) {
- jawBone->boneTarget.vx = (short)(g_icb->getRandomSource()->getRandomNumber(JAW_MAX - 1));
- jawBone->boneTarget.vz = (short)0;
- jawBone->boneTarget.vy = (short)0;
+ jawBone->boneTarget.vx = (int16)(g_icb->getRandomSource()->getRandomNumber(JAW_MAX - 1));
+ jawBone->boneTarget.vz = (int16)0;
+ jawBone->boneTarget.vy = (int16)0;
}
}
// player was shot by obj
// needs some work to get right
-void SetPlayerShotBone(int obj_id) {
+void SetPlayerShotBone(int32 obj_id) {
_logic *player_log = MS->player.log;
_logic *obj_log = MS->logic_structs[obj_id];
@@ -169,11 +169,11 @@ void SetPlayerShotBone(int obj_id) {
else
player_pan = MS->player.log->auto_display_pan;
- int direction;
+ int32 direction;
// get direction got shot from...
- direction = (int)(4096.0 * (PXAngleOfVector(-dz, -dx) - player_pan));
+ direction = (int32)(4096.0 * (PXAngleOfVector(-dz, -dx) - player_pan));
// make sure it is -2048 - 2048
if (direction > 2047)
@@ -220,7 +220,7 @@ void SetPlayerShotBone(int obj_id) {
// update the neck bone
// should only be called with player as logic
void UpdatePlayerLook() {
- static int status = STATUS_NONE;
+ static int32 status = STATUS_NONE;
_logic *log = MS->player.log;
BoneDeformation *b = &(log->voxel_info->lookBone);
@@ -257,7 +257,7 @@ void UpdatePlayerLook() {
PXfloat player_pan;
PXreal ox, oy, oz, px, py, pz;
PXreal dx, dy, dz;
- int playerEye;
+ int32 playerEye;
// get postion of players head
@@ -302,7 +302,7 @@ void UpdatePlayerLook() {
}
// is an interact object, check for height.
else {
- int height = STANDARD_MARKER_HEIGHT; // standard prop height
+ int32 height = STANDARD_MARKER_HEIGHT; // standard prop height
// if look_height set for this marker set
if (target->look_height != -1)
@@ -323,8 +323,8 @@ void UpdatePlayerLook() {
// Now find angles for neck bone...
- b->boneTarget.vz = (short)(4096.0 * (PXAngleOfVector(-dz, -dx) - player_pan));
- b->boneTarget.vx = (short)(4096.0 * PXAngleOfVector((PXfloat)PXsqrt(dx * dx + dz * dz), dy));
+ b->boneTarget.vz = (int16)(4096.0 * (PXAngleOfVector(-dz, -dx) - player_pan));
+ b->boneTarget.vx = (int16)(4096.0 * PXAngleOfVector((PXfloat)PXsqrt(dx * dx + dz * dz), dy));
// make sure vz is in range -2048 - 2048... this might not be because of subtracting off player_pan
@@ -341,7 +341,7 @@ void UpdatePlayerLook() {
// armed unarmed
- int armed = MS->player.log->mega->Fetch_armed_status();
+ int32 armed = MS->player.log->mega->Fetch_armed_status();
// from NONE to a status
@@ -379,7 +379,7 @@ void UpdatePlayerLook() {
LimitShort(b->boneTarget.vx, -256, 256);
// for turning it looks better if you look up slightly (vx=vx-abs(vz)/2)
- b->boneTarget.vx = (short)(b->boneTarget.vx - (abs(b->boneTarget.vz) / 3));
+ b->boneTarget.vx = (int16)(b->boneTarget.vx - (abs(b->boneTarget.vz) / 3));
// we need to set the speed to be STANDARD_LOOK_SPEED
b->boneSpeed = STANDARD_LOOK_SPEED;
@@ -395,7 +395,7 @@ void UpdatePlayerLook() {
// limit pitch (pan can be any value so gun is always pointing at target...)
LimitShort(b->boneTarget.vx, -256, 256);
- b->boneTarget.vy = (short)((b->boneTarget.vx * b->boneTarget.vz) / 1024);
+ b->boneTarget.vy = (int16)((b->boneTarget.vx * b->boneTarget.vz) / 1024);
// we need to set the speed to be STANDARD_LOOK_SPEED
b->boneSpeed = STANDARD_LOOK_SPEED * 2;
@@ -429,11 +429,11 @@ mcodeFunctionReturnCodes speak_simple_look(int32 &result, int32 *params) { retur
// the array of standard look coords
-#define LOOK_RIGHT (short)(-384)
-#define LOOK_UP (short)(-196)
+#define LOOK_RIGHT (int16)(-384)
+#define LOOK_UP (int16)(-196)
-#define LOOK_LEFT (short)(-LOOK_RIGHT)
-#define LOOK_DOWN (short)(-LOOK_UP)
+#define LOOK_LEFT (int16)(-LOOK_RIGHT)
+#define LOOK_DOWN (int16)(-LOOK_UP)
const short looks[9][3] = {
{0, 0, 0}, // ahead
@@ -460,7 +460,7 @@ const short looks[9][3] = {
// simple look
mcodeFunctionReturnCodes _game_session::fn_simple_look(int32 &, int32 *params) {
- int l = params[0]; // which direction
+ int32 l = params[0]; // which direction
if (!logic_structs[cur_id]->mega)
Fatal_error("fn_set_neck_vector called by non mega %s", L->GetName());
@@ -480,10 +480,10 @@ mcodeFunctionReturnCodes _game_session::speak_simple_look(int32 &, int32 *params
const char *object_name = (const char *)MemoryUtil::resolvePtr(params[0]);
// object
- int object_id = objects->Fetch_item_number_by_name(object_name);
+ int32 object_id = objects->Fetch_item_number_by_name(object_name);
// direction
- int l = params[1];
+ int32 l = params[1];
if (!logic_structs[object_id]->mega)
Fatal_error("fn_set_neck_vector called by non mega %s", logic_structs[object_id]->GetName());
@@ -506,7 +506,7 @@ mcodeFunctionReturnCodes _game_session::speak_simple_look(int32 &, int32 *params
// set neck bone of current object
mcodeFunctionReturnCodes _game_session::fn_set_neck_bone(int32 &, int32 *params) {
- int bone = params[0];
+ int32 bone = params[0];
if (!logic_structs[cur_id]->mega)
Fatal_error("fn_set_neck_bone called by non mega %s", L->GetName());
@@ -529,7 +529,7 @@ mcodeFunctionReturnCodes _game_session::fn_set_neck_bone(int32 &, int32 *params)
// where NAME is object name...
//
mcodeFunctionReturnCodes _game_session::fn_set_neck_vector(int32 &, int32 *params) {
- int x, y, z, speed;
+ int32 x, y, z, speed;
x = params[0];
y = params[1];
@@ -560,8 +560,8 @@ mcodeFunctionReturnCodes _game_session::fn_set_neck_vector(int32 &, int32 *param
// 4 - speed
//
mcodeFunctionReturnCodes _game_session::speak_set_neck_vector(int32 &, int32 *params) {
- int object_id;
- int x, y, z, speed;
+ int32 object_id;
+ int32 x, y, z, speed;
const char *object_name = (const char *)MemoryUtil::resolvePtr(params[0]);
@@ -584,10 +584,10 @@ mcodeFunctionReturnCodes _game_session::speak_set_neck_vector(int32 &, int32 *pa
Tdebug("bones.txt", "%s: Setting bone <%d,%d,%d> at speed %d", object_name, x, y, z, speed);
- logic_structs[object_id]->voxel_info->scriptedLookBoneTarget.vx = (short)x;
- logic_structs[object_id]->voxel_info->scriptedLookBoneTarget.vy = (short)y;
- logic_structs[object_id]->voxel_info->scriptedLookBoneTarget.vz = (short)z;
- logic_structs[object_id]->voxel_info->lookBone.boneSpeed = (short)speed;
+ logic_structs[object_id]->voxel_info->scriptedLookBoneTarget.vx = (int16)x;
+ logic_structs[object_id]->voxel_info->scriptedLookBoneTarget.vy = (int16)y;
+ logic_structs[object_id]->voxel_info->scriptedLookBoneTarget.vz = (int16)z;
+ logic_structs[object_id]->voxel_info->lookBone.boneSpeed = (int16)speed;
return IR_CONT;
}
diff --git a/engines/icb/bone.h b/engines/icb/bone.h
index ae7a51d3b0..15e85382bd 100644
--- a/engines/icb/bone.h
+++ b/engines/icb/bone.h
@@ -36,7 +36,7 @@ namespace ICB {
void UpdateTalking(_logic *log, rap_API *rap);
-void SetPlayerShotBone(int obj_id);
+void SetPlayerShotBone(int32 obj_id);
void UpdatePlayerLook();
diff --git a/engines/icb/breath.cpp b/engines/icb/breath.cpp
index 4a66f2e26d..a9acf6b838 100644
--- a/engines/icb/breath.cpp
+++ b/engines/icb/breath.cpp
@@ -47,9 +47,9 @@ mcodeFunctionReturnCodes _game_session::fn_breath(int32 &, int32 *params) {
M->breath.Init();
// location is not used at the moment
- M->breath.position.vx = (short)params[1];
- M->breath.position.vy = (short)params[2];
- M->breath.position.vz = (short)params[3];
+ M->breath.position.vx = (int16)params[1];
+ M->breath.position.vy = (int16)params[2];
+ M->breath.position.vz = (int16)params[3];
return IR_CONT;
}
@@ -96,16 +96,16 @@ Breath::Breath() {
#define BREATH_WAIT (12 * BREATH_WAIT_SECONDS * BREATH_DC + BREATH_IC) // between breaths
void Breath::Init() {
- breathEnd = (short)(BREATH_WAIT);
+ breathEnd = (int16)(BREATH_WAIT);
int i;
for (i = 0; i < MAX_BREATH; i++) {
breathStarted[i] = 0;
if (on == BREATH_ON) {
- breathColour[i] = (short)(breathEnd - (BREATH_DC * i));
+ breathColour[i] = (int16)(breathEnd - (BREATH_DC * i));
} else { // smoke...
- breathColour[i] = (short)(breathEnd - (SMOKE_DC * i));
+ breathColour[i] = (int16)(breathEnd - (SMOKE_DC * i));
}
}
diff --git a/engines/icb/breath.h b/engines/icb/breath.h
index 6b69965890..c2bf6c0b3d 100644
--- a/engines/icb/breath.h
+++ b/engines/icb/breath.h
@@ -42,13 +42,13 @@ class Breath {
public:
SVECTOR position; // 8 bytes?
- short breathColour[MAX_BREATH]; // 8 bytes
+ int16 breathColour[MAX_BREATH]; // 8 bytes
int8 breathZ[MAX_BREATH]; // 4 bytes
int8 breathY[MAX_BREATH]; // 4 bytes
int8 breathSize[MAX_BREATH]; // 4 bytes
int8 breathStarted[MAX_BREATH]; // 4 bytes
- short breathEnd; // 2 bytes
+ int16 breathEnd; // 2 bytes
uint8 on; // 1 byte
int8 allStarted; // 1 byte (how many times reset)
diff --git a/engines/icb/chi.cpp b/engines/icb/chi.cpp
index 5d4ea77934..7fbfe53a63 100644
--- a/engines/icb/chi.cpp
+++ b/engines/icb/chi.cpp
@@ -847,7 +847,7 @@ bool8 _game_session::Make_floor_coordinate(PXreal *x, PXreal *z) {
if (!local_history_count)
return FALSE8;
- int choice = g_icb->getRandomSource()->getRandomNumber(local_history_count - 1);
+ int32 choice = g_icb->getRandomSource()->getRandomNumber(local_history_count - 1);
*x = local_history[choice].x;
*z = local_history[choice].z;
diff --git a/engines/icb/cluster_manager_pc.cpp b/engines/icb/cluster_manager_pc.cpp
index 80986ceafa..ed07dc38ea 100644
--- a/engines/icb/cluster_manager_pc.cpp
+++ b/engines/icb/cluster_manager_pc.cpp
@@ -174,9 +174,9 @@ char *ClusterManager::GetCDRoot(void) {
return m_cdroot2;
}
-int ClusterManager::WhichCD(MISSION_ID mission) {
+int32 ClusterManager::WhichCD(MISSION_ID mission) {
// All demos exist on one CD only
- int demo = g_globalScriptVariables.GetVariable("demo");
+ int32 demo = g_globalScriptVariables.GetVariable("demo");
if (demo != 0)
return 1;
@@ -193,7 +193,7 @@ int ClusterManager::WhichCD(MISSION_ID mission) {
return 0;
}
-bool8 ClusterManager::CheckForCD(int /*number*/) {
+bool8 ClusterManager::CheckForCD(int32 /*number*/) {
strcpy(m_cdroot1, "");
strcpy(m_cdroot2, "");
return TRUE8;
@@ -228,10 +228,10 @@ void ClusterManager::CleanHardDisk() {
return;
}
-void ClusterManager::MissingCD(int /*number*/) {
+void ClusterManager::MissingCD(int32 /*number*/) {
}
-bool8 ClusterManager::MissingCDWithCancel(int /*number*/) {
+bool8 ClusterManager::MissingCDWithCancel(int32 /*number*/) {
return FALSE8;
}
@@ -286,16 +286,16 @@ bool8 ClusterManager::DrawCoverFrame(void) {
void ClusterManager::InitialiseProgressBits() {
// Tweakable
- int width = 5;
- int height = 15;
- int spacing = 2;
- int initialY = SCREEN_DEPTH - height - 30;
+ int32 width = 5;
+ int32 height = 15;
+ int32 spacing = 2;
+ int32 initialY = SCREEN_DEPTH - height - 30;
// Calculate entire width so we can centre things
- int length = (NUMBER_OF_PROGRESS_BITS * (width + spacing)) - spacing;
- int initialX = (SCREEN_WIDTH / 2) - (length / 2);
+ int32 length = (NUMBER_OF_PROGRESS_BITS * (width + spacing)) - spacing;
+ int32 initialX = (SCREEN_WIDTH / 2) - (length / 2);
- for (int i = 0; i < NUMBER_OF_PROGRESS_BITS; i++) {
+ for (int32 i = 0; i < NUMBER_OF_PROGRESS_BITS; i++) {
m_progressBits[i].r.left = initialX;
m_progressBits[i].r.top = initialY;
m_progressBits[i].r.right = initialX + width;
@@ -313,7 +313,7 @@ void ClusterManager::InitialiseProgressBits() {
void ClusterManager::UpdateProgressBits() {
if (m_frameCounter % PROGRESS_BIT_DELAY == 0) {
// Update the state of all bits
- for (int i = 0; i < NUMBER_OF_PROGRESS_BITS; i++) {
+ for (int32 i = 0; i < NUMBER_OF_PROGRESS_BITS; i++) {
if (m_progressBits[i].state > 0 && m_progressBits[i].state != 6) {
m_progressBits[i].state = m_progressBits[i].state + 1;
}
@@ -324,7 +324,7 @@ void ClusterManager::UpdateProgressBits() {
float progress_inc = (float)(m_filelistTotalBytes / NUMBER_OF_PROGRESS_BITS);
// The number of bits that should bit switched on
- uint bitsOn = (int)((float)m_bytesDone / progress_inc);
+ uint32 bitsOn = (int32)((float)m_bytesDone / progress_inc);
// Do we need to switch on a new bit
if (bitsOn > m_bitsDone) {
@@ -334,7 +334,7 @@ void ClusterManager::UpdateProgressBits() {
}
void ClusterManager::DrawProgressBits() {
- for (int i = 0; i < NUMBER_OF_PROGRESS_BITS; i++) {
+ for (int32 i = 0; i < NUMBER_OF_PROGRESS_BITS; i++) {
Fill_rect(m_progressBits[i].r.left, m_progressBits[i].r.top, m_progressBits[i].r.right, m_progressBits[i].r.bottom, g_progressColourMap[m_progressBits[i].state]);
}
}
diff --git a/engines/icb/cluster_manager_pc.h b/engines/icb/cluster_manager_pc.h
index bdd1d8cb35..3c915f8ea9 100644
--- a/engines/icb/cluster_manager_pc.h
+++ b/engines/icb/cluster_manager_pc.h
@@ -55,7 +55,7 @@ private:
char m_cdroot1[1024];
char m_cdroot2[1024];
bool8 m_multipleCDDrives;
- int m_activeCDDrive;
+ int32 m_activeCDDrive;
// Working mission directory name (hashed)
char m_missionDir[8];
@@ -124,10 +124,10 @@ private:
void MinimumInstallCheck();
bool8 IsMissionDataInstalled(MISSION_ID &m);
void CleanHardDisk();
- int WhichCD(MISSION_ID mission);
- bool8 CheckForCD(int number);
- void MissingCD(int number);
- bool8 MissingCDWithCancel(int number);
+ int32 WhichCD(MISSION_ID mission);
+ bool8 CheckForCD(int32 number);
+ void MissingCD(int32 number);
+ bool8 MissingCDWithCancel(int32 number);
// Filelist handling
void LoadFileList(MISSION_ID mission);
diff --git a/engines/icb/common/datapacker.cpp b/engines/icb/common/datapacker.cpp
index 231d5766e5..495113c264 100644
--- a/engines/icb/common/datapacker.cpp
+++ b/engines/icb/common/datapacker.cpp
@@ -84,7 +84,7 @@ DataPacker::ReturnCodes DataPacker::open(const ModeEnum mode, const PackModeEnum
}
// Put a value into the bit-stream
-DataPacker::ReturnCodes DataPacker::put(const int value, Common::WriteStream *stream) {
+DataPacker::ReturnCodes DataPacker::put(const int32 value, Common::WriteStream *stream) {
if (iMode != WRITE) {
return BAD_MODE;
}
@@ -100,15 +100,15 @@ DataPacker::ReturnCodes DataPacker::put(const int value, Common::WriteStream *st
// For DONT_PACK mode just write the data straight out
if (iPackMode == DONT_PACK) {
// Check it is a legal value : 16-bits
- int lvarMin = -(1 << 15);
- int lvarMax = +((1 << 15) - 1);
+ int32 lvarMin = -(1 << 15);
+ int32 lvarMax = +((1 << 15) - 1);
if ((value < lvarMin) || (value > lvarMax)) {
return BAD_VALUE;
}
- int nItems = 2;
- short v16 = (short)value;
- int ret = stream->write((const void *)&v16, nItems);
+ int32 nItems = 2;
+ int16 v16 = (int16)value;
+ int32 ret = stream->write((const void *)&v16, nItems);
if (ret != nItems) {
return WRITE_ERROR;
@@ -117,7 +117,7 @@ DataPacker::ReturnCodes DataPacker::put(const int value, Common::WriteStream *st
}
// Convert the value to be within limits
- int v = value - packMin;
+ int32 v = value - packMin;
// Check the value is within range
if ((v < 0) || (v > packMax)) {
@@ -126,19 +126,19 @@ DataPacker::ReturnCodes DataPacker::put(const int value, Common::WriteStream *st
// Add the value in
if (pos == 0) {
- buffer[0] = (unsigned char)((v >> 6) & 0xFF); // v's top 8-bits
- buffer[1] = (unsigned char)((v & 0x3F) << 2); // v's bottom 6-bits into top 6-bits
+ buffer[0] = (uint8)((v >> 6) & 0xFF); // v's top 8-bits
+ buffer[1] = (uint8)((v & 0x3F) << 2); // v's bottom 6-bits into top 6-bits
} else if (pos == 1) {
buffer[1] |= ((v >> 12) & 0x03); // v's top 2-bits into bottom 2
- buffer[2] = (unsigned char)((v >> 4) & 0xFF); // v's middle 8-bits
- buffer[3] = (unsigned char)((v & 0x0F) << 4); // v's bottom 4-bits into top 4
+ buffer[2] = (uint8)((v >> 4) & 0xFF); // v's middle 8-bits
+ buffer[3] = (uint8)((v & 0x0F) << 4); // v's bottom 4-bits into top 4
} else if (pos == 2) {
buffer[3] |= ((v >> 10) & 0x0F); // v's top 4-bits into bottom 4
- buffer[4] = (unsigned char)((v >> 2) & 0xFF); // v's middle 8-bits
- buffer[5] = (unsigned char)((v & 0x03) << 6); // v's bottom 2-bits into top 2
+ buffer[4] = (uint8)((v >> 2) & 0xFF); // v's middle 8-bits
+ buffer[5] = (uint8)((v & 0x03) << 6); // v's bottom 2-bits into top 2
} else if (pos == 3) {
buffer[5] |= ((v >> 8) & 0x3F); // v's top 6-bits into bottom 6
- buffer[6] = (unsigned char)(v & 0xFF); // v's bottom 8-bits
+ buffer[6] = (uint8)(v & 0xFF); // v's bottom 8-bits
}
// Put data into the next position !
pos++;
@@ -151,8 +151,8 @@ DataPacker::ReturnCodes DataPacker::put(const int value, Common::WriteStream *st
buffer[4], buffer[5], buffer[6]);
#endif // #if 0
// Write out the buffer
- int nItems = BUFFER_BYTE_SIZE;
- int ret = stream->write((const void *)buffer, nItems);
+ int32 nItems = BUFFER_BYTE_SIZE;
+ int32 ret = stream->write((const void *)buffer, nItems);
if (ret != nItems) {
return WRITE_ERROR;
@@ -180,9 +180,9 @@ DataPacker::ReturnCodes DataPacker::Get(int32 &value, Common::SeekableReadStream
// For DONT_PACK mode just read the data straight in
if (iPackMode == DONT_PACK) {
- int nItems = 2;
- short int v16;
- int ret = stream->read((void *)&v16, nItems);
+ int32 nItems = 2;
+ int16 v16;
+ int32 ret = stream->read((void *)&v16, nItems);
value = v16;
if (ret != nItems) {
@@ -194,8 +194,8 @@ DataPacker::ReturnCodes DataPacker::Get(int32 &value, Common::SeekableReadStream
// Do we need to fill up the current buffer ?
if (pos == PACK_CHUNK_SIZE) {
// Read into the buffer
- int nItems = BUFFER_BYTE_SIZE;
- int ret = stream->read((void *)buffer, nItems);
+ int32 nItems = BUFFER_BYTE_SIZE;
+ int32 ret = stream->read((void *)buffer, nItems);
if (ret != nItems) {
return READ_ERROR;
@@ -245,8 +245,8 @@ DataPacker::ReturnCodes DataPacker::Get(int32 &value, Common::SeekableReadStream
DataPacker::ReturnCodes DataPacker::close(Common::WriteStream *stream) {
if ((iMode == WRITE) && (pos != 0)) {
// Write out the remaining data items
- int nItems = BUFFER_BYTE_SIZE;
- int ret = stream->write((const void *)buffer, nItems);
+ int32 nItems = BUFFER_BYTE_SIZE;
+ int32 ret = stream->write((const void *)buffer, nItems);
if (ret != nItems) {
return WRITE_ERROR;
@@ -293,7 +293,7 @@ DataPacker &DataPacker::operator=(DataPacker &b) {
packMin = b.packMin;
packMax = b.packMax;
- for (int i = 0; i < BUFFER_BYTE_SIZE; i++) {
+ for (int32 i = 0; i < BUFFER_BYTE_SIZE; i++) {
buffer[i] = b.buffer[i];
}
@@ -302,7 +302,7 @@ DataPacker &DataPacker::operator=(DataPacker &b) {
// Clear out the data buffer
void DataPacker::ClearBuffer() {
- for (int i = 0; i < BUFFER_BYTE_SIZE; i++) {
+ for (int32 i = 0; i < BUFFER_BYTE_SIZE; i++) {
buffer[i] = 0x00;
}
}
diff --git a/engines/icb/common/datapacker.h b/engines/icb/common/datapacker.h
index e7d88934d7..9aa538c547 100644
--- a/engines/icb/common/datapacker.h
+++ b/engines/icb/common/datapacker.h
@@ -58,7 +58,7 @@ public:
ReturnCodes open(const ModeEnum mode, const PackModeEnum packMode);
// Put a value into the bit-stream
- ReturnCodes put(const int value, Common::WriteStream *fh);
+ ReturnCodes put(const int32 value, Common::WriteStream *fh);
// Get a value from the bit-stream
ReturnCodes Get(int32 &value, Common::SeekableReadStream *stream);
@@ -67,9 +67,9 @@ public:
ReturnCodes close(Common::WriteStream *stream);
ReturnCodes close(Common::SeekableReadStream *stream);
// Simple inspectors
- int Pos() const { return pos; }
- int PackMin() const { return packMin; }
- int PackMax() const { return packMax; }
+ int32 Pos() const { return pos; }
+ int32 PackMin() const { return packMin; }
+ int32 PackMax() const { return packMax; }
private:
void ClearBuffer();
@@ -78,11 +78,11 @@ private:
ModeEnum iMode;
PackModeEnum iPackMode;
- int pos;
- int packMin;
- int packMax;
+ int32 pos;
+ int32 packMin;
+ int32 packMax;
- unsigned char buffer[BUFFER_BYTE_SIZE];
+ uint8 buffer[BUFFER_BYTE_SIZE];
};
} // End of namespace ICB
diff --git a/engines/icb/common/pc_props.h b/engines/icb/common/pc_props.h
index 65bd2a7128..a79719ae59 100644
--- a/engines/icb/common/pc_props.h
+++ b/engines/icb/common/pc_props.h
@@ -72,7 +72,7 @@ public:
pcPropRGBState(uint8 *propBasePtr, uint32 dataOffset) {
uint8 *ptr = propBasePtr + dataOffset;
- for (int i = 0; i < TILE_COUNT; i++) {
+ for (int32 i = 0; i < TILE_COUNT; i++) {
zPtrs[i] = 0;
if (uint32 offset = READ_LE_U32(ptr)) {
zPtrs[i] = (uint16 *)(propBasePtr + offset);
@@ -80,7 +80,7 @@ public:
ptr += 4;
}
- for (int i = 0; i < TILE_COUNT; i++) {
+ for (int32 i = 0; i < TILE_COUNT; i++) {
semiPtrs[i] = 0;
if (uint32 offset = READ_LE_U32(ptr)) {
semiPtrs[i] = (uint16 *)(propBasePtr + offset);
@@ -142,8 +142,8 @@ public:
tileRects = (LRECT *)ptr;
}
- uint16 *GetZTileTable(int t) { return zPtrs[t]; }
- uint16 *GetSemiTileTable(int t) { return semiPtrs[t]; }
+ uint16 *GetZTileTable(int32 t) { return zPtrs[t]; }
+ uint16 *GetSemiTileTable(int32 t) { return semiPtrs[t]; }
uint16 GetLRBgTileQty() { return nLRBgTiles; }
uint16 GetLRFgTileQty() { return nLRFgTiles; }
uint16 GetHRBgTileQty() { return nHRBgTiles; }
diff --git a/engines/icb/common/ptr_util.cpp b/engines/icb/common/ptr_util.cpp
index 6d33ada68b..03fccf215a 100644
--- a/engines/icb/common/ptr_util.cpp
+++ b/engines/icb/common/ptr_util.cpp
@@ -33,7 +33,7 @@ namespace ICB {
namespace MemoryUtil {
-const int PTR_ARRAY_MAX(1024);
+const int32 PTR_ARRAY_MAX(1024);
// map pointers to 32-bit references (bottom 32-bits of address)
struct PointerReference {
diff --git a/engines/icb/common/px_anims.h b/engines/icb/common/px_anims.h
index 23831c5a5f..1eb4fd951e 100644
--- a/engines/icb/common/px_anims.h
+++ b/engines/icb/common/px_anims.h
@@ -135,7 +135,7 @@ inline void PXmarker_PSX::SetPackedXYZPan(uint8 _x8, uint16 _x7y9, uint32 _y6z15
inline void PXmarker_PSX::GetPan(float *pan) const { *pan = (float)(((y6z15pan11 & 0x7FF) << 1)) / 4096.0f; }
inline void PXmarker_PSX::GetXYZ(float *x, float *y, float *z) const {
- int ix, iy, iz;
+ int32 ix, iy, iz;
ix = ((x8 << 7) | (x7y9 >> 9));
if (ix >= 16384)
@@ -168,7 +168,7 @@ typedef struct {
// PXanim //
typedef struct {
char tag[4];
- int schema;
+ int32 schema;
uint8 frame_qty;
uint8 speed;
uint16 offsets[1];
@@ -176,7 +176,7 @@ typedef struct {
typedef struct {
char tag[4];
- int schema;
+ int32 schema;
uint8 frame_qty;
uint8 speed;
uint16 offsets[1];
@@ -185,7 +185,7 @@ typedef struct {
inline void ConvertPXanim(PXanim_PSX *anim) {
// Support old schema type files
if (anim->schema == PSX_PXANIM_SCHEMA - 1) {
- int nFrames = anim->frame_qty;
+ int32 nFrames = anim->frame_qty;
anim->frame_qty = (uint8)nFrames;
anim->speed = 1;
anim->schema = PSX_PXANIM_SCHEMA;
@@ -195,7 +195,7 @@ inline void ConvertPXanim(PXanim_PSX *anim) {
inline void ConvertPXanim(PXanim_PC *anim) {
// Support old schema type files
if (anim->schema == PC_PXANIM_SCHEMA - 1) {
- int nFrames = anim->frame_qty;
+ int32 nFrames = anim->frame_qty;
anim->frame_qty = (uint8)nFrames;
anim->speed = 1;
anim->schema = PC_PXANIM_SCHEMA;
diff --git a/engines/icb/common/px_array.h b/engines/icb/common/px_array.h
index 332eda8916..3977f140c6 100644
--- a/engines/icb/common/px_array.h
+++ b/engines/icb/common/px_array.h
@@ -53,19 +53,19 @@ public:
void operator=(const rcActArray &);
// Member access functions
- uint GetNoItems() const { return (m_userPosition); }
+ uint32 GetNoItems() const { return (m_userPosition); }
- uint Add(const Type &f); // Add an item.
+ uint32 Add(const Type &f); // Add an item.
Type &operator[](uint); // Give access to an entry
- const Type &operator[](uint i) const;
+ const Type &operator[](uint32 i) const;
- void SetSize(uint n) { ResizeArray(n); }
+ void SetSize(uint32 n) { ResizeArray(n); }
void Reset();
private:
- uint m_userPosition; // Next place to add an item to
- uint m_allocatedSize; // How many items have been allocated
+ uint32 m_userPosition; // Next place to add an item to
+ uint32 m_allocatedSize; // How many items have been allocated
Type **m_contents; // A pointer to pointers to the objects
@@ -83,13 +83,13 @@ void T_MYACTARRAY::operator=(const rcActArray &a) {
{
m_contents = new Type *[m_allocatedSize];
- for (uint count = 0; count < m_allocatedSize; count++)
+ for (uint32 count = 0; count < m_allocatedSize; count++)
m_contents[count] = new Type(*(a.m_contents[count]));
}
}
MY_TEMPLATE
-Type &T_MYACTARRAY::operator[](uint n) {
+Type &T_MYACTARRAY::operator[](uint32 n) {
if (n >= m_userPosition) {
ResizeArray(n);
m_userPosition = n + 1;
@@ -98,7 +98,7 @@ Type &T_MYACTARRAY::operator[](uint n) {
}
MY_TEMPLATE
-const Type &T_MYACTARRAY::operator[](uint n) const {
+const Type &T_MYACTARRAY::operator[](uint32 n) const {
// It is permissable to look at an element that has not been defined, as the constructor assures
// that the contents are valid
if (n >= m_userPosition) {
@@ -113,7 +113,7 @@ const Type &T_MYACTARRAY::operator[](uint n) const {
MY_TEMPLATE T_MYACTARRAY::~rcActArray() { Reset(); }
MY_TEMPLATE void T_MYACTARRAY::Reset() {
- for (uint count = 0; count < m_allocatedSize; count++)
+ for (uint32 count = 0; count < m_allocatedSize; count++)
delete m_contents[count];
if (m_allocatedSize)
@@ -122,11 +122,11 @@ MY_TEMPLATE void T_MYACTARRAY::Reset() {
m_userPosition = 0;
}
-MY_TEMPLATE void T_MYACTARRAY::ResizeArray(uint n2) {
+MY_TEMPLATE void T_MYACTARRAY::ResizeArray(uint32 n2) {
// if n is still within the allocated area then just set the last position
if (n2 >= m_allocatedSize) {
// Make sure we are going to make the thing big enough
- uint nextSize = m_allocatedSize ? m_allocatedSize + m_allocatedSize : 1; // Double, or 1 if now 0
+ uint32 nextSize = m_allocatedSize ? m_allocatedSize + m_allocatedSize : 1; // Double, or 1 if now 0
while (nextSize <= n2)
nextSize += nextSize;
@@ -137,7 +137,7 @@ MY_TEMPLATE void T_MYACTARRAY::ResizeArray(uint n2) {
memcpy((unsigned char *)newArray, (unsigned char *)m_contents, m_allocatedSize * sizeof(Type *));
}
// Put empty objects in the newly allocated space
- for (uint newObjects = m_allocatedSize; newObjects < nextSize; newObjects++)
+ for (uint32 newObjects = m_allocatedSize; newObjects < nextSize; newObjects++)
newArray[newObjects] = new Type;
// Remove any old stuff
if (m_allocatedSize)
@@ -147,14 +147,14 @@ MY_TEMPLATE void T_MYACTARRAY::ResizeArray(uint n2) {
}
}
-MY_TEMPLATE uint T_MYACTARRAY::Add(const Type &f) {
+MY_TEMPLATE uint32 T_MYACTARRAY::Add(const Type &f) {
operator[](m_userPosition) = f;
return (m_userPosition - 1);
}
MY_TEMPLATE class rcAutoPtrArray {
- uint m_noContents; // How many entries have been allocated
- uint m_userPosition; // Next position for the Add command
+ uint32 m_noContents; // How many entries have been allocated
+ uint32 m_userPosition; // Next position for the Add command
Type **m_contents; // A pointer to pointers to the objects
@@ -166,9 +166,9 @@ public:
~rcAutoPtrArray(); // Destruct the array
// Member access functions
- uint GetNoItems() const { return (m_userPosition); }
+ uint32 GetNoItems() const { return (m_userPosition); }
- uint Add(Type *f) {
+ uint32 Add(Type *f) {
operator[](m_userPosition) = f;
return (m_userPosition - 1);
}
@@ -178,7 +178,7 @@ public:
void Reset();
void RemoveAndShuffle(uint); // Remove an object from the array
- void SetSize(uint n) { ResizeArray(n); }
+ void SetSize(uint32 n) { ResizeArray(n); }
// Super dangerous, but faster, access to the array
Type *GetRawArray() { return (*m_contents); }
@@ -190,7 +190,7 @@ private: // Prevent use of the PtrArray copy constructor
};
MY_TEMPLATE
-Type *&T_MYPTRARRAY::operator[](uint n) {
+Type *&T_MYPTRARRAY::operator[](uint32 n) {
if (n >= m_userPosition) {
ResizeArray(n);
m_userPosition = n + 1;
@@ -199,7 +199,7 @@ Type *&T_MYPTRARRAY::operator[](uint n) {
}
MY_TEMPLATE
-const Type *&T_MYPTRARRAY::operator[](uint n) const {
+const Type *&T_MYPTRARRAY::operator[](uint32 n) const {
// It is permissable to look at an element that has not been defined, as it will be defined as NULL
if (n >= m_userPosition) {
(const_cast<rcAutoPtrArray<Type> *>(this))->ResizeArray(n);
@@ -213,7 +213,7 @@ MY_TEMPLATE T_MYPTRARRAY::~rcAutoPtrArray() { Reset(); }
MY_TEMPLATE void T_MYPTRARRAY::Reset() {
// The pointer array maintains responsibility for deleting any contents
- for (uint count = 0; count < m_userPosition; count++)
+ for (uint32 count = 0; count < m_userPosition; count++)
if (m_contents[count])
delete m_contents[count];
if (m_noContents)
@@ -221,10 +221,10 @@ MY_TEMPLATE void T_MYPTRARRAY::Reset() {
m_noContents = m_userPosition = 0;
}
-MY_TEMPLATE void T_MYPTRARRAY::ResizeArray(uint n2) {
+MY_TEMPLATE void T_MYPTRARRAY::ResizeArray(uint32 n2) {
if (n2 >= m_noContents) {
// Double the allocation value
- uint nextSize = m_noContents > 0 ? m_noContents + m_noContents : 1;
+ uint32 nextSize = m_noContents > 0 ? m_noContents + m_noContents : 1;
while (n2 >= nextSize)
nextSize = nextSize + nextSize;
// Get a New pointer array of the correct size
@@ -242,7 +242,7 @@ MY_TEMPLATE void T_MYPTRARRAY::ResizeArray(uint n2) {
}
}
-MY_TEMPLATE void T_MYPTRARRAY::RemoveAndShuffle(uint n) {
+MY_TEMPLATE void T_MYPTRARRAY::RemoveAndShuffle(uint32 n) {
// Remove an object from the array
// First delete it
@@ -253,8 +253,8 @@ MY_TEMPLATE void T_MYPTRARRAY::RemoveAndShuffle(uint n) {
}
template <class Type> class rcIntArray {
- uint m_noContents; // How many entries there are
- uint m_userPosition; // Where the next add position goes
+ uint32 m_noContents; // How many entries there are
+ uint32 m_userPosition; // Where the next add position goes
Type *m_contents;
void ResizeArray(uint); // Change the size of the array
@@ -275,25 +275,25 @@ public:
}
// Constructor with an initial size
- rcIntArray(uint initialSize) { ResizeArray(initialSize); }
+ rcIntArray(uint32 initialSize) { ResizeArray(initialSize); }
const rcIntArray &operator=(const rcIntArray &);
// Member access functions
- uint GetNoItems() const { return (m_userPosition); }
+ uint32 GetNoItems() const { return (m_userPosition); }
- uint Add(Type f); // Add an integer. Only makes sense if the resize step is one
+ uint32 Add(Type f); // Add an integer. Only makes sense if the resize step is one
Type &operator[](uint); // Give access to an entry
const Type operator[](uint) const; // Give access to an entry
void Reset();
- void SetSize(uint n) { ResizeArray(n); }
+ void SetSize(uint32 n) { ResizeArray(n); }
Type *GetRawArray() { return (m_contents); }
};
-template <class Type> Type &rcIntArray<Type>::operator[](uint index) {
+template <class Type> Type &rcIntArray<Type>::operator[](uint32 index) {
if (index >= m_userPosition) {
ResizeArray(index);
m_userPosition = index + 1;
@@ -302,7 +302,7 @@ template <class Type> Type &rcIntArray<Type>::operator[](uint index) {
}
// This version of [] allows the array to be part of a const function
-template <class Type> const Type rcIntArray<Type>::operator[](uint index) const {
+template <class Type> const Type rcIntArray<Type>::operator[](uint32 index) const {
// It is permissable to look at an element that has not been defined, as it will have been set to 0
if (index >= m_userPosition) {
// Remove any 'constness' for a resize
@@ -313,10 +313,10 @@ template <class Type> const Type rcIntArray<Type>::operator[](uint index) const
return m_contents[index];
}
-template <class IntType> void rcIntArray<IntType>::ResizeArray(uint accessedSize) {
+template <class IntType> void rcIntArray<IntType>::ResizeArray(uint32 accessedSize) {
// Check if we need to do any reallocating
if (accessedSize >= m_noContents) {
- uint newSize = m_noContents > 0 ? m_noContents * 2 : 1;
+ uint32 newSize = m_noContents > 0 ? m_noContents * 2 : 1;
while (newSize <= accessedSize)
newSize = newSize + newSize;
@@ -334,7 +334,7 @@ template <class IntType> void rcIntArray<IntType>::ResizeArray(uint accessedSize
}
template <class IntType> const rcIntArray<IntType> &rcIntArray<IntType>::operator=(const rcIntArray<IntType> &obOpB) {
- uint nCount;
+ uint32 nCount;
if (m_noContents)
delete[] m_contents;
@@ -358,7 +358,7 @@ template <class Type> void rcIntArray<Type>::Reset() {
}
}
-template <class Type> uint rcIntArray<Type>::Add(Type f) {
+template <class Type> uint32 rcIntArray<Type>::Add(Type f) {
// Add an integer. Only makes sense if the resize step is one
operator[](m_userPosition) = f;
return (m_userPosition - 1);
diff --git a/engines/icb/common/px_bitmap_pc.h b/engines/icb/common/px_bitmap_pc.h
index 5a5ac455b0..8c51c5baca 100644
--- a/engines/icb/common/px_bitmap_pc.h
+++ b/engines/icb/common/px_bitmap_pc.h
@@ -45,7 +45,7 @@ namespace ICB {
typedef struct {
uint32 x, y; // X and Y position of sprite.
uint32 width, height; // Width and height of the sprite in pixels.
- unsigned char data[1]; // Sprite data.
+ uint8 data[1]; // Sprite data.
} _pxPCSprite;
@@ -64,10 +64,10 @@ public:
uint32 Fetch_number_of_items() const { return num_sprites; }
inline _pxPCSprite *Fetch_item_by_number(uint32 nNumber);
- unsigned char *Fetch_palette_pointer() { return &palette[0]; }
+ uint8 *Fetch_palette_pointer() { return &palette[0]; }
private:
- unsigned char palette[4 * 256]; // RGB but padded with 0 to 32-bits.
+ uint8 palette[4 * 256]; // RGB but padded with 0 to 32-bits.
uint32 num_sprites; // Number of sprites in this file.
uint32 sprite_offsets[1]; // Offsets to sprite data for each sprite.
@@ -80,7 +80,7 @@ inline _pxPCSprite *_pxPCBitmap::Fetch_item_by_number(uint32 nNumber) {
assert(nNumber < num_sprites);
// Return the pointer.
- return ((_pxPCSprite *)(((unsigned char *)this) + sprite_offsets[nNumber]));
+ return ((_pxPCSprite *)(((uint8 *)this) + sprite_offsets[nNumber]));
}
} // End of namespace ICB
diff --git a/engines/icb/common/px_bones.cpp b/engines/icb/common/px_bones.cpp
index 5a1e0bc777..956fad4d85 100644
--- a/engines/icb/common/px_bones.cpp
+++ b/engines/icb/common/px_bones.cpp
@@ -33,11 +33,11 @@ namespace ICB {
void BoneDeformation::UpdateBoneValue(short &v, short t) {
if (v < t) {
- v = (short)(v + boneSpeed);
+ v = (int16)(v + boneSpeed);
if (v > t)
v = t;
} else if (v > t) {
- v = (short)(v - boneSpeed);
+ v = (int16)(v - boneSpeed);
if (v < t)
v = t;
}
diff --git a/engines/icb/common/px_bones.h b/engines/icb/common/px_bones.h
index 36c6a045ef..8b7c618b5b 100644
--- a/engines/icb/common/px_bones.h
+++ b/engines/icb/common/px_bones.h
@@ -48,12 +48,12 @@ public:
boneNumber = -1;
}
- short boneNumber;
- short boneSpeed;
+ int16 boneNumber;
+ int16 boneSpeed;
SVECTOR boneValue;
SVECTOR boneTarget;
- void UpdateBoneValue(short &v, short t);
+ void UpdateBoneValue(int16 &v, int16 t);
void Target0();
void Update();
};
diff --git a/engines/icb/common/px_camera.h b/engines/icb/common/px_camera.h
index ad59e2ea00..501e000aec 100644
--- a/engines/icb/common/px_camera.h
+++ b/engines/icb/common/px_camera.h
@@ -39,7 +39,7 @@ typedef struct PXmatrix_PC {
struct PCcamera {
char id[4];
- int schema;
+ int32 schema;
PXmatrix_PC view;
float pan;
float focLen;
diff --git a/engines/icb/common/px_capri_maths.h b/engines/icb/common/px_capri_maths.h
index fd2442dc43..7b672a84b9 100644
--- a/engines/icb/common/px_capri_maths.h
+++ b/engines/icb/common/px_capri_maths.h
@@ -36,8 +36,8 @@ namespace ICB {
// make our own equivalents
typedef struct MATRIX {
- short m[3][3]; /* 3x3 rotation matrix */
- short pad;
+ int16 m[3][3]; /* 3x3 rotation matrix */
+ int16 pad;
int32 t[3]; /* transfer vector */
MATRIX() { pad = 0; }
} MATRIX;
@@ -51,8 +51,8 @@ typedef struct VECTOR {
/* short word type 3D vector */
typedef struct SVECTOR {
- short vx, vy;
- short vz, pad;
+ int16 vx, vy;
+ int16 vz, pad;
SVECTOR() { pad = 0; }
bool operator==(const SVECTOR &v) { return ((v.vx == vx) && (v.vy == vy) && (v.vz == vz)); }
} SVECTOR;
@@ -60,7 +60,7 @@ typedef struct SVECTOR {
/* short word type 3D vector */
typedef struct CVECTOR {
uint8 r, g;
- short b, pad;
+ int16 b, pad;
CVECTOR() { pad = 0; }
bool operator==(const CVECTOR &v) { return ((v.r == r) && (v.g == g) && (v.b == b)); }
} CVECTOR;
@@ -70,7 +70,7 @@ typedef struct CVECTOR {
#define ONE 4096
#define myPI (3.141592654f)
-inline int myNINT(float f) {
+inline int32 myNINT(float f) {
if (f >= 0.0f)
return int(f + 0.5f);
else
@@ -101,7 +101,7 @@ extern MATRIX gterot;
extern MATRIX gtetrans;
extern MATRIX gtecolour;
extern MATRIX gtelight;
-extern short gteback[3];
+extern int16 gteback[3];
extern int32 gtegeomscrn;
extern uint8 dcache[1024];
@@ -152,9 +152,9 @@ inline void myApplyMatrixLV(MATRIX *m, VECTOR *invec, VECTOR *outvec) {
}
inline void myApplyMatrixSV(MATRIX *m, SVECTOR *invec, SVECTOR *outvec) {
- outvec->vx = (short)(((int)m->m[0][0] * invec->vx + (int)m->m[0][1] * invec->vy + (int)m->m[0][2] * invec->vz) / 4096);
- outvec->vy = (short)(((int)m->m[1][0] * invec->vx + (int)m->m[1][1] * invec->vy + (int)m->m[1][2] * invec->vz) / 4096);
- outvec->vz = (short)(((int)m->m[2][0] * invec->vx + (int)m->m[2][1] * invec->vy + (int)m->m[2][2] * invec->vz) / 4096);
+ outvec->vx = (int16)(((int)m->m[0][0] * invec->vx + (int)m->m[0][1] * invec->vy + (int)m->m[0][2] * invec->vz) / 4096);
+ outvec->vy = (int16)(((int)m->m[1][0] * invec->vx + (int)m->m[1][1] * invec->vy + (int)m->m[1][2] * invec->vz) / 4096);
+ outvec->vz = (int16)(((int)m->m[2][0] * invec->vx + (int)m->m[2][1] * invec->vy + (int)m->m[2][2] * invec->vz) / 4096);
}
inline void mygte_MulMatrix0(MATRIX *m1, MATRIX *m2, MATRIX *out) {
@@ -164,15 +164,15 @@ inline void mygte_MulMatrix0(MATRIX *m1, MATRIX *m2, MATRIX *out) {
work = &local;
else
work = out;
- work->m[0][0] = (short)(((int)m1->m[0][0] * (int)m2->m[0][0] + (int)m1->m[0][1] * (int)m2->m[1][0] + (int)m1->m[0][2] * (int)m2->m[2][0]) / 4096);
- work->m[0][1] = (short)(((int)m1->m[0][0] * (int)m2->m[0][1] + (int)m1->m[0][1] * (int)m2->m[1][1] + (int)m1->m[0][2] * (int)m2->m[2][1]) / 4096);
- work->m[0][2] = (short)(((int)m1->m[0][0] * (int)m2->m[0][2] + (int)m1->m[0][1] * (int)m2->m[1][2] + (int)m1->m[0][2] * (int)m2->m[2][2]) / 4096);
- work->m[1][0] = (short)(((int)m1->m[1][0] * (int)m2->m[0][0] + (int)m1->m[1][1] * (int)m2->m[1][0] + (int)m1->m[1][2] * (int)m2->m[2][0]) / 4096);
- work->m[1][1] = (short)(((int)m1->m[1][0] * (int)m2->m[0][1] + (int)m1->m[1][1] * (int)m2->m[1][1] + (int)m1->m[1][2] * (int)m2->m[2][1]) / 4096);
- work->m[1][2] = (short)(((int)m1->m[1][0] * (int)m2->m[0][2] + (int)m1->m[1][1] * (int)m2->m[1][2] + (int)m1->m[1][2] * (int)m2->m[2][2]) / 4096);
- work->m[2][0] = (short)(((int)m1->m[2][0] * (int)m2->m[0][0] + (int)m1->m[2][1] * (int)m2->m[1][0] + (int)m1->m[2][2] * (int)m2->m[2][0]) / 4096);
- work->m[2][1] = (short)(((int)m1->m[2][0] * (int)m2->m[0][1] + (int)m1->m[2][1] * (int)m2->m[1][1] + (int)m1->m[2][2] * (int)m2->m[2][1]) / 4096);
- work->m[2][2] = (short)(((int)m1->m[2][0] * (int)m2->m[0][2] + (int)m1->m[2][1] * (int)m2->m[1][2] + (int)m1->m[2][2] * (int)m2->m[2][2]) / 4096);
+ work->m[0][0] = (int16)(((int)m1->m[0][0] * (int)m2->m[0][0] + (int)m1->m[0][1] * (int)m2->m[1][0] + (int)m1->m[0][2] * (int)m2->m[2][0]) / 4096);
+ work->m[0][1] = (int16)(((int)m1->m[0][0] * (int)m2->m[0][1] + (int)m1->m[0][1] * (int)m2->m[1][1] + (int)m1->m[0][2] * (int)m2->m[2][1]) / 4096);
+ work->m[0][2] = (int16)(((int)m1->m[0][0] * (int)m2->m[0][2] + (int)m1->m[0][1] * (int)m2->m[1][2] + (int)m1->m[0][2] * (int)m2->m[2][2]) / 4096);
+ work->m[1][0] = (int16)(((int)m1->m[1][0] * (int)m2->m[0][0] + (int)m1->m[1][1] * (int)m2->m[1][0] + (int)m1->m[1][2] * (int)m2->m[2][0]) / 4096);
+ work->m[1][1] = (int16)(((int)m1->m[1][0] * (int)m2->m[0][1] + (int)m1->m[1][1] * (int)m2->m[1][1] + (int)m1->m[1][2] * (int)m2->m[2][1]) / 4096);
+ work->m[1][2] = (int16)(((int)m1->m[1][0] * (int)m2->m[0][2] + (int)m1->m[1][1] * (int)m2->m[1][2] + (int)m1->m[1][2] * (int)m2->m[2][2]) / 4096);
+ work->m[2][0] = (int16)(((int)m1->m[2][0] * (int)m2->m[0][0] + (int)m1->m[2][1] * (int)m2->m[1][0] + (int)m1->m[2][2] * (int)m2->m[2][0]) / 4096);
+ work->m[2][1] = (int16)(((int)m1->m[2][0] * (int)m2->m[0][1] + (int)m1->m[2][1] * (int)m2->m[1][1] + (int)m1->m[2][2] * (int)m2->m[2][1]) / 4096);
+ work->m[2][2] = (int16)(((int)m1->m[2][0] * (int)m2->m[0][2] + (int)m1->m[2][1] * (int)m2->m[1][2] + (int)m1->m[2][2] * (int)m2->m[2][2]) / 4096);
if (work != out) {
out->m[0][0] = work->m[0][0];
@@ -218,8 +218,8 @@ inline void mygte_RotTransPers(SVECTOR *in0, int32 *sxy0, int32 * /* p */, int32
*flag = 0;
if (cam.vz != 0) {
- scrn->vx = (short)((cam.vx * gtegeomscrn) / cam.vz);
- scrn->vy = (short)((cam.vy * gtegeomscrn) / cam.vz);
+ scrn->vx = (int16)((cam.vx * gtegeomscrn) / cam.vz);
+ scrn->vy = (int16)((cam.vy * gtegeomscrn) / cam.vz);
} else {
// To force an error and hence an illegal polygon
scrn->vx = 2048;
@@ -254,50 +254,50 @@ inline void mygte_RotTransPers3(SVECTOR *in0, SVECTOR *in1, SVECTOR *in2, int32
}
inline void myRotMatrix_gte(SVECTOR *rot, MATRIX *m) {
- const int one = (1 << 12);
+ const int32 one = (1 << 12);
float ang0 = (float)rot->vx * 2.0f * myPI / one;
MATRIX m0;
- int c0 = myNINT(one * (float)cos(ang0));
- int s0 = myNINT(one * (float)sin(ang0));
+ int32 c0 = myNINT(one * (float)cos(ang0));
+ int32 s0 = myNINT(one * (float)sin(ang0));
m0.m[0][0] = one;
m0.m[0][1] = 0;
m0.m[0][2] = 0;
m0.m[1][0] = 0;
- m0.m[1][1] = (short)c0;
- m0.m[1][2] = (short)-s0;
+ m0.m[1][1] = (int16)c0;
+ m0.m[1][2] = (int16)-s0;
m0.m[2][0] = 0;
- m0.m[2][1] = (short)s0;
- m0.m[2][2] = (short)c0;
+ m0.m[2][1] = (int16)s0;
+ m0.m[2][2] = (int16)c0;
float ang1 = (float)rot->vy * 2.0f * myPI / one;
- int c1 = myNINT(one * (float)cos(ang1));
- int s1 = myNINT(one * (float)sin(ang1));
+ int32 c1 = myNINT(one * (float)cos(ang1));
+ int32 s1 = myNINT(one * (float)sin(ang1));
MATRIX m1;
- m1.m[0][0] = (short)c1;
+ m1.m[0][0] = (int16)c1;
m1.m[0][1] = 0;
- m1.m[0][2] = (short)s1;
+ m1.m[0][2] = (int16)s1;
m1.m[1][0] = 0;
m1.m[1][1] = one;
m1.m[1][2] = 0;
- m1.m[2][0] = (short)-s1;
+ m1.m[2][0] = (int16)-s1;
m1.m[2][1] = 0;
- m1.m[2][2] = (short)c1;
+ m1.m[2][2] = (int16)c1;
float ang2 = (float)rot->vz * 2.0f * myPI / one;
- int c2 = myNINT(one * (float)cos(ang2));
- int s2 = myNINT(one * (float)sin(ang2));
+ int32 c2 = myNINT(one * (float)cos(ang2));
+ int32 s2 = myNINT(one * (float)sin(ang2));
MATRIX m2;
- m2.m[0][0] = (short)c2;
- m2.m[0][1] = (short)-s2;
+ m2.m[0][0] = (int16)c2;
+ m2.m[0][1] = (int16)-s2;
m2.m[0][2] = 0;
- m2.m[1][0] = (short)s2;
- m2.m[1][1] = (short)c2;
+ m2.m[1][0] = (int16)s2;
+ m2.m[1][1] = (int16)c2;
m2.m[1][2] = 0;
m2.m[2][0] = 0;
@@ -309,9 +309,9 @@ inline void myRotMatrix_gte(SVECTOR *rot, MATRIX *m) {
}
inline void mygte_SetBackColor(int32 r, int32 g, int32 b) {
- gteback[0] = (short)r;
- gteback[1] = (short)g;
- gteback[2] = (short)b;
+ gteback[0] = (int16)r;
+ gteback[1] = (int16)g;
+ gteback[2] = (int16)b;
}
inline void mygte_SetColorMatrix(MATRIX *m) { gtecolour = *m; }
@@ -343,15 +343,15 @@ inline void mygte_NormalColorCol(SVECTOR *v0, CVECTOR *in0, CVECTOR *out0) {
// colourEffect is 0-4095 (2^12)
// gteback is 0-255 (2^8)
- colourEffect.vx = (short)((colourEffect.vx >> 4) + gteback[0]);
- colourEffect.vy = (short)((colourEffect.vy >> 4) + gteback[1]);
- colourEffect.vz = (short)((colourEffect.vz >> 4) + gteback[2]);
+ colourEffect.vx = (int16)((colourEffect.vx >> 4) + gteback[0]);
+ colourEffect.vy = (int16)((colourEffect.vy >> 4) + gteback[1]);
+ colourEffect.vz = (int16)((colourEffect.vz >> 4) + gteback[2]);
// 256 = 1.0 in colourEffect
// 128 = 1.0 in in0
- int red = ((in0->r * colourEffect.vx) >> 8);
- int green = ((in0->g * colourEffect.vy) >> 8);
- int blue = ((in0->b * colourEffect.vz) >> 8);
+ int32 red = ((in0->r * colourEffect.vx) >> 8);
+ int32 green = ((in0->g * colourEffect.vy) >> 8);
+ int32 blue = ((in0->b * colourEffect.vz) >> 8);
if (red > 255)
red = 255;
@@ -390,10 +390,10 @@ inline void mygte_NormalClip(int32 sxy0, int32 sxy1, int32 sxy2, int32 *flag) {
SVECTOR *v2 = (SVECTOR *)&sxy2;
// compute the cross-product of (v1-v0) x (v2-v0)
- int l0x = v1->vx - v0->vx;
- int l0y = v1->vy - v0->vy;
- int l1x = v2->vx - v0->vx;
- int l1y = v2->vy - v0->vy;
+ int32 l0x = v1->vx - v0->vx;
+ int32 l0y = v1->vy - v0->vy;
+ int32 l1x = v2->vx - v0->vx;
+ int32 l1y = v2->vy - v0->vy;
*flag = ((l0x * l1y) - (l0y * l1x));
}
diff --git a/engines/icb/common/px_capri_maths_pc.cpp b/engines/icb/common/px_capri_maths_pc.cpp
index 5cd3f9adc6..1fba731b3c 100644
--- a/engines/icb/common/px_capri_maths_pc.cpp
+++ b/engines/icb/common/px_capri_maths_pc.cpp
@@ -37,8 +37,8 @@ MATRIXPC gterot_pc;
MATRIXPC gtetrans_pc;
MATRIXPC gtecolour_pc;
MATRIXPC gtelight_pc;
-int gteback_pc[3];
+int32 gteback_pc[3];
int32 gtegeomscrn_pc;
-int gtescreenscaleshift_pc = 0;
+int32 gtescreenscaleshift_pc = 0;
} // End of namespace ICB
diff --git a/engines/icb/common/px_capri_maths_pc.h b/engines/icb/common/px_capri_maths_pc.h
index 34e7249c08..f0803aaa41 100644
--- a/engines/icb/common/px_capri_maths_pc.h
+++ b/engines/icb/common/px_capri_maths_pc.h
@@ -36,8 +36,8 @@ namespace ICB {
// make our own equivalents
typedef struct MATRIXPC {
- int m[3][3]; /* 3x3 rotation matrix */
- int pad;
+ int32 m[3][3]; /* 3x3 rotation matrix */
+ int32 pad;
int32 t[3]; /* transfer vector */
MATRIXPC() { pad = 0; }
} MATRIXPC;
@@ -51,8 +51,8 @@ typedef struct VECTOR {
/* short word type 3D vector */
typedef struct SVECTORPC {
- int vx, vy;
- int vz, pad;
+ int32 vx, vy;
+ int32 vz, pad;
SVECTORPC() { pad = 0; }
bool operator==(const SVECTORPC &v) { return ((v.vx == vx) && (v.vy == vy) && (v.vz == vz)); }
} SVECTORPC;
@@ -60,7 +60,7 @@ typedef struct SVECTORPC {
/* short word type 3D vector */
typedef struct CVECTOR {
uint8 r, g;
- short b, pad;
+ int16 b, pad;
CVECTOR() { pad = 0; }
bool operator==(const CVECTOR &v) { return ((v.r == r) && (v.g == g) && (v.b == b)); }
} CVECTOR;
@@ -68,12 +68,12 @@ typedef struct CVECTOR {
#endif // #if (_PSX_ON_PC==0)
//-=- Definitions -=-//
-const int ONE_PC_SCALE = 12;
-const int ONE_PC = 1 << ONE_PC_SCALE;
+const int32 ONE_PC_SCALE = 12;
+const int32 ONE_PC = 1 << ONE_PC_SCALE;
const float myPI_PC = 3.141592654f;
-const int ZSCALE = 1;
+const int32 ZSCALE = 1;
-inline int myNINT_PC(float f) {
+inline int32 myNINT_PC(float f) {
if (f >= 0.0f)
return int(f + 0.5f);
else
@@ -109,9 +109,9 @@ extern MATRIXPC gterot_pc;
extern MATRIXPC gtetrans_pc;
extern MATRIXPC gtecolour_pc;
extern MATRIXPC gtelight_pc;
-extern int gteback_pc[3];
+extern int32 gteback_pc[3];
extern int32 gtegeomscrn_pc;
-extern int gtescreenscaleshift_pc;
+extern int32 gtescreenscaleshift_pc;
//------------------------------------------------------------------------
@@ -355,8 +355,8 @@ inline void mygte_RotTransPers3_pc(SVECTORPC *in0, SVECTORPC *in1, SVECTORPC *in
inline void myRotMatrix_gte_pc(SVECTOR *rot, MATRIXPC *m) {
float ang0 = (float)rot->vx * 2.0f * myPI_PC / 4096;
MATRIXPC m0;
- int c0 = myNINT_PC(ONE_PC * (float)cos(ang0));
- int s0 = myNINT_PC(ONE_PC * (float)sin(ang0));
+ int32 c0 = myNINT_PC(ONE_PC * (float)cos(ang0));
+ int32 s0 = myNINT_PC(ONE_PC * (float)sin(ang0));
m0.m[0][0] = ONE_PC;
m0.m[0][1] = 0;
m0.m[0][2] = 0;
@@ -370,8 +370,8 @@ inline void myRotMatrix_gte_pc(SVECTOR *rot, MATRIXPC *m) {
m0.m[2][2] = c0;
float ang1 = (float)rot->vy * 2.0f * myPI_PC / 4096;
- int c1 = myNINT_PC(ONE_PC * (float)cos(ang1));
- int s1 = myNINT_PC(ONE_PC * (float)sin(ang1));
+ int32 c1 = myNINT_PC(ONE_PC * (float)cos(ang1));
+ int32 s1 = myNINT_PC(ONE_PC * (float)sin(ang1));
MATRIXPC m1;
m1.m[0][0] = c1;
m1.m[0][1] = 0;
@@ -386,8 +386,8 @@ inline void myRotMatrix_gte_pc(SVECTOR *rot, MATRIXPC *m) {
m1.m[2][2] = c1;
float ang2 = (float)rot->vz * 2.0f * myPI_PC / 4096;
- int c2 = myNINT_PC(ONE_PC * (float)cos(ang2));
- int s2 = myNINT_PC(ONE_PC * (float)sin(ang2));
+ int32 c2 = myNINT_PC(ONE_PC * (float)cos(ang2));
+ int32 s2 = myNINT_PC(ONE_PC * (float)sin(ang2));
MATRIXPC m2;
m2.m[0][0] = c2;
@@ -457,9 +457,9 @@ inline void mygte_NormalColorCol_pc(SVECTOR *v0, CVECTOR *in0, CVECTOR *out0) {
// 256 = 1.0 in colourEffect
// 128 = 1.0 in in0
- int red = ((in0->r * colourEffect.vx) >> 8);
- int green = ((in0->g * colourEffect.vy) >> 8);
- int blue = ((in0->b * colourEffect.vz) >> 8);
+ int32 red = ((in0->r * colourEffect.vx) >> 8);
+ int32 green = ((in0->g * colourEffect.vy) >> 8);
+ int32 blue = ((in0->b * colourEffect.vz) >> 8);
if (red > 255)
red = 255;
@@ -500,10 +500,10 @@ inline int32 myVectorNormal_pc(VECTOR *in0, VECTOR *out0) {
inline void mygte_NormalClip_pc(SVECTORPC *sxy0, SVECTORPC *sxy1, SVECTORPC *sxy2, int32 *flag) {
// compute the cross-product of (v1-v0) x (v2-v0)
- int l0x = sxy1->vx - sxy0->vx;
- int l0y = sxy1->vy - sxy0->vy;
- int l1x = sxy2->vx - sxy0->vx;
- int l1y = sxy2->vy - sxy0->vy;
+ int32 l0x = sxy1->vx - sxy0->vx;
+ int32 l0y = sxy1->vy - sxy0->vy;
+ int32 l1x = sxy2->vx - sxy0->vx;
+ int32 l1y = sxy2->vy - sxy0->vy;
*flag = ((l0x * l1y) - (l0y * l1x));
}
@@ -512,10 +512,10 @@ inline void mygte_NormalClip_pc(SVECTORPC *sxy0, SVECTORPC *sxy1, SVECTORPC *sxy
inline void mygte_NormalClip_pc(SVECTOR *sxy0, SVECTOR *sxy1, SVECTOR *sxy2, int32 *flag) {
// compute the cross-product of (v1-v0) x (v2-v0)
- int l0x = sxy1->vx - sxy0->vx;
- int l0y = sxy1->vy - sxy0->vy;
- int l1x = sxy2->vx - sxy0->vx;
- int l1y = sxy2->vy - sxy0->vy;
+ int32 l0x = sxy1->vx - sxy0->vx;
+ int32 l0y = sxy1->vy - sxy0->vy;
+ int32 l1x = sxy2->vx - sxy0->vx;
+ int32 l1y = sxy2->vy - sxy0->vy;
*flag = ((l0x * l1y) - (l0y * l1x));
}
diff --git a/engines/icb/common/px_clu_api.h b/engines/icb/common/px_clu_api.h
index a2ed9d3f36..c5ff65da42 100644
--- a/engines/icb/common/px_clu_api.h
+++ b/engines/icb/common/px_clu_api.h
@@ -70,7 +70,7 @@ typedef struct HEADER_OPEN {
uint32 header_size;
uint32 noFiles;
uint32 cluster_hash;
- int cdpos;
+ int32 cdpos;
char description[MAX_DESCRIPTION_SIZE];
} HEADER_OPEN;
diff --git a/engines/icb/common/px_common.h b/engines/icb/common/px_common.h
index 12332d2781..631c0d0426 100644
--- a/engines/icb/common/px_common.h
+++ b/engines/icb/common/px_common.h
@@ -107,10 +107,10 @@ class px_standard_header {
int32 unused2; // For future expansion
char name[STANDARD_HEADER_NAME_LENGTH]; // 32 bytes worth of ascii name information
- void SetData(int version, _file_type type, int owner, const char *name);
+ void SetData(int32 version, _file_type type, int32 owner, const char *name);
_file_type GetType() { return (type); }
const char *GetName() { return (name); }
- uint GetVersion() { return (version); }
+ uint32 GetVersion() { return (version); }
};
typedef struct {
@@ -177,10 +177,10 @@ typedef struct PXvector_PC {
} PXvector_PC;
typedef struct PXsvector_PSX {
- short x;
- short y;
- short z;
- short pad;
+ int16 x;
+ int16 y;
+ int16 z;
+ int16 pad;
} PXsvector_PSX;
typedef struct PXvector_PSX {
@@ -198,10 +198,10 @@ typedef PXsvector_PC PXsvector;
#endif
typedef struct PXorient_PSX {
- short pan;
- short tilt;
- short cant;
- short pad;
+ int16 pan;
+ int16 tilt;
+ int16 cant;
+ int16 pad;
} PXorient_PSX;
typedef struct PXorient_PC {
diff --git a/engines/icb/common/px_game_object.h b/engines/icb/common/px_game_object.h
index 5e27e1dade..a8e35eed96 100644
--- a/engines/icb/common/px_game_object.h
+++ b/engines/icb/common/px_game_object.h
@@ -53,8 +53,8 @@ class c_un_game_object {
public:
// Main access functions
const char *GetName() const; // Get a pointer to the object name
- uint GetNoLvars() const; // Get the number of local variables
- uint GetNoScripts() const; // Get the number of scripts
+ uint32 GetNoLvars() const; // Get the number of local variables
+ uint32 GetNoScripts() const; // Get the number of scripts
const char *GetScriptName(uint32) const; // Get the name of a script
uint32 GetSize() { return (m_size); }
uint32 GetLvarInfoOffset() { return (m_var_table_offset); }
@@ -115,19 +115,19 @@ inline const char *c_un_game_object::GetName() const {
return ((const char *)(((const char *) this) + m_name_offset));
}
-inline uint c_un_game_object::GetNoLvars() const {
+inline uint32 c_un_game_object::GetNoLvars() const {
// Get the number of local variables
return (m_noLvars);
}
-inline uint c_un_game_object::GetNoScripts() const {
+inline uint32 c_un_game_object::GetNoScripts() const {
// Get the number of scripts
return (m_noScripts);
}
inline const char *c_un_game_object::GetScriptName(uint32 scriptNo) const {
assert(scriptNo < m_noScripts);
- return ((const char *)(((const char *) this) + ((const int *)(((const char *)this) + m_script_name_table_offset))[scriptNo]));
+ return ((const char *)(((const char *) this) + ((const int32 *)(((const char *)this) + m_script_name_table_offset))[scriptNo]));
}
inline const char *c_un_game_object::GetScriptVariableName(uint32 varNo) const {
@@ -171,7 +171,7 @@ inline int32 c_un_game_object::GetVariable(const char *name) const {
inline void c_un_game_object::SetIntegerVariable(uint32 lvar, int32 val) {
assert(lvar < m_noLvars);
- (((int *)(((char *)this) + m_lvars_offset))[lvar]) = val;
+ (((int32 *)(((char *)this) + m_lvars_offset))[lvar]) = val;
}
inline int32 &c_un_game_object::GetIntegerVariable(uint32 lvar) {
@@ -183,7 +183,7 @@ inline int32 &c_un_game_object::GetIntegerVariable(uint32 lvar) {
inline const char *c_un_game_object::GetStringVariable(uint32 lvar) const {
// Get an lvar value
assert(lvar < m_noLvars);
- return (((const char *) this) + ((const int *)(((const char *)this) + m_lvars_offset))[lvar]);
+ return (((const char *) this) + ((const int32 *)(((const char *)this) + m_lvars_offset))[lvar]);
}
class c_compressed_game_object {
@@ -195,8 +195,8 @@ class c_compressed_game_object {
public:
// Main access functions
const char *GetName() const; // Get a pointer to the object name
- uint GetNoLvars() const; // Get the number of local variables
- uint GetNoScripts() const; // Get the number of scripts
+ uint32 GetNoLvars() const; // Get the number of local variables
+ uint32 GetNoScripts() const; // Get the number of scripts
uint32 GetSize() { return (m_size); }
// Using the hash system you cannot get names, only hashes
@@ -267,24 +267,24 @@ inline const char *c_compressed_game_object::GetName() const {
return ((const char *)(((const char *) this) + m_name_offset));
}
-inline uint c_compressed_game_object::GetNoLvars() const {
+inline uint32 c_compressed_game_object::GetNoLvars() const {
// Get the number of local variables
return (m_noLvars);
}
-inline uint c_compressed_game_object::GetNoScripts() const {
+inline uint32 c_compressed_game_object::GetNoScripts() const {
// Get the number of scripts
return (m_noScripts);
}
inline uint32 c_compressed_game_object::GetScriptNameFullHash(uint32 scriptNo) const {
assert(scriptNo < m_noScripts);
- return (((const int *)(((const char *)this) + m_script_name_hash_table_offset))[scriptNo * 2]);
+ return (((const int32 *)(((const char *)this) + m_script_name_hash_table_offset))[scriptNo * 2]);
}
inline uint32 c_compressed_game_object::GetScriptNamePartHash(uint32 scriptNo) const {
assert(scriptNo < m_noScripts);
- return (((const int *)(((const char *)this) + m_script_name_hash_table_offset))[scriptNo * 2 + 1]);
+ return (((const int32 *)(((const char *)this) + m_script_name_hash_table_offset))[scriptNo * 2 + 1]);
}
inline const char *c_compressed_game_object::GetScriptVariableName(uint32 varNo) const {
@@ -328,7 +328,7 @@ inline int32 c_compressed_game_object::GetVariable(const char *name) const {
inline void c_compressed_game_object::SetIntegerVariable(uint32 lvar, int32 val) {
assert(lvar < m_noLvars);
- (((int *)(((char *)this) + m_lvars_offset))[lvar]) = val;
+ (((int32 *)(((char *)this) + m_lvars_offset))[lvar]) = val;
}
inline int32 &c_compressed_game_object::GetIntegerVariable(uint32 lvar) {
@@ -340,7 +340,7 @@ inline int32 &c_compressed_game_object::GetIntegerVariable(uint32 lvar) {
inline const char *c_compressed_game_object::GetStringVariable(uint32 lvar) const {
// Get an lvar value
assert(lvar < m_noLvars);
- return (((const char *) this) + ((const int *)(((const char *)this) + m_lvars_offset))[lvar]);
+ return (((const char *) this) + ((const int32 *)(((const char *)this) + m_lvars_offset))[lvar]);
}
class CSettableGameObject : public c_un_game_object {
diff --git a/engines/icb/common/px_globalvariables.cpp b/engines/icb/common/px_globalvariables.cpp
index ba7cfd9fca..36e097893a 100644
--- a/engines/icb/common/px_globalvariables.cpp
+++ b/engines/icb/common/px_globalvariables.cpp
@@ -34,7 +34,7 @@ CpxGlobalScriptVariables::CpxGlobalScriptVariables() {
m_no_vars = 0;
m_sorted = 0;
- int i;
+ int32 i;
for (i = 0; i < MAX_global_vars; i++) {
m_vars[i].hash = 666;
m_vars[i].value = 666;
@@ -43,15 +43,15 @@ CpxGlobalScriptVariables::CpxGlobalScriptVariables() {
}
int32 CpxGlobalScriptVariables::FindVariable(uint32 hash) {
- int index = -1;
+ int32 index = -1;
if (m_sorted == 0) {
SortVariables();
} else {
// Use binary search system to find the variables
// The variables are stored in ascending hash sorted order
- int min = 0;
- int max = m_no_vars;
+ int32 min = 0;
+ int32 max = m_no_vars;
index = ((max - min) >> 1);
CpxVariable *pvar = m_vars + index;
@@ -81,7 +81,7 @@ int32 CpxGlobalScriptVariables::FindVariable(uint32 hash) {
//#define CHECK_BINARY_SEARCH
#ifdef CHECK_BINARY_SEARCH
- uint i;
+ uint32 i;
int32 oldi = 0;
// Check the binarry search worked
for (i = 0; i < m_no_vars; i++) {
@@ -141,7 +141,7 @@ void CpxGlobalScriptVariables::SetVariable(uint32 hash, int32 value) {
// i.e. they are relying on the initialisation code which is bad
// warn = 0
// Don't give the warning - this is needed for save games which Get all global's !
-int32 CpxGlobalScriptVariables::GetVariable(uint32 hash, const char *name, int warn) {
+int32 CpxGlobalScriptVariables::GetVariable(uint32 hash, const char *name, int32 warn) {
// Has the variable been defined already
int32 i = FindVariable(hash);
if (i != -1) {
diff --git a/engines/icb/common/px_globalvariables.h b/engines/icb/common/px_globalvariables.h
index deea908ba5..0becd58e89 100644
--- a/engines/icb/common/px_globalvariables.h
+++ b/engines/icb/common/px_globalvariables.h
@@ -54,14 +54,14 @@ private:
// This is not part of the CpxVariable class - because of memory packing reasons
uint8 m_varInit[MAX_global_vars];
- uint m_no_vars;
- uint m_sorted;
+ uint32 m_no_vars;
+ uint32 m_sorted;
public:
CpxGlobalScriptVariables();
void SortVariables();
- int32 GetVariable(uint32 hash, const char *name = NULL, int warn = 1); // Get a variable by hash
+ int32 GetVariable(uint32 hash, const char *name = NULL, int32 warn = 1); // Get a variable by hash
int32 GetVariable(const char *n) { // Get a variable
return GetVariable(EngineHashString(n), n);
}
@@ -81,9 +81,9 @@ public:
return FindVariable(EngineHashString(n));
}
- uint GetNoItems() { return (m_no_vars); }
+ uint32 GetNoItems() { return (m_no_vars); }
- const CpxVariable &operator[](uint n) { return (m_vars[n]); } // Return reference to variable itself (const)
+ const CpxVariable &operator[](uint32 n) { return (m_vars[n]); } // Return reference to variable itself (const)
};
} // End of namespace ICB
diff --git a/engines/icb/common/px_list.h b/engines/icb/common/px_list.h
index 0832f7ad92..a948e56426 100644
--- a/engines/icb/common/px_list.h
+++ b/engines/icb/common/px_list.h
@@ -56,7 +56,7 @@ public:
void Append(const Type &); // Append item to the end of the list
void Insert(const Type &); // Inserts an item after the current item
pxList<Type> *Find(const Type &); // Returns the list whose head == entry (NULL if not found)
- int Length(); // Returns the length of the list
+ int32 Length(); // Returns the length of the list
};
template <class Type> class rcSortedList {
@@ -77,7 +77,7 @@ public:
Type &Head(); // The lists' head
rcSortedList<Type> *Tail(); // The lists' tail
bool IsEmpty(); // Is the list empty ?
- int Length(); // Returns the length of the list
+ int32 Length(); // Returns the length of the list
public:
rcSortedList<Type> *Insert(const Type &); // Inserts an item in the correct place
@@ -117,7 +117,7 @@ template <class Type> pxList<Type> *pxList<Type>::Find(const Type &entry) {
return (Tail()->Find(entry));
}
-template <class Type> int pxList<Type>::Length() {
+template <class Type> int32 pxList<Type>::Length() {
if (IsEmpty())
return 0;
@@ -173,7 +173,7 @@ template <class Type> rcSortedList<Type> *rcSortedList<Type>::Find(const Type &e
return (Tail()->Find(entry));
}
-template <class Type> int rcSortedList<Type>::Length() {
+template <class Type> int32 rcSortedList<Type>::Length() {
if (IsEmpty())
return 0;
diff --git a/engines/icb/common/px_rcutypes.h b/engines/icb/common/px_rcutypes.h
index 9860601714..15bcca9431 100644
--- a/engines/icb/common/px_rcutypes.h
+++ b/engines/icb/common/px_rcutypes.h
@@ -35,9 +35,9 @@ namespace ICB {
// Definition of a boolean value that can be used across the PC and PSX. I stopped true being 0xff because
// C++ weak typing allows you to assign a bool8 to an int8 without warning, whereupon '==' fails for TRUE8 because
// one is signed and one isn't.
-typedef unsigned char bool8;
-#define TRUE8 ((unsigned char)0x01)
-#define FALSE8 ((unsigned char)0x00)
+typedef uint8 bool8;
+#define TRUE8 ((uint8)0x01)
+#define FALSE8 ((uint8)0x00)
// end of file
diff --git a/engines/icb/common/px_scriptengine.cpp b/engines/icb/common/px_scriptengine.cpp
index 0020669dd5..05b8cedc8b 100644
--- a/engines/icb/common/px_scriptengine.cpp
+++ b/engines/icb/common/px_scriptengine.cpp
@@ -41,7 +41,7 @@ CpxGlobalScriptVariables g_globalScriptVariables;
// Information for the script program stack
#define STACK_SIZE 10 // The size of the stack
int32 stack[STACK_SIZE]; // The current stack
-int stackPointer = 0; // Position within stack
+int32 stackPointer = 0; // Position within stack
#define _SCRIPT_ENGINE_ERROR(mess) Fatal_error("Script engine error\nObject %s\nScript %s\nMessage %s", object->GetName(), scriptSourceName, mess)
@@ -119,7 +119,7 @@ extern mcodeFunctionReturnCodes fn_start_player_interaction(int32 &, int32 *);
scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to the script data that can be modified
c_game_object *object, // A pointer to the object that owns this object
- int *engineReturnValue2,
+ int32 *engineReturnValue2,
const char *scriptSourceName) { // A value to return to the game engine
// Run a script
ScriptTrace("Run script");
@@ -135,14 +135,14 @@ scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to
const char *actualScript = scriptData;
// Some variables to hold parameters and values
- int parameter1, parameter2, value;
+ int32 parameter1, parameter2, value;
bool8 isInExpression = FALSE8;
// Reset the fn routine control return value
- int fn_routines_control_return_flag = (-1);
+ int32 fn_routines_control_return_flag = (-1);
// Variable to prevent infinite loops
- uint infiniteLoopCounter = 0;
+ uint32 infiniteLoopCounter = 0;
while (*actualScript) {
// Quick check for infinite loops
@@ -152,7 +152,7 @@ scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to
Fatal_error("Internal script loop in object %s", object->GetName());
}
- int command = *(actualScript++);
+ int32 command = *(actualScript++);
// so that call_mcode and call_mcode_expr can share code...
isInExpression = FALSE8;
@@ -181,7 +181,7 @@ scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to
case CP_PUSH_ADDRESS_LOCAL_VAR32: {
Fetch8(value); // Get the local variable number
- if (!((value >= 0) && (value < (int)object->GetNoLvars())))
+ if (!((value >= 0) && (value < (int32)object->GetNoLvars())))
_SCRIPT_ENGINE_ERROR("Local variable out of range");
ScriptTrace("Push address of local integer variable %d = %d", value, &object->GetIntegerVariable(value));
PushOnStack(MemoryUtil::encodePtr((uint8 *)&object->GetIntegerVariable(value)));
@@ -329,7 +329,7 @@ scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to
// Get the script index
Fetch32(parameter1);
- if (!((parameter1 >= 0) && (parameter1 < (int)object->GetNoScripts())))
+ if (!((parameter1 >= 0) && (parameter1 < (int32)object->GetNoScripts())))
_SCRIPT_ENGINE_ERROR("Virtual script call out of range");
// Get the type
@@ -365,7 +365,7 @@ scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to
case CP_PUSH_LOCAL_VAR32: // 16: Push a local variable on to the stack
Fetch8(value); // Get the local variable number
- if (!((value >= 0) && (value < (int)object->GetNoLvars())))
+ if (!((value >= 0) && (value < (int32)object->GetNoLvars())))
_SCRIPT_ENGINE_ERROR("Unknown variable??");
ScriptTrace("Push local integer variable %d = %d", value, object->GetIntegerVariable(value));
@@ -375,7 +375,7 @@ scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to
case CP_POP_LOCAL_VAR32: // 17 // Pop a local variable from the stack
Fetch8(value); // Get the local variable number
- if (!(value >= 0) && (value < (int)object->GetNoLvars()))
+ if (!(value >= 0) && (value < (int32)object->GetNoLvars()))
_SCRIPT_ENGINE_ERROR("Unknown variable??");
ScriptTrace("Pop local variable %d", value);
@@ -385,7 +385,7 @@ scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to
case CP_PUSH_LOCAL_VARSTRING: // 18: Push a local string variable on to the stack
Fetch8(value); // Get the local variable number
- if (!((value >= 0) && (value < (int)object->GetNoLvars())))
+ if (!((value >= 0) && (value < (int32)object->GetNoLvars())))
_SCRIPT_ENGINE_ERROR("Unknown variable (string)??");
ScriptTrace("Push local string variable %d = \"%s\"", value, object->GetStringVariable(value));
diff --git a/engines/icb/common/px_scriptengine.h b/engines/icb/common/px_scriptengine.h
index 763ff5b116..ac1cb1bdfb 100644
--- a/engines/icb/common/px_scriptengine.h
+++ b/engines/icb/common/px_scriptengine.h
@@ -45,7 +45,7 @@ enum scriptInterpreterReturnCodes {
scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to the script data that can be modified
c_game_object *object, // A pointer to the object that owns this object
- int *engineReturnValue = NULL,
+ int32 *engineReturnValue = NULL,
const char *scriptSourceName = NULL); // A value to return to the game engine
void SetScriptDebugging(bool8 f); // Set script debugging flag
diff --git a/engines/icb/common/px_staticlayers.h b/engines/icb/common/px_staticlayers.h
index d505e0335c..78adb1133f 100644
--- a/engines/icb/common/px_staticlayers.h
+++ b/engines/icb/common/px_staticlayers.h
@@ -52,9 +52,9 @@ class pcStaticLayers {
uint8 *DataStart() { return (uint8 *)id; }
public:
- uint16 *GetSemiTileTable(int idx) { return semiPtrs[idx] ? (uint16 *)(DataStart() + semiPtrs[idx]) : 0; }
+ uint16 *GetSemiTileTable(int32 idx) { return semiPtrs[idx] ? (uint16 *)(DataStart() + semiPtrs[idx]) : 0; }
- uint16 *GetTileTable(int idx) { return tilePtrs[idx] ? (uint16 *)(DataStart() + tilePtrs[idx]) : 0; }
+ uint16 *GetTileTable(int32 idx) { return tilePtrs[idx] ? (uint16 *)(DataStart() + tilePtrs[idx]) : 0; }
uint32 GetSchema() {
if (READ_LE_U32(id) != PCLAYER_ID)
diff --git a/engines/icb/common/px_string.cpp b/engines/icb/common/px_string.cpp
index b420e19f38..3e294a435b 100644
--- a/engines/icb/common/px_string.cpp
+++ b/engines/icb/common/px_string.cpp
@@ -45,7 +45,7 @@ const char *pxString::operator=(const char *str) {
delete[] s;
if (str) {
// We are not assigning a null string
- uint len = strlen(const_cast<char *>(str)) + 1;
+ uint32 len = strlen(const_cast<char *>(str)) + 1;
s = new char[len];
memcpy((unsigned char *)s, (unsigned char *)const_cast<char *>(str), len);
} else
@@ -59,7 +59,7 @@ void pxString::operator=(const pxString &str) {
delete[] s;
if (str.s) {
// We are not assigning a null string
- uint len = strlen((char *)(str.s)) + 1;
+ uint32 len = strlen((char *)(str.s)) + 1;
s = new char[len];
memcpy((unsigned char *)s, (unsigned char *)str.s, len);
} else
@@ -70,8 +70,8 @@ const char *pxString::operator+=(const char *adder) {
// Add a string
if (adder) {
- uint slen = s ? strlen(s) : 0; // Get original string length
- uint adderlen = strlen(const_cast<char *>(adder)); // Get additional string length
+ uint32 slen = s ? strlen(s) : 0; // Get original string length
+ uint32 adderlen = strlen(const_cast<char *>(adder)); // Get additional string length
char *buf = new char[slen + adderlen + 1]; // Create a buffer
if (s)
memcpy((unsigned char *)buf, (unsigned char *)s, slen); // Move the original string in
@@ -103,7 +103,7 @@ bool pxString::operator==(const char *string) const {
return ((bool)(strcmp(s, const_cast<char *>(string)) == 0));
}
-void pxString::SetString(const char *data, uint len) {
+void pxString::SetString(const char *data, uint32 len) {
// Get the first len characters from another string
// Lose any string we currently hold
@@ -121,9 +121,9 @@ void pxString::SetString(const char *data, uint len) {
s = NULL;
}
-void pxString::Substr(pxString &rsStr, uint nStart, uint nNum) const {
+void pxString::Substr(pxString &rsStr, uint32 nStart, uint32 nNum) const {
char *pNewString;
- uint slen = strlen(s); // ds: No need to calculate this several times
+ uint32 slen = strlen(s); // ds: No need to calculate this several times
// Do some range checking.
if (nStart > (slen - 1)) {
@@ -152,9 +152,9 @@ void pxString::Substr(pxString &rsStr, uint nStart, uint nNum) const {
delete[] pNewString;
}
-uint pxString::StrChr(char cToFind, uint nStartPos) const {
+uint32 pxString::StrChr(char cToFind, uint32 nStartPos) const {
char *pcPositionOfFirst;
- uint nStringLength = strlen(s);
+ uint32 nStringLength = strlen(s);
// Check if the start position is outside the string.
if (nStartPos >= nStringLength)
@@ -216,7 +216,7 @@ const pxString &pxString::Format(const char *format, ...) {
// The data could be any size. Rather than incrementally allocating memory until
// it fits a large buffer multiple is used that should cover 99.9% of all strings
// but will still cope with unfeasably large ones
- uint startBufferSize = 1024;
+ uint32 startBufferSize = 1024;
// Allocate a start buffer
s = new char[startBufferSize + 2];
@@ -225,7 +225,7 @@ const pxString &pxString::Format(const char *format, ...) {
// Process the variable arguments
va_list arglist;
- uint slen;
+ uint32 slen;
// Keep doubling the size of the buffer until it fits
while (va_start(arglist, format), slen = vsnprintf(s, startBufferSize, const_cast<char *>(format), arglist), SLEN_CHECK) {
@@ -276,7 +276,7 @@ const char *pxVString(const char *format, ...) {
return buf;
}
-pxFixedCharBuffer::pxFixedCharBuffer(uint len) {
+pxFixedCharBuffer::pxFixedCharBuffer(uint32 len) {
// Construct the object with the appropriate amount of data
m_data = new char[len];
@@ -286,7 +286,7 @@ pxFixedCharBuffer::pxFixedCharBuffer(uint len) {
}
}
-pxFlexiCharBuffer::pxFlexiCharBuffer(uint initLen) {
+pxFlexiCharBuffer::pxFlexiCharBuffer(uint32 initLen) {
m_bufLen = initLen;
m_buffer = new char[initLen]; // The buffer itself
@@ -294,16 +294,16 @@ pxFlexiCharBuffer::pxFlexiCharBuffer(uint initLen) {
pxFlexiCharBuffer::~pxFlexiCharBuffer() { delete[] m_buffer; }
-char &pxFlexiCharBuffer::operator[](uint offset) {
+char &pxFlexiCharBuffer::operator[](uint32 offset) {
CheckSize(offset);
return (m_buffer[offset]);
}
-void pxFlexiCharBuffer::CheckSize(uint size) {
+void pxFlexiCharBuffer::CheckSize(uint32 size) {
// Make sure we have enough room
if (size >= m_bufLen) {
- uint newLen = size + 1;
+ uint32 newLen = size + 1;
char *newb = new char[newLen];
assert(newb);
memcpy((unsigned char *)newb, (unsigned char *)m_buffer, m_bufLen);
@@ -313,14 +313,14 @@ void pxFlexiCharBuffer::CheckSize(uint size) {
}
}
-void pxFlexiCharBuffer::StrCpy(uint offset, const char *string) {
+void pxFlexiCharBuffer::StrCpy(uint32 offset, const char *string) {
// Add a string
- uint slen = strlen(const_cast<char *>(string));
+ uint32 slen = strlen(const_cast<char *>(string));
CheckSize(offset + slen);
memcpy((unsigned char *)(m_buffer + offset), (unsigned char *)const_cast<char *>(string), slen);
}
-void pxFlexiCharBuffer::StrnCpy(uint offset, const char *string, uint len) {
+void pxFlexiCharBuffer::StrnCpy(uint32 offset, const char *string, uint32 len) {
// Copy a number of characters to the buffer
CheckSize(offset + len);
memcpy((unsigned char *)(m_buffer + offset), (unsigned char *)const_cast<char *>(string), len);
diff --git a/engines/icb/common/px_string.h b/engines/icb/common/px_string.h
index a28389b21d..88e61f9dc9 100644
--- a/engines/icb/common/px_string.h
+++ b/engines/icb/common/px_string.h
@@ -48,17 +48,17 @@ public:
const char *operator=(const char *); // Assign a value
void operator=(const pxString &); // Assign a value
const char *operator+=(const char *); // Add a string
- char &operator[](uint n) {
+ char &operator[](uint32 n) {
return (s[n]); // Get a character (no reason not to allow it to change)
}
- char &operator[](int n) {
+ char &operator[](int32 n) {
return (s[n]); // Get a character (no reason not to allow it to change)
}
bool IsNull() const {
return ((bool)(s == NULL)); // Check for a null value
}
bool IsEmpty() const; // Check for an empty string
- uint GetLen() const; // Returns the length of the string.
+ uint32 GetLen() const; // Returns the length of the string.
void ToUpper(); // Make contents of string uppercase
void ToLower(); // Make contents of string lowercase
void ConvertPath(); // Converts a path to native format
@@ -67,12 +67,12 @@ public:
const pxString operator+(const char *) const;
- inline pxString Substr(uint nStart, uint nLen) const; // Return a part of this string
- void Substr(pxString &rsStr, uint nStart, uint nLen) const; // A faster substring.
+ inline pxString Substr(uint32 nStart, uint32 nLen) const; // Return a part of this string
+ void Substr(pxString &rsStr, uint32 nStart, uint32 nLen) const; // A faster substring.
- void SetString(const char *data, uint len); // Get the first len characters from another string
+ void SetString(const char *data, uint32 len); // Get the first len characters from another string
- uint StrChr(char cToFind, uint nStartPos = 0) const; // Find position of a character in a string [PS 17/08/98]
+ uint32 StrChr(char cToFind, uint32 nStartPos = 0) const; // Find position of a character in a string [PS 17/08/98]
// char * comparisons
bool operator==(const char *string) const; // Do a character by character comparison
@@ -82,7 +82,7 @@ public:
inline pxString::pxString(const pxString &str) {
if (str.s) {
// There is some data to copy
- uint len = strlen((char *)str.s) + 1;
+ uint32 len = strlen((char *)str.s) + 1;
s = new char[len];
memcpy((unsigned char *)s, (unsigned char *)str.s, len);
} else
@@ -100,11 +100,11 @@ const char *pxVString(const char *format, ...);
class pxFlexiCharBuffer {
char *m_buffer; // The buffer itself
- uint m_bufLen; // The buffer length
+ uint32 m_bufLen; // The buffer length
public:
// explicit
- pxFlexiCharBuffer(uint len = 40);
+ pxFlexiCharBuffer(uint32 len = 40);
~pxFlexiCharBuffer();
char &operator[](uint); // Allow array access
@@ -122,8 +122,8 @@ public:
return (m_buffer); // Treat as a void *
}
- void StrCpy(uint offset, const char *text); // Copy a string to the buffer
- void StrnCpy(uint offset, const char *text, uint len); // Copy a number of characters to the buffer
+ void StrCpy(uint32 offset, const char *text); // Copy a string to the buffer
+ void StrnCpy(uint32 offset, const char *text, uint32 len); // Copy a number of characters to the buffer
// Prevent copy or assignment
private:
@@ -135,7 +135,7 @@ class pxFixedCharBuffer {
char *m_data;
public:
- pxFixedCharBuffer(uint len);
+ pxFixedCharBuffer(uint32 len);
~pxFixedCharBuffer() { delete[] m_data; }
operator void *() { return (m_data); }
@@ -155,7 +155,7 @@ inline pxString::pxString() {
inline pxString::pxString(const char *str) {
// Copy constructor
if (str) {
- uint len = strlen(str) + 1;
+ uint32 len = strlen(str) + 1;
s = new char[len];
memcpy(s, str, len);
} else
@@ -170,14 +170,14 @@ inline bool pxString::IsEmpty() const {
return (false);
}
-inline uint pxString::GetLen() const {
+inline uint32 pxString::GetLen() const {
if ((s == NULL))
return (0);
return (strlen(s));
}
-inline pxString pxString::Substr(uint nStart, uint nNum) const {
+inline pxString pxString::Substr(uint32 nStart, uint32 nNum) const {
pxString rsRetVal;
Substr(rsRetVal, nStart, nNum);
diff --git a/engines/icb/common/px_walkarea_integer.h b/engines/icb/common/px_walkarea_integer.h
index 78c99e7787..d365aa79d0 100644
--- a/engines/icb/common/px_walkarea_integer.h
+++ b/engines/icb/common/px_walkarea_integer.h
@@ -36,7 +36,7 @@ namespace ICB {
typedef struct __point { // 3D integer coordinate representation
__point(void) : x(0), y(0), z(0) { ; }
- __point(int X, int Y, int Z) : x(X), y(Y), z(Z) { ; }
+ __point(int32 X, int32 Y, int32 Z) : x(X), y(Y), z(Z) { ; }
int32 x;
int32 y;
diff --git a/engines/icb/common/revtex_api.h b/engines/icb/common/revtex_api.h
index 4ad5799c74..3dee6bce58 100644
--- a/engines/icb/common/revtex_api.h
+++ b/engines/icb/common/revtex_api.h
@@ -43,10 +43,10 @@ typedef struct revtex_API {
uint32 schema;
// RevTexture revtex;
- u_int palette[256]; // windows 32-bit RGB with 1 byte of padding
- u_int width; // must be power of 2
- u_int height; // must be power of 2
- u_int levelOffset[9]; // width/1 * height/1 -> width/256 * height/256
+ uint32 palette[256]; // windows 32-bit RGB with 1 byte of padding
+ uint32 width; // must be power of 2
+ uint32 height; // must be power of 2
+ uint32 levelOffset[9]; // width/1 * height/1 -> width/256 * height/256
} revtex_API;
diff --git a/engines/icb/configfile.cpp b/engines/icb/configfile.cpp
index 31ddbf087b..97c4f8e27e 100644
--- a/engines/icb/configfile.cpp
+++ b/engines/icb/configfile.cpp
@@ -62,7 +62,7 @@ Common::String ConfigFile::readSetting(const Common::String §ion, const Comm
return defaultValue;
}
-int ConfigFile::readIntSetting(const Common::String §ion, const Common::String &key, int defaultValue) const {
+int32 ConfigFile::readIntSetting(const Common::String §ion, const Common::String &key, int32 defaultValue) const {
return atoi(readSetting(section, key, Common::String().format("%d", defaultValue)).c_str());
}
diff --git a/engines/icb/debug.cpp b/engines/icb/debug.cpp
index 39b8c88515..574bf63493 100644
--- a/engines/icb/debug.cpp
+++ b/engines/icb/debug.cpp
@@ -126,10 +126,10 @@ void _game_session::Show_lit_unlit_diagnostics() {
// Really shoud write a PSXLamp::GetState( uint32 n ) !
PSXLampState *plampstate = pLamp->states + state;
- int r = plampstate->c.r;
- int g = plampstate->c.g;
- int b = plampstate->c.b;
- int m = plampstate->m;
+ int32 r = plampstate->c.r;
+ int32 g = plampstate->c.g;
+ int32 b = plampstate->c.b;
+ int32 m = plampstate->m;
r = (r * m) >> 7; // m has 1.0 = 128
g = (g * m) >> 7; // m has 1.0 = 128
@@ -162,8 +162,8 @@ void _game_session::Show_lit_unlit_diagnostics() {
PXWorldToFilm(pos, camera, result, lightpos);
// draw rectangle of the correct colour
- int x0 = (int32)(lightpos.x + (SCREEN_WIDTH / 2));
- int y0 = (int32)(SCREEN_DEPTH / 2 - lightpos.y);
+ int32 x0 = (int32)(lightpos.x + (SCREEN_WIDTH / 2));
+ int32 y0 = (int32)(SCREEN_DEPTH / 2 - lightpos.y);
uint32 penrgb = (r << 16) | (g << 8) | (b << 0);
Fill_rect(x0 - LIGHT_RECT_WIDTH / 2, y0 - LIGHT_RECT_HEIGHT / 2, x0 + LIGHT_RECT_WIDTH / 2, y0 + LIGHT_RECT_HEIGHT / 2, penrgb, (int32)-lightpos.z);
@@ -171,8 +171,8 @@ void _game_session::Show_lit_unlit_diagnostics() {
// Draw a 'shadow' away from light ! - to try and guess z-distance
pos.y += LIGHT_TIE_Y_OFFSET;
PXWorldToFilm(pos, camera, result, tiepos);
- int x1 = (int32)(tiepos.x + (SCREEN_WIDTH / 2));
- int y1 = (int32)(SCREEN_DEPTH / 2 - tiepos.y);
+ int32 x1 = (int32)(tiepos.x + (SCREEN_WIDTH / 2));
+ int32 y1 = (int32)(SCREEN_DEPTH / 2 - tiepos.y);
penrgb = LIGHT_TIE_PEN;
Fill_rect(x1 - LIGHT_TIE_WIDTH / 2, y1 - LIGHT_TIE_HEIGHT / 2, x1 + LIGHT_TIE_WIDTH / 2, y1 + LIGHT_TIE_HEIGHT / 2, penrgb, (int32)-tiepos.z);
@@ -180,7 +180,7 @@ void _game_session::Show_lit_unlit_diagnostics() {
ad = surface_manager->Lock_surface(working_buffer_id);
// Draw a pink line from light to its tie !
- General_draw_line_24_32((short)x0, (short)y0, (short)x1, (short)y1, &tiecolour, ad, pitch);
+ General_draw_line_24_32((int16)x0, (int16)y0, (int16)x1, (int16)y1, &tiecolour, ad, pitch);
// Print the name of the light at the light pos and the tie pos
Clip_text_print(&tcol, x0, y0, ad, pitch, "%s", pLamp->lamp_name);
@@ -190,9 +190,9 @@ void _game_session::Show_lit_unlit_diagnostics() {
if ((pLamp->type == DIRECT_LIGHT) || (pLamp->type == SPOT_LIGHT)) {
// plampstate direciton is normalised to be 4096 int32
// Take that down to 128cm int32 (>>5)
- int dx = plampstate->vx >> 5;
- int dy = plampstate->vy >> 5;
- int dz = plampstate->vz >> 5;
+ int32 dx = plampstate->vx >> 5;
+ int32 dy = plampstate->vy >> 5;
+ int32 dz = plampstate->vz >> 5;
// Remove the tie position offset
pos.y -= LIGHT_TIE_Y_OFFSET;
@@ -204,7 +204,7 @@ void _game_session::Show_lit_unlit_diagnostics() {
// Draw a line to show the direction of the light
x1 = (int32)(tiepos.x + (SCREEN_WIDTH / 2));
y1 = (int32)(SCREEN_DEPTH / 2 - tiepos.y);
- General_draw_line_24_32((short)x0, (short)y0, (short)x1, (short)y1, &dcolour, ad, pitch);
+ General_draw_line_24_32((int16)x0, (int16)y0, (int16)x1, (int16)y1, &dcolour, ad, pitch);
}
// Unlock to use Fill_rect !
diff --git a/engines/icb/debug_pc.cpp b/engines/icb/debug_pc.cpp
index 95b477b65c..5df23d5de1 100644
--- a/engines/icb/debug_pc.cpp
+++ b/engines/icb/debug_pc.cpp
@@ -44,9 +44,9 @@ namespace ICB {
bool8 zdebug = false;
// For the overloads of new & delete
-extern unsigned int newMemAlloc;
-extern unsigned int newMemUsed;
-extern unsigned int newNptrs;
+extern uint32 newMemAlloc;
+extern uint32 newMemUsed;
+extern uint32 newNptrs;
void Fatal_error(const char *format...) {
char buf[256];
diff --git a/engines/icb/debug_pc.h b/engines/icb/debug_pc.h
index 2dcec02f6b..8bdfe6c7aa 100644
--- a/engines/icb/debug_pc.h
+++ b/engines/icb/debug_pc.h
@@ -47,8 +47,8 @@ void Tdebug(const char *file, const char *format, ...);
// XXX: FIXME: This function stores the number of elapsed microseconds in an unsigned 32-bit int, which will overflow in just over an
// hour...
// We should make sure all the client code deals with this properly!
-inline unsigned int GetMicroTimer(void) {
- static int first = 1;
+inline uint32 GetMicroTimer(void) {
+ static int32 first = 1;
static TimeDate startTime;
if (first) {
diff --git a/engines/icb/drawpoly_pc.cpp b/engines/icb/drawpoly_pc.cpp
index 9d81e643e8..5e6fbb7792 100644
--- a/engines/icb/drawpoly_pc.cpp
+++ b/engines/icb/drawpoly_pc.cpp
@@ -38,12 +38,12 @@ namespace ICB {
#if _PSX_ON_PC == 1
-extern unsigned int selFace;
+extern uint32 selFace;
extern CVECTOR unlitPoly;
extern CVECTOR deadObjectColour;
-extern unsigned int deadObject;
+extern uint32 deadObject;
-extern unsigned int _drawBface;
+extern uint32 _drawBface;
extern uint8 selWRed;
extern uint8 selWGreen;
@@ -56,12 +56,12 @@ extern uint8 selPAlpha;
#else // #if _PSX_ON_PC == 1
-unsigned int selFace = 65537;
+uint32 selFace = 65537;
CVECTOR unlitPoly = {255, 255, 255, 0};
CVECTOR deadObjectColour = {0, 0, 0, 0};
-unsigned int deadObject = 0;
+uint32 deadObject = 0;
-unsigned int _drawBface = 0;
+uint32 _drawBface = 0;
uint8 selWRed = 0;
uint8 selWGreen = 255;
@@ -82,25 +82,25 @@ inline void LightPolygon(SVECTOR *n0, CVECTOR *rgbIn, CVECTOR *rgb0) {
ApplyMatrixSV_pc(>elight_pc, n0, &lightEffect);
if (useLampWidth) {
- lightEffect.vx = (short)(lightEffect.vx + lampWidth[0]);
- lightEffect.vy = (short)(lightEffect.vy + lampWidth[1]);
- lightEffect.vz = (short)(lightEffect.vy + lampWidth[2]);
+ lightEffect.vx = (int16)(lightEffect.vx + lampWidth[0]);
+ lightEffect.vy = (int16)(lightEffect.vy + lampWidth[1]);
+ lightEffect.vz = (int16)(lightEffect.vy + lampWidth[2]);
}
if (useLampBounce) {
if (lightEffect.vx < 0) {
- lightEffect.vx = (short)-lightEffect.vx;
+ lightEffect.vx = (int16)-lightEffect.vx;
if (lightEffect.vx > lampBounce[0])
- lightEffect.vx = (short)lampBounce[0];
+ lightEffect.vx = (int16)lampBounce[0];
}
if (lightEffect.vy < 0) {
- lightEffect.vy = (short)-lightEffect.vy;
+ lightEffect.vy = (int16)-lightEffect.vy;
if (lightEffect.vy > lampBounce[1])
- lightEffect.vy = (short)lampBounce[1];
+ lightEffect.vy = (int16)lampBounce[1];
}
if (lightEffect.vz < 0) {
- lightEffect.vz = (short)-lightEffect.vz;
+ lightEffect.vz = (int16)-lightEffect.vz;
if (lightEffect.vz > lampBounce[2])
- lightEffect.vz = (short)lampBounce[2];
+ lightEffect.vz = (int16)lampBounce[2];
}
} else {
if (lightEffect.vx < 0)
@@ -123,15 +123,15 @@ inline void LightPolygon(SVECTOR *n0, CVECTOR *rgbIn, CVECTOR *rgb0) {
// colourEffect is 0-4095 (2^12)
// gteback is 0-255 (2^8)
- colourEffect.vx = (short)((colourEffect.vx >> 4) + gteback_pc[0]);
- colourEffect.vy = (short)((colourEffect.vy >> 4) + gteback_pc[1]);
- colourEffect.vz = (short)((colourEffect.vz >> 4) + gteback_pc[2]);
+ colourEffect.vx = (int16)((colourEffect.vx >> 4) + gteback_pc[0]);
+ colourEffect.vy = (int16)((colourEffect.vy >> 4) + gteback_pc[1]);
+ colourEffect.vz = (int16)((colourEffect.vz >> 4) + gteback_pc[2]);
// 256 = 1.0 in colourEffect
// 128 = 1.0 in in0
- int red = (rgbIn->r * colourEffect.vx);
- int green = (rgbIn->g * colourEffect.vy);
- int blue = (rgbIn->b * colourEffect.vz);
+ int32 red = (rgbIn->r * colourEffect.vx);
+ int32 green = (rgbIn->g * colourEffect.vy);
+ int32 blue = (rgbIn->b * colourEffect.vz);
red = red >> 8;
green = green >> 8;
@@ -211,15 +211,15 @@ gte_lcirbk();
//------------------------------------------------------------------------
// Flat, Un-Textured, Self-Luminous, triangles
-void drawFUS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
+void drawFUS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
- // u_int num = min( n, 10 ); // do a maximum of 10 polygons
- u_int num = n;
+ // uint32 num = min( n, 10 ); // do a maximum of 10 polygons
+ uint32 num = n;
int32 p, flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0, z1, z2;
SVECTORPC sxy0, sxy1, sxy2, stemp;
@@ -354,16 +354,16 @@ void drawFUS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
//------------------------------------------------------------------------
// Gouraud, Un-Textured, Self-Luminous, triangles
-void drawGUS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
+void drawGUS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
- // u_int num = min( n, 10 ); // do a maximum of 10 polygons
- u_int num = n;
+ // uint32 num = min( n, 10 ); // do a maximum of 10 polygons
+ uint32 num = n;
uint32 tmp;
int32 p, flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0, z1, z2;
SVECTORPC sxy0, sxy1, sxy2, stemp;
@@ -516,18 +516,18 @@ void drawGUS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
}
// Flat, Textured, Self-Luminous Triangles
-void drawFTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
+void drawFTS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
- // u_int num = min( n, 10 ); // do a maximum of 10 polygons
- u_int num = n;
- u_short uu0, uu1, uu2;
- u_short vv0, vv1, vv2;
+ // uint32 num = min( n, 10 ); // do a maximum of 10 polygons
+ uint32 num = n;
+ uint16 uu0, uu1, uu2;
+ uint16 vv0, vv1, vv2;
uint32 tmp;
int32 p, flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0, z1, z2;
SVECTORPC sxy0, sxy1, sxy2, stemp;
@@ -560,16 +560,16 @@ void drawFTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
}
uv0 = *pPoly++;
- vv0 = (u_short)((uv0 >> 16) & 0xFFFF);
- uu0 = (u_short)(uv0 & 0xFFFF);
+ vv0 = (uint16)((uv0 >> 16) & 0xFFFF);
+ uu0 = (uint16)(uv0 & 0xFFFF);
uv1 = *pPoly++;
- vv1 = (u_short)((uv1 >> 16) & 0xFFFF);
- uu1 = (u_short)(uv1 & 0xFFFF);
+ vv1 = (uint16)((uv1 >> 16) & 0xFFFF);
+ uu1 = (uint16)(uv1 & 0xFFFF);
uv2 = *pPoly++;
- vv2 = (u_short)((uv2 >> 16) & 0xFFFF);
- uu2 = (u_short)(uv2 & 0xFFFF);
+ vv2 = (uint16)((uv2 >> 16) & 0xFFFF);
+ uu2 = (uint16)(uv2 & 0xFFFF);
tmp = *pPoly++;
v0 = pVertex + (tmp & 0xFFFF);
@@ -713,18 +713,18 @@ void drawFTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
}
// Gouraud, Textured, Self-Luminous Triangles
-void drawGTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
+void drawGTS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
- // u_int num = min( n, 10 ); // do a maximum of 10 polygons
- u_int num = n;
- u_short uu0, uu1, uu2;
- u_short vv0, vv1, vv2;
+ // uint32 num = min( n, 10 ); // do a maximum of 10 polygons
+ uint32 num = n;
+ uint16 uu0, uu1, uu2;
+ uint16 vv0, vv1, vv2;
uint32 tmp;
int32 p, flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0, z1, z2;
SVECTORPC sxy0, sxy1, sxy2, stemp;
@@ -763,16 +763,16 @@ void drawGTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
}
uv0 = *pPoly++;
- vv0 = (u_short)((uv0 >> 16) & 0xFFFF);
- uu0 = (u_short)(uv0 & 0xFFFF);
+ vv0 = (uint16)((uv0 >> 16) & 0xFFFF);
+ uu0 = (uint16)(uv0 & 0xFFFF);
uv1 = *pPoly++;
- vv1 = (u_short)((uv1 >> 16) & 0xFFFF);
- uu1 = (u_short)(uv1 & 0xFFFF);
+ vv1 = (uint16)((uv1 >> 16) & 0xFFFF);
+ uu1 = (uint16)(uv1 & 0xFFFF);
uv2 = *pPoly++;
- vv2 = (u_short)((uv2 >> 16) & 0xFFFF);
- uu2 = (u_short)(uv2 & 0xFFFF);
+ vv2 = (uint16)((uv2 >> 16) & 0xFFFF);
+ uu2 = (uint16)(uv2 & 0xFFFF);
tmp = *pPoly++;
v0 = pVertex + (tmp & 0xFFFF);
@@ -932,16 +932,16 @@ void drawGTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
}
// Flat, Un-Textured, Lit, triangles
-void drawFUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal) {
+void drawFUL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal) {
SVECTOR *n0;
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
- // u_int num = min( n, 10 ); // do a maximum of 10 polygons
- u_int num = n;
+ // uint32 num = min( n, 10 ); // do a maximum of 10 polygons
+ uint32 num = n;
int32 p, flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0, z1, z2;
SVECTORPC sxy0, sxy1, sxy2, stemp;
@@ -950,7 +950,7 @@ void drawFUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
CVECTOR *rgbIn;
CVECTOR rgb0 = {0, 0, 0, 0};
uint32 tmp;
- u_char ctmp;
+ uint8 ctmp;
pPoly = polyStart;
// Loop over each polygon
@@ -1032,9 +1032,9 @@ void drawFUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
// so should be drawn in front of wireframe triangles
if ((_drawNormals) && ((selFace == i) || (selFace > 65536))) {
// Do coord transform on the scaled normal vectors + v0
- sn0.vx = (short)(v0->vx + (-n0->vx >> _normalScale));
- sn0.vy = (short)(v0->vy + (-n0->vy >> _normalScale));
- sn0.vz = (short)(v0->vz + (-n0->vz >> _normalScale));
+ sn0.vx = (int16)(v0->vx + (-n0->vx >> _normalScale));
+ sn0.vy = (int16)(v0->vy + (-n0->vy >> _normalScale));
+ sn0.vz = (int16)(v0->vz + (-n0->vz >> _normalScale));
// z0 = RotTransPers( &sn0, &sxyn0, &p, &flag );
gte_RotTransPers_pc(&sn0, &sxyn0, &p, &flag, &z0);
// Normal 0 : scale the normal and add to vertex scrn pos
@@ -1077,7 +1077,7 @@ void drawFUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
line->y3 = sxy0.vy;
// Draw a wireframe that responds to lighting
if (_drawLit) {
- int cval;
+ int32 cval;
// Compute the colour scaling and clip it
// Flat shading so give the same colour to each vertex
if (rgbIn->r != 0) {
@@ -1152,7 +1152,7 @@ void drawFUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
}
// Gouraud, Un-Textured, Lit, triangles
-void drawGUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal) {
+void drawGUL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal) {
SVECTOR *n0;
SVECTOR *n1;
SVECTOR *n2;
@@ -1161,12 +1161,12 @@ void drawGUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
SVECTORPC *v2;
SVECTOR *ntemp;
- // u_int num = min( n, 10 ); // do a maximum of 10 polygons
- u_int num = n;
+ // uint32 num = min( n, 10 ); // do a maximum of 10 polygons
+ uint32 num = n;
uint32 tmp;
- u_char ctmp;
+ uint8 ctmp;
int32 p, flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0, z1, z2;
SVECTORPC sxy0, sxy1, sxy2, stemp;
@@ -1271,7 +1271,7 @@ void drawGUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
// NormalColorCol3( n0, n1, n2, &rgbIn, &rgb0, &rgb1, &rgb2 );
LIGHTPOLYGON3(n0, n1, n2, &rgbIn, &rgb0, &rgb1, &rgb2);
- int cval;
+ int32 cval;
if (!_drawGouraud) {
// For flat shading mode take the average RGB for the face
@@ -1302,15 +1302,15 @@ void drawGUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
// so should be drawn in front of wireframe triangles
if ((_drawNormals) && ((selFace == i) || (selFace > 65536))) {
// Do coord transform on the scaled normal vectors + v0
- sn0.vx = (short)(v0->vx + (-n0->vx >> _normalScale));
- sn0.vy = (short)(v0->vy + (-n0->vy >> _normalScale));
- sn0.vz = (short)(v0->vz + (-n0->vz >> _normalScale));
- sn1.vx = (short)(v1->vx + (-n1->vx >> _normalScale));
- sn1.vy = (short)(v1->vy + (-n1->vy >> _normalScale));
- sn1.vz = (short)(v1->vz + (-n1->vz >> _normalScale));
- sn2.vx = (short)(v2->vx + (-n2->vx >> _normalScale));
- sn2.vy = (short)(v2->vy + (-n2->vy >> _normalScale));
- sn2.vz = (short)(v2->vz + (-n2->vz >> _normalScale));
+ sn0.vx = (int16)(v0->vx + (-n0->vx >> _normalScale));
+ sn0.vy = (int16)(v0->vy + (-n0->vy >> _normalScale));
+ sn0.vz = (int16)(v0->vz + (-n0->vz >> _normalScale));
+ sn1.vx = (int16)(v1->vx + (-n1->vx >> _normalScale));
+ sn1.vy = (int16)(v1->vy + (-n1->vy >> _normalScale));
+ sn1.vz = (int16)(v1->vz + (-n1->vz >> _normalScale));
+ sn2.vx = (int16)(v2->vx + (-n2->vx >> _normalScale));
+ sn2.vy = (int16)(v2->vy + (-n2->vy >> _normalScale));
+ sn2.vz = (int16)(v2->vz + (-n2->vz >> _normalScale));
// z0 = RotTransPers3( &sn0, &sn1, &sn2,
// &sxyn0, &sxyn1, &sxyn2, &p, &flag );
@@ -1392,7 +1392,7 @@ void drawGUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
if (_drawLit) {
LINE_G4 *line = (LINE_G4 *)drawpacket;
setLineG4(line);
- int cval;
+ int32 cval;
if (_drawGouraud) {
// Give each vertex a seperate colour
// Compute the colour scaling and clip it
@@ -1630,20 +1630,20 @@ void drawGUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
}
// Flat, Textured, Lit Triangles
-void drawFTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal) {
+void drawFTL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal) {
SVECTOR *n0;
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
- // u_int num = min( n, 10 ); // do a maximum of 10 polygons
- u_int num = n;
- u_short uu0, uu1, uu2;
- u_short vv0, vv1, vv2;
+ // uint32 num = min( n, 10 ); // do a maximum of 10 polygons
+ uint32 num = n;
+ uint16 uu0, uu1, uu2;
+ uint16 vv0, vv1, vv2;
uint32 tmp;
- u_char ctmp;
+ uint8 ctmp;
int32 p, flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0, z1, z2;
SVECTORPC sxy0, sxy1, sxy2, stemp;
@@ -1671,16 +1671,16 @@ void drawFTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
// v0 | n0
// v2 | v1
uv0 = *pPoly++;
- vv0 = (u_short)((uv0 >> 16) & 0xFFFF);
- uu0 = (u_short)(uv0 & 0xFFFF);
+ vv0 = (uint16)((uv0 >> 16) & 0xFFFF);
+ uu0 = (uint16)(uv0 & 0xFFFF);
uv1 = *pPoly++;
- vv1 = (u_short)((uv1 >> 16) & 0xFFFF);
- uu1 = (u_short)(uv1 & 0xFFFF);
+ vv1 = (uint16)((uv1 >> 16) & 0xFFFF);
+ uu1 = (uint16)(uv1 & 0xFFFF);
uv2 = *pPoly++;
- vv2 = (u_short)((uv2 >> 16) & 0xFFFF);
- uu2 = (u_short)(uv2 & 0xFFFF);
+ vv2 = (uint16)((uv2 >> 16) & 0xFFFF);
+ uu2 = (uint16)(uv2 & 0xFFFF);
tmp = *pPoly++;
v0 = pVertex + (tmp >> 16);
@@ -1757,9 +1757,9 @@ void drawFTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
// so should be drawn in front of wireframe triangles
if ((_drawNormals) && ((selFace == i) || (selFace > 65536))) {
// Do coord transform on the scaled normal vectors + v0
- sn0.vx = (short)(v0->vx + (-n0->vx >> _normalScale));
- sn0.vy = (short)(v0->vy + (-n0->vy >> _normalScale));
- sn0.vz = (short)(v0->vz + (-n0->vz >> _normalScale));
+ sn0.vx = (int16)(v0->vx + (-n0->vx >> _normalScale));
+ sn0.vy = (int16)(v0->vy + (-n0->vy >> _normalScale));
+ sn0.vz = (int16)(v0->vz + (-n0->vz >> _normalScale));
// z0 = RotTransPers( &sn0, &sxyn0, &p, &flag );
gte_RotTransPers_pc(&sn0, &sxyn0, &p, &flag, &z0);
// Normal 0
@@ -1791,7 +1791,7 @@ void drawFTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
if ((_drawWfrm) || (selFace == i)) {
// Draw a wireframe that responds to lighting
if (_drawLit) {
- int cval;
+ int32 cval;
LINE_G4 *line = (LINE_G4 *)drawpacket;
setLineG4(line);
// Compute the colour scaling and clip it
@@ -1944,7 +1944,7 @@ void drawFTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
}
// Gouraud, Textured, Lit Triangles
-void drawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal) {
+void drawGTL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal) {
SVECTOR *n0;
SVECTOR *n1;
SVECTOR *n2;
@@ -1953,14 +1953,14 @@ void drawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
SVECTORPC *v2;
SVECTOR *ntemp;
- // u_int num = min( n, 10 ); // do a maximum of 10 polygons
- u_int num = n;
- u_short uu0, uu1, uu2;
- u_short vv0, vv1, vv2;
+ // uint32 num = min( n, 10 ); // do a maximum of 10 polygons
+ uint32 num = n;
+ uint16 uu0, uu1, uu2;
+ uint16 vv0, vv1, vv2;
uint32 tmp;
- u_char ctmp;
+ uint8 ctmp;
int32 p, flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0, z1, z2;
SVECTORPC sxy0, sxy1, sxy2, stemp;
@@ -1986,16 +1986,16 @@ void drawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
// v1 | n1
// v2 | n2
uv0 = *pPoly++;
- vv0 = (u_short)((uv0 >> 16) & 0xFFFF);
- uu0 = (u_short)(uv0 & 0xFFFF);
+ vv0 = (uint16)((uv0 >> 16) & 0xFFFF);
+ uu0 = (uint16)(uv0 & 0xFFFF);
uv1 = *pPoly++;
- vv1 = (u_short)((uv1 >> 16) & 0xFFFF);
- uu1 = (u_short)(uv1 & 0xFFFF);
+ vv1 = (uint16)((uv1 >> 16) & 0xFFFF);
+ uu1 = (uint16)(uv1 & 0xFFFF);
uv2 = *pPoly++;
- vv2 = (u_short)((uv2 >> 16) & 0xFFFF);
- uu2 = (u_short)(uv2 & 0xFFFF);
+ vv2 = (uint16)((uv2 >> 16) & 0xFFFF);
+ uu2 = (uint16)(uv2 & 0xFFFF);
tmp = *pPoly++;
v0 = pVertex + (tmp >> 16);
@@ -2073,7 +2073,7 @@ void drawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
// Do the full gouraud computation
// NormalColorCol3( n0, n1, n2, &rgbIn, &rgb0, &rgb1, &rgb2 );
LIGHTPOLYGON3(n0, n1, n2, &rgbIn, &rgb0, &rgb1, &rgb2);
- int cval;
+ int32 cval;
if (!_drawGouraud) {
// For flat shading mode take the average RGB for the face
@@ -2100,15 +2100,15 @@ void drawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
// so should be drawn in front of wireframe triangles
if ((_drawNormals) && ((selFace == i) || (selFace > 65536))) {
// Do coord transform on the scaled normal vectors + v0
- sn0.vx = (short)(v0->vx + (-n0->vx >> _normalScale));
- sn0.vy = (short)(v0->vy + (-n0->vy >> _normalScale));
- sn0.vz = (short)(v0->vz + (-n0->vz >> _normalScale));
- sn1.vx = (short)(v1->vx + (-n1->vx >> _normalScale));
- sn1.vy = (short)(v1->vy + (-n1->vy >> _normalScale));
- sn1.vz = (short)(v1->vz + (-n1->vz >> _normalScale));
- sn2.vx = (short)(v2->vx + (-n2->vx >> _normalScale));
- sn2.vy = (short)(v2->vy + (-n2->vy >> _normalScale));
- sn2.vz = (short)(v2->vz + (-n2->vz >> _normalScale));
+ sn0.vx = (int16)(v0->vx + (-n0->vx >> _normalScale));
+ sn0.vy = (int16)(v0->vy + (-n0->vy >> _normalScale));
+ sn0.vz = (int16)(v0->vz + (-n0->vz >> _normalScale));
+ sn1.vx = (int16)(v1->vx + (-n1->vx >> _normalScale));
+ sn1.vy = (int16)(v1->vy + (-n1->vy >> _normalScale));
+ sn1.vz = (int16)(v1->vz + (-n1->vz >> _normalScale));
+ sn2.vx = (int16)(v2->vx + (-n2->vx >> _normalScale));
+ sn2.vy = (int16)(v2->vy + (-n2->vy >> _normalScale));
+ sn2.vz = (int16)(v2->vz + (-n2->vz >> _normalScale));
// z0 = RotTransPers3( &sn0, &sn1, &sn2,
// &sxyn0, &sxyn1, &sxyn2, &p, &flag );
gte_RotTransPers3_pc(&sn0, &sn1, &sn2, &sxyn0, &sxyn1, &sxyn2, &p, &flag, &z0);
@@ -2189,7 +2189,7 @@ void drawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
if (_drawLit) {
LINE_G4 *line = (LINE_G4 *)drawpacket;
setLineG4(line);
- int cval;
+ int32 cval;
if (_drawGouraud) {
// Give each vertex a seperate colour
// Compute the colour scaling and clip it
@@ -2494,15 +2494,15 @@ void drawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *p
// draw backfacing triangles as well
// the colour is set by a global variable
-void drawTRI3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
+void drawTRI3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
- // u_int num = min( n, 10 ); // do a maximum of 10 polygons
- u_int num = n;
+ // uint32 num = min( n, 10 ); // do a maximum of 10 polygons
+ uint32 num = n;
int32 p, flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0, z1, z2;
SVECTORPC sxy0, sxy1, sxy2, stemp;
@@ -2625,13 +2625,13 @@ void drawTRI3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
#endif // #if CD_MODE == 0
// Flat, Un-Textured, Self-Luminous, triangles
-void fastDrawFUS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
+void fastDrawFUS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
int32 flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0;
SVECTORPC sxy0, sxy1, sxy2;
@@ -2712,14 +2712,14 @@ void fastDrawFUS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
}
// Fast: no options, Gouraud, Un-Textured, Self-Luminous, triangles
-void fastDrawGUS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
+void fastDrawGUS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
uint32 tmp;
int32 flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0;
SVECTORPC sxy0, sxy1, sxy2;
@@ -2812,16 +2812,16 @@ void fastDrawGUS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
}
// Fast: no options, Flat, Textured, Self-Luminous Triangles
-void fastDrawFTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
+void fastDrawFTS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
- u_short uu0, uu1, uu2;
- u_short vv0, vv1, vv2;
+ uint16 uu0, uu1, uu2;
+ uint16 vv0, vv1, vv2;
uint32 tmp;
int32 flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0;
SVECTORPC sxy0, sxy1, sxy2;
@@ -2854,16 +2854,16 @@ void fastDrawFTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
}
uv0 = *pPoly++;
- vv0 = (u_short)((uv0 >> 16) & 0xFFFF);
- uu0 = (u_short)(uv0 & 0xFFFF);
+ vv0 = (uint16)((uv0 >> 16) & 0xFFFF);
+ uu0 = (uint16)(uv0 & 0xFFFF);
uv1 = *pPoly++;
- vv1 = (u_short)((uv1 >> 16) & 0xFFFF);
- uu1 = (u_short)(uv1 & 0xFFFF);
+ vv1 = (uint16)((uv1 >> 16) & 0xFFFF);
+ uu1 = (uint16)(uv1 & 0xFFFF);
uv2 = *pPoly++;
- vv2 = (u_short)((uv2 >> 16) & 0xFFFF);
- uu2 = (u_short)(uv2 & 0xFFFF);
+ vv2 = (uint16)((uv2 >> 16) & 0xFFFF);
+ uu2 = (uint16)(uv2 & 0xFFFF);
tmp = *pPoly++;
v0 = pVertex + (tmp & 0xFFFF);
@@ -2925,16 +2925,16 @@ void fastDrawFTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
}
// Fast: no options, Gouraud, Textured, Self-Luminous Triangles
-void fastDrawGTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
+void fastDrawGTS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
- u_short uu0, uu1, uu2;
- u_short vv0, vv1, vv2;
+ uint16 uu0, uu1, uu2;
+ uint16 vv0, vv1, vv2;
uint32 tmp;
int32 flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0;
SVECTORPC sxy0, sxy1, sxy2;
@@ -2972,16 +2972,16 @@ void fastDrawGTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
}
uv0 = *pPoly++;
- vv0 = (u_short)((uv0 >> 16) & 0xFFFF);
- uu0 = (u_short)(uv0 & 0xFFFF);
+ vv0 = (uint16)((uv0 >> 16) & 0xFFFF);
+ uu0 = (uint16)(uv0 & 0xFFFF);
uv1 = *pPoly++;
- vv1 = (u_short)((uv1 >> 16) & 0xFFFF);
- uu1 = (u_short)(uv1 & 0xFFFF);
+ vv1 = (uint16)((uv1 >> 16) & 0xFFFF);
+ uu1 = (uint16)(uv1 & 0xFFFF);
uv2 = *pPoly++;
- vv2 = (u_short)((uv2 >> 16) & 0xFFFF);
- uu2 = (u_short)(uv2 & 0xFFFF);
+ vv2 = (uint16)((uv2 >> 16) & 0xFFFF);
+ uu2 = (uint16)(uv2 & 0xFFFF);
tmp = *pPoly++;
v0 = pVertex + (tmp & 0xFFFF);
@@ -3048,14 +3048,14 @@ void fastDrawGTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
}
// Fast: no options, Flat, Un-Textured, Lit, triangles
-void fastDrawFUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal) {
+void fastDrawFUL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal) {
SVECTOR *n0;
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
int32 flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0;
SVECTORPC sxy0, sxy1, sxy2;
@@ -3138,7 +3138,7 @@ void fastDrawFUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTO
}
// Fast: no options, Gouraud, Un-Textured, Lit, triangles
-void fastDrawGUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal) {
+void fastDrawGUL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal) {
SVECTOR *n0;
SVECTOR *n1;
SVECTOR *n2;
@@ -3148,7 +3148,7 @@ void fastDrawGUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTO
uint32 tmp;
int32 flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0;
SVECTORPC sxy0, sxy1, sxy2;
@@ -3246,17 +3246,17 @@ void fastDrawGUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTO
//------------------------------------------------------------------------
// Fast: no options, Flat, Textured, Lit Triangles
-void fastDrawFTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal) {
+void fastDrawFTL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal) {
SVECTOR *n0;
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
- u_short uu0, uu1, uu2;
- u_short vv0, vv1, vv2;
+ uint16 uu0, uu1, uu2;
+ uint16 vv0, vv1, vv2;
uint32 tmp;
int32 flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0;
SVECTORPC sxy0, sxy1, sxy2;
@@ -3282,16 +3282,16 @@ void fastDrawFTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTO
// v0 | n0
// v2 | v1
uv0 = *pPoly++;
- vv0 = (u_short)((uv0 >> 16) & 0xFFFF);
- uu0 = (u_short)(uv0 & 0xFFFF);
+ vv0 = (uint16)((uv0 >> 16) & 0xFFFF);
+ uu0 = (uint16)(uv0 & 0xFFFF);
uv1 = *pPoly++;
- vv1 = (u_short)((uv1 >> 16) & 0xFFFF);
- uu1 = (u_short)(uv1 & 0xFFFF);
+ vv1 = (uint16)((uv1 >> 16) & 0xFFFF);
+ uu1 = (uint16)(uv1 & 0xFFFF);
uv2 = *pPoly++;
- vv2 = (u_short)((uv2 >> 16) & 0xFFFF);
- uu2 = (u_short)(uv2 & 0xFFFF);
+ vv2 = (uint16)((uv2 >> 16) & 0xFFFF);
+ uu2 = (uint16)(uv2 & 0xFFFF);
tmp = *pPoly++;
v0 = pVertex + (tmp >> 16);
@@ -3356,7 +3356,7 @@ void fastDrawFTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTO
}
// Fast : no options : Gouraud, Textured, Lit Triangles
-void fastDrawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal) {
+void fastDrawGTL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal) {
SVECTOR *n0;
SVECTOR *n1;
SVECTOR *n2;
@@ -3364,14 +3364,14 @@ void fastDrawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTO
SVECTORPC *v1;
SVECTORPC *v2;
- u_short uu0;
- u_short uu1;
- u_short uu2;
- u_short vv0;
- u_short vv1;
- u_short vv2;
+ uint16 uu0;
+ uint16 uu1;
+ uint16 uu2;
+ uint16 vv0;
+ uint16 vv1;
+ uint16 vv2;
int32 flag;
- u_int i;
+ uint32 i;
int32 z0;
uint32 uv0;
uint32 uv1;
@@ -3382,17 +3382,17 @@ void fastDrawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTO
SVECTORPC sxy0;
SVECTORPC sxy1;
SVECTORPC sxy2;
- int pad0;
- int pad1;
- int pad2;
+ int32 pad0;
+ int32 pad1;
+ int32 pad2;
// Base colour for gouraud shading computation
// Could easily be specified per polygon
CVECTOR rgbIn = {128, 128, 128, 0};
CVECTOR rgb0, rgb1, rgb2;
- int my_minUsedZpos;
- int my_maxUsedZpos;
+ int32 my_minUsedZpos;
+ int32 my_maxUsedZpos;
my_minUsedZpos = minUsedZpos;
my_maxUsedZpos = maxUsedZpos;
@@ -3412,16 +3412,16 @@ void fastDrawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTO
// v2 | n2
uv0 = *(pPoly++);
- vv0 = (u_short)((uv0 >> 16) & 0xFFFF);
- uu0 = (u_short)(uv0 & 0xFFFF);
+ vv0 = (uint16)((uv0 >> 16) & 0xFFFF);
+ uu0 = (uint16)(uv0 & 0xFFFF);
uv1 = *(pPoly++);
- vv1 = (u_short)((uv1 >> 16) & 0xFFFF);
- uu1 = (u_short)(uv1 & 0xFFFF);
+ vv1 = (uint16)((uv1 >> 16) & 0xFFFF);
+ uu1 = (uint16)(uv1 & 0xFFFF);
uv2 = *(pPoly++);
- vv2 = (u_short)((uv2 >> 16) & 0xFFFF);
- uu2 = (u_short)(uv2 & 0xFFFF);
+ vv2 = (uint16)((uv2 >> 16) & 0xFFFF);
+ uu2 = (uint16)(uv2 & 0xFFFF);
vt0 = *(pPoly++);
v0 = (pVertex + (vt0 >> 16));
@@ -3666,13 +3666,13 @@ void drawSolidBboxPC(SVECTOR *scrn, CVECTOR *rgbIn) {
// Simple flat untextured triangles
// draw backfacing triangles as well
// the colour is set by a global variable
-void fastDrawTRI3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex) {
+void fastDrawTRI3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
SVECTORPC *v1;
SVECTORPC *v2;
int32 flag;
- u_int i;
+ uint32 i;
uint32 *pPoly;
int32 z0;
SVECTORPC sxy0, sxy1, sxy2, stemp;
diff --git a/engines/icb/drawpoly_pc.h b/engines/icb/drawpoly_pc.h
index 2bec433e02..03ab8e780c 100644
--- a/engines/icb/drawpoly_pc.h
+++ b/engines/icb/drawpoly_pc.h
@@ -33,10 +33,10 @@
namespace ICB {
-extern unsigned int selFace;
+extern uint32 selFace;
extern CVECTOR unlitPoly;
-extern unsigned int _drawBface;
-extern unsigned int deadObject;
+extern uint32 _drawBface;
+extern uint32 deadObject;
#if CD_MODE == 0
@@ -44,60 +44,60 @@ extern unsigned int deadObject;
void drawSolidBboxPC(SVECTOR *scrn, CVECTOR *rgbIn);
// Debug : Flat, Un-Textured, Self-Luminous, triangles
-void drawFUS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex);
+void drawFUS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex);
// Debug : Gouraud, Un-Textured, Self-Luminous, triangles
-void drawGUS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex);
+void drawGUS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex);
// Debug : Flat, Textured, Self-Luminous Triangles
-void drawFTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex);
+void drawFTS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex);
// Debug : Gouraud, Textured, Self-Luminous Triangles
-void drawGTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex);
+void drawGTS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex);
// Debug : Flat, Un-Textured, Lit, triangles
-void drawFUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal);
+void drawFUL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal);
// Debug : Gouraud, Un-Textured, Lit, triangles
-void drawGUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal);
+void drawGUL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal);
// Debug : Flat, Textured, Lit Triangles
-void drawFTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal);
+void drawFTL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal);
// Debug : Gouraud, Textured, Lit Triangles
-void drawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal);
+void drawGTL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal);
// Debug : Simple Flat, Un-Textured triangles with no colour in them
-void drawTRI3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex);
+void drawTRI3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex);
#endif // #if CD_MODE == 0
// Optimised : Flat, Un-Textured, Self-Luminous, triangles
-void fastDrawFUS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex);
+void fastDrawFUS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex);
// Optimised : Gouraud, Un-Textured, Self-Luminous, triangles
-void fastDrawGUS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex);
+void fastDrawGUS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex);
// Optimised : Flat, Textured, Self-Luminous Triangles
-void fastDrawFTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex);
+void fastDrawFTS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex);
// Optimised : Gouraud, Textured, Self-Luminous Triangles
-void fastDrawGTS3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex);
+void fastDrawGTS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex);
// Optimised : Flat, Un-Textured, Lit, triangles
-void fastDrawFUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal);
+void fastDrawFUL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal);
// Optimised : Gouraud, Un-Textured, Lit, triangles
-void fastDrawGUL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal);
+void fastDrawGUL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal);
// Optimised : Flat, Textured, Lit Triangles
-void fastDrawFTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal);
+void fastDrawFTL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal);
// Optimised : Gouraud, Textured, Lit Triangles
-void fastDrawGTL3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex, SVECTOR *pNormal);
+void fastDrawGTL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *pNormal);
// Optimised : Simple Flat, Un-Textured triangles with no colour in them
-void fastDrawTRI3PC(uint32 *polyStart, const u_int n, SVECTORPC *pVertex);
+void fastDrawTRI3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex);
} // End of namespace ICB
diff --git a/engines/icb/floors.cpp b/engines/icb/floors.cpp
index 781e05ff7e..09f7440268 100644
--- a/engines/icb/floors.cpp
+++ b/engines/icb/floors.cpp
@@ -81,7 +81,7 @@ void _floor_world::___init() {
// get some useful stats
total_heights = 0; // set to 0
- int nMissing = 0;
+ int32 nMissing = 0;
for (j = 0; j < total_floors; j++) {
floor = (_floor *)floors->Fetch_item_by_number(j);
diff --git a/engines/icb/fn_animation.cpp b/engines/icb/fn_animation.cpp
index 9902d4f4a7..ff4512b53a 100644
--- a/engines/icb/fn_animation.cpp
+++ b/engines/icb/fn_animation.cpp
@@ -171,7 +171,7 @@ mcodeFunctionReturnCodes _game_session::fn_face_camera(int32 &, int32 *params) {
// ensures actual pan is what we are looking at
mcodeFunctionReturnCodes _game_session::fn_set_feet_to_pan(int32 &, int32 *) {
// we face straight ahead
- I->lookBone.boneTarget.vz = (short)(0);
+ I->lookBone.boneTarget.vz = (int16)(0);
// and our pan is set to the looking_pan
L->pan = M->looking_pan;
@@ -710,7 +710,7 @@ mcodeFunctionReturnCodes _game_session::fn_play_generic_anim(int32 &, int32 *par
PXanim *anim = (PXanim *)rs_anims->Res_open(I->get_info_name(L->cur_anim_type), I->info_name_hash[L->cur_anim_type], I->base_path, I->base_path_hash); //
// last frame is currently displayed?
- if ((int)(L->anim_pc + M->anim_speed) >= (anim->frame_qty - 1)) {
+ if ((int32)(L->anim_pc + M->anim_speed) >= (anim->frame_qty - 1)) {
L->looping = FALSE8;
return (IR_CONT);
}
@@ -783,7 +783,7 @@ mcodeFunctionReturnCodes _game_session::fn_easy_play_generic_anim(int32 &, int32
PXanim *anim = (PXanim *)rs_anims->Res_open(I->get_info_name(L->cur_anim_type), I->info_name_hash[L->cur_anim_type], I->base_path, I->base_path_hash);
// last frame is currently displayed?
- if ((int)(L->anim_pc + M->anim_speed) >= (anim->frame_qty - 1)) {
+ if ((int32)(L->anim_pc + M->anim_speed) >= (anim->frame_qty - 1)) {
L->looping = FALSE8;
return (IR_CONT);
}
@@ -850,7 +850,7 @@ mcodeFunctionReturnCodes _game_session::fn_easy_play_generic_anim_with_pan(int32
PXanim *anim = (PXanim *)rs_anims->Res_open(I->get_info_name(L->cur_anim_type), I->info_name_hash[L->cur_anim_type], I->base_path, I->base_path_hash); //
// last frame is currently displayed?
- if ((int)(L->anim_pc + 1) == (anim->frame_qty - 1)) {
+ if ((int32)(L->anim_pc + 1) == (anim->frame_qty - 1)) {
L->looping = FALSE8;
return (IR_CONT);
}
@@ -910,7 +910,7 @@ mcodeFunctionReturnCodes _game_session::fn_easy_play_custom_anim_with_pan(int32
PXanim *anim = (PXanim *)rs_anims->Res_open(I->get_info_name(L->cur_anim_type), I->info_name_hash[L->cur_anim_type], I->base_path, I->base_path_hash); //
// last frame is currently displayed?
- if ((int)(L->anim_pc + 1) == (anim->frame_qty - 1)) {
+ if ((int32)(L->anim_pc + 1) == (anim->frame_qty - 1)) {
L->looping = FALSE8;
return (IR_CONT);
@@ -1325,7 +1325,7 @@ mcodeFunctionReturnCodes _game_session::fn_new_apply_bullet(int32 &, int32 *para
// 0 - nothing on screen
// 1 - normal light/muzzleflash/cartridge case
// default is 1
- int shotType = object->GetIntegerValueOrDefault("gun_effects", 1);
+ int32 shotType = object->GetIntegerValueOrDefault("gun_effects", 1);
// if mega then do dynamic light (only if shotType isnt 0
if ((logic_structs[cur_id]->image_type == VOXEL) && (shotType == 1)) {
@@ -1355,7 +1355,7 @@ mcodeFunctionReturnCodes _game_session::fn_new_apply_bullet(int32 &, int32 *para
rnd = g_icb->getRandomSource()->getRandomNumber(100 - 1);
// we didn't miss
- int missed = 0;
+ int32 missed = 0;
// user hit chance of 0 means always miss
if (params[1]) {
diff --git a/engines/icb/fn_fx_pc.cpp b/engines/icb/fn_fx_pc.cpp
index 88cbaf6573..4bdbcc5bb4 100644
--- a/engines/icb/fn_fx_pc.cpp
+++ b/engines/icb/fn_fx_pc.cpp
@@ -37,17 +37,17 @@ mcodeFunctionReturnCodes fx_generic_fade(int32 &result, int32 *params) { return
mcodeFunctionReturnCodes _game_session::fx_narrow_screen(int32 &, int32 *params) {
/* Parameters */
- int mode = params[0]; // border mode
- int red = params[1]; // red component of cover
- int green = params[2]; // green component of cover
- int blue = params[3]; // blue component of cover
- int percent = params[4]; // 0 - 100 percentage screen to cover
- int cycles = params[5]; // number of cycles to shirnk over
+ int32 mode = params[0]; // border mode
+ int32 red = params[1]; // red component of cover
+ int32 green = params[2]; // green component of cover
+ int32 blue = params[3]; // blue component of cover
+ int32 percent = params[4]; // 0 - 100 percentage screen to cover
+ int32 cycles = params[5]; // number of cycles to shirnk over
/* Function Storage */
- static int heightStep = 0;
- static int alphaStep = 0;
- static int cycleCount = 0;
+ static int32 heightStep = 0;
+ static int32 alphaStep = 0;
+ static int32 cycleCount = 0;
// Get access to the border rectangle
LRECT &border = surface_manager->BorderRect();
@@ -57,7 +57,7 @@ mcodeFunctionReturnCodes _game_session::fx_narrow_screen(int32 &, int32 *params)
cycles = 1;
// Calculate the fxtarget screen coverage
- int fxtarget = (480 * percent) / 200;
+ int32 fxtarget = (480 * percent) / 200;
if (cycleCount == 0) {
// First time through
@@ -153,18 +153,18 @@ mcodeFunctionReturnCodes _game_session::fx_narrow_screen(int32 &, int32 *params)
// where on/off is equiverlant to to/from
mcodeFunctionReturnCodes _game_session::fx_generic_fade(int32 &, int32 *params) {
- int mode = params[0];
- int onOff = params[1];
- int fromRed = params[2];
- int fromGreen = params[3];
- int fromBlue = params[4];
- int toRed = params[5];
- int toGreen = params[6];
- int toBlue = params[7];
- int cycles = params[8];
+ int32 mode = params[0];
+ int32 onOff = params[1];
+ int32 fromRed = params[2];
+ int32 fromGreen = params[3];
+ int32 fromBlue = params[4];
+ int32 toRed = params[5];
+ int32 toGreen = params[6];
+ int32 toBlue = params[7];
+ int32 cycles = params[8];
/* Function Storage */
- static int alphaStep = 0;
+ static int32 alphaStep = 0;
// Is this the first time through ?
if (alphaStep == 0) {
@@ -190,7 +190,7 @@ mcodeFunctionReturnCodes _game_session::fx_generic_fade(int32 &, int32 *params)
}
// Increment / Decrement the alpha value
- int newAlpha = surface_manager->FadeAlpha();
+ int32 newAlpha = surface_manager->FadeAlpha();
if (onOff) {
// Fading in
newAlpha += alphaStep;
diff --git a/engines/icb/fn_interact.cpp b/engines/icb/fn_interact.cpp
index 03d549f844..e7e5e968e8 100644
--- a/engines/icb/fn_interact.cpp
+++ b/engines/icb/fn_interact.cpp
@@ -446,7 +446,7 @@ mcodeFunctionReturnCodes _game_session::Core_prop_interact(int32 & /*result*/, i
PXanim *pAnim = (PXanim *)rs_anims->Res_open(I->get_info_name(L->cur_anim_type), I->info_name_hash[L->cur_anim_type], I->base_path, I->base_path_hash); //
// last frame is currently displayed?
- if ((int)(L->anim_pc + M->anim_speed) >= (pAnim->frame_qty - 1)) {
+ if ((int32)(L->anim_pc + M->anim_speed) >= (pAnim->frame_qty - 1)) {
L->looping = FALSE8;
M->reverse_route = FALSE8;
diff --git a/engines/icb/fn_sound.cpp b/engines/icb/fn_sound.cpp
index 674ed96d6d..150c67dcb2 100644
--- a/engines/icb/fn_sound.cpp
+++ b/engines/icb/fn_sound.cpp
@@ -57,7 +57,7 @@ mcodeFunctionReturnCodes fn_set_sfx(int32 &result, int32 *params) { return (MS->
// open 0
// close 1
mcodeFunctionReturnCodes _game_session::fn_set_sfx(int32 &, int32 *params) {
- int whichVar;
+ int32 whichVar;
const char *name = (const char *)MemoryUtil::resolvePtr(params[0]);
const char *sfx = (const char *)MemoryUtil::resolvePtr(params[1]);
@@ -172,7 +172,7 @@ mcodeFunctionReturnCodes _game_session::fn_stop_sfx(int32 &, int32 *params) {
strcpy(tempSnd, sub + strlen("::"));
- int obj = MS->objects->Fetch_item_number_by_name(tempObj);
+ int32 obj = MS->objects->Fetch_item_number_by_name(tempObj);
if (obj != -1)
RemoveRegisteredSound(obj, tempSnd);
diff --git a/engines/icb/fn_sting_pc.cpp b/engines/icb/fn_sting_pc.cpp
index 3aeee21db2..92041b76cf 100644
--- a/engines/icb/fn_sting_pc.cpp
+++ b/engines/icb/fn_sting_pc.cpp
@@ -52,7 +52,7 @@ mcodeFunctionReturnCodes speak_stop_music(int32 &result, int32 *params) { return
mcodeFunctionReturnCodes speak_end_music(int32 &result, int32 *params) { return (MS->speak_end_music(result, params)); }
// Global data for this file
-int inSpeechMusicAllocated = 0;
+int32 inSpeechMusicAllocated = 0;
// Useful prototype
bool8 DoesClusterContainFile(const char *clustername, uint32 hash_to_find, uint32 &fileoffset, uint32 &filesize);
@@ -84,7 +84,7 @@ void LoadSting(uint32 looking_for_hash) {
// If we've allocated some emulated psx memory
if (inSpeechMusicAllocated != 0) {
- if ((int)file_size > inSpeechMusicAllocated)
+ if ((int32)file_size > inSpeechMusicAllocated)
Fatal_error("Cannot load music as it's size exceeds that given to speak_allocate_music()!");
}
@@ -166,8 +166,8 @@ mcodeFunctionReturnCodes _game_session::fn_stop_sting(int32 &, int32 *) {
}
mcodeFunctionReturnCodes _game_session::speak_allocate_music(int32 &, int32 *params) {
- int seconds = (int)params[0];
- int hertz = (int)params[1];
+ int32 seconds = (int32)params[0];
+ int32 hertz = (int32)params[1];
// Hardcode this puupy to match the psx for now
hertz = 16000;
diff --git a/engines/icb/footstep.cpp b/engines/icb/footstep.cpp
index 58e1ad929e..3de3017f4d 100644
--- a/engines/icb/footstep.cpp
+++ b/engines/icb/footstep.cpp
@@ -83,7 +83,7 @@ mcodeFunctionReturnCodes _game_session::fn_set_floor_footstep_sfx(int32 &, int32
// fn_set_footstep_weight(weight);
// set weight of mega for footstep: % of cords weight alowable 0-200
mcodeFunctionReturnCodes _game_session::fn_set_footstep_weight(int32 &, int32 *params) {
- int w;
+ int32 w;
w = params[0];
@@ -162,7 +162,7 @@ void _game_session::UpdateFootstep() {
// do the footstep
if (step) {
// volume
- int vol;
+ int32 vol;
// volume from weight (0-128, standard is 64)
vol = (M->footstep_weight * 63) / 100;
@@ -189,8 +189,8 @@ void _game_session::UpdateFootstep() {
else {
// try and find our floor in the overrides...
uint32 sfx = 0;
- int floor = L->owner_floor_rect;
- int i = 0;
+ int32 floor = L->owner_floor_rect;
+ int32 i = 0;
// loop through or until we have a sfx
while ((i < numFloorFootSfx) && (sfx == 0)) {
diff --git a/engines/icb/function.cpp b/engines/icb/function.cpp
index 6e27d474c2..0f7c12f9c5 100644
--- a/engines/icb/function.cpp
+++ b/engines/icb/function.cpp
@@ -793,7 +793,7 @@ mcodeFunctionReturnCodes _game_session::fn_call_socket(int32 &result, int32 *par
// params 0 ascii name of target object
// 1 ascii name of socket script
- int retval;
+ int32 retval;
uint32 script_hash;
const char *target_object_name = (const char *)MemoryUtil::resolvePtr(params[0]);
@@ -895,7 +895,7 @@ bool8 _game_session::Call_socket(uint32 id, const char *script, int32 *retval) {
// get the address of the script we want to run
const char *pc = (const char *)scripts->Try_fetch_item_by_hash(socket_object->GetScriptNameFullHash(k));
- int result = static_cast<int>(*retval);
+ int32 result = static_cast<int>(*retval);
// run the script - pass its object so vars can be accessed
RunScript(pc, socket_object, &result);
@@ -1960,7 +1960,7 @@ mcodeFunctionReturnCodes _game_session::fn_lib_lift_chord_and_chi(int32 &result,
uint32 lift = 0; // lift number in platform list
bool8 hit = FALSE8;
uint32 j = 0;
- static int issued_warning = FALSE8;
+ static int32 issued_warning = FALSE8;
const char *nico_name = (const char *)MemoryUtil::resolvePtr(params[0]);
if (!prev_save_state) { // could not save last go - then cant operate lift either. Player is in a private script
@@ -2056,10 +2056,10 @@ mcodeFunctionReturnCodes _game_session::fn_lift2_process(int32 &result, int32 *p
bool8 has_platform = FALSE8;
PXreal lifty = REAL_ZERO;
uint32 lift = 0; // lift number in platform list
- static int issued_warning = FALSE8;
+ static int32 issued_warning = FALSE8;
const char *nico_name = (const char *)MemoryUtil::resolvePtr(params[0]);
- static int inited = FALSE8;
+ static int32 inited = FALSE8;
if (!inited) {
for (j = 0; j < MAX_session_objects; j++)
lift2s[j].init = 0;
diff --git a/engines/icb/game_script.cpp b/engines/icb/game_script.cpp
index 7e23772e2a..d40eeb2ee1 100644
--- a/engines/icb/game_script.cpp
+++ b/engines/icb/game_script.cpp
@@ -96,7 +96,7 @@ void _game_script::Run_to_bookmark(const char *name) {
char p1[ENGINE_STRING_LEN];
// reset program counter (but keep demo flag!)
- int demo = g_globalScriptVariables.GetVariable("demo");
+ int32 demo = g_globalScriptVariables.GetVariable("demo");
Restart_game_script();
g_globalScriptVariables.SetVariable("demo", demo);
diff --git a/engines/icb/general_npc_animation.cpp b/engines/icb/general_npc_animation.cpp
index e3c377e1f2..5b52a327ec 100644
--- a/engines/icb/general_npc_animation.cpp
+++ b/engines/icb/general_npc_animation.cpp
@@ -533,14 +533,14 @@ bool8 _game_session::Calc_target_pan(PXreal x, PXreal z, PXreal x2, PXreal z2) {
L->anim_pc = 0; // legal pc for first frame in turn anim - this needs thought
// we face straight ahead
- I->lookBone.boneTarget.vz = (short)(0);
+ I->lookBone.boneTarget.vz = (int16)(0);
return (TRUE8);
} else {
// face towards object or whatever with upper body
I->lookBone.boneNumber = 1;
I->lookBone.boneSpeed = 128;
- I->lookBone.boneTarget.vz = (short)(diff * (4096 / FULL_TURN)); // on psx diff is 0-4096 (full_turn), so we want diff*1 = diff * (4096/4096)
+ I->lookBone.boneTarget.vz = (int16)(diff * (4096 / FULL_TURN)); // on psx diff is 0-4096 (full_turn), so we want diff*1 = diff * (4096/4096)
// on pc diff is 0-1 (full_turn), we we want diff*4096 = diff * (4096/1)
return (FALSE8);
@@ -586,7 +586,7 @@ bool8 _game_session::Calc_target_pan_no_bones(PXreal x, PXreal z, PXreal x2, PXr
L->anim_pc = 0; // legal pc for first frame in turn anim - this needs thought
// we face straight ahead
- I->lookBone.boneTarget.vz = (short)(0);
+ I->lookBone.boneTarget.vz = (int16)(0);
return (TRUE8);
} else {
@@ -689,7 +689,7 @@ void _game_session::Hard_start_single_anim(__mega_set_names next_anim) {
int32 _game_session::Soften_up_anim_file(__mega_set_names link, int32 diff) {
// pick best frame in passed anim compared to best so far passed in 'diff'
uint32 old_leg_pos;
- int j;
+ int32 j;
// Jake check the anim exists / make its name
ANIM_CHECK(L->cur_anim_type);
@@ -738,7 +738,7 @@ bool8 _game_session::Play_anim() {
PXanim *pAnim = (PXanim *)rs_anims->Res_open(I->get_info_name(L->cur_anim_type), I->info_name_hash[L->cur_anim_type], I->base_path, I->base_path_hash);
// last frame currently displayed?
- if ((int)(L->anim_pc + 1) == (pAnim->frame_qty - 1)) {
+ if ((int32)(L->anim_pc + 1) == (pAnim->frame_qty - 1)) {
// we displayed the last frame last cycle - so display first of new mode this cycle
// we may have been playing a link anim - so check for a new anim waiting in M->next_anim_type
if (M->next_anim_type == __NO_ANIM) {
@@ -818,7 +818,7 @@ bool8 _game_session::Play_anim_with_no_movement() {
PXanim *pAnim = (PXanim *)rs_anims->Res_open(I->get_info_name(L->cur_anim_type), I->info_name_hash[L->cur_anim_type], I->base_path, I->base_path_hash); //
// last frame currently displayed?
- if ((int)(L->anim_pc + 1) == (pAnim->frame_qty - 1)) {
+ if ((int32)(L->anim_pc + 1) == (pAnim->frame_qty - 1)) {
// we displayed the last frame last cycle - so display first of new mode this cycle
// we may have been playing a link anim - so check for a new anim waiting in M->next_anim_type
diff --git a/engines/icb/gfx/gfxstub.cpp b/engines/icb/gfx/gfxstub.cpp
index 20923386f7..7454a4437c 100644
--- a/engines/icb/gfx/gfxstub.cpp
+++ b/engines/icb/gfx/gfxstub.cpp
@@ -30,7 +30,7 @@
namespace ICB {
-int _selFace;
+int32 _selFace;
// Number of GPU packets to reserve
#define PACKETMAX 2900 * 4
@@ -48,7 +48,7 @@ GPUPACKET *drawpacketStart;
GPUPACKET *drawpacketEnd;
// Global double buffer index
-int drawBuf = 0;
+int32 drawBuf = 0;
// Global ot arrays and stuff
OT_tag *otarray[2];
@@ -109,7 +109,7 @@ void recoverFromOTcrash(void) {
void ResetZRange(void) {
// Reset the z-sorting values
nearClip = minUsedZpos - 100; // last used value -1m
- int dz = maxUsedZpos - nearClip;
+ int32 dz = maxUsedZpos - nearClip;
// Simple zones for otz_shift
if (dz < OTZ_ZONE1) // 1cm
otz_shift = 0;
diff --git a/engines/icb/gfx/gfxstub.h b/engines/icb/gfx/gfxstub.h
index c953989541..086084cdbe 100644
--- a/engines/icb/gfx/gfxstub.h
+++ b/engines/icb/gfx/gfxstub.h
@@ -46,8 +46,8 @@ namespace ICB {
// The emulation of VRAM : 16-bit pixels 1024x512 big
#define VRAM_WIDTH 1024
#define VRAM_HEIGHT 512
-extern u_short psxVRAM[VRAM_WIDTH * VRAM_HEIGHT];
-extern u_short psxTP;
+extern uint16 psxVRAM[VRAM_WIDTH * VRAM_HEIGHT];
+extern uint16 psxTP;
// Generic routines in gfxstub.cpp
void InitDrawing(void);
@@ -60,59 +60,59 @@ void startDrawing(void);
void endDrawing(void);
// Real graphic routines
-int DrawSprite(int x0, int y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, u_short u0, u_short v0, uint8 alpha, u_short z, void *tex);
+int32 DrawSprite(int32 x0, int32 y0, int16 w, int16 h, uint8 r0, uint8 g0, uint8 b0, uint16 u0, uint16 v0, uint8 alpha, uint16 z, void *tex);
// Single coloured rectangle
-int DrawTile(int x0, int y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, u_short z);
+int32 DrawTile(int32 x0, int32 y0, int16 w, int16 h, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, uint16 z);
// Single flat coloured line : 2 points, 1 colour
-int DrawLineF2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, u_short z);
+int32 DrawLineF2(int32 x0, int32 y0, int32 x1, int32 y1, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, uint16 z);
// two connected lines flat coloured : 3 points, 1 colour
-int DrawLineF3(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, u_short z);
+int32 DrawLineF3(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, uint16 z);
// three connected lines flat coloured : 4 points, 1 colour
-int DrawLineF4(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, u_short z);
+int32 DrawLineF4(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, uint16 z);
// Single gouraud coloured line : 2 points, 2 colours
-int DrawLineG2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 alpha, u_short z);
+int32 DrawLineG2(int32 x0, int32 y0, int32 x1, int32 y1, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 alpha, uint16 z);
// two connected lines gouraud coloured : 3 points, 3 colours
-int DrawLineG3(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, uint8 alpha, u_short z);
+int32 DrawLineG3(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, uint8 alpha, uint16 z);
// three connected lines gouraud coloured : 4 points, 4 colours
-int DrawLineG4(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, uint8 r3,
- uint8 g3, uint8 b3, uint8 alpha, u_short z);
+int32 DrawLineG4(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, uint8 r3,
+ uint8 g3, uint8 b3, uint8 alpha, uint16 z);
// Simple flat coloured triangle : 3 points, 1 colour
-int DrawFlatTriangle(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, u_short z);
+int32 DrawFlatTriangle(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, uint16 z);
// Simple flat coloured quad : 4 points, 1 colour
-int DrawFlatQuad(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, u_short z);
+int32 DrawFlatQuad(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, uint16 z);
// Simple gouraud coloured triangle : 3 points, 3 colours
-int DrawGouraudTriangle(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, uint8 alpha,
- u_short z);
+int32 DrawGouraudTriangle(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, uint8 alpha,
+ uint16 z);
// Simple gouraud coloured quad : 4 points, 4 colours
-int DrawGouraudQuad(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2,
- uint8 r3, uint8 g3, uint8 b3, uint8 alpha, u_short z);
+int32 DrawGouraudQuad(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2,
+ uint8 r3, uint8 g3, uint8 b3, uint8 alpha, uint16 z);
// Simple flat coloured triangle : 3 points, 1 colour, 3 UV's
-int DrawFlatTriangleTextured(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, uint8 g0, uint8 b0, u_short u0, u_short v0, u_short u1, u_short v1, u_short u2, u_short v2,
- uint8 alpha, u_short z, void *tex);
+int32 DrawFlatTriangleTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, uint8 r0, uint8 g0, uint8 b0, uint16 u0, uint16 v0, uint16 u1, uint16 v1, uint16 u2, uint16 v2,
+ uint8 alpha, uint16 z, void *tex);
// Simple flat coloured quad : 4 points, 1 colour, 4 UV's
-int DrawFlatQuadTextured(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint8 r0, uint8 g0, uint8 b0, u_short u0, u_short v0, u_short u1, u_short v1, u_short u2,
- u_short v2, u_short u3, u_short v3, uint8 alpha, u_short z, void *tex);
+int32 DrawFlatQuadTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 r0, uint8 g0, uint8 b0, uint16 u0, uint16 v0, uint16 u1, uint16 v1, uint16 u2,
+ uint16 v2, uint16 u3, uint16 v3, uint8 alpha, uint16 z, void *tex);
// Simple gouraud coloured triangle : 3 points, 3 colours
-int DrawGouraudTriangleTextured(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2,
- u_short u0, u_short v0, u_short u1, u_short v1, u_short u2, u_short v2, uint8 alpha, u_short z, void *tex);
+int32 DrawGouraudTriangleTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2,
+ uint16 u0, uint16 v0, uint16 u1, uint16 v1, uint16 u2, uint16 v2, uint8 alpha, uint16 z, void *tex);
// Simple gouraud coloured quad : 4 points, 4 colours
-int DrawGouraudQuadTextured(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2,
- uint8 b2, uint8 r3, uint8 g3, uint8 b3, u_short u0, u_short v0, u_short u1, u_short v1, u_short u2, u_short v2, u_short u3, u_short v3, uint8 alpha,
- u_short z, void *tex);
+int32 DrawGouraudQuadTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2,
+ uint8 b2, uint8 r3, uint8 g3, uint8 b3, uint16 u0, uint16 v0, uint16 u1, uint16 v1, uint16 u2, uint16 v2, uint16 u3, uint16 v3, uint8 alpha,
+ uint16 z, void *tex);
} // End of namespace ICB
diff --git a/engines/icb/gfx/gfxstub_dutch.cpp b/engines/icb/gfx/gfxstub_dutch.cpp
index 38405ba902..71df5cd7bb 100644
--- a/engines/icb/gfx/gfxstub_dutch.cpp
+++ b/engines/icb/gfx/gfxstub_dutch.cpp
@@ -32,38 +32,38 @@
namespace ICB {
typedef struct {
- int x0, x1;
- int count;
- int a0, r0, g0, b0;
- int a1, r1, g1, b1;
- int u0, v0;
- int u1, v1;
+ int32 x0, x1;
+ int32 count;
+ int32 a0, r0, g0, b0;
+ int32 a1, r1, g1, b1;
+ int32 u0, v0;
+ int32 u1, v1;
} span_t;
#define MAX_SCREEN_HEIGHT 4096
span_t spans[MAX_SCREEN_HEIGHT];
-#define GETBValue(rgb) ((u_char)(rgb))
-#define GETGValue(rgb) ((u_char)(((u_short)(rgb)) >> 8))
-#define GETRValue(rgb) ((u_char)((rgb) >> 16))
-#define GETAValue(rgb) ((u_char)((rgb) >> 24))
+#define GETBValue(rgb) ((uint8)(rgb))
+#define GETGValue(rgb) ((uint8)(((uint16)(rgb)) >> 8))
+#define GETRValue(rgb) ((uint8)((rgb) >> 16))
+#define GETAValue(rgb) ((uint8)((rgb) >> 24))
-extern int mip_map_level;
+extern int32 mip_map_level;
typedef struct {
char *pRGB;
- int RGBPitch;
- int RGBBytesPerPixel;
+ int32 RGBPitch;
+ int32 RGBBytesPerPixel;
char *pZ;
- int ZPitch;
- int ZBytesPerPixel;
+ int32 ZPitch;
+ int32 ZBytesPerPixel;
} MyRenderDevice;
MyRenderDevice myRenDev = {NULL, 0, 0, NULL, 0, 0};
RevRenderDevice *lastRevRenDev = NULL;
-int SetRenderDevice(RevRenderDevice *renderDev) {
+int32 SetRenderDevice(RevRenderDevice *renderDev) {
lastRevRenDev = NULL;
if (renderDev->RGBdata == NULL)
return 1;
@@ -90,13 +90,13 @@ int SetRenderDevice(RevRenderDevice *renderDev) {
TextureHandle myTexHan;
-int SetTextureState(TextureHandle *texture) {
+int32 SetTextureState(TextureHandle *texture) {
myTexHan = *texture;
return 0;
}
-int UnregisterTexture(TextureHandle *texture) {
- int i;
+int32 UnregisterTexture(TextureHandle *texture) {
+ int32 i;
for (i = 0; i < 9; i++)
if ((texture->pRGBA[i]) != NULL)
@@ -112,7 +112,7 @@ int UnregisterTexture(TextureHandle *texture) {
}
TextureHandle *RegisterTexture(const RevTexture *revInput) {
- int i;
+ int32 i;
TextureHandle *th = new TextureHandle();
th->w = revInput->width;
@@ -155,13 +155,13 @@ TextureHandle *RegisterTexture(const RevTexture *revInput) {
}
th->bpp = 1;
- th->palette = new u_int[256];
+ th->palette = new uint32[256];
for (i = 0; i < 256; i++)
th->palette[i] = revInput->palette[i];
- int size = th->w * th->h * th->bpp;
+ int32 size = th->w * th->h * th->bpp;
for (i = 0; i < 9; i++) {
- th->pRGBA[i] = new u_char[size];
+ th->pRGBA[i] = new uint8[size];
memcpy(th->pRGBA[i], revInput->level[i], size);
size /= 4;
if (size / th->bpp == 0)
@@ -174,11 +174,11 @@ TextureHandle *RegisterTexture(const RevTexture *revInput) {
void ClearProcessorState() { return; }
-int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
- int i, j, topvert, bottomvert, leftvert, rightvert, nextvert;
- int itopy, ibottomy, spantopy, spanbottomy, count;
- int x, a, r, g, b, u, v;
- int ixslope, iaslope, irslope, igslope, ibslope, iuslope, ivslope;
+int32 DrawGouraudTexturedPolygon(const vertex2D *verts, int32 nVerts, uint16 z) {
+ int32 i, j, topvert, bottomvert, leftvert, rightvert, nextvert;
+ int32 itopy, ibottomy, spantopy, spanbottomy, count;
+ int32 x, a, r, g, b, u, v;
+ int32 ixslope, iaslope, irslope, igslope, ibslope, iuslope, ivslope;
float topy, bottomy, height, width, prestep;
float xslope, aslope, rslope, gslope, bslope, uslope, vslope;
float y;
@@ -190,10 +190,10 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
return 0;
// Test for clockwise polygons
- int l0x = (verts[0].x - verts[1].x) >> 16;
- int l0y = (verts[0].y - verts[1].y) >> 16;
- int l1x = (verts[2].x - verts[1].x) >> 16;
- int l1y = (verts[2].y - verts[1].y) >> 16;
+ int32 l0x = (verts[0].x - verts[1].x) >> 16;
+ int32 l0y = (verts[0].y - verts[1].y) >> 16;
+ int32 l1x = (verts[2].x - verts[1].x) >> 16;
+ int32 l1y = (verts[2].y - verts[1].y) >> 16;
if (l0x * l1y > l0y * l1x) {
return 0;
}
@@ -214,8 +214,8 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
}
}
- itopy = (int)ceil(topy);
- ibottomy = (int)ceil(bottomy);
+ itopy = (int32)ceil(topy);
+ ibottomy = (int32)ceil(bottomy);
// reject polygons that don't cross a scan
if (ibottomy == itopy)
@@ -230,9 +230,9 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
if (nextvert < 0)
nextvert = nVerts - 1;
y = (float)(verts[leftvert].y / 65536.0f);
- spantopy = (int)ceil(y);
+ spantopy = (int32)ceil(y);
y = (float)(verts[nextvert].y / 65536.0f);
- spanbottomy = (int)ceil(y);
+ spanbottomy = (int32)ceil(y);
if (spantopy < spanbottomy) {
height = (float)((verts[nextvert].y - verts[leftvert].y) / 65536.0f);
width = (float)((verts[nextvert].x - verts[leftvert].x) / 65536.0f);
@@ -247,21 +247,21 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
prestep = spantopy - (float)(verts[leftvert].y / 65536.0f);
- x = (int)((((verts[leftvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- u = (int)((((verts[leftvert].u) / 65536.0f) + (uslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- v = (int)((((verts[leftvert].v) / 65536.0f) + (vslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- a = (int)((GETAValue(verts[leftvert].colour) + (aslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- r = (int)((GETRValue(verts[leftvert].colour) + (rslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- g = (int)((GETGValue(verts[leftvert].colour) + (gslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- b = (int)((GETBValue(verts[leftvert].colour) + (bslope * prestep)) * 65536.0) + ((1 << 16) - 1);
-
- ixslope = (int)(xslope * 65536.0);
- iuslope = (int)(uslope * 65536.0);
- ivslope = (int)(vslope * 65536.0);
- iaslope = (int)(aslope * 65536.0);
- irslope = (int)(rslope * 65536.0);
- igslope = (int)(gslope * 65536.0);
- ibslope = (int)(bslope * 65536.0);
+ x = (int32)((((verts[leftvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ u = (int32)((((verts[leftvert].u) / 65536.0f) + (uslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ v = (int32)((((verts[leftvert].v) / 65536.0f) + (vslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ a = (int32)((GETAValue(verts[leftvert].colour) + (aslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ r = (int32)((GETRValue(verts[leftvert].colour) + (rslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ g = (int32)((GETGValue(verts[leftvert].colour) + (gslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ b = (int32)((GETBValue(verts[leftvert].colour) + (bslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+
+ ixslope = (int32)(xslope * 65536.0);
+ iuslope = (int32)(uslope * 65536.0);
+ ivslope = (int32)(vslope * 65536.0);
+ iaslope = (int32)(aslope * 65536.0);
+ irslope = (int32)(rslope * 65536.0);
+ igslope = (int32)(gslope * 65536.0);
+ ibslope = (int32)(bslope * 65536.0);
for (j = spantopy; j < spanbottomy; j++) {
pspan->x0 = x >> 16;
@@ -294,9 +294,9 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
do {
nextvert = (rightvert + 1) % nVerts;
y = (float)(verts[rightvert].y / 65536.0f);
- spantopy = (int)ceil(y);
+ spantopy = (int32)ceil(y);
y = (float)(verts[nextvert].y / 65536.0f);
- spanbottomy = (int)ceil(y);
+ spanbottomy = (int32)ceil(y);
if (spantopy < spanbottomy) {
height = (float)((verts[nextvert].y - verts[rightvert].y) / 65536.0f);
width = (float)((verts[nextvert].x - verts[rightvert].x) / 65536.0f);
@@ -311,21 +311,21 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
prestep = spantopy - (float)(verts[rightvert].y / 65536.0f);
- x = (int)((((verts[rightvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- u = (int)((((verts[rightvert].u) / 65536.0f) + (uslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- v = (int)((((verts[rightvert].v) / 65536.0f) + (vslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- a = (int)((GETAValue(verts[rightvert].colour) + (aslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- r = (int)((GETRValue(verts[rightvert].colour) + (rslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- g = (int)((GETGValue(verts[rightvert].colour) + (gslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- b = (int)((GETBValue(verts[rightvert].colour) + (bslope * prestep)) * 65536.0) + ((1 << 16) - 1);
-
- ixslope = (int)(xslope * 65536.0);
- iuslope = (int)(uslope * 65536.0);
- ivslope = (int)(vslope * 65536.0);
- iaslope = (int)(aslope * 65536.0);
- irslope = (int)(rslope * 65536.0);
- igslope = (int)(gslope * 65536.0);
- ibslope = (int)(bslope * 65536.0);
+ x = (int32)((((verts[rightvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ u = (int32)((((verts[rightvert].u) / 65536.0f) + (uslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ v = (int32)((((verts[rightvert].v) / 65536.0f) + (vslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ a = (int32)((GETAValue(verts[rightvert].colour) + (aslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ r = (int32)((GETRValue(verts[rightvert].colour) + (rslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ g = (int32)((GETGValue(verts[rightvert].colour) + (gslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ b = (int32)((GETBValue(verts[rightvert].colour) + (bslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+
+ ixslope = (int32)(xslope * 65536.0);
+ iuslope = (int32)(uslope * 65536.0);
+ ivslope = (int32)(vslope * 65536.0);
+ iaslope = (int32)(aslope * 65536.0);
+ irslope = (int32)(rslope * 65536.0);
+ igslope = (int32)(gslope * 65536.0);
+ ibslope = (int32)(bslope * 65536.0);
for (j = spantopy; j < spanbottomy; j++) {
pspan->x1 = x >> 16;
@@ -352,8 +352,8 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
// Draw the spans
pspan = spans;
- int mipw = myTexHan.w >> mip_map_level;
- int miph = myTexHan.h >> mip_map_level;
+ int32 mipw = myTexHan.w >> mip_map_level;
+ int32 miph = myTexHan.h >> mip_map_level;
for (i = itopy; i < ibottomy; i++) {
count = pspan->x1 - pspan->x0;
@@ -376,8 +376,8 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
char *left = myRenDev.pRGB + (myRenDev.RGBPitch * i) + myRenDev.RGBBytesPerPixel * x;
char *zleft = myRenDev.pZ + (myRenDev.ZPitch * i) + myRenDev.ZBytesPerPixel * pspan->x0;
do {
- int pu = (u >> (8 + mip_map_level));
- int pv = (v >> (8 + mip_map_level));
+ int32 pu = (u >> (8 + mip_map_level));
+ int32 pv = (v >> (8 + mip_map_level));
if (pu < 0)
pu = 0;
@@ -389,11 +389,11 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
if (pv >= miph)
pv = miph - 1;
- u_int toff = (pu + (pv * mipw)) * myTexHan.bpp;
- u_char *texel = ((u_char *)(myTexHan.pRGBA[mip_map_level])) + toff;
+ uint32 toff = (pu + (pv * mipw)) * myTexHan.bpp;
+ uint8 *texel = ((uint8 *)(myTexHan.pRGBA[mip_map_level])) + toff;
// RGB data
- int ta, tr, tg, tb;
+ int32 ta, tr, tg, tb;
if (myTexHan.bpp > 3) {
ta = *(texel + 3);
tr = *(texel + 2);
@@ -401,8 +401,8 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
tb = *(texel + 0);
} else {
// Palette data
- u_char index = *texel;
- u_int colour = myTexHan.palette[index];
+ uint8 index = *texel;
+ uint32 colour = myTexHan.palette[index];
ta = ((colour >> 24) & 0xFF);
tr = ((colour >> 16) & 0xFF);
tg = ((colour >> 8) & 0xFF);
@@ -410,9 +410,9 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
}
// BGR : 128 = scale of 1.0
- int pr = ((r >> 8) * tr);
- int pg = ((g >> 8) * tg);
- int pb = ((b >> 8) * tb);
+ int32 pr = ((r >> 8) * tr);
+ int32 pg = ((g >> 8) * tg);
+ int32 pb = ((b >> 8) * tb);
if (pr < 0)
pr = 0;
@@ -436,7 +436,7 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
*(left + 1) = (char)pg;
*(left + 2) = (char)pr;
*(left + 3) = (char)ta; // use the texture alpha value
- *(u_short *)(zleft + 0) = z;
+ *(uint16 *)(zleft + 0) = z;
left += myRenDev.RGBBytesPerPixel;
zleft += myRenDev.ZBytesPerPixel;
@@ -454,9 +454,9 @@ int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
return 1;
}
-int DrawFlatUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
- int i, j, topvert, bottomvert, leftvert, rightvert, nextvert;
- int itopy, ibottomy, ixslope, spantopy, spanbottomy, x, count;
+int32 DrawFlatUnTexturedPolygon(const vertex2D *verts, int32 nVerts, uint16 z) {
+ int32 i, j, topvert, bottomvert, leftvert, rightvert, nextvert;
+ int32 itopy, ibottomy, ixslope, spantopy, spanbottomy, x, count;
float topy, bottomy, xslope, height, width, prestep;
float y;
span_t *pspan;
@@ -465,19 +465,19 @@ int DrawFlatUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
return 0;
// Test for clockwise polygons
- int l0x = (verts[0].x - verts[1].x) >> 16;
- int l0y = (verts[0].y - verts[1].y) >> 16;
- int l1x = (verts[2].x - verts[1].x) >> 16;
- int l1y = (verts[2].y - verts[1].y) >> 16;
+ int32 l0x = (verts[0].x - verts[1].x) >> 16;
+ int32 l0y = (verts[0].y - verts[1].y) >> 16;
+ int32 l1x = (verts[2].x - verts[1].x) >> 16;
+ int32 l1y = (verts[2].y - verts[1].y) >> 16;
if (l0x * l1y > l0y * l1x) {
return 0;
}
// The colour is in vertex 0
- u_char a0 = GETAValue(verts[0].colour);
- u_char r0 = GETRValue(verts[0].colour);
- u_char g0 = GETGValue(verts[0].colour);
- u_char b0 = GETBValue(verts[0].colour);
+ uint8 a0 = GETAValue(verts[0].colour);
+ uint8 r0 = GETRValue(verts[0].colour);
+ uint8 g0 = GETGValue(verts[0].colour);
+ uint8 b0 = GETBValue(verts[0].colour);
topy = 999999.0f;
bottomy = -999999.0f;
@@ -495,8 +495,8 @@ int DrawFlatUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
}
}
- itopy = (int)ceil(topy);
- ibottomy = (int)ceil(bottomy);
+ itopy = (int32)ceil(topy);
+ ibottomy = (int32)ceil(bottomy);
// reject polygons that don't cross a scan
if (ibottomy == itopy)
@@ -511,20 +511,20 @@ int DrawFlatUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
if (nextvert < 0)
nextvert = nVerts - 1;
y = (float)(verts[leftvert].y / 65536.0f);
- spantopy = (int)ceil(y);
+ spantopy = (int32)ceil(y);
y = (float)(verts[nextvert].y / 65536.0f);
- spanbottomy = (int)ceil(y);
+ spanbottomy = (int32)ceil(y);
if (spantopy < spanbottomy) {
- height = (float)((int)(verts[nextvert].y - verts[leftvert].y) / 65536.0f);
- width = (float)((int)(verts[nextvert].x - verts[leftvert].x) / 65536.0f);
+ height = (float)((int32)(verts[nextvert].y - verts[leftvert].y) / 65536.0f);
+ width = (float)((int32)(verts[nextvert].x - verts[leftvert].x) / 65536.0f);
xslope = width / height;
prestep = spantopy - (float)((verts[leftvert].y) / 65536.0f);
- x = (int)((((verts[leftvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ x = (int32)((((verts[leftvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- ixslope = (int)(xslope * 65536.0);
+ ixslope = (int32)(xslope * 65536.0);
for (j = spantopy; j < spanbottomy; j++) {
pspan->x0 = x >> 16;
@@ -545,9 +545,9 @@ int DrawFlatUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
do {
nextvert = (rightvert + 1) % nVerts;
y = (float)(verts[rightvert].y / 65536.0f);
- spantopy = (int)ceil(y);
+ spantopy = (int32)ceil(y);
y = (float)(verts[nextvert].y / 65536.0f);
- spanbottomy = (int)ceil(y);
+ spanbottomy = (int32)ceil(y);
if (spantopy < spanbottomy) {
height = (float)((verts[nextvert].y - verts[rightvert].y) / 65536.0f);
width = (float)((verts[nextvert].x - verts[rightvert].x) / 65536.0f);
@@ -556,9 +556,9 @@ int DrawFlatUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
prestep = spantopy - (float)((verts[rightvert].y) / 65536.0f);
- x = (int)((((verts[rightvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ x = (int32)((((verts[rightvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- ixslope = (int)(xslope * 65536.0);
+ ixslope = (int32)(xslope * 65536.0);
for (j = spantopy; j < spanbottomy; j++) {
pspan->x1 = x >> 16;
@@ -584,7 +584,7 @@ int DrawFlatUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
*(left + 2) = r0;
*(left + 3) = a0;
left += myRenDev.RGBBytesPerPixel;
- *(u_short *)(zleft + 0) = z;
+ *(uint16 *)(zleft + 0) = z;
zleft += myRenDev.ZBytesPerPixel;
count--;
} while (count > 0);
@@ -594,11 +594,11 @@ int DrawFlatUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
return 1;
}
-int DrawGouraudUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
- int i, j, topvert, bottomvert, leftvert, rightvert, nextvert;
- int itopy, ibottomy, spantopy, spanbottomy, count;
- int ixslope, iaslope, irslope, igslope, ibslope;
- int x, a, r, g, b;
+int32 DrawGouraudUnTexturedPolygon(const vertex2D *verts, int32 nVerts, uint16 z) {
+ int32 i, j, topvert, bottomvert, leftvert, rightvert, nextvert;
+ int32 itopy, ibottomy, spantopy, spanbottomy, count;
+ int32 ixslope, iaslope, irslope, igslope, ibslope;
+ int32 x, a, r, g, b;
float topy, bottomy, xslope, aslope, rslope, gslope, bslope;
float height, width, prestep;
float y;
@@ -608,10 +608,10 @@ int DrawGouraudUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
return 0;
// Test for clockwise polygons
- int l0x = (verts[0].x - verts[1].x) >> 16;
- int l0y = (verts[0].y - verts[1].y) >> 16;
- int l1x = (verts[2].x - verts[1].x) >> 16;
- int l1y = (verts[2].y - verts[1].y) >> 16;
+ int32 l0x = (verts[0].x - verts[1].x) >> 16;
+ int32 l0y = (verts[0].y - verts[1].y) >> 16;
+ int32 l1x = (verts[2].x - verts[1].x) >> 16;
+ int32 l1y = (verts[2].y - verts[1].y) >> 16;
if (l0x * l1y > l0y * l1x) {
return 0;
}
@@ -632,8 +632,8 @@ int DrawGouraudUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
}
}
- itopy = (int)ceil(topy);
- ibottomy = (int)ceil(bottomy);
+ itopy = (int32)ceil(topy);
+ ibottomy = (int32)ceil(bottomy);
if (ibottomy == itopy)
return 1; // reject polygons that don't cross a scan
@@ -647,9 +647,9 @@ int DrawGouraudUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
if (nextvert < 0)
nextvert = nVerts - 1;
y = (float)((verts[leftvert].y) / 65536.0f);
- spantopy = (int)ceil(y);
+ spantopy = (int32)ceil(y);
y = (float)((verts[nextvert].y) / 65536.0f);
- spanbottomy = (int)ceil(y);
+ spanbottomy = (int32)ceil(y);
if (spantopy < spanbottomy) {
height = (float)((verts[nextvert].y - verts[leftvert].y) / 65536.0f);
width = (float)((verts[nextvert].x - verts[leftvert].x) / 65536.0f);
@@ -662,17 +662,17 @@ int DrawGouraudUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
prestep = spantopy - (float)((verts[leftvert].y) / 65536.0f);
- x = (int)((((verts[leftvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- a = (int)((GETAValue(verts[leftvert].colour) + (aslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- r = (int)((GETRValue(verts[leftvert].colour) + (rslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- g = (int)((GETGValue(verts[leftvert].colour) + (gslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- b = (int)((GETBValue(verts[leftvert].colour) + (bslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ x = (int32)((((verts[leftvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ a = (int32)((GETAValue(verts[leftvert].colour) + (aslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ r = (int32)((GETRValue(verts[leftvert].colour) + (rslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ g = (int32)((GETGValue(verts[leftvert].colour) + (gslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ b = (int32)((GETBValue(verts[leftvert].colour) + (bslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- ixslope = (int)(xslope * 65536.0);
- iaslope = (int)(aslope * 65536.0);
- irslope = (int)(rslope * 65536.0);
- igslope = (int)(gslope * 65536.0);
- ibslope = (int)(bslope * 65536.0);
+ ixslope = (int32)(xslope * 65536.0);
+ iaslope = (int32)(aslope * 65536.0);
+ irslope = (int32)(rslope * 65536.0);
+ igslope = (int32)(gslope * 65536.0);
+ ibslope = (int32)(bslope * 65536.0);
for (j = spantopy; j < spanbottomy; j++) {
pspan->x0 = x >> 16;
@@ -701,9 +701,9 @@ int DrawGouraudUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
do {
nextvert = (rightvert + 1) % nVerts;
y = (float)((verts[rightvert].y) / 65536.0f);
- spantopy = (int)ceil(y);
+ spantopy = (int32)ceil(y);
y = (float)((verts[nextvert].y) / 65536.0f);
- spanbottomy = (int)ceil(y);
+ spanbottomy = (int32)ceil(y);
if (spantopy < spanbottomy) {
height = (float)((verts[nextvert].y - verts[rightvert].y) / 65536.0f);
width = (float)((verts[nextvert].x - verts[rightvert].x) / 65536.0f);
@@ -716,17 +716,17 @@ int DrawGouraudUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
prestep = spantopy - (float)((verts[rightvert].y) / 65536.0f);
- x = (int)((((verts[rightvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- a = (int)((GETAValue(verts[rightvert].colour) + (aslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- r = (int)((GETRValue(verts[rightvert].colour) + (rslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- g = (int)((GETGValue(verts[rightvert].colour) + (gslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- b = (int)((GETBValue(verts[rightvert].colour) + (bslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ x = (int32)((((verts[rightvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ a = (int32)((GETAValue(verts[rightvert].colour) + (aslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ r = (int32)((GETRValue(verts[rightvert].colour) + (rslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ g = (int32)((GETGValue(verts[rightvert].colour) + (gslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ b = (int32)((GETBValue(verts[rightvert].colour) + (bslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- ixslope = (int)(xslope * 65536.0);
- iaslope = (int)(aslope * 65536.0);
- irslope = (int)(rslope * 65536.0);
- igslope = (int)(gslope * 65536.0);
- ibslope = (int)(bslope * 65536.0);
+ ixslope = (int32)(xslope * 65536.0);
+ iaslope = (int32)(aslope * 65536.0);
+ irslope = (int32)(rslope * 65536.0);
+ igslope = (int32)(gslope * 65536.0);
+ ibslope = (int32)(bslope * 65536.0);
for (j = spantopy; j < spanbottomy; j++) {
pspan->x1 = x >> 16;
@@ -768,7 +768,7 @@ int DrawGouraudUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
*(left + 1) = (char)(g >> 8);
*(left + 2) = (char)(r >> 8);
*(left + 3) = (char)(a >> 8);
- *(u_short *)(zleft + 0) = z;
+ *(uint16 *)(zleft + 0) = z;
zleft += myRenDev.ZBytesPerPixel;
left += myRenDev.RGBBytesPerPixel;
x++;
@@ -783,11 +783,11 @@ int DrawGouraudUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
return 1;
}
-int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
- int i, j, topvert, bottomvert, leftvert, rightvert, nextvert;
- int itopy, ibottomy, spantopy, spanbottomy, count;
- int x, u, v;
- int ixslope, iuslope, ivslope;
+int32 DrawFlatTexturedPolygon(const vertex2D *verts, int32 nVerts, uint16 z) {
+ int32 i, j, topvert, bottomvert, leftvert, rightvert, nextvert;
+ int32 itopy, ibottomy, spantopy, spanbottomy, count;
+ int32 x, u, v;
+ int32 ixslope, iuslope, ivslope;
float topy, bottomy, height, width, prestep;
float xslope, uslope, vslope;
float y;
@@ -799,18 +799,18 @@ int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
return 0;
// Test for clockwise polygons
- int l0x = (verts[0].x - verts[1].x) >> 16;
- int l0y = (verts[0].y - verts[1].y) >> 16;
- int l1x = (verts[2].x - verts[1].x) >> 16;
- int l1y = (verts[2].y - verts[1].y) >> 16;
+ int32 l0x = (verts[0].x - verts[1].x) >> 16;
+ int32 l0y = (verts[0].y - verts[1].y) >> 16;
+ int32 l1x = (verts[2].x - verts[1].x) >> 16;
+ int32 l1y = (verts[2].y - verts[1].y) >> 16;
if (l0x * l1y > l0y * l1x) {
return 0;
}
- // u_char a0 = GETAValue(verts[0].colour);
- u_char r0 = GETRValue(verts[0].colour);
- u_char g0 = GETGValue(verts[0].colour);
- u_char b0 = GETBValue(verts[0].colour);
+ // uint8 a0 = GETAValue(verts[0].colour);
+ uint8 r0 = GETRValue(verts[0].colour);
+ uint8 g0 = GETGValue(verts[0].colour);
+ uint8 b0 = GETBValue(verts[0].colour);
topy = 999999.0f;
bottomy = -999999.0f;
@@ -828,8 +828,8 @@ int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
}
}
- itopy = (int)ceil(topy);
- ibottomy = (int)ceil(bottomy);
+ itopy = (int32)ceil(topy);
+ ibottomy = (int32)ceil(bottomy);
if (ibottomy == itopy)
return 1; // reject polygons that don't cross a scan
@@ -843,9 +843,9 @@ int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
if (nextvert < 0)
nextvert = nVerts - 1;
y = (float)((verts[leftvert].y) / 65536.0f);
- spantopy = (int)ceil(y);
+ spantopy = (int32)ceil(y);
y = (float)((verts[nextvert].y) / 65536.0f);
- spanbottomy = (int)ceil(y);
+ spanbottomy = (int32)ceil(y);
if (spantopy < spanbottomy) {
height = (float)((verts[nextvert].y - verts[leftvert].y) / 65536.0f);
width = (float)((verts[nextvert].x - verts[leftvert].x) / 65536.0f);
@@ -856,13 +856,13 @@ int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
prestep = spantopy - (float)((verts[leftvert].y) / 65536.0f);
- x = (int)((((verts[leftvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- u = (int)((((verts[leftvert].u) / 65536.0f) + (uslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- v = (int)((((verts[leftvert].v) / 65536.0f) + (vslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ x = (int32)((((verts[leftvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ u = (int32)((((verts[leftvert].u) / 65536.0f) + (uslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ v = (int32)((((verts[leftvert].v) / 65536.0f) + (vslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- ixslope = (int)(xslope * 65536.0);
- iuslope = (int)(uslope * 65536.0);
- ivslope = (int)(vslope * 65536.0);
+ ixslope = (int32)(xslope * 65536.0);
+ iuslope = (int32)(uslope * 65536.0);
+ ivslope = (int32)(vslope * 65536.0);
for (j = spantopy; j < spanbottomy; j++) {
pspan->x0 = x >> 16;
@@ -887,9 +887,9 @@ int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
do {
nextvert = (rightvert + 1) % nVerts;
y = (float)((verts[rightvert].y) / 65536.0f);
- spantopy = (int)ceil(y);
+ spantopy = (int32)ceil(y);
y = (float)((verts[nextvert].y) / 65536.0f);
- spanbottomy = (int)ceil(y);
+ spanbottomy = (int32)ceil(y);
if (spantopy < spanbottomy) {
height = (float)((verts[nextvert].y - verts[rightvert].y) / 65536.0f);
width = (float)((verts[nextvert].x - verts[rightvert].x) / 65536.0f);
@@ -900,13 +900,13 @@ int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
prestep = spantopy - (float)((verts[rightvert].y) / 65536.0f);
- x = (int)((((verts[rightvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- u = (int)((((verts[rightvert].u) / 65536.0f) + (uslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- v = (int)((((verts[rightvert].v) / 65536.0f) + (vslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ x = (int32)((((verts[rightvert].x) / 65536.0f) + (xslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ u = (int32)((((verts[rightvert].u) / 65536.0f) + (uslope * prestep)) * 65536.0) + ((1 << 16) - 1);
+ v = (int32)((((verts[rightvert].v) / 65536.0f) + (vslope * prestep)) * 65536.0) + ((1 << 16) - 1);
- ixslope = (int)(xslope * 65536.0);
- iuslope = (int)(uslope * 65536.0);
- ivslope = (int)(vslope * 65536.0);
+ ixslope = (int32)(xslope * 65536.0);
+ iuslope = (int32)(uslope * 65536.0);
+ ivslope = (int32)(vslope * 65536.0);
for (j = spantopy; j < spanbottomy; j++) {
pspan->x1 = x >> 16;
@@ -925,8 +925,8 @@ int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
// Draw the spans
pspan = spans;
- int mipw = myTexHan.w >> mip_map_level;
- int miph = myTexHan.h >> mip_map_level;
+ int32 mipw = myTexHan.w >> mip_map_level;
+ int32 miph = myTexHan.h >> mip_map_level;
for (i = itopy; i < ibottomy; i++) {
count = pspan->x1 - pspan->x0;
@@ -941,8 +941,8 @@ int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
char *left = myRenDev.pRGB + (myRenDev.RGBPitch * i) + myRenDev.RGBBytesPerPixel * x;
char *zleft = myRenDev.pZ + (myRenDev.ZPitch * i) + myRenDev.ZBytesPerPixel * pspan->x0;
do {
- int pu = (u >> (8 + mip_map_level));
- int pv = (v >> (8 + mip_map_level));
+ int32 pu = (u >> (8 + mip_map_level));
+ int32 pv = (v >> (8 + mip_map_level));
if (pu < 0)
pu = 0;
@@ -954,11 +954,11 @@ int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
if (pv >= miph)
pv = miph - 1;
- u_int toff = (pu + (pv * mipw)) * myTexHan.bpp;
- u_char *texel = ((u_char *)(myTexHan.pRGBA[mip_map_level])) + toff;
+ uint32 toff = (pu + (pv * mipw)) * myTexHan.bpp;
+ uint8 *texel = ((uint8 *)(myTexHan.pRGBA[mip_map_level])) + toff;
// RGB data
- int ta, tr, tg, tb;
+ int32 ta, tr, tg, tb;
if (myTexHan.bpp > 3) {
ta = *(texel + 3);
tr = *(texel + 2);
@@ -966,18 +966,18 @@ int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
tb = *(texel + 0);
} else {
// Palette data
- u_char index = *texel;
- u_int colour = myTexHan.palette[index];
- ta = (u_char)((colour >> 24) & 0xFF);
- tr = (u_char)((colour >> 16) & 0xFF);
- tg = (u_char)((colour >> 8) & 0xFF);
- tb = (u_char)((colour >> 0) & 0xFF);
+ uint8 index = *texel;
+ uint32 colour = myTexHan.palette[index];
+ ta = (uint8)((colour >> 24) & 0xFF);
+ tr = (uint8)((colour >> 16) & 0xFF);
+ tg = (uint8)((colour >> 8) & 0xFF);
+ tb = (uint8)((colour >> 0) & 0xFF);
}
// BGR : 128 = scale of 1.0
- // int a = a0;
- int r = r0;
- int g = g0;
- int b = b0;
+ // int32 a = a0;
+ int32 r = r0;
+ int32 g = g0;
+ int32 b = b0;
r = (r * tr);
g = (g * tg);
@@ -1006,7 +1006,7 @@ int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z) {
*(left + 2) = (char)r;
*(left + 3) = (char)ta; // use the texture alpha value
- *(u_short *)(zleft + 0) = z;
+ *(uint16 *)(zleft + 0) = z;
left += myRenDev.RGBBytesPerPixel;
zleft += myRenDev.ZBytesPerPixel;
x++;
diff --git a/engines/icb/gfx/gfxstub_dutch.h b/engines/icb/gfx/gfxstub_dutch.h
index d1c494de32..a72bbed05d 100644
--- a/engines/icb/gfx/gfxstub_dutch.h
+++ b/engines/icb/gfx/gfxstub_dutch.h
@@ -30,29 +30,25 @@
namespace ICB {
-typedef unsigned int u_int;
-typedef unsigned char u_char;
-typedef unsigned short u_short;
-
typedef struct {
- u_int width; // 640
- u_int height; // 480
- u_int stride; // width * 4
- u_char *RGBdata; // width * height * 32-bits
- u_short *Zdata; // width * height * 16-bits
+ uint32 width; // 640
+ uint32 height; // 480
+ uint32 stride; // width * 4
+ uint8 *RGBdata; // width * height * 32-bits
+ uint16 *Zdata; // width * height * 16-bits
} RevRenderDevice;
typedef struct {
int x, y; // fixed-point 16:16
int u, v; // fixed-point 16:16
- u_int colour; // B, G, R, alpha (low->high mem)
+ uint32 colour; // B, G, R, alpha (low->high mem)
} vertex2D;
typedef struct {
- u_int *palette; /*[256]*/ // windows 32-bit RGB with 1 byte of padding
- u_int width; // must be power of 2
- u_int height; // must be power of 2
- u_char *level[9]; // width/1 * height/1 -> width/256 * height/256
+ uint32 *palette; /*[256]*/ // windows 32-bit RGB with 1 byte of padding
+ uint32 width; // must be power of 2
+ uint32 height; // must be power of 2
+ uint8 *level[9]; // width/1 * height/1 -> width/256 * height/256
} RevTexture;
class TextureHandle;
@@ -67,19 +63,19 @@ int SetRenderDevice(RevRenderDevice *renderDev);
int GetRenderDevice(RevRenderDevice *renderDev);
// Colour is verts[0].colour
-int DrawFlatUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z);
+int DrawFlatUnTexturedPolygon(const vertex2D *verts, int nVerts, uint16 z);
-int DrawGouraudUnTexturedPolygon(const vertex2D *verts, int nVerts, u_short z);
+int DrawGouraudUnTexturedPolygon(const vertex2D *verts, int nVerts, uint16 z);
// Colour is verts[0].colour
-int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, u_short z);
+int DrawFlatTexturedPolygon(const vertex2D *verts, int nVerts, uint16 z);
-int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, u_short z);
+int DrawGouraudTexturedPolygon(const vertex2D *verts, int nVerts, uint16 z);
// Colour is verts[0].colour
-int DrawFlatTexturedTransparentPolygon(const vertex2D *verts, int nVerts, u_short z);
+int DrawFlatTexturedTransparentPolygon(const vertex2D *verts, int nVerts, uint16 z);
-int DrawGouraudTexturedTransparentPolygon(const vertex2D *verts, int nVerts, u_short z);
+int DrawGouraudTexturedTransparentPolygon(const vertex2D *verts, int nVerts, uint16 z);
static const int GFXLIB_TRANSPARENT_COLOUR = 0xDEADBEAF;
diff --git a/engines/icb/gfx/gfxstub_rev.cpp b/engines/icb/gfx/gfxstub_rev.cpp
index d1a7906a09..8ecf992f50 100644
--- a/engines/icb/gfx/gfxstub_rev.cpp
+++ b/engines/icb/gfx/gfxstub_rev.cpp
@@ -33,32 +33,32 @@
namespace ICB {
-#define MAKERGB(r, g, b, a) ((u_int)(((u_char)(b) | ((u_short)((u_char)(g)) << 8)) | (((u_int)(u_char)(r)) << 16) | (((u_int)(u_char)(a)) << 24)))
+#define MAKERGB(r, g, b, a) ((uint32)(((uint8)(b) | ((uint16)((uint8)(g)) << 8)) | (((uint32)(uint8)(r)) << 16) | (((uint32)(uint8)(a)) << 24)))
#define TEMP_TEXTURE_WIDTH 256
#define TEMP_TEXTURE_HEIGHT 256
#define BYTES_PER_COLOUR 4
-u_char pcRGBA[TEMP_TEXTURE_WIDTH * TEMP_TEXTURE_HEIGHT * BYTES_PER_COLOUR];
+uint8 pcRGBA[TEMP_TEXTURE_WIDTH * TEMP_TEXTURE_HEIGHT * BYTES_PER_COLOUR];
-int bpp = 0;
+int32 bpp = 0;
// The big screen bitmap to draw everything into
extern char *pRGB;
-extern int RGBWidth;
-extern int RGBHeight;
-extern int RGBPitch;
-extern int RGBBytesPerPixel;
+extern int32 RGBWidth;
+extern int32 RGBHeight;
+extern int32 RGBPitch;
+extern int32 RGBBytesPerPixel;
// The z buffer bitmap
extern char *pZ;
-extern int ZPitch;
-extern int ZBytesPerPixel;
+extern int32 ZPitch;
+extern int32 ZBytesPerPixel;
#define MAX_POLYGON_VERTS 8
vertex2D verts[8];
vertex2D clipverts[8];
-int SimpleReject(vertex2D *vertices) {
+int32 SimpleReject(vertex2D *vertices) {
int64 l0x = (verts[0].x - vertices[1].x);
int64 l0y = (verts[0].y - vertices[1].y);
int64 l1x = (verts[2].x - vertices[1].x);
@@ -74,7 +74,7 @@ int SimpleReject(vertex2D *vertices) {
return 0;
}
-int ClipPolygon(vertex2D *inverts, int inNverts, vertex2D *outverts, int *outNverts);
+int32 ClipPolygon(vertex2D *inverts, int32 inNverts, vertex2D *outverts, int32 *outNverts);
void startDrawing() {}
@@ -84,11 +84,11 @@ void endDrawing() {
// Real graphic routines
// r0, g0, b0 : 128 means colour scale of 1.0
-int DrawSprite(int x0, int y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, u_short /*u0*/, u_short v0, uint8 alpha, u_short z, void *tex) {
- int x, y;
- int lx0, ly0;
+int32 DrawSprite(int32 x0, int32 y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, uint16 /*u0*/, uint16 v0, uint8 alpha, uint16 z, void *tex) {
+ int32 x, y;
+ int32 lx0, ly0;
TextureHandle *pthan = NULL;
- int lx1, ly1;
+ int32 lx1, ly1;
if (tex == NULL) {
return 0;
@@ -120,9 +120,9 @@ int DrawSprite(int x0, int y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, u
return 1;
char *line = pRGB + (RGBPitch * ly0);
- int xStart = RGBBytesPerPixel * lx0;
+ int32 xStart = RGBBytesPerPixel * lx0;
char *zline = pZ + (ZPitch * ly0);
- int xzStart = ZBytesPerPixel * lx0;
+ int32 xzStart = ZBytesPerPixel * lx0;
uint8 *texel = (uint8 *)pcRGBA + (v0 * TEMP_TEXTURE_WIDTH) * BYTES_PER_COLOUR;
@@ -130,12 +130,12 @@ int DrawSprite(int x0, int y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, u
char *row = line + xStart;
char *zrow = zline + xzStart;
for (x = lx0; x < lx1; x++) {
- int r = r0;
- int g = g0;
- int b = b0;
- int tr = *(texel + 2);
- int tg = *(texel + 1);
- int tb = *(texel + 0);
+ int32 r = r0;
+ int32 g = g0;
+ int32 b = b0;
+ int32 tr = *(texel + 2);
+ int32 tg = *(texel + 1);
+ int32 tb = *(texel + 0);
r = (r * tr);
g = (g * tg);
@@ -163,7 +163,7 @@ int DrawSprite(int x0, int y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, u
*(row + 1) = (char)g;
*(row + 2) = (char)r;
*(row + 3) = alpha;
- *(u_short *)(zrow + 0) = z;
+ *(uint16 *)(zrow + 0) = z;
row += RGBBytesPerPixel;
zrow += ZBytesPerPixel;
}
@@ -174,10 +174,10 @@ int DrawSprite(int x0, int y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, u
}
// Single coloured rectangle
-int DrawTile(int x0, int y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, u_short z) {
- int x, y;
- int lx0, ly0;
- int lx1, ly1;
+int32 DrawTile(int32 x0, int32 y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, uint16 z) {
+ int32 x, y;
+ int32 lx0, ly0;
+ int32 lx1, ly1;
lx0 = RGBWidth / 2 + x0;
ly0 = RGBHeight / 2 + y0;
@@ -199,9 +199,9 @@ int DrawTile(int x0, int y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, uin
return 1;
char *line = pRGB + (RGBPitch * ly0);
- int xStart = RGBBytesPerPixel * lx0;
+ int32 xStart = RGBBytesPerPixel * lx0;
char *zline = pZ + (ZPitch * ly0);
- int xzStart = ZBytesPerPixel * lx0;
+ int32 xzStart = ZBytesPerPixel * lx0;
for (y = ly0; y < ly1; y++) {
char *row = line + xStart;
@@ -211,7 +211,7 @@ int DrawTile(int x0, int y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, uin
*(row + 1) = g0;
*(row + 2) = r0;
*(row + 3) = alpha;
- *(u_short *)(zrow + 0) = z;
+ *(uint16 *)(zrow + 0) = z;
row += RGBBytesPerPixel;
zrow += ZBytesPerPixel;
}
@@ -221,21 +221,21 @@ int DrawTile(int x0, int y0, short w, short h, uint8 r0, uint8 g0, uint8 b0, uin
}
// Single flat coloured line : 2 points, 1 colour
-int DrawLineF2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, u_short z) {
+int32 DrawLineF2(int32 x0, int32 y0, int32 x1, int32 y1, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, uint16 z) {
// Uses Bressnham's incremental algorithm!
// we pass a colour
- int dx, dy;
- int dxmod, dymod;
- int ince, incne;
- int d;
- int x, y;
- int addTo;
+ int32 dx, dy;
+ int32 dxmod, dymod;
+ int32 ince, incne;
+ int32 d;
+ int32 x, y;
+ int32 addTo;
- x0 = (short)(RGBWidth / 2 + x0);
- x1 = (short)(RGBWidth / 2 + x1);
- y0 = (short)(RGBHeight / 2 + y0);
- y1 = (short)(RGBHeight / 2 + y1);
+ x0 = (int16)(RGBWidth / 2 + x0);
+ x1 = (int16)(RGBWidth / 2 + x1);
+ y0 = (int16)(RGBHeight / 2 + y0);
+ y1 = (int16)(RGBHeight / 2 + y1);
// Make sure we're going from left to right
if (x1 < x0) {
@@ -267,13 +267,13 @@ int DrawLineF2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
x = x0;
y = y0;
if ((x >= 0) && (x < RGBWidth) && (y >= 0) && (y < RGBHeight)) {
- int index = y * RGBPitch + (x * RGBBytesPerPixel);
+ int32 index = y * RGBPitch + (x * RGBBytesPerPixel);
pRGB[index + 0] = b0;
pRGB[index + 1] = g0;
pRGB[index + 2] = r0;
pRGB[index + 3] = alpha;
index = y * ZPitch + (x * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
while (x < x1) {
@@ -286,13 +286,13 @@ int DrawLineF2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
y += 1;
}
if ((x >= 0) && (x < RGBWidth) && (y >= 0) && (y < RGBHeight)) {
- int index = y * RGBPitch + (x * RGBBytesPerPixel);
+ int32 index = y * RGBPitch + (x * RGBBytesPerPixel);
pRGB[index + 0] = b0;
pRGB[index + 1] = g0;
pRGB[index + 2] = r0;
pRGB[index + 3] = alpha;
index = y * ZPitch + (x * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
}
} else {
@@ -308,13 +308,13 @@ int DrawLineF2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
x = x0;
y = y0;
if ((x >= 0) && (x < RGBWidth) && (addTo - y >= 0) && (addTo - y < RGBHeight)) {
- int index = (addTo - y) * RGBPitch + (x * RGBBytesPerPixel);
+ int32 index = (addTo - y) * RGBPitch + (x * RGBBytesPerPixel);
pRGB[index + 0] = b0;
pRGB[index + 1] = g0;
pRGB[index + 2] = r0;
pRGB[index + 3] = alpha;
index = (addTo - y) * ZPitch + (x * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
while (x < x1) {
@@ -327,13 +327,13 @@ int DrawLineF2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
y += 1;
}
if ((x >= 0) && (x < RGBWidth) && (addTo - y >= 0) && (addTo - y < RGBHeight)) {
- int index = (addTo - y) * RGBPitch + (x * RGBBytesPerPixel);
+ int32 index = (addTo - y) * RGBPitch + (x * RGBBytesPerPixel);
pRGB[index + 0] = b0;
pRGB[index + 1] = g0;
pRGB[index + 2] = r0;
pRGB[index + 3] = alpha;
index = (addTo - y) * ZPitch + (x * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
}
}
@@ -358,13 +358,13 @@ int DrawLineF2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
x = x0;
y = y0;
if ((x >= 0) && (x < RGBWidth) && (y >= 0) && (y < RGBHeight)) {
- int index = y * RGBPitch + (x * RGBBytesPerPixel);
+ int32 index = y * RGBPitch + (x * RGBBytesPerPixel);
pRGB[index + 0] = b0;
pRGB[index + 1] = g0;
pRGB[index + 2] = r0;
pRGB[index + 3] = alpha;
index = y * ZPitch + (x * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
while (y < y1) {
if (d <= 0) {
@@ -376,13 +376,13 @@ int DrawLineF2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
y += 1;
}
if ((x >= 0) && (x < RGBWidth) && (y >= 0) && (y < RGBHeight)) {
- int index = y * RGBPitch + (x * RGBBytesPerPixel);
+ int32 index = y * RGBPitch + (x * RGBBytesPerPixel);
pRGB[index + 0] = b0;
pRGB[index + 1] = g0;
pRGB[index + 2] = r0;
pRGB[index + 3] = alpha;
index = y * ZPitch + (x * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
}
} else {
@@ -398,13 +398,13 @@ int DrawLineF2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
x = x0;
y = y0;
if ((addTo - x >= 0) && (addTo - x < RGBWidth) && (y >= 0) && (y < RGBHeight)) {
- int index = y * RGBPitch + ((addTo - x) * RGBBytesPerPixel);
+ int32 index = y * RGBPitch + ((addTo - x) * RGBBytesPerPixel);
pRGB[index + 0] = b0;
pRGB[index + 1] = g0;
pRGB[index + 2] = r0;
pRGB[index + 3] = alpha;
index = y * ZPitch + ((addTo - x) * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
while (y < y1) {
@@ -417,13 +417,13 @@ int DrawLineF2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
y += 1;
}
if ((addTo - x >= 0) && (addTo - x < RGBWidth) && (y >= 0) && (y < RGBHeight)) {
- int index = y * RGBPitch + ((addTo - x) * RGBBytesPerPixel);
+ int32 index = y * RGBPitch + ((addTo - x) * RGBBytesPerPixel);
pRGB[index + 0] = b0;
pRGB[index + 1] = g0;
pRGB[index + 2] = r0;
pRGB[index + 3] = alpha;
index = y * ZPitch + ((addTo - x) * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
}
}
@@ -432,14 +432,14 @@ int DrawLineF2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
}
// two connected lines flat coloured : 3 points, 1 colour
-int DrawLineF3(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, u_short z) {
+int32 DrawLineF3(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, uint16 z) {
DrawLineF2(x0, y0, x1, y1, r0, g0, b0, alpha, z);
DrawLineF2(x1, y1, x2, y2, r0, g0, b0, alpha, z);
return 0;
}
// three connected lines flat coloured : 4 points, 1 colour
-int DrawLineF4(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, u_short z) {
+int32 DrawLineF4(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, uint16 z) {
DrawLineF2(x0, y0, x1, y1, r0, g0, b0, alpha, z);
DrawLineF2(x1, y1, x2, y2, r0, g0, b0, alpha, z);
DrawLineF2(x2, y2, x3, y3, r0, g0, b0, alpha, z);
@@ -447,27 +447,27 @@ int DrawLineF4(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, u
}
// Single gouraud coloured line : 2 points, 2 colours
-int DrawLineG2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 alpha, u_short z) {
+int32 DrawLineG2(int32 x0, int32 y0, int32 x1, int32 y1, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 alpha, uint16 z) {
// Uses Bressnham's incremental algorithm!
// we pass a colour
- int dx, dy;
- int dxmod, dymod;
- int ince, incne;
- int d;
- int x, y;
- int addTo;
- int dred;
- int dgreen;
- int dblue;
- int r, g, b;
- int lr0, lg0, lb0;
- int lr1, lg1, lb1;
-
- x0 = (short)(RGBWidth / 2 + x0);
- x1 = (short)(RGBWidth / 2 + x1);
- y0 = (short)(RGBHeight / 2 + y0);
- y1 = (short)(RGBHeight / 2 + y1);
+ int32 dx, dy;
+ int32 dxmod, dymod;
+ int32 ince, incne;
+ int32 d;
+ int32 x, y;
+ int32 addTo;
+ int32 dred;
+ int32 dgreen;
+ int32 dblue;
+ int32 r, g, b;
+ int32 lr0, lg0, lb0;
+ int32 lr1, lg1, lb1;
+
+ x0 = (int16)(RGBWidth / 2 + x0);
+ x1 = (int16)(RGBWidth / 2 + x1);
+ y0 = (int16)(RGBHeight / 2 + y0);
+ y1 = (int16)(RGBHeight / 2 + y1);
// Make sure we're going from left to right
if (x1 < x0) {
@@ -529,13 +529,13 @@ int DrawLineG2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
g = lg0;
b = lb0;
if ((x >= 0) && (x < RGBWidth) && (y >= 0) && (y < RGBHeight)) {
- int index = y * RGBPitch + (x * RGBBytesPerPixel);
+ int32 index = y * RGBPitch + (x * RGBBytesPerPixel);
pRGB[index + 0] = b0;
pRGB[index + 1] = g0;
pRGB[index + 2] = r0;
pRGB[index + 3] = alpha;
index = y * ZPitch + (x * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
while (x < x1) {
@@ -551,12 +551,12 @@ int DrawLineG2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
g += dgreen;
b += dblue;
if ((x >= 0) && (x < RGBWidth) && (y >= 0) && (y < RGBHeight)) {
- int index = y * RGBPitch + (x * RGBBytesPerPixel);
+ int32 index = y * RGBPitch + (x * RGBBytesPerPixel);
pRGB[index + 0] = (uint8)(b >> 8);
pRGB[index + 1] = (uint8)(g >> 8);
pRGB[index + 2] = (uint8)(r >> 8);
index = y * ZPitch + (x * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
}
} else {
@@ -575,13 +575,13 @@ int DrawLineG2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
g = lg0;
b = lb0;
if ((x >= 0) && (x < RGBWidth) && (addTo - y >= 0) && (addTo - y < RGBHeight)) {
- int index = (addTo - y) * RGBPitch + (x * RGBBytesPerPixel);
+ int32 index = (addTo - y) * RGBPitch + (x * RGBBytesPerPixel);
pRGB[index + 0] = b0;
pRGB[index + 1] = g0;
pRGB[index + 2] = r0;
pRGB[index + 3] = alpha;
index = (addTo - y) * ZPitch + (x * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
while (x < x1) {
@@ -597,12 +597,12 @@ int DrawLineG2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
g += dgreen;
b += dblue;
if ((x >= 0) && (x < RGBWidth) && (addTo - y >= 0) && (addTo - y < RGBHeight)) {
- int index = (addTo - y) * RGBPitch + (x * RGBBytesPerPixel);
+ int32 index = (addTo - y) * RGBPitch + (x * RGBBytesPerPixel);
pRGB[index + 0] = (uint8)(b >> 8);
pRGB[index + 1] = (uint8)(g >> 8);
pRGB[index + 2] = (uint8)(r >> 8);
index = (addTo - y) * ZPitch + (x * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
}
}
@@ -648,13 +648,13 @@ int DrawLineG2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
g = lg0;
b = lb0;
if ((x >= 0) && (x < RGBWidth) && (y >= 0) && (y < RGBHeight)) {
- int index = y * RGBPitch + (x * RGBBytesPerPixel);
+ int32 index = y * RGBPitch + (x * RGBBytesPerPixel);
pRGB[index + 0] = b0;
pRGB[index + 1] = g0;
pRGB[index + 2] = r0;
pRGB[index + 3] = alpha;
index = y * ZPitch + (x * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
while (y < y1) {
if (d <= 0) {
@@ -669,13 +669,13 @@ int DrawLineG2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
g += dgreen;
b += dblue;
if ((x >= 0) && (x < RGBWidth) && (y >= 0) && (y < RGBHeight)) {
- int index = y * RGBPitch + (x * RGBBytesPerPixel);
+ int32 index = y * RGBPitch + (x * RGBBytesPerPixel);
pRGB[index + 0] = (uint8)(b >> 8);
pRGB[index + 1] = (uint8)(g >> 8);
pRGB[index + 2] = (uint8)(r >> 8);
pRGB[index + 3] = alpha;
index = y * ZPitch + (x * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
}
} else {
@@ -694,13 +694,13 @@ int DrawLineG2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
g = lg0;
b = lb0;
if ((addTo - x >= 0) && (addTo - x < RGBWidth) && (y >= 0) && (y < RGBHeight)) {
- int index = y * RGBPitch + ((addTo - x) * RGBBytesPerPixel);
+ int32 index = y * RGBPitch + ((addTo - x) * RGBBytesPerPixel);
pRGB[index + 0] = b0;
pRGB[index + 1] = g0;
pRGB[index + 2] = r0;
pRGB[index + 3] = alpha;
index = y * ZPitch + ((addTo - x) * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
while (y < y1) {
@@ -716,13 +716,13 @@ int DrawLineG2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
g += dgreen;
b += dblue;
if ((addTo - x >= 0) && (addTo - x < RGBWidth) && (y >= 0) && (y < RGBHeight)) {
- int index = y * RGBPitch + ((addTo - x) * RGBBytesPerPixel);
+ int32 index = y * RGBPitch + ((addTo - x) * RGBBytesPerPixel);
pRGB[index + 0] = (uint8)(b >> 8);
pRGB[index + 1] = (uint8)(g >> 8);
pRGB[index + 2] = (uint8)(r >> 8);
pRGB[index + 3] = alpha;
index = y * ZPitch + ((addTo - x) * ZBytesPerPixel);
- *(u_short *)(pZ + index + 0) = z;
+ *(uint16 *)(pZ + index + 0) = z;
}
}
}
@@ -731,15 +731,15 @@ int DrawLineG2(int x0, int y0, int x1, int y1, uint8 r0, uint8 g0, uint8 b0, uin
}
// two connected lines gouraud coloured : 3 points, 3 colours
-int DrawLineG3(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, uint8 alpha, u_short z) {
+int32 DrawLineG3(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, uint8 alpha, uint16 z) {
DrawLineG2(x0, y0, x1, y1, r0, g0, b0, r1, g1, b1, alpha, z);
DrawLineG2(x1, y1, x2, y2, r1, g1, b1, r2, g2, b2, alpha, z);
return 0;
}
// three connected lines gouraud coloured : 4 points, 4 colours
-int DrawLineG4(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, uint8 r3,
- uint8 g3, uint8 b3, uint8 alpha, u_short z) {
+int32 DrawLineG4(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, uint8 r3,
+ uint8 g3, uint8 b3, uint8 alpha, uint16 z) {
DrawLineG2(x0, y0, x1, y1, r0, g0, b0, r1, g1, b1, alpha, z);
DrawLineG2(x1, y1, x2, y2, r1, g1, b1, r2, g2, b2, alpha, z);
DrawLineG2(x2, y2, x3, y3, r2, g2, b2, r3, g3, b3, alpha, z);
@@ -747,7 +747,7 @@ int DrawLineG4(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, u
}
// Simple flat coloured triangle : 3 points, 1 colour
-int DrawFlatTriangle(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, u_short z) {
+int32 DrawFlatTriangle(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, uint16 z) {
verts[0].x = (RGBWidth / 2 + x0) << 16;
verts[0].y = (RGBHeight / 2 + y0) << 16;
verts[1].x = (RGBWidth / 2 + x1) << 16;
@@ -757,16 +757,16 @@ int DrawFlatTriangle(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, u
verts[0].colour = MAKERGB(r0, g0, b0, alpha);
- int nVerts;
+ int32 nVerts;
if (ClipPolygon(verts, 3, clipverts, &nVerts) == 0)
return 1;
- int ret;
+ int32 ret;
if (nVerts == 3) {
ret = DrawFlatUnTexturedPolygon(clipverts, 3, z);
} else {
- int i;
+ int32 i;
vertex2D newVerts[3];
ret = 0;
@@ -785,7 +785,7 @@ int DrawFlatTriangle(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, u
}
// Simple flat coloured quad : 4 points, 1 colour
-int DrawFlatQuad(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, u_short z) {
+int32 DrawFlatQuad(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 r0, uint8 g0, uint8 b0, uint8 alpha, uint16 z) {
// Input Quad is :
// 0----1
// | |
@@ -806,13 +806,13 @@ int DrawFlatQuad(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3,
verts[0].colour = MAKERGB(r0, g0, b0, alpha);
- int nVerts;
+ int32 nVerts;
if (ClipPolygon(verts, 4, clipverts, &nVerts) == 0)
return 1;
- int ret;
+ int32 ret;
vertex2D newVerts[3];
- int i;
+ int32 i;
ret = 0;
for (i = 3; i <= nVerts; i++) {
@@ -828,8 +828,8 @@ int DrawFlatQuad(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3,
}
// Simple gouraud coloured triangle : 3 points, 3 colours
-int DrawGouraudTriangle(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, uint8 alpha,
- u_short z) {
+int32 DrawGouraudTriangle(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, uint8 alpha,
+ uint16 z) {
verts[0].x = (RGBWidth / 2 + x0) << 16;
verts[0].y = (RGBHeight / 2 + y0) << 16;
verts[1].x = (RGBWidth / 2 + x1) << 16;
@@ -841,16 +841,16 @@ int DrawGouraudTriangle(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0
verts[1].colour = MAKERGB(r1, g1, b1, alpha);
verts[2].colour = MAKERGB(r2, g2, b2, alpha);
- int nVerts;
+ int32 nVerts;
if (ClipPolygon(verts, 3, clipverts, &nVerts) == 0)
return 1;
- int ret;
+ int32 ret;
if (nVerts == 3) {
ret = DrawGouraudUnTexturedPolygon(clipverts, 3, z);
} else {
- int i;
+ int32 i;
vertex2D newVerts[3];
ret = 0;
@@ -869,8 +869,8 @@ int DrawGouraudTriangle(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0
}
// Simple gouraud coloured quad : 4 points, 4 colours
-int DrawGouraudQuad(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2,
- uint8 r3, uint8 g3, uint8 b3, uint8 alpha, u_short z) {
+int32 DrawGouraudQuad(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2,
+ uint8 r3, uint8 g3, uint8 b3, uint8 alpha, uint16 z) {
// Input Quad is :
// 0----1
// | |
@@ -893,13 +893,13 @@ int DrawGouraudQuad(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int
verts[3].colour = MAKERGB(r2, g2, b2, alpha);
verts[2].colour = MAKERGB(r3, g3, b3, alpha);
- int nVerts;
+ int32 nVerts;
if (ClipPolygon(verts, 4, clipverts, &nVerts) == 0)
return 1;
- int ret;
+ int32 ret;
vertex2D newVerts[3];
- int i;
+ int32 i;
ret = 0;
for (i = 3; i <= nVerts; i++) {
@@ -916,8 +916,8 @@ int DrawGouraudQuad(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int
// Simple flat coloured triangle : 3 points, 1 colour, 3 UV's
// r0, g0, b0 : 128 means colour scale of 1.0
-int DrawFlatTriangleTextured(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, uint8 g0, uint8 b0, u_short u0, u_short v0, u_short u1, u_short v1, u_short u2, u_short v2,
- uint8 alpha, u_short z, void *tex) {
+int32 DrawFlatTriangleTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, uint8 r0, uint8 g0, uint8 b0, uint16 u0, uint16 v0, uint16 u1, uint16 v1, uint16 u2, uint16 v2,
+ uint8 alpha, uint16 z, void *tex) {
verts[0].x = (RGBWidth / 2 + x0) << 16;
verts[0].y = (RGBHeight / 2 + y0) << 16;
verts[1].x = (RGBWidth / 2 + x1) << 16;
@@ -934,7 +934,7 @@ int DrawFlatTriangleTextured(int x0, int y0, int x1, int y1, int x2, int y2, uin
verts[0].colour = MAKERGB(r0, g0, b0, alpha);
- int nVerts;
+ int32 nVerts;
if (ClipPolygon(verts, 3, clipverts, &nVerts) == 0)
return 1;
@@ -949,12 +949,12 @@ int DrawFlatTriangleTextured(int x0, int y0, int x1, int y1, int x2, int y2, uin
return 0;
}
- int ret;
+ int32 ret;
if (nVerts == 3) {
ret = DrawFlatTexturedPolygon(clipverts, 3, z);
} else {
- int i;
+ int32 i;
vertex2D newVerts[3];
ret = 0;
@@ -976,8 +976,8 @@ int DrawFlatTriangleTextured(int x0, int y0, int x1, int y1, int x2, int y2, uin
// Simple flat coloured quad : 4 points, 1 colour, 4 UV's
// r0, g0, b0 : 128 means colour scale of 1.0
-int DrawFlatQuadTextured(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint8 r0, uint8 g0, uint8 b0, u_short u0, u_short v0, u_short u1, u_short v1, u_short u2,
- u_short v2, u_short u3, u_short v3, uint8 alpha, u_short z, void *tex) {
+int32 DrawFlatQuadTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 r0, uint8 g0, uint8 b0, uint16 u0, uint16 v0, uint16 u1, uint16 v1, uint16 u2,
+ uint16 v2, uint16 u3, uint16 v3, uint8 alpha, uint16 z, void *tex) {
// Input Quad is :
// 0----1
// | |
@@ -1007,7 +1007,7 @@ int DrawFlatQuadTextured(int x0, int y0, int x1, int y1, int x2, int y2, int x3,
verts[3].v = v2 << 8;
verts[2].v = v3 << 8;
- int nVerts;
+ int32 nVerts;
if (ClipPolygon(verts, 4, clipverts, &nVerts) == 0)
return 1;
@@ -1022,9 +1022,9 @@ int DrawFlatQuadTextured(int x0, int y0, int x1, int y1, int x2, int y2, int x3,
return 0;
}
- int ret;
+ int32 ret;
vertex2D newVerts[3];
- int i;
+ int32 i;
ret = 0;
for (i = 3; i <= nVerts; i++) {
@@ -1041,12 +1041,12 @@ int DrawFlatQuadTextured(int x0, int y0, int x1, int y1, int x2, int y2, int x3,
return ret;
}
-int tempor = 0;
+int32 tempor = 0;
// Simple gouraud coloured triangle : 3 points, 3 colours
// r0, g0, b0 : 128 means colour scale of 1.0
-int DrawGouraudTriangleTextured(int x0, int y0, int x1, int y1, int x2, int y2, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2,
- u_short u0, u_short v0, u_short u1, u_short v1, u_short u2, u_short v2, uint8 alpha, u_short z, void *tex) {
+int32 DrawGouraudTriangleTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2,
+ uint16 u0, uint16 v0, uint16 u1, uint16 v1, uint16 u2, uint16 v2, uint8 alpha, uint16 z, void *tex) {
verts[0].x = (RGBWidth / 2 + x0) << 16;
verts[0].y = (RGBHeight / 2 + y0) << 16;
verts[1].x = (RGBWidth / 2 + x1) << 16;
@@ -1064,7 +1064,7 @@ int DrawGouraudTriangleTextured(int x0, int y0, int x1, int y1, int x2, int y2,
verts[1].colour = MAKERGB(r1, g1, b1, alpha);
verts[2].colour = MAKERGB(r2, g2, b2, alpha);
- int nVerts;
+ int32 nVerts;
if (ClipPolygon(verts, 3, clipverts, &nVerts) == 0)
return 1;
@@ -1079,12 +1079,12 @@ int DrawGouraudTriangleTextured(int x0, int y0, int x1, int y1, int x2, int y2,
return 0;
}
- int ret;
+ int32 ret;
if (nVerts == 3) {
ret = DrawGouraudTexturedPolygon(clipverts, 3, z);
} else {
- int i;
+ int32 i;
vertex2D newVerts[3];
ret = 0;
@@ -1107,9 +1107,9 @@ int DrawGouraudTriangleTextured(int x0, int y0, int x1, int y1, int x2, int y2,
// Simple gouraud coloured quad : 4 points, 4 colours
// r0, g0, b0 : 128 means colour scale of 1.0
-int DrawGouraudQuadTextured(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2,
- uint8 b2, uint8 r3, uint8 g3, uint8 b3, u_short u0, u_short v0, u_short u1, u_short v1, u_short u2, u_short v2, u_short u3, u_short v3, uint8 alpha,
- u_short z, void *tex) {
+int32 DrawGouraudQuadTextured(int32 x0, int32 y0, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 r0, uint8 g0, uint8 b0, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2,
+ uint8 b2, uint8 r3, uint8 g3, uint8 b3, uint16 u0, uint16 v0, uint16 u1, uint16 v1, uint16 u2, uint16 v2, uint16 u3, uint16 v3, uint8 alpha,
+ uint16 z, void *tex) {
// Input Quad is :
// 0----1
// | |
@@ -1142,7 +1142,7 @@ int DrawGouraudQuadTextured(int x0, int y0, int x1, int y1, int x2, int y2, int
verts[3].v = v2 << 8;
verts[2].v = v3 << 8;
- int nVerts;
+ int32 nVerts;
if (ClipPolygon(verts, 4, clipverts, &nVerts) == 0)
return 1;
@@ -1157,9 +1157,9 @@ int DrawGouraudQuadTextured(int x0, int y0, int x1, int y1, int x2, int y2, int
return 0;
}
- int ret;
+ int32 ret;
vertex2D newVerts[3];
- int i;
+ int32 i;
ret = 0;
for (i = 3; i <= nVerts; i++) {
@@ -1176,7 +1176,7 @@ int DrawGouraudQuadTextured(int x0, int y0, int x1, int y1, int x2, int y2, int
return ret;
}
-inline void Intersection(vertex2D *out, vertex2D v0, vertex2D v1, int p) {
+inline void Intersection(vertex2D *out, vertex2D v0, vertex2D v1, int32 p) {
out->x = v0.x + p * ((v1.x - v0.x) >> 8);
out->y = v0.y + p * ((v1.y - v0.y) >> 8);
@@ -1185,14 +1185,14 @@ inline void Intersection(vertex2D *out, vertex2D v0, vertex2D v1, int p) {
out->v = v0.v + p * ((v1.v - v0.v) >> 8);
}
-inline void ClipWithTopPlane(vertex2D *inVerts, int inNverts, vertex2D *outVerts, int *outNverts) {
+inline void ClipWithTopPlane(vertex2D *inVerts, int32 inNverts, vertex2D *outVerts, int32 *outNverts) {
vertex2D intersect;
- int i, ni;
- int j;
- int percent;
+ int32 i, ni;
+ int32 j;
+ int32 percent;
uint8 bits[MAX_POLYGON_VERTS];
- int yPlane = (0) << 16;
+ int32 yPlane = (0) << 16;
for (i = 0; i < inNverts; i++)
bits[i] = (uint8)(inVerts[i].y >= yPlane);
@@ -1245,14 +1245,14 @@ inline void ClipWithTopPlane(vertex2D *inVerts, int inNverts, vertex2D *outVerts
*outNverts = j;
}
-inline void ClipWithBottomPlane(vertex2D *inVerts, int inNverts, vertex2D *outVerts, int *outNverts) {
+inline void ClipWithBottomPlane(vertex2D *inVerts, int32 inNverts, vertex2D *outVerts, int32 *outNverts) {
vertex2D intersect;
- int i, ni;
- int j;
- int percent;
+ int32 i, ni;
+ int32 j;
+ int32 percent;
uint8 bits[MAX_POLYGON_VERTS];
- int yPlane = (RGBHeight - 1) << 16;
+ int32 yPlane = (RGBHeight - 1) << 16;
for (i = 0; i < inNverts; i++)
bits[i] = (uint8)(inVerts[i].y < yPlane);
@@ -1304,14 +1304,14 @@ inline void ClipWithBottomPlane(vertex2D *inVerts, int inNverts, vertex2D *outVe
*outNverts = j;
}
-inline void ClipWithLeftPlane(vertex2D *inVerts, int inNverts, vertex2D *outVerts, int *outNverts) {
+inline void ClipWithLeftPlane(vertex2D *inVerts, int32 inNverts, vertex2D *outVerts, int32 *outNverts) {
vertex2D intersect;
- int i, ni;
- int j;
- int percent;
+ int32 i, ni;
+ int32 j;
+ int32 percent;
uint8 bits[MAX_POLYGON_VERTS];
- int xPlane = (0) << 16;
+ int32 xPlane = (0) << 16;
for (i = 0; i < inNverts; i++)
bits[i] = (uint8)(inVerts[i].x >= xPlane);
@@ -1362,14 +1362,14 @@ inline void ClipWithLeftPlane(vertex2D *inVerts, int inNverts, vertex2D *outVert
*outNverts = j;
}
-inline void ClipWithRightPlane(vertex2D *inVerts, int inNverts, vertex2D *outVerts, int *outNverts) {
+inline void ClipWithRightPlane(vertex2D *inVerts, int32 inNverts, vertex2D *outVerts, int32 *outNverts) {
vertex2D intersect;
- int i, ni;
- int j;
- int percent;
+ int32 i, ni;
+ int32 j;
+ int32 percent;
uint8 bits[MAX_POLYGON_VERTS];
- int xPlane = (RGBWidth - 1) << 16;
+ int32 xPlane = (RGBWidth - 1) << 16;
for (i = 0; i < inNverts; i++)
bits[i] = (uint8)(inVerts[i].x < xPlane);
@@ -1428,8 +1428,8 @@ inline void ClipWithRightPlane(vertex2D *inVerts, int inNverts, vertex2D *outVer
// Simple clipping by polygon rejection
-int ClipPolygon(vertex2D *inverts, int inNverts, vertex2D *outverts, int *ret) {
- int i;
+int32 ClipPolygon(vertex2D *inverts, int32 inNverts, vertex2D *outverts, int32 *ret) {
+ int32 i;
for (i = 0; i < inNverts; i++) {
@@ -1448,12 +1448,12 @@ int ClipPolygon(vertex2D *inverts, int inNverts, vertex2D *outverts, int *ret) {
// Complex clipping to the screen boundaries
-int ClipPolygon(vertex2D *inverts, int inNverts, vertex2D *outverts, int *ret) {
- int i;
+int32 ClipPolygon(vertex2D *inverts, int32 inNverts, vertex2D *outverts, int32 *ret) {
+ int32 i;
- int outNverts;
+ int32 outNverts;
- int newinNverts;
+ int32 newinNverts;
vertex2D newinverts[MAX_POLYGON_VERTS];
if (SimpleReject(inverts))
diff --git a/engines/icb/gfx/gfxstub_rev_dutch.h b/engines/icb/gfx/gfxstub_rev_dutch.h
index 370e1be77a..ad760ef66d 100644
--- a/engines/icb/gfx/gfxstub_rev_dutch.h
+++ b/engines/icb/gfx/gfxstub_rev_dutch.h
@@ -34,15 +34,15 @@ namespace ICB {
class TextureHandle {
public:
- u_char *pRGBA[9]; // width/1 * height/1 -> width/256 * height/256
- u_int *palette;
- int w;
- int h;
- int bpp;
+ uint8 *pRGBA[9]; // width/1 * height/1 -> width/256 * height/256
+ uint32 *palette;
+ int32 w;
+ int32 h;
+ int32 bpp;
};
-RevTexture *MakeRevTexture(u_int w, u_int h, u_int *palette, u_char *img);
-void Make24palette(u_int *outPal, u_short *inPal);
+RevTexture *MakeRevTexture(uint32 w, uint32 h, uint32 *palette, uint8 *img);
+void Make24palette(uint32 *outPal, uint16 *inPal);
} // End of namespace ICB
diff --git a/engines/icb/gfx/psx_anims.h b/engines/icb/gfx/psx_anims.h
index bb9709dfbb..fa8183d50a 100644
--- a/engines/icb/gfx/psx_anims.h
+++ b/engines/icb/gfx/psx_anims.h
@@ -34,7 +34,7 @@
namespace ICB {
-static inline PXframe_PSX *psxFrameEnOfAnim(unsigned int n, PXanim_PSX *pAnim, const char *file, const int line) {
+static inline PXframe_PSX *psxFrameEnOfAnim(uint32 n, PXanim_PSX *pAnim, const char *file, const int32 line) {
// Convert to the new schema
ConvertPXanim(pAnim);
if (n >= pAnim->frame_qty) {
diff --git a/engines/icb/gfx/psx_camera.h b/engines/icb/gfx/psx_camera.h
index 8bee78c546..f3f10f5d74 100644
--- a/engines/icb/gfx/psx_camera.h
+++ b/engines/icb/gfx/psx_camera.h
@@ -43,12 +43,12 @@ namespace ICB {
typedef struct {
MATRIX view;
- u_short focLen;
+ uint16 focLen;
} psxPCcameraOld;
typedef struct {
MATRIX view;
- u_short focLen;
+ uint16 focLen;
int32 pos[3];
} psxPCcamera;
@@ -56,22 +56,22 @@ typedef struct {
float m[3][3];
float t[3];
float fov;
- int width;
- int height;
+ int32 width;
+ int32 height;
} psxFloatCamera;
typedef struct {
char id[4];
- int schema;
+ int32 schema;
MATRIX view;
- int pan;
- u_short focLen;
- int weatherType;
- int lightning;
- int windx;
- int windy;
- int windz;
- int particleCount;
+ int32 pan;
+ uint16 focLen;
+ int32 weatherType;
+ int32 lightning;
+ int32 windx;
+ int32 windy;
+ int32 windz;
+ int32 particleCount;
} psxCamera;
// Useful camera and co-ordinate system based maths
diff --git a/engines/icb/gfx/psx_light.h b/engines/icb/gfx/psx_light.h
index 0224f3da64..0dc59c3911 100644
--- a/engines/icb/gfx/psx_light.h
+++ b/engines/icb/gfx/psx_light.h
@@ -31,8 +31,8 @@
namespace ICB {
typedef struct psxLight {
- int vx, vy, vz;
- int r, g, b; // don't need to be int's but makes life easier
+ int32 vx, vy, vz;
+ int32 r, g, b; // don't need to be int's but makes life easier
} psxLight;
} // End of namespace ICB
diff --git a/engines/icb/gfx/psx_pcdefines.h b/engines/icb/gfx/psx_pcdefines.h
index 2a164d53dd..2549c38cd3 100644
--- a/engines/icb/gfx/psx_pcdefines.h
+++ b/engines/icb/gfx/psx_pcdefines.h
@@ -31,30 +31,17 @@
#include "common/types.h"
namespace ICB {
-
-// We'll need a u_char type
-typedef unsigned char u_char;
-
-// We'll need a u_short type
-typedef unsigned short u_short;
-
-// a u_int32 type
-// typedef unsigned long u_int32;
-
-// a uint type
-typedef unsigned int u_int;
-
// make our own equivalents
typedef struct MATRIX {
- short m[3][3]; /* 3x3 rotation matrix */
- short pad;
+ int16 m[3][3]; /* 3x3 rotation matrix */
+ int16 pad;
int32 t[3]; /* transfer vector */
MATRIX() { pad = 0; }
} MATRIX;
typedef struct MATRIXPC {
- int m[3][3]; /* 3x3 rotation matrix */
- int pad;
+ int32 m[3][3]; /* 3x3 rotation matrix */
+ int32 pad;
int32 t[3]; /* transfer vector */
MATRIXPC() { pad = 0; }
} MATRIXPC;
@@ -68,26 +55,26 @@ typedef struct VECTOR {
/* short word type 3D vector */
typedef struct SVECTOR {
- short vx, vy;
- short vz, pad;
+ int16 vx, vy;
+ int16 vz, pad;
} SVECTOR;
/* short word type 3D vector - PC version */
typedef struct SVECTORPC {
- int vx, vy;
- int vz, pad;
+ int32 vx, vy;
+ int32 vz, pad;
} SVECTORPC;
typedef struct CVECTOR {
/* color type vector */
- u_char r, g, b, cd;
+ uint8 r, g, b, cd;
} CVECTOR;
typedef struct {/* 2D short vector */
short vx, vy;
} DVECTOR;
-typedef unsigned char PACKET;
+typedef uint8 PACKET;
/* For holding the coordinate frame of the bone animation */
typedef struct _GsCOORDUNIT {
@@ -122,7 +109,7 @@ typedef struct GsTYPEUNIT {
typedef struct GsOT_TAG {
unsigned p : 24;
- unsigned char num : 8;
+ uint8 num : 8;
} GsOT_TAG;
typedef struct GsOT {
@@ -136,22 +123,22 @@ typedef struct GsOT {
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
} GsARGUNIT;
typedef struct {
DVECTOR vec;
- short otz;
- short p;
+ int16 otz;
+ int16 p;
} GsWORKUNIT;
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
uint32 *primtop;
SVECTOR *vertop;
@@ -161,8 +148,8 @@ typedef struct {
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
uint32 *primtop;
SVECTOR *vertop;
@@ -174,8 +161,8 @@ typedef struct {
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
uint32 *imagetop;
uint32 *cluttop;
@@ -184,8 +171,8 @@ typedef struct {
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
uint32 *polytop;
uint32 *boxtop;
@@ -196,8 +183,8 @@ typedef struct {
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
uint32 *polytop;
uint32 *boxtop;
@@ -209,8 +196,8 @@ typedef struct {
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
uint32 *cparam;
GsCOORDUNIT *coord;
@@ -220,8 +207,8 @@ typedef struct {
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
uint32 *lparam;
GsCOORDUNIT *coord;
@@ -231,36 +218,36 @@ typedef struct {
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
uint32 *coord_sect;
int32 *mimepr;
uint32 mimenum;
- u_short mimeid, reserved;
+ uint16 mimeid, reserved;
uint32 *mime_diff_sect;
} GsARGUNIT_JntMIMe;
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
uint32 *coord_sect;
- u_short mimeid, reserved;
+ uint16 mimeid, reserved;
uint32 *mime_diff_sect;
} GsARGUNIT_RstJntMIMe;
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
int32 *mimepr;
uint32 mimenum;
- u_short mimeid, reserved;
+ uint16 mimeid, reserved;
uint32 *mime_diff_sect;
SVECTOR *orgs_vn_sect;
SVECTOR *vert_sect;
@@ -270,10 +257,10 @@ typedef struct {
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
- u_short mimeid, reserved;
+ uint16 mimeid, reserved;
uint32 *mime_diff_sect;
SVECTOR *orgs_vn_sect;
SVECTOR *vert_sect;
@@ -283,8 +270,8 @@ typedef struct {
typedef struct {
uint32 *primp;
GsOT *tagp;
- int shift;
- int offset;
+ int32 shift;
+ int32 offset;
PACKET *out_packetp;
int32 header_size;
uint32 *htop;
@@ -293,25 +280,25 @@ typedef struct {
} GsARGUNIT_ANIM;
typedef struct {
- short idx;
- u_char sid;
- u_char pad;
+ int16 idx;
+ uint8 sid;
+ uint8 pad;
} GsSEH;
typedef struct {
uint32 rewrite_idx;
- u_short size, num;
- u_short ii;
- u_short aframe;
- u_char sid;
- signed char speed;
- u_short srcii;
- short rframe;
- u_short tframe;
- u_short ci, ti;
- u_short start;
- u_char start_sid;
- u_char traveling;
+ uint16 size, num;
+ uint16 ii;
+ uint16 aframe;
+ uint8 sid;
+ int8 speed;
+ uint16 srcii;
+ int16 rframe;
+ uint16 tframe;
+ uint16 ci, ti;
+ uint16 start;
+ uint8 start_sid;
+ uint8 traveling;
} GsSEQ;
/*
diff --git a/engines/icb/gfx/psx_pcgpu.cpp b/engines/icb/gfx/psx_pcgpu.cpp
index 6a75995d03..e518ecbd0a 100644
--- a/engines/icb/gfx/psx_pcgpu.cpp
+++ b/engines/icb/gfx/psx_pcgpu.cpp
@@ -42,19 +42,19 @@ namespace ICB {
void *OTusrData;
// No ABR support : at the moment
-u_short psxTP;
+uint16 psxTP;
// The emulation of VRAM : 16-bit pixels 1024x512 big
-u_short psxVRAM[VRAM_WIDTH * VRAM_HEIGHT];
+uint16 psxVRAM[VRAM_WIDTH * VRAM_HEIGHT];
// Set VRAM to a certain colour
-int ClearImage(RECT16 *rect, u_char r, u_char g, u_char b) {
- u_short colour;
- int x, y;
- int i;
+int32 ClearImage(RECT16 *rect, uint8 r, uint8 g, uint8 b) {
+ uint16 colour;
+ int32 x, y;
+ int32 i;
// Convert 24-bit colour to 15-bit
- colour = (u_short)((r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10));
+ colour = (uint16)((r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10));
for (y = rect->y; y < rect->y + rect->h; y++) {
for (x = rect->x; x < rect->x + rect->w; x++) {
@@ -66,17 +66,17 @@ int ClearImage(RECT16 *rect, u_char r, u_char g, u_char b) {
}
// Fill VRAM with data
-u_short LoadClut(uint32 *clut, int x, int y) {
+uint16 LoadClut(uint32 *clut, int32 x, int32 y) {
RECT16 rect;
- setRECT(&rect, (short)x, (short)y, 256, 1);
+ setRECT(&rect, (int16)x, (int16)y, 256, 1);
LoadImage(&rect, clut);
- return (u_short)getClut(x, y);
+ return (uint16)getClut(x, y);
}
// Fill VRAM with data
-int LoadImage(RECT16 *rect, uint32 *p) {
- int x, y, i;
- u_short *p16 = (u_short *)p;
+int32 LoadImage(RECT16 *rect, uint32 *p) {
+ int32 x, y, i;
+ uint16 *p16 = (uint16 *)p;
for (y = rect->y; y < rect->y + rect->h; y++) {
for (x = rect->x; x < rect->x + rect->w; x++) {
@@ -89,9 +89,9 @@ int LoadImage(RECT16 *rect, uint32 *p) {
}
// Move data around within VRAM
-int MoveImage(RECT16 *rect, int x, int y) {
- int x0, y0, i0;
- int x1, y1, i1;
+int32 MoveImage(RECT16 *rect, int32 x, int32 y) {
+ int32 x0, y0, i0;
+ int32 x1, y1, i1;
y1 = y;
for (y0 = rect->y; y0 < rect->y + rect->h; y0++) {
@@ -108,8 +108,8 @@ int MoveImage(RECT16 *rect, int x, int y) {
}
// Setup the linked list for the OT tags from back to the front
-OT_tag *ClearOTagR(OT_tag *ot, uint size) {
- int i = size - 1;
+OT_tag *ClearOTagR(OT_tag *ot, uint32 size) {
+ int32 i = size - 1;
while (i > 0) {
ot[i].addr = (void *)&ot[i - 1];
ot[i].len = UNLINKED_LEN;
@@ -121,8 +121,8 @@ OT_tag *ClearOTagR(OT_tag *ot, uint size) {
}
// Setup the linked list for the OT tags from front to back
-OT_tag *ClearOTag(OT_tag *ot, uint size) {
- uint i = 0;
+OT_tag *ClearOTag(OT_tag *ot, uint32 size) {
+ uint32 i = 0;
while (i < (size - 1)) {
ot[i].addr = (void *)&ot[i + 1];
ot[i].len = UNLINKED_LEN;
@@ -132,7 +132,7 @@ OT_tag *ClearOTag(OT_tag *ot, uint size) {
return ot;
}
-int nPrims;
+int32 nPrims;
// Draw the damm things
void DrawOTag(OT_tag *ot) {
@@ -156,14 +156,14 @@ void DrawPrim(void *prim) {
P_TAG *p = (P_TAG *)prim;
uint32 code = p->code;
uint32 len = p->len;
- u_short z0 = p->z0;
+ uint16 z0 = p->z0;
void *usr = p->usr;
uint8 alpha = 0x00;
// Catch special primitives
// DR_TPAGE
if ((code & 0xe1) == 0xe1) {
- psxTP = (u_short)(*((uint32 *)&(p->r0)) & 0xFFFF);
+ psxTP = (uint16)(*((uint32 *)&(p->r0)) & 0xFFFF);
len -= GPUSIZE_DR_TPAGE; // we have used one word of data up
// Move the pointer onto the correct place
p++; // move past the P_TAG
@@ -177,7 +177,7 @@ void DrawPrim(void *prim) {
// Get the base alpha value
alpha = ((P_HEADER *)(p))->code;
// Modify that based on tbe ABR value
- u_char abr = (u_char)((psxTP >> 5) & 0x3);
+ uint8 abr = (uint8)((psxTP >> 5) & 0x3);
if (abr == 0) {
// alpha is 0-64, so 32 is average
alpha = 0xC0 | 0x20; // average of background + foreground
diff --git a/engines/icb/gfx/psx_pcgpu.h b/engines/icb/gfx/psx_pcgpu.h
index 6cb3f64b6a..8b1e5fb974 100644
--- a/engines/icb/gfx/psx_pcgpu.h
+++ b/engines/icb/gfx/psx_pcgpu.h
@@ -179,13 +179,13 @@ extern void *OTusrData;
* Primitive Handling Macros
*/
#define setusr(p, _usr) (((P_TAG *)(p))->usr = (void *)(_usr))
-#define setz(p, _z) (((P_TAG *)(p))->z0 = (u_short)(_z))
-#define setlen(p, _len) (((P_TAG *)(p))->len = (u_char)(_len))
+#define setz(p, _z) (((P_TAG *)(p))->z0 = (uint16)(_z))
+#define setlen(p, _len) (((P_TAG *)(p))->len = (uint8)(_len))
#define setaddr(p, _addr) (((P_TAG *)(p))->addr = (void *)(_addr))
-#define setcode(p, _code) (((P_TAG *)(p))->code = (u_char)(_code))
+#define setcode(p, _code) (((P_TAG *)(p))->code = (uint8)(_code))
-#define getlen(p) (u_char)(((P_TAG *)(p))->len)
-#define getcode(p) (u_char)(((P_TAG *)(p))->code)
+#define getlen(p) (uint8)(((P_TAG *)(p))->len)
+#define getcode(p) (uint8)(((P_TAG *)(p))->code)
#define getaddr(p) (void *)(((P_TAG *)(p))->addr)
#define nextPrim(p) (void *)(((P_TAG *)(p))->addr)
@@ -259,36 +259,36 @@ extern void *OTusrData;
* Rectangle:
*/
typedef struct {
- short x, y; /* offset point on VRAM */
- short w, h; /* width and height */
+ int16 x, y; /* offset point on VRAM */
+ int16 w, h; /* width and height */
} RECT16;
typedef struct {
- int x, y; /* offset point on VRAM */
- int w, h; /* width and height */
+ int32 x, y; /* offset point on VRAM */
+ int32 w, h; /* width and height */
} RECT32;
typedef struct {
void *addr;
- u_short len;
- u_short z0;
+ uint16 len;
+ uint16 z0;
void *usr;
- u_char r0, g0, b0, code;
+ uint8 r0, g0, b0, code;
} P_TAG;
-typedef struct { u_char r0, g0, b0, code; } P_CODE;
+typedef struct { uint8 r0, g0, b0, code; } P_CODE;
typedef struct {
void *addr;
- u_short len;
- u_short z0;
+ uint16 len;
+ uint16 z0;
void *usr;
- u_char r0, g0, b0, code;
+ uint8 r0, g0, b0, code;
} OT_tag;
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
+ uint8 r0, g0, b0, code;
} P_HEADER;
/*
@@ -301,22 +301,22 @@ typedef struct {
typedef struct {
RECT16 clip; /* clip area */
- short ofs[2]; /* drawing offset */
+ int16 ofs[2]; /* drawing offset */
RECT16 tw; /* texture window */
- u_short tpage; /* texture page */
- u_char dtd; /* dither flag (0:off, 1:on) */
- u_char dfe; /* flag to draw on display area (0:off 1:on) */
- u_char isbg; /* enable to auto-clear */
- u_char r0, g0, b0; /* initital background color */
+ uint16 tpage; /* texture page */
+ uint8 dtd; /* dither flag (0:off, 1:on) */
+ uint8 dfe; /* flag to draw on display area (0:off 1:on) */
+ uint8 isbg; /* enable to auto-clear */
+ uint8 r0, g0, b0; /* initital background color */
DR_ENV dr_env; /* reserved */
} DRAWENV;
typedef struct {
RECT16 disp; /* display area */
RECT16 screen; /* display start point */
- u_char isinter; /* interlace 0: off 1: on */
- u_char isrgb24; /* RGB24 bit mode */
- u_char pad0, pad1; /* reserved */
+ uint8 isinter; /* interlace 0: off 1: on */
+ uint8 isrgb24; /* RGB24 bit mode */
+ uint8 pad0, pad1; /* reserved */
} DISPENV;
/*
@@ -325,94 +325,94 @@ typedef struct {
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- int x1, y1;
- int x2, y2;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ int32 x1, y1;
+ int32 x2, y2;
} POLY_F3; /* Flat Triangle */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- int x1, y1;
- int x2, y2;
- int x3, y3;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ int32 x1, y1;
+ int32 x2, y2;
+ int32 x3, y3;
} POLY_F4; /* Flat Quadrangle */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_short u0, v0;
- int x1, y1;
- u_short u1, v1;
- int x2, y2;
- u_short u2, v2;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint16 u0, v0;
+ int32 x1, y1;
+ uint16 u1, v1;
+ int32 x2, y2;
+ uint16 u2, v2;
} POLY_FT3; /* Flat Textured Triangle */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_short u0, v0;
- int x1, y1;
- u_short u1, v1;
- int x2, y2;
- u_short u2, v2;
- int x3, y3;
- u_short u3, v3;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint16 u0, v0;
+ int32 x1, y1;
+ uint16 u1, v1;
+ int32 x2, y2;
+ uint16 u2, v2;
+ int32 x3, y3;
+ uint16 u3, v3;
} POLY_FT4; /* Flat Textured Quadrangle */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char r1, g1, b1, pad1;
- int x1, y1;
- u_char r2, g2, b2, pad2;
- int x2, y2;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 r1, g1, b1, pad1;
+ int32 x1, y1;
+ uint8 r2, g2, b2, pad2;
+ int32 x2, y2;
} POLY_G3; /* Gouraud Triangle */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char r1, g1, b1, pad1;
- int x1, y1;
- u_char r2, g2, b2, pad2;
- int x2, y2;
- u_char r3, g3, b3, pad3;
- int x3, y3;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 r1, g1, b1, pad1;
+ int32 x1, y1;
+ uint8 r2, g2, b2, pad2;
+ int32 x2, y2;
+ uint8 r3, g3, b3, pad3;
+ int32 x3, y3;
} POLY_G4; /* Gouraud Quadrangle */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_short u0, v0;
- u_char r1, g1, b1, p1;
- int x1, y1;
- u_short u1, v1;
- u_char r2, g2, b2, p2;
- int x2, y2;
- u_short u2, v2;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint16 u0, v0;
+ uint8 r1, g1, b1, p1;
+ int32 x1, y1;
+ uint16 u1, v1;
+ uint8 r2, g2, b2, p2;
+ int32 x2, y2;
+ uint16 u2, v2;
} POLY_GT3; /* Gouraud Textured Triangle */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_short u0, v0;
- u_char r1, g1, b1, p1;
- int x1, y1;
- u_short u1, v1;
- u_char r2, g2, b2, p2;
- int x2, y2;
- u_short u2, v2;
- u_char r3, g3, b3, p3;
- int x3, y3;
- u_short u3, v3;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint16 u0, v0;
+ uint8 r1, g1, b1, p1;
+ int32 x1, y1;
+ uint16 u1, v1;
+ uint8 r2, g2, b2, p2;
+ int32 x2, y2;
+ uint16 u2, v2;
+ uint8 r3, g3, b3, p3;
+ int32 x3, y3;
+ uint16 u3, v3;
} POLY_GT4; /* Gouraud Textured Quadrangle */
/*
@@ -420,59 +420,59 @@ typedef struct {
*/
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- int x1, y1;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ int32 x1, y1;
} LINE_F2; /* Unconnected Flat Line */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char r1, g1, b1, p1;
- int x1, y1;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 r1, g1, b1, p1;
+ int32 x1, y1;
} LINE_G2; /* Unconnected Gouraud Line */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- int x1, y1;
- int x2, y2;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ int32 x1, y1;
+ int32 x2, y2;
uint32 pad;
} LINE_F3; /* 2 connected Flat Line */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char r1, g1, b1, p1;
- int x1, y1;
- u_char r2, g2, b2, p2;
- int x2, y2;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 r1, g1, b1, p1;
+ int32 x1, y1;
+ uint8 r2, g2, b2, p2;
+ int32 x2, y2;
uint32 pad;
} LINE_G3; /* 2 connected Gouraud Line */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- int x1, y1;
- int x2, y2;
- int x3, y3;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ int32 x1, y1;
+ int32 x2, y2;
+ int32 x3, y3;
uint32 pad;
} LINE_F4; /* 3 connected Flat Line Quadrangle */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char r1, g1, b1, p1;
- int x1, y1;
- u_char r2, g2, b2, p2;
- int x2, y2;
- u_char r3, g3, b3, p3;
- int x3, y3;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 r1, g1, b1, p1;
+ int32 x1, y1;
+ uint8 r2, g2, b2, p2;
+ int32 x2, y2;
+ uint8 r3, g3, b3, p3;
+ int32 x3, y3;
uint32 pad;
} LINE_G4; /* 3 connected Gouraud Line */
@@ -481,24 +481,24 @@ typedef struct {
*/
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_short u0, v0;
- short w, h;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint16 u0, v0;
+ int16 w, h;
} SPRT; /* free size Sprite */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_short u0, v0;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint16 u0, v0;
} SPRT_16; /* 16x16 Sprite */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_short u0, v0;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint16 u0, v0;
} SPRT_8; /* 8x8 Sprite */
/*
@@ -506,27 +506,27 @@ typedef struct {
*/
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
- short w, h;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ int16 w, h;
} TILE; /* free size Tile */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
} TILE_16; /* 16x16 Tile */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
} TILE_8; /* 8x8 Tile */
typedef struct {
P_TAG tag;
- u_char r0, g0, b0, code;
- int x0, y0;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
} TILE_1; /* 1x1 Tile */
/*
@@ -584,13 +584,13 @@ typedef struct {
*/
typedef struct {
uint32 id;
- u_char r0, g0, b0, p0; /* Color of vertex 0 */
- u_char r1, g1, b1, p1; /* Color of vertex 1 */
- u_char r2, g2, b2, p2; /* Color of vertex 2 */
- u_char r3, g3, b3, p3; /* Color of vertex 3 */
- u_short tpage, clut; /* texture page ID, clut ID */
- u_char u0, v0, u1, v1; /* texture corner point */
- u_char u2, v2, u3, v3;
+ uint8 r0, g0, b0, p0; /* Color of vertex 0 */
+ uint8 r1, g1, b1, p1; /* Color of vertex 1 */
+ uint8 r2, g2, b2, p2; /* Color of vertex 2 */
+ uint8 r3, g3, b3, p3; /* Color of vertex 3 */
+ uint16 tpage, clut; /* texture page ID, clut ID */
+ uint8 u0, v0, u1, v1; /* texture corner point */
+ uint8 u2, v2, u3, v3;
/* independent vertex model */
SVECTOR x0, x1, x2, x3; /* 3D corner point */
@@ -600,10 +600,10 @@ typedef struct {
SVECTOR *v_ofs; /* offset to vertex database */
SVECTOR *n_ofs; /* offset to normal database */
- u_short vert0, vert1; /* index of vertex */
- u_short vert2, vert3;
- u_short norm0, norm1; /* index of normal */
- u_short norm2, norm3;
+ uint16 vert0, vert1; /* index of vertex */
+ uint16 vert2, vert3;
+ uint16 norm0, norm1; /* index of normal */
+ uint16 norm2, norm3;
} TMD_PRIM;
@@ -618,9 +618,9 @@ typedef struct {
uint32 *paddr; /* texture image address on main memory */
} TIM_IMAGE;
-extern int LoadImage(RECT16 *rect, uint32 *p);
-extern OT_tag *ClearOTag(OT_tag *ot, uint n);
-extern OT_tag *ClearOTagR(OT_tag *ot, uint n);
+extern int32 LoadImage(RECT16 *rect, uint32 *p);
+extern OT_tag *ClearOTag(OT_tag *ot, uint32 n);
+extern OT_tag *ClearOTagR(OT_tag *ot, uint32 n);
extern void DrawOTag(OT_tag *p);
extern void DrawPrim(void *p);
diff --git a/engines/icb/gfx/psx_pchmd.h b/engines/icb/gfx/psx_pchmd.h
index de1bf48f5e..c623bd077e 100644
--- a/engines/icb/gfx/psx_pchmd.h
+++ b/engines/icb/gfx/psx_pchmd.h
@@ -54,9 +54,9 @@ const int32 HMD_FTL3_SIZE = 5;
const int32 HMD_GTL3_SIZE = 6;
const int32 TRIANGLE_SIZE = 2;
-int decodeHMDpolygon(uint primType, uint pcplatform, uint32 *&pp, uint &code0, uint &r0, uint &g0, uint &b0, uint &code1, uint &r1, uint &g1, uint &b1, uint &code2, uint &r2,
- uint &g2, uint &b2, uint &u0, uint &v0, uint &u1, uint &v1, uint &u2, uint &v2, uint &cba, uint &cx, uint &cy, uint &tsb, uint &tp, uint &n0, uint &vert0,
- uint &n1, uint &vert1, uint &n2, uint &vert2, uint dump);
+int32 decodeHMDpolygon(uint32 primType, uint32 pcplatform, uint32 *&pp, uint32 &code0, uint32 &r0, uint32 &g0, uint32 &b0, uint32 &code1, uint32 &r1, uint32 &g1, uint32 &b1, uint32 &code2, uint32 &r2,
+ uint32 &g2, uint32 &b2, uint32 &u0, uint32 &v0, uint32 &u1, uint32 &v1, uint32 &u2, uint32 &v2, uint32 &cba, uint32 &cx, uint32 &cy, uint32 &tsb, uint32 &tp, uint32 &n0, uint32 &vert0,
+ uint32 &n1, uint32 &vert1, uint32 &n2, uint32 &vert2, uint32 dump);
// Handy structures for decoding polygon information
@@ -71,7 +71,7 @@ int decodeHMDpolygon(uint primType, uint pcplatform, uint32 *&pp, uint &code0, u
// vp1 | vp0
// pad | vp2
typedef struct PolyFUS3 {
- u_char r0, g0, b0, code0;
+ uint8 r0, g0, b0, code0;
uint16 vp0, vp1;
uint16 vp2, pad;
} PolyFUS3;
@@ -89,9 +89,9 @@ typedef struct PolyFUS3 {
// vp1 | vp0
// pad | vp2
typedef struct PolyGUS3 {
- u_char r0, g0, b0, code0;
- u_char r1, g1, b1, code1;
- u_char r2, g2, b2, code2;
+ uint8 r0, g0, b0, code0;
+ uint8 r1, g1, b1, code1;
+ uint8 r2, g2, b2, code2;
uint16 vp0, vp1;
uint16 vp2, pad;
} PolyGUS3;
@@ -111,12 +111,12 @@ typedef struct PolyGUS3 {
// --------------------------
// vp2 | vp1
typedef struct PolyFTS3 {
- u_char r0, g0, b0, code0;
- u_char u0, v0;
+ uint8 r0, g0, b0, code0;
+ uint8 u0, v0;
uint16 cba;
- u_char u1, v1;
+ uint8 u1, v1;
uint16 tsb;
- u_char u2, v2;
+ uint8 u2, v2;
uint16 vp0;
uint16 vp1, vp2;
} PolyFTS3;
@@ -138,14 +138,14 @@ typedef struct PolyFTS3 {
// --------------------------
// vp2 | vp2
typedef struct PolyGTS3 {
- u_char r0, g0, b0, code0;
- u_char r1, g1, b1, code1;
- u_char r2, g2, b2, code2;
- u_char u0, v0;
+ uint8 r0, g0, b0, code0;
+ uint8 r1, g1, b1, code1;
+ uint8 r2, g2, b2, code2;
+ uint8 u0, v0;
uint16 cba;
- u_char u1, v1;
+ uint8 u1, v1;
uint16 tsb;
- u_char u2, v2;
+ uint8 u2, v2;
uint16 vp0;
uint16 vp1, vp2;
} PolyGTS3;
@@ -161,7 +161,7 @@ typedef struct PolyGTS3 {
// vp0 | np0
// vp2 | vp1
typedef struct PolyFUL3 {
- u_char r0, g0, b0, code0;
+ uint8 r0, g0, b0, code0;
uint16 np0, vp0;
uint16 vp1, vp2;
} PolyFUL3;
@@ -178,7 +178,7 @@ typedef struct PolyFUL3 {
// vp1 | np1
// vp2 | np2
typedef struct PolyGUL3 {
- u_char r0, g0, b0, code0;
+ uint8 r0, g0, b0, code0;
uint16 np0, vp0;
uint16 np1, vp1;
uint16 np2, vp2;
@@ -198,11 +198,11 @@ typedef struct PolyGUL3 {
// vp0 | np0
// vp2 | vp1
typedef struct PolyFTL3 {
- u_char u0, v0;
+ uint8 u0, v0;
uint16 cba;
- u_char u1, v1;
+ uint8 u1, v1;
uint16 tsb;
- u_char u2, v2;
+ uint8 u2, v2;
uint16 pad;
uint16 np0, vp0;
uint16 vp1, vp2;
@@ -224,11 +224,11 @@ typedef struct PolyFTL3 {
// vp2 | np2
//
typedef struct PolyGTL3 {
- u_char u0, v0;
+ uint8 u0, v0;
uint16 cba;
- u_char u1, v1;
+ uint8 u1, v1;
uint16 tsb;
- u_char u2, v2;
+ uint8 u2, v2;
uint16 pad;
uint16 np0, vp0;
uint16 np1, vp1;
diff --git a/engines/icb/gfx/psx_poly.h b/engines/icb/gfx/psx_poly.h
index 6c6654960d..32f6bb9b42 100644
--- a/engines/icb/gfx/psx_poly.h
+++ b/engines/icb/gfx/psx_poly.h
@@ -112,7 +112,7 @@ namespace ICB {
#define zeroTagPoly(p) (setaddr((&(p)->tag_poly), 0), setlen((&(p)->tag_poly), 0) = 0)
-#define setlen(p, _len) (((P_TAG *)(p))->len = (u_char)(_len))
+#define setlen(p, _len) (((P_TAG *)(p))->len = (uint8)(_len))
#define setTDrawTPageSize(p, s) setlen((p), (s)), setTcode((p), _get_mode(0, 1, 0))
@@ -150,107 +150,107 @@ namespace ICB {
typedef struct __tpoly_f3 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- int x1, y1;
- int x2, y2;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ int32 x1, y1;
+ int32 x2, y2;
} TPOLY_F3; // Flat Triangle with ABR control
typedef struct __tpoly_f4 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- int x1, y1;
- int x2, y2;
- int x3, y3;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ int32 x1, y1;
+ int32 x2, y2;
+ int32 x3, y3;
} TPOLY_F4; // Flat Quadrangle with ABR control
typedef struct __tpoly_g3 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char r1, g1, b1, pad1;
- int x1, y1;
- u_char r2, g2, b2, pad2;
- int x2, y2;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 r1, g1, b1, pad1;
+ int32 x1, y1;
+ uint8 r2, g2, b2, pad2;
+ int32 x2, y2;
} TPOLY_G3; // Gouraud Triangle with ABR control
typedef struct __tpoly_g4 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char r1, g1, b1, pad1;
- int x1, y1;
- u_char r2, g2, b2, pad2;
- int x2, y2;
- u_char r3, g3, b3, pad3;
- int x3, y3;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 r1, g1, b1, pad1;
+ int32 x1, y1;
+ uint8 r2, g2, b2, pad2;
+ int32 x2, y2;
+ uint8 r3, g3, b3, pad3;
+ int32 x3, y3;
} TPOLY_G4; // Gouraud Quadrangle with ABR control
typedef struct __tline_f2 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- int x1, y1;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ int32 x1, y1;
} TLINE_F2; // Unconnected Flat Line with ABR control
typedef struct __tline_g2 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char r1, g1, b1, p1;
- int x1, y1;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 r1, g1, b1, p1;
+ int32 x1, y1;
} TLINE_G2; // Unconnected Gouraud Line with ABR control
typedef struct __tline_f3 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- int x1, y1;
- int x2, y2;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ int32 x1, y1;
+ int32 x2, y2;
uint32 pad;
} TLINE_F3; // 2 connected Flat Line with ABR control
typedef struct __tline_g3 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char r1, g1, b1, p1;
- int x1, y1;
- u_char r2, g2, b2, p2;
- int x2, y2;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 r1, g1, b1, p1;
+ int32 x1, y1;
+ uint8 r2, g2, b2, p2;
+ int32 x2, y2;
uint32 pad;
} TLINE_G3; // 2 connected Gouraud Line with ABR control
typedef struct __tline_f4 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- int x1, y1;
- int x2, y2;
- int x3, y3;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ int32 x1, y1;
+ int32 x2, y2;
+ int32 x3, y3;
uint32 pad;
} TLINE_F4; // 3 connected Flat Line Quadrangle with ABR control
typedef struct __tline_g4 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char r1, g1, b1, p1;
- int x1, y1;
- u_char r2, g2, b2, p2;
- int x2, y2;
- u_char r3, g3, b3, p3;
- int x3, y3;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 r1, g1, b1, p1;
+ int32 x1, y1;
+ uint8 r2, g2, b2, p2;
+ int32 x2, y2;
+ uint8 r3, g3, b3, p3;
+ int32 x3, y3;
uint32 pad;
} TLINE_G4; // 3 connected Gouraud Line with ABR control
@@ -258,58 +258,58 @@ typedef struct __tline_g4 {
typedef struct __tsprt {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char u0, v0;
- u_short clut;
- short w, h;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 u0, v0;
+ uint16 clut;
+ int16 w, h;
} TSPRT; // Free size Sprite with TPage/ABR control
typedef struct __tsprt_16 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char u0, v0;
- u_short clut;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 u0, v0;
+ uint16 clut;
} TSPRT_16; // 16x16 Sprite with TPage/ABR control
typedef struct __tsprt_8 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- u_char u0, v0;
- u_short clut;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ uint8 u0, v0;
+ uint16 clut;
} TSPRT_8; // 8x8 Sprite with TPage/ABR control
typedef struct __ttile {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
- short w, h;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
+ int16 w, h;
} TTILE; // free size Tile with ABR control
typedef struct __ttile16 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
} TTILE_16; // 16x16 Tile with ABR control
typedef struct __ttile_8 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
} TTILE_8; // 8x8 Tile with ABR control
typedef struct __ttile_1 {
P_TAG tag;
OT_tag tag_poly;
- u_char r0, g0, b0, code;
- int x0, y0;
+ uint8 r0, g0, b0, code;
+ int32 x0, y0;
} TTILE_1; // 1x1 Tile with ABR control
} // End of namespace ICB
diff --git a/engines/icb/gfx/psx_props.h b/engines/icb/gfx/psx_props.h
index cd961baad8..3d02af6f81 100644
--- a/engines/icb/gfx/psx_props.h
+++ b/engines/icb/gfx/psx_props.h
@@ -71,10 +71,10 @@ namespace ICB {
uint8 zdata[w*h];
psxZOverlay layers[n]
{
- short xs, xe;
- short ys, ye;
- u_short zs, ze;
- u_short dZScale, dZShift;
+ int16 xs, xe;
+ int16 ys, ye;
+ uint16 zs, ze;
+ uint16 dZScale, dZShift;
}
}
}
@@ -112,10 +112,10 @@ namespace ICB {
uint8 zdata[w*h];
psxZOverlay layers[n]
{
- short xs, xe;
- short ys, ye;
- u_short zs, ze;
- u_short dZScale, dZShift;
+ int16 xs, xe;
+ int16 ys, ye;
+ uint16 zs, ze;
+ uint16 dZScale, dZShift;
}
}
}
diff --git a/engines/icb/gfx/psx_pxactor.h b/engines/icb/gfx/psx_pxactor.h
index a53a299e4f..db50c44e84 100644
--- a/engines/icb/gfx/psx_pxactor.h
+++ b/engines/icb/gfx/psx_pxactor.h
@@ -44,7 +44,7 @@ typedef struct psxActor {
MATRIX lw;
SVECTOR rot;
SVECTOR pos;
- int style;
+ int32 style;
// Screen postion
SVECTOR sPos;
@@ -60,7 +60,7 @@ typedef struct psxActor {
SVECTOR shadowBox[MAX_SHADOWS][8];
SVECTOR shadowMinBox[MAX_SHADOWS];
SVECTOR shadowMaxBox[MAX_SHADOWS];
- uint nShadows;
+ uint32 nShadows;
} psxActor;
diff --git a/engines/icb/gfx/psx_scrn.h b/engines/icb/gfx/psx_scrn.h
index 8d94c5d1fc..55b66f5b4b 100644
--- a/engines/icb/gfx/psx_scrn.h
+++ b/engines/icb/gfx/psx_scrn.h
@@ -67,14 +67,14 @@ typedef struct DoubleBuffer {
// #define MAX_DRLOADS 2048
// Screen position for 0,0
-extern int scrn_ox;
-extern int scrn_oy;
+extern int32 scrn_ox;
+extern int32 scrn_oy;
// Global double buffer and drawing functions
void SwapDoubleBuffer(void);
void SwapBufferIndex(void);
-void DrawDisplayList(int buf);
-void Init_display(int w, int h, int x1, int y1, int x2, int y2, int ox, int oy, int clear);
+void DrawDisplayList(int32 buf);
+void Init_display(int32 w, int32 h, int32 x1, int32 y1, int32 x2, int32 y2, int32 ox, int32 oy, int32 clear);
void RenderCycle(void);
// Global double buffer and drawing variables
@@ -82,22 +82,22 @@ void RenderCycle(void);
extern OT_tag *otarray[2];
extern OT_tag *drawot;
-extern int drawBuf;
-extern int dont_set_dispbuf;
+extern int32 drawBuf;
+extern int32 dont_set_dispbuf;
extern DoubleBuffer db[2];
extern DoubleBuffer *pdb;
-extern u_int reloadFont;
-extern int global_use_otlist;
+extern uint32 reloadFont;
+extern int32 global_use_otlist;
// A global array place in which to create GPU packets
-typedef u_char GPUPACKET;
+typedef uint8 GPUPACKET;
extern GPUPACKET *drawpacket;
extern GPUPACKET *drawpacketStart;
extern GPUPACKET *drawpacketEnd;
// For tracking the maximum number of packets used
-extern int globalPacketMax;
-extern int packetsUsed;
+extern int32 globalPacketMax;
+extern int32 packetsUsed;
// How much to shift & then offset the z values from gte to
// put them into the otlist
@@ -105,7 +105,7 @@ extern int32 otz_shift;
extern int32 otz_offset;
// Enable/disable updating of the auto-sliding & scaling min,max z position
-extern int update_minmaxzpos;
+extern int32 update_minmaxzpos;
// Global graphics options for z-clipping and camera scalings
extern int32 minZOTpos;
@@ -161,7 +161,7 @@ static inline void addPrims(uint32 *ot, void *p0, void *p1) {
// Cheers to Nick Pelling for this excellent mySetDrawLoad
// This one is a straight forward inline version of SetDrawLoad
// and adds the DR_FLUSH onto the end
-static inline void mySetDrawLoad(DR_LOAD *p, RECT16 *r, int length) {
+static inline void mySetDrawLoad(DR_LOAD *p, RECT16 *r, int32 length) {
p->code[0] = (uint32)(0xA0 << 24); // 0xA0000000
p->code[1] = *((uint32 *)r);
p->code[2] = *((uint32 *)r + 1);
@@ -170,7 +170,7 @@ static inline void mySetDrawLoad(DR_LOAD *p, RECT16 *r, int length) {
}
// This one is just like SetDrawLoad but does not add the DR_FLUSH on the end
-static inline void mySetDrawLoadNoFlush(DR_LOAD *p, RECT16 *r, int length) {
+static inline void mySetDrawLoadNoFlush(DR_LOAD *p, RECT16 *r, int32 length) {
p->code[0] = (uint32)(0xA0 << 24); // 0xA0000000
p->code[1] = *((uint32 *)r);
p->code[2] = *((uint32 *)r + 1);
@@ -179,7 +179,7 @@ static inline void mySetDrawLoadNoFlush(DR_LOAD *p, RECT16 *r, int length) {
}
// Handy function for using the packets global array
-static inline void myAddPacket(int len) {
+static inline void myAddPacket(int32 len) {
// Advance to next spot :
// can still fail e.g. add a small packet then try to add a large packet
drawpacket += len;
@@ -189,7 +189,7 @@ static inline void myAddPacket(int len) {
}
// Handy function for putting a DR_LOAD into the packets global array
-static inline void myAddDRLOAD(RECT16 *r, uint32 *pot, int length) {
+static inline void myAddDRLOAD(RECT16 *r, uint32 *pot, int32 length) {
mySetDrawLoad((DR_LOAD *)drawpacket, r, length);
addPrim(pot, drawpacket);
myAddPacket(((5 + length) << 2));
@@ -197,7 +197,7 @@ static inline void myAddDRLOAD(RECT16 *r, uint32 *pot, int length) {
// Handy function for putting a DR_LOAD into the packets global array
// but without adding a DR_FLUSH onto the end
-static inline void myAddDRLOADNoFlush(RECT16 *r, uint32 *pot, int length) {
+static inline void myAddDRLOADNoFlush(RECT16 *r, uint32 *pot, int32 length) {
mySetDrawLoadNoFlush((DR_LOAD *)drawpacket, r, length);
addPrim(pot, drawpacket);
myAddPacket(((4 + length) << 2));
diff --git a/engines/icb/gfx/psx_tman.cpp b/engines/icb/gfx/psx_tman.cpp
index 7dcb6ef9c5..1448141593 100644
--- a/engines/icb/gfx/psx_tman.cpp
+++ b/engines/icb/gfx/psx_tman.cpp
@@ -41,15 +41,15 @@ void TextureManager::Init(short nx0, short ny0, short nx1, short ny1) {
y0 = ny0;
x1 = nx1;
y1 = ny1;
- tileW = (short)((x1 - x0) / N_TILES_X);
- tileH = (short)((y1 - y0) / N_TILES_Y);
+ tileW = (int16)((x1 - x0) / N_TILES_X);
+ tileH = (int16)((y1 - y0) / N_TILES_Y);
nSlotsUsed = 0;
nPalettesUsed = 0;
- int t;
+ int32 t;
for (t = 0; t < MAX_NUMBER_TILES; t++) {
inuse[t] = 0;
}
- int s;
+ int32 s;
for (s = 0; s < MAX_NUMBER_SLOTS; s++) {
tSlots[s].id = 0;
tSlots[s].age = 0;
@@ -62,8 +62,8 @@ void TextureManager::Init(short nx0, short ny0, short nx1, short ny1) {
TextureManager::~TextureManager() {}
-TextureInfo *TextureManager::FindTexture(u_int id, u_int age) {
- u_int s;
+TextureInfo *TextureManager::FindTexture(uint32 id, uint32 age) {
+ uint32 s;
TextureInfo *slot = tSlots;
for (s = 0; s < MAX_NUMBER_SLOTS; s++) {
if (slot->id == id) {
@@ -76,7 +76,7 @@ TextureInfo *TextureManager::FindTexture(u_int id, u_int age) {
return NULL;
}
-TextureInfo *TextureManager::AddTexture(uint32 * /*tim_ptr*/, u_int id, u_int age, u_short imgW, u_short imgH) {
+TextureInfo *TextureManager::AddTexture(uint32 * /*tim_ptr*/, uint32 id, uint32 age, uint16 imgW, uint16 imgH) {
// printf( "Adding Texture %X", id );
if (id == 0) {
Message_box("AddTexture 0 ID");
@@ -84,22 +84,22 @@ TextureInfo *TextureManager::AddTexture(uint32 * /*tim_ptr*/, u_int id, u_int ag
}
// Try to find a slot for it
- u_int t = 0;
- u_int s = 0;
- u_int purges = 0;
+ uint32 t = 0;
+ uint32 s = 0;
+ uint32 purges = 0;
- u_int oldest;
- u_int fitted = 0;
+ uint32 oldest;
+ uint32 fitted = 0;
TextureInfo *slot;
- u_int xt = 0;
- u_int yt = 0;
- u_int ntx0 = (imgW + tileW - 1) / tileW;
- u_int nty0 = (imgH + tileH - 1) / tileH;
+ uint32 xt = 0;
+ uint32 yt = 0;
+ uint32 ntx0 = (imgW + tileW - 1) / tileW;
+ uint32 nty0 = (imgH + tileH - 1) / tileH;
- u_int x, y;
- u_int xend, yend;
- u_int dy = N_TILES_X;
- u_int place0, place;
+ uint32 x, y;
+ uint32 xend, yend;
+ uint32 dy = N_TILES_X;
+ uint32 place0, place;
while (fitted == 0) {
xt = 0;
yt = 0;
@@ -188,10 +188,10 @@ TextureInfo *TextureManager::AddTexture(uint32 * /*tim_ptr*/, u_int id, u_int ag
tSlots[purges].age = 0;
// Now more tricky reset the inuse flags
RECT16 *pr = &(tSlots[purges].r);
- u_int tx = (pr->x - x0) / tileW;
- u_int ty = (pr->y - y0) / tileH;
- u_int ntx = pr->w / tileW;
- u_int nty = pr->h / tileH;
+ uint32 tx = (pr->x - x0) / tileW;
+ uint32 ty = (pr->y - y0) / tileH;
+ uint32 ntx = pr->w / tileW;
+ uint32 nty = pr->h / tileH;
if (ntx == 0)
ntx = 1;
if (nty == 0)
@@ -231,21 +231,21 @@ TextureInfo *TextureManager::AddTexture(uint32 * /*tim_ptr*/, u_int id, u_int ag
if (yt > N_TILES_Y) {
Message_box("bad yt %d", yt);
}
- slot->r.x = (short)(xt * tileW + x0);
- slot->r.y = (short)(yt * tileH + y0);
+ slot->r.x = (int16)(xt * tileW + x0);
+ slot->r.y = (int16)(yt * tileH + y0);
slot->r.w = imgW;
slot->r.h = imgH;
- slot->tsb = (short)getTPage(1, 0, slot->r.x, slot->r.y); // 8-bit, b+f
- slot->cba = (short)getClut(CHARACTER_CLUT_X, (CHARACTER_CLUT_Y + s));
- slot->uoffset = (u_char)(slot->r.x - ((slot->tsb & 0xF) << 6));
- slot->voffset = (u_char)(slot->r.y - (((slot->tsb >> 4) & 0x1) << 8));
+ slot->tsb = (int16)getTPage(1, 0, slot->r.x, slot->r.y); // 8-bit, b+f
+ slot->cba = (int16)getClut(CHARACTER_CLUT_X, (CHARACTER_CLUT_Y + s));
+ slot->uoffset = (uint8)(slot->r.x - ((slot->tsb & 0xF) << 6));
+ slot->voffset = (uint8)(slot->r.y - (((slot->tsb >> 4) & 0x1) << 8));
return slot;
}
void TextureManager::PurgeAll(void) { Init(x0, y0, x1, y1); }
-PaletteInfo *TextureManager::FindPalette(u_int id, u_int age) {
- u_int s;
+PaletteInfo *TextureManager::FindPalette(uint32 id, uint32 age) {
+ uint32 s;
PaletteInfo *slot = pSlots;
for (s = 0; s < MAX_NUMBER_SLOTS; s++) {
if (slot->id == id) {
@@ -257,12 +257,12 @@ PaletteInfo *TextureManager::FindPalette(u_int id, u_int age) {
return NULL;
}
-PaletteInfo *TextureManager::AddPalette(uint32 * /*clut_ptr*/, u_int id, u_int age) {
+PaletteInfo *TextureManager::AddPalette(uint32 * /*clut_ptr*/, uint32 id, uint32 age) {
if (nPalettesUsed < MAX_NUMBER_PALETTES) {
PaletteInfo *slot = &(pSlots[nPalettesUsed]);
slot->x = CHARACTER_ALTERNATE_CLUT_X;
- slot->y = (short)(CHARACTER_ALTERNATE_CLUT_Y + nPalettesUsed);
- slot->cba = (short)getClut(slot->x, slot->y);
+ slot->y = (int16)(CHARACTER_ALTERNATE_CLUT_Y + nPalettesUsed);
+ slot->cba = (int16)getClut(slot->x, slot->y);
slot->id = id;
slot->age = age;
diff --git a/engines/icb/gfx/psx_tman.h b/engines/icb/gfx/psx_tman.h
index f2ead0d1fd..ad22ad8d26 100644
--- a/engines/icb/gfx/psx_tman.h
+++ b/engines/icb/gfx/psx_tman.h
@@ -43,48 +43,48 @@ namespace ICB {
typedef struct TextureInfo {
// DO NOT CHANGE THIS SECTION OF THE STRUCTURE
// AS PSX ASSMEBLER ROUTINES RELY ON IT BEING LIKE THIS
- short tsb; // tpf | abr | texture_page = getTpate( tpf, abr, x, y );
- short cba; // cy | cx = getClut(cx,cy)
- u_char uoffset;
- u_char voffset;
- short padding;
+ int16 tsb; // tpf | abr | texture_page = getTpate( tpf, abr, x, y );
+ int16 cba; // cy | cx = getClut(cx,cy)
+ uint8 uoffset;
+ uint8 voffset;
+ int16 padding;
// DO WHAT YOU LIKE FROM HERE ONWARDS
- u_int id;
- u_int age;
+ uint32 id;
+ uint32 age;
RECT16 r;
} TextureInfo;
typedef struct PaletteInfo {
- u_int id;
- u_int age;
- short x;
- short y;
- short cba; // cy | cx = getClut(cx,cy)
- short padding;
+ uint32 id;
+ uint32 age;
+ int16 x;
+ int16 y;
+ int16 cba; // cy | cx = getClut(cx,cy)
+ int16 padding;
} PaletteInfo;
class TextureManager {
public:
TextureManager();
- TextureManager(short nx0, short ny0, short nx1, short ny1);
+ TextureManager(int16 nx0, int16 ny0, int16 nx1, int16 ny1);
~TextureManager();
- void Init(short nx0, short ny0, short nx1, short ny1);
- TextureInfo *FindTexture(u_int id, u_int age);
- TextureInfo *AddTexture(uint32 *tim_ptr, u_int id, u_int age, u_short imgW, u_short imgH);
+ void Init(int16 nx0, int16 ny0, int16 nx1, int16 ny1);
+ TextureInfo *FindTexture(uint32 id, uint32 age);
+ TextureInfo *AddTexture(uint32 *tim_ptr, uint32 id, uint32 age, uint16 imgW, uint16 imgH);
- PaletteInfo *FindPalette(u_int id, u_int age);
- PaletteInfo *AddPalette(uint32 *clut_ptr, u_int id, u_int age);
+ PaletteInfo *FindPalette(uint32 id, uint32 age);
+ PaletteInfo *AddPalette(uint32 *clut_ptr, uint32 id, uint32 age);
void PurgeAll(void);
TextureInfo tSlots[MAX_NUMBER_SLOTS];
PaletteInfo pSlots[MAX_NUMBER_PALETTES];
- u_char inuse[MAX_NUMBER_TILES];
- short x0, y0;
- short x1, y1;
- u_short tileW, tileH;
- u_int nSlotsUsed;
- u_int nPalettesUsed;
+ uint8 inuse[MAX_NUMBER_TILES];
+ int16 x0, y0;
+ int16 x1, y1;
+ uint16 tileW, tileH;
+ uint32 nSlotsUsed;
+ uint32 nPalettesUsed;
};
} // End of namespace ICB
diff --git a/engines/icb/gfx/rab_api.cpp b/engines/icb/gfx/rab_api.cpp
index 7465d8ac50..d01922c818 100644
--- a/engines/icb/gfx/rab_api.cpp
+++ b/engines/icb/gfx/rab_api.cpp
@@ -34,7 +34,7 @@ namespace ICB {
// Decompress the FrameData into the CurrentFrame data storage
// e.g. undo the delta compression or replace the zero ignored
// values with zero
-Bone_Frame *rab_API::GetFrame(const int f) {
+Bone_Frame *rab_API::GetFrame(const int32 f) {
Bone_Frame *curFrm = GetCurrentFrame();
Bone_Frame *prevFrm = NULL;
@@ -50,22 +50,22 @@ Bone_Frame *rab_API::GetFrame(const int f) {
// For deltas we need the previous frame
if ((frm->typeSize & DataTypeDeltas) != 0) {
prevFrm = GetFrame(f - 1);
- int dcvx;
- int dcvy;
- int dcvz;
- int prevVx;
- int prevVy;
- int prevVz;
- int curVx;
- int curVy;
- int curVz;
- int temp;
- int prevCrot;
- int nBits = 0;
- int min;
- int mask;
- int storeZero;
- int dataSize;
+ int32 dcvx;
+ int32 dcvy;
+ int32 dcvz;
+ int32 prevVx;
+ int32 prevVy;
+ int32 prevVz;
+ int32 curVx;
+ int32 curVy;
+ int32 curVz;
+ int32 temp;
+ int32 prevCrot;
+ int32 nBits = 0;
+ int32 min;
+ int32 mask;
+ int32 storeZero;
+ int32 dataSize;
// So just need to add on the deltas to the previous frame !
{
@@ -92,7 +92,7 @@ Bone_Frame *rab_API::GetFrame(const int f) {
temp = 0;
if (storeZero == 0) {
- b = (int)(*data);
+ b = (int32)(*data);
data++;
} else {
b = i;
@@ -167,7 +167,7 @@ Bone_Frame *rab_API::GetFrame(const int f) {
}
// Then update the angles which are non-zero
for (i = 0; i < nt; i++) {
- b = (int)(*data);
+ b = (int32)(*data);
memcpy(&(curFrm->bones[b].crot), (data + 1), sizeof(CompTriplet));
data += NONZERO_ANGLES_32_BYTE_SIZE;
}
@@ -177,7 +177,7 @@ Bone_Frame *rab_API::GetFrame(const int f) {
}
}
curFrm->poseBone = frm->poseBone;
- currentFrame = (u_char)f;
+ currentFrame = (uint8)f;
}
return curFrm;
@@ -185,7 +185,7 @@ Bone_Frame *rab_API::GetFrame(const int f) {
// Compress an SVECTOR ( uint16 vx,vy,vz, pad; ) -> uint32
// by dividing the angles (12-bits 0-4095) by four to make them 10-bits
-int CompressSVECTOR(SVECTOR rotin, CompTriplet *rotout) {
+int32 CompressSVECTOR(SVECTOR rotin, CompTriplet *rotout) {
int16 vx = rotin.vx;
int16 vy = rotin.vy;
int16 vz = rotin.vz;
@@ -199,13 +199,13 @@ int CompressSVECTOR(SVECTOR rotin, CompTriplet *rotout) {
vz += 4096;
// Reduce to 10-bits
- vx = (short)((vx >> COMP_ANGLE_SHIFT) & COMP_VX_MASK);
- vy = (short)((vy >> COMP_ANGLE_SHIFT) & COMP_VY_MASK);
- vz = (short)((vz >> COMP_ANGLE_SHIFT) & COMP_VZ_MASK);
+ vx = (int16)((vx >> COMP_ANGLE_SHIFT) & COMP_VX_MASK);
+ vy = (int16)((vy >> COMP_ANGLE_SHIFT) & COMP_VY_MASK);
+ vz = (int16)((vz >> COMP_ANGLE_SHIFT) & COMP_VZ_MASK);
// Pack into a single int32
// x = 10-bits into upper rot
- int temp = (vx << COMP_VX_SHIFT);
+ int32 temp = (vx << COMP_VX_SHIFT);
// y = 10-bits into middle rot
temp |= (vy << COMP_VY_SHIFT);
// z = 10-bits into lower rot
diff --git a/engines/icb/gfx/rab_api.h b/engines/icb/gfx/rab_api.h
index 7035bc588a..a5662e2639 100644
--- a/engines/icb/gfx/rab_api.h
+++ b/engines/icb/gfx/rab_api.h
@@ -157,17 +157,17 @@ typedef struct rab_API {
// byte offsets from start of the file
uint32 frameOffsets[1]; // nFrames of them
- Bone_Frame *GetFrame(const int f);
+ Bone_Frame *GetFrame(const int32 f);
Bone_Frame *GetCurrentFrame(void) { return (Bone_Frame *)((uint8 *)(id + currentFrameOffset)); }
- FrameData *GetFrameData(const int f) { return (FrameData *)((uint8 *)(id + frameOffsets[f])); }
+ FrameData *GetFrameData(const int32 f) { return (FrameData *)((uint8 *)(id + frameOffsets[f])); }
} rab_API;
// Compress an SVECTOR ( uint16 vx,vy,vz, pad; ) -> uint32
// by dividing the angles (12-bits 0-4095) by four to make them 10-bits
-int CompressSVECTOR(SVECTOR rotin, uint32 *rotout);
+int32 CompressSVECTOR(SVECTOR rotin, uint32 *rotout);
// Uncompress an SVECTOR ( uint32 -> uint16 vx,vy,vz, pad; )
// by multiplying the angles (10-bits 0-1023) by four to make them 12-bits
diff --git a/engines/icb/gfx/rap_api.h b/engines/icb/gfx/rap_api.h
index ea1cc0f8df..211ca73c93 100644
--- a/engines/icb/gfx/rap_api.h
+++ b/engines/icb/gfx/rap_api.h
@@ -93,9 +93,9 @@ typedef struct WeightedVertexLink {
// Notice, how poor ANSI C/C++ is at its representation
//
-const int RAP_NO_PLATFORM = 0;
-const int RAP_PC_PLATFORM = 1;
-const int RAP_PSX_PLATFORM = 2;
+const int32 RAP_NO_PLATFORM = 0;
+const int32 RAP_PC_PLATFORM = 1;
+const int32 RAP_PSX_PLATFORM = 2;
typedef struct rap_API {
char id[4];
@@ -161,7 +161,7 @@ typedef struct rap_API {
}
uint32 *GetAnimPolyPtr() { return (uint32 *)(id + animPolyOffset); }
- uint32 *GetAnimPolyFrame(int frame) { return (uint32 *)(id + animPolyOffset + nAnimTypes * 2 * sizeof(uint32) + frame * animPolySize); }
+ uint32 *GetAnimPolyFrame(int32 frame) { return (uint32 *)(id + animPolyOffset + nAnimTypes * 2 * sizeof(uint32) + frame * animPolySize); }
} rap_API;
diff --git a/engines/icb/global_objects.cpp b/engines/icb/global_objects.cpp
index 9c187b2aa4..46b50edac5 100644
--- a/engines/icb/global_objects.cpp
+++ b/engines/icb/global_objects.cpp
@@ -31,17 +31,17 @@
namespace ICB {
-int globalCharSpacing = 0;
+int32 globalCharSpacing = 0;
// Prop sprite brightness to use when highlighting a prop that the player could interact with
-int g_prop_select_r = 200;
-int g_prop_select_g = 200;
-int g_prop_select_b = 200;
+int32 g_prop_select_r = 200;
+int32 g_prop_select_g = 200;
+int32 g_prop_select_b = 200;
// extra ambient brightness to use when highlighting a mega that the player could interact with
-int g_mega_select_r = 200;
-int g_mega_select_g = 200;
-int g_mega_select_b = 200;
+int32 g_mega_select_r = 200;
+int32 g_mega_select_g = 200;
+int32 g_mega_select_b = 200;
// holds info about current mission
_mission *g_mission = NULL;
diff --git a/engines/icb/global_objects.h b/engines/icb/global_objects.h
index 8ee117cde5..f29931f9ef 100644
--- a/engines/icb/global_objects.h
+++ b/engines/icb/global_objects.h
@@ -36,8 +36,8 @@
namespace ICB {
// Define the minimum distance an actor can be from the camera until he/she is clipped in cm
-const int g_actor_hither_plane = 100; // 1m
-const int g_actor_far_clip_plane = 8000; // 80m
+const int32 g_actor_hither_plane = 100; // 1m
+const int32 g_actor_far_clip_plane = 8000; // 80m
class res_man;
// this is the main resource manager object
@@ -103,14 +103,14 @@ extern const char *g_m09;
extern const char *g_m10;
// Prop sprite brightness to use when highlighting a prop that the player could interact with
-extern int g_prop_select_r;
-extern int g_prop_select_g;
-extern int g_prop_select_b;
+extern int32 g_prop_select_r;
+extern int32 g_prop_select_g;
+extern int32 g_prop_select_b;
// extra ambient brightness to use when highlighting a mega that the player could interact with
-extern int g_mega_select_r;
-extern int g_mega_select_g;
-extern int g_mega_select_b;
+extern int32 g_mega_select_r;
+extern int32 g_mega_select_g;
+extern int32 g_mega_select_b;
} // End of namespace ICB
diff --git a/engines/icb/global_objects_psx.cpp b/engines/icb/global_objects_psx.cpp
index a4423fc0c0..e2e8db9488 100644
--- a/engines/icb/global_objects_psx.cpp
+++ b/engines/icb/global_objects_psx.cpp
@@ -33,12 +33,12 @@ namespace ICB {
// For reusing characters already loaded into VRAM
// -32 because characters start from ' '
-u_short cPos[N_FONT_CHARS];
+uint16 cPos[N_FONT_CHARS];
uint8 cPWidth[N_FONT_CHARS];
uint8 cHeight[N_FONT_CHARS];
uint8 cWidth[N_FONT_CHARS];
-u_short fontClutLoaded = 0;
-u_short fontFreePos = 0;
+uint16 fontClutLoaded = 0;
+uint16 fontFreePos = 0;
uint8 fontNcolours = 0;
// Global instances of common strings, as GCC seems to make
@@ -48,7 +48,7 @@ const char *global_null_path = "";
// The different fonts we have available
const char *fonts[MAX_FONTS] = {"font", "city", "futura", "futura_outline"};
-int selFont = 2;
+int32 selFont = 2;
const char *global_sys_font = fonts[selFont];
const char *global_set_path = "\\M\\%s.CAM;1";
@@ -85,68 +85,68 @@ TextureManager *tman;
psxLight Lights[4];
// Colour of ambient to add when targetting a mega and you are armed
-int mega_select_armed_r = 60;
-int mega_select_armed_g = 10;
-int mega_select_armed_b = 10;
+int32 mega_select_armed_r = 60;
+int32 mega_select_armed_g = 10;
+int32 mega_select_armed_b = 10;
// Colour of ambient to add when targetting a mega and you are unarmed
-int mega_select_unarmed_r = 50;
-int mega_select_unarmed_g = 50;
-int mega_select_unarmed_b = 50;
+int32 mega_select_unarmed_r = 50;
+int32 mega_select_unarmed_g = 50;
+int32 mega_select_unarmed_b = 50;
#if CD_BUILD == 0
// Colour of the z-fragments outlines
-int zfragRed = 255;
-int zfragGreen = 0;
-int zfragBlue = 0;
+int32 zfragRed = 255;
+int32 zfragGreen = 0;
+int32 zfragBlue = 0;
// Colour of the z-layers outlines
-int zoverRed = 255;
-int zoverGreen = 0;
-int zoverBlue = 255;
+int32 zoverRed = 255;
+int32 zoverGreen = 0;
+int32 zoverBlue = 255;
#endif // #if CD_BUILD == 0
// Colour of the actors bounding box
-int bboxRed = 0;
-int bboxGreen = 255;
-int bboxBlue = 0;
+int32 bboxRed = 0;
+int32 bboxGreen = 255;
+int32 bboxBlue = 0;
// Colour of the actors screen outline
-int slineRed = 0;
-int slineGreen = 0;
-int slineBlue = 255;
+int32 slineRed = 0;
+int32 slineGreen = 0;
+int32 slineBlue = 255;
// Colour of the wire-frame man
-int wfrmRed = 100;
-int wfrmGreen = 50;
-int wfrmBlue = 20;
+int32 wfrmRed = 100;
+int32 wfrmGreen = 50;
+int32 wfrmBlue = 20;
// Drawing options
-int _normalScale = 8;
-int _useWindingOrder = 1;
-int _removeBackface = 1;
-int _drawWfrm = 0;
-int _drawTxture = 1;
-int _drawLit = 1;
-int _drawGouraud = 1;
-int _drawPolys = 1;
-int _drawNormals = 0;
-
-int _drawActor = 1;
-int _drawSline = 0;
-int _drawShadowSline = 0;
-int _drawBbox = 0;
-int _drawShadowBbox = 0;
-int _drawSolidBbox = 0;
-int _drawZfragEdge = 0;
-int _drawZLayerEdge = 0;
-int _drawZfragImg = 1;
-int _drawText = 0;
-int _drawCompass = 0;
-int _drawBG = 1;
-int _drawProps = 1;
-int _drawSemiTrans = 1;
-
-int _drawDebugMesh = 0;
+int32 _normalScale = 8;
+int32 _useWindingOrder = 1;
+int32 _removeBackface = 1;
+int32 _drawWfrm = 0;
+int32 _drawTxture = 1;
+int32 _drawLit = 1;
+int32 _drawGouraud = 1;
+int32 _drawPolys = 1;
+int32 _drawNormals = 0;
+
+int32 _drawActor = 1;
+int32 _drawSline = 0;
+int32 _drawShadowSline = 0;
+int32 _drawBbox = 0;
+int32 _drawShadowBbox = 0;
+int32 _drawSolidBbox = 0;
+int32 _drawZfragEdge = 0;
+int32 _drawZLayerEdge = 0;
+int32 _drawZfragImg = 1;
+int32 _drawText = 0;
+int32 _drawCompass = 0;
+int32 _drawBG = 1;
+int32 _drawProps = 1;
+int32 _drawSemiTrans = 1;
+
+int32 _drawDebugMesh = 0;
} // End of namespace ICB
diff --git a/engines/icb/global_objects_psx.h b/engines/icb/global_objects_psx.h
index 443e94b9b1..5657629005 100644
--- a/engines/icb/global_objects_psx.h
+++ b/engines/icb/global_objects_psx.h
@@ -48,12 +48,12 @@ extern uint8 *eightkb;
// For reusing characters already loaded into VRAM
// -32 because characters start from ' '
#define N_FONT_CHARS (256 - ' ')
-extern u_short cPos[N_FONT_CHARS];
+extern uint16 cPos[N_FONT_CHARS];
extern uint8 cPWidth[N_FONT_CHARS];
extern uint8 cHeight[N_FONT_CHARS];
extern uint8 cWidth[N_FONT_CHARS];
-extern u_short fontClutLoaded;
-extern u_short fontFreePos;
+extern uint16 fontClutLoaded;
+extern uint16 fontFreePos;
extern uint8 fontNcolours;
// Global instances of common strings, as GCC seems to make
@@ -97,97 +97,97 @@ extern _surface_manager *surface_manager;
extern psxLight Lights[4];
// Colour of ambient to add when targetting a mega and you are armed
-extern int mega_select_armed_r;
-extern int mega_select_armed_g;
-extern int mega_select_armed_b;
+extern int32 mega_select_armed_r;
+extern int32 mega_select_armed_g;
+extern int32 mega_select_armed_b;
// Colour of ambient to add when targetting a mega and you are unarmed
-extern int mega_select_unarmed_r;
-extern int mega_select_unarmed_g;
-extern int mega_select_unarmed_b;
+extern int32 mega_select_unarmed_r;
+extern int32 mega_select_unarmed_g;
+extern int32 mega_select_unarmed_b;
// Colour of the actors bounding box
-extern int bboxRed;
-extern int bboxGreen;
-extern int bboxBlue;
+extern int32 bboxRed;
+extern int32 bboxGreen;
+extern int32 bboxBlue;
// Colour of the actors screen outline
-extern int slineRed;
-extern int slineGreen;
-extern int slineBlue;
+extern int32 slineRed;
+extern int32 slineGreen;
+extern int32 slineBlue;
// Colour of the z-fragments outlines
-extern int zfragRed;
-extern int zfragGreen;
-extern int zfragBlue;
+extern int32 zfragRed;
+extern int32 zfragGreen;
+extern int32 zfragBlue;
// Colour of the z-layers outlines
-extern int zoverRed;
-extern int zoverGreen;
-extern int zoverBlue;
+extern int32 zoverRed;
+extern int32 zoverGreen;
+extern int32 zoverBlue;
// Colour of the wire-frame man
-extern int wfrmRed;
-extern int wfrmGreen;
-extern int wfrmBlue;
+extern int32 wfrmRed;
+extern int32 wfrmGreen;
+extern int32 wfrmBlue;
// Drawing options
-extern int _normalScale;
-extern int _useWindingOrder;
-extern int _removeBackface;
-extern int _drawWfrm;
-extern int _drawTxture;
-extern int _drawLit;
-extern int _drawGouraud;
-extern int _drawPolys;
-extern int _drawNormals;
-
-extern int _drawActor;
-extern int _drawBbox;
-extern int _drawShadowBbox;
-extern int _drawSolidBbox;
-extern int _drawSline;
-extern int _drawShadowSline;
-extern int _drawZfragEdge;
-extern int _drawZLayerEdge;
-extern int _drawZfragImg;
-extern int _drawBG;
-extern int _drawProps;
-extern int _drawSemiTrans;
-
-extern int _drawText;
-extern int _drawCompass;
-
-extern int _drawDebugMesh;
+extern int32 _normalScale;
+extern int32 _useWindingOrder;
+extern int32 _removeBackface;
+extern int32 _drawWfrm;
+extern int32 _drawTxture;
+extern int32 _drawLit;
+extern int32 _drawGouraud;
+extern int32 _drawPolys;
+extern int32 _drawNormals;
+
+extern int32 _drawActor;
+extern int32 _drawBbox;
+extern int32 _drawShadowBbox;
+extern int32 _drawSolidBbox;
+extern int32 _drawSline;
+extern int32 _drawShadowSline;
+extern int32 _drawZfragEdge;
+extern int32 _drawZLayerEdge;
+extern int32 _drawZfragImg;
+extern int32 _drawBG;
+extern int32 _drawProps;
+extern int32 _drawSemiTrans;
+
+extern int32 _drawText;
+extern int32 _drawCompass;
+
+extern int32 _drawDebugMesh;
// For choosing different fonts
#define MAX_FONTS (4)
extern const char *fonts[MAX_FONTS];
-extern int selFont;
+extern int32 selFont;
#define MAX_MOVIES (64)
-extern int selMovie;
-extern int selSession;
-extern int selGame;
+extern int32 selMovie;
+extern int32 selSession;
+extern int32 selGame;
// For choosing actor names for voxel_viewer
#define MAX_ACTORS 10
-extern int selActor;
+extern int32 selActor;
extern char *actor_names[MAX_ACTORS];
// For choosing actor outfits for voxel_viewer
#define MAX_OUTFITS 8
-extern int selOutfit;
+extern int32 selOutfit;
extern char *actor_outfits[MAX_OUTFITS];
// For choosing actor weapons for voxel_viewer
#define MAX_WEAPONS 3
-extern int selWeapon;
+extern int32 selWeapon;
extern char *actor_weapons[MAX_WEAPONS];
// For choosing actor anims : these come from the master list in
// animation_mega_set.{cpp,h}
-extern int selAnim;
+extern int32 selAnim;
} // End of namespace ICB
diff --git a/engines/icb/global_switches.h b/engines/icb/global_switches.h
index f131e97604..69143c3271 100644
--- a/engines/icb/global_switches.h
+++ b/engines/icb/global_switches.h
@@ -47,10 +47,10 @@ public:
_display_mode display_mode; // nethack or full voxel
- int actorShadows; // -1 = top down shadows only, 0 - no actors shadows
- int current_cd;
- int antialiasedActorLevel; // 0 = none, 1 = edges only, 2 = edge + actor blend
- int missionTimeout; // how many game cycles to run a mission for ( <=0 - means forever)
+ int32 actorShadows; // -1 = top down shadows only, 0 - no actors shadows
+ int32 current_cd;
+ int32 antialiasedActorLevel; // 0 = none, 1 = edges only, 2 = edge + actor blend
+ int32 missionTimeout; // how many game cycles to run a mission for ( <=0 - means forever)
bool8 nicos_displayed; // yes or no
bool8 frag_help; // display set fragments
diff --git a/engines/icb/graphic_prims.h b/engines/icb/graphic_prims.h
index 2ea6ba6651..6fbbf2f045 100644
--- a/engines/icb/graphic_prims.h
+++ b/engines/icb/graphic_prims.h
@@ -94,7 +94,7 @@ LRECT ConvertPxBitmapRectToRECT(const _PxBitmapRect &sBitmapRect);
// Additive gouraud line .... what else ?
void AdditiveGouraudLine(int16 x0, int16 y0, _rgb c0, int16 x1, int16 y1, _rgb c1, uint32 surface_id);
void BlendedLine(int32 x0, int32 y0, int32 x1, int32 y1, _rgb c, uint32 surface_id);
-void BlendedLine(int32 x0, int32 y0, int32 x1, int32 y1, _rgb c, int surface_width, int surface_height, uint32 pitch, uint8 *surface);
+void BlendedLine(int32 x0, int32 y0, int32 x1, int32 y1, _rgb c, int32 surface_width, int32 surface_height, uint32 pitch, uint8 *surface);
DXrect MakeRECTFromSpriteSizes(int32 nX, int32 nY, uint32 nWidth, uint32 nHeight);
diff --git a/engines/icb/graphic_prims_pc.cpp b/engines/icb/graphic_prims_pc.cpp
index 4a24462464..629b64dea0 100644
--- a/engines/icb/graphic_prims_pc.cpp
+++ b/engines/icb/graphic_prims_pc.cpp
@@ -168,12 +168,12 @@ void General_draw_line_24_32(int16 x0, int16 y0, int16 x1, int16 y1, _rgb *colou
// we pass the surface base
// assume 640*480
- int dx, dy;
- int dxmod, dymod;
- int ince, incne;
- int d;
- int x, y;
- int addTo;
+ int32 dx, dy;
+ int32 dxmod, dymod;
+ int32 ince, incne;
+ int32 d;
+ int32 x, y;
+ int32 addTo;
uint32 BYTEWIDE;
uint32 vram = 4;
@@ -353,17 +353,17 @@ void General_draw_line_24_32(int16 x0, int16 y0, int16 x1, int16 y1, _rgb *colou
void AdditiveGouraudLine(int16 x0, int16 y0, _rgb c0, int16 x1, int16 y1, _rgb c1, uint32 surface_id) {
// Uses Bressnham's incremental algorithm!
// We have a start colour and an end colour
- int dx, dy;
- int dxmod, dymod;
- int ince, incne;
- int d;
- int x, y;
- int addTo;
+ int32 dx, dy;
+ int32 dxmod, dymod;
+ int32 ince, incne;
+ int32 d;
+ int32 x, y;
+ int32 addTo;
uint8 *surface = (uint8 *)surface_manager->Lock_surface(surface_id);
uint32 pitch = surface_manager->Get_pitch(surface_id);
- int surface_width = surface_manager->Get_width(surface_id);
- int surface_height = surface_manager->Get_height(surface_id);
+ int32 surface_width = surface_manager->Get_width(surface_id);
+ int32 surface_height = surface_manager->Get_height(surface_id);
// Make sure we're going from left to right
if (x1 < x0) {
@@ -401,9 +401,9 @@ void AdditiveGouraudLine(int16 x0, int16 y0, _rgb c0, int16 x1, int16 y1, _rgb c
uint8 r = c0.red;
uint8 g = c0.green;
uint8 b = c0.blue;
- int dr = (dx) ? (c1.red - c0.red) / dx : 0;
- int dg = (dx) ? (c1.green - c0.green) / dx : 0;
- int db = (dx) ? (c1.blue - c0.blue) / dx : 0;
+ int32 dr = (dx) ? (c1.red - c0.red) / dx : 0;
+ int32 dg = (dx) ? (c1.green - c0.green) / dx : 0;
+ int32 db = (dx) ? (c1.blue - c0.blue) / dx : 0;
uint32 offset = y * pitch + (x << 2);
if ((x >= 0) && (x < surface_width) && (y >= 0) && (y < surface_height)) {
surface[offset] = ((surface[offset] + b) > 255) ? (uint8)255 : (uint8)(surface[offset] + b);
@@ -446,9 +446,9 @@ void AdditiveGouraudLine(int16 x0, int16 y0, _rgb c0, int16 x1, int16 y1, _rgb c
uint8 r = c0.red;
uint8 g = c0.green;
uint8 b = c0.blue;
- int dr = (dx) ? (c1.red - c0.red) / dx : 0;
- int dg = (dx) ? (c1.green - c0.green) / dx : 0;
- int db = (dx) ? (c1.blue - c0.blue) / dx : 0;
+ int32 dr = (dx) ? (c1.red - c0.red) / dx : 0;
+ int32 dg = (dx) ? (c1.green - c0.green) / dx : 0;
+ int32 db = (dx) ? (c1.blue - c0.blue) / dx : 0;
uint32 offset = (addTo - y) * pitch + (x << 2);
if ((x >= 0) && (x < surface_width) && (addTo - y >= 0) && (addTo - y < surface_height)) {
@@ -506,9 +506,9 @@ void AdditiveGouraudLine(int16 x0, int16 y0, _rgb c0, int16 x1, int16 y1, _rgb c
uint8 r = c0.red;
uint8 g = c0.green;
uint8 b = c0.blue;
- int dr = (dy) ? (c1.red - c0.red) / dy : 0;
- int dg = (dy) ? (c1.green - c0.green) / dy : 0;
- int db = (dy) ? (c1.blue - c0.blue) / dy : 0;
+ int32 dr = (dy) ? (c1.red - c0.red) / dy : 0;
+ int32 dg = (dy) ? (c1.green - c0.green) / dy : 0;
+ int32 db = (dy) ? (c1.blue - c0.blue) / dy : 0;
uint32 offset = y * pitch + (x << 2);
@@ -553,9 +553,9 @@ void AdditiveGouraudLine(int16 x0, int16 y0, _rgb c0, int16 x1, int16 y1, _rgb c
uint8 r = c0.red;
uint8 g = c0.green;
uint8 b = c0.blue;
- int dr = (dy) ? (c1.red - c0.red) / dy : 0;
- int dg = (dy) ? (c1.green - c0.green) / dy : 0;
- int db = (dy) ? (c1.blue - c0.blue) / dy : 0;
+ int32 dr = (dy) ? (c1.red - c0.red) / dy : 0;
+ int32 dg = (dy) ? (c1.green - c0.green) / dy : 0;
+ int32 db = (dy) ? (c1.blue - c0.blue) / dy : 0;
uint32 offset = y * pitch + ((addTo - x) << 2);
@@ -595,23 +595,23 @@ void AdditiveGouraudLine(int16 x0, int16 y0, _rgb c0, int16 x1, int16 y1, _rgb c
void BlendedLine(int32 x0, int32 y0, int32 x1, int32 y1, _rgb c, uint32 surface_id) {
uint8 *surface = (uint8 *)surface_manager->Lock_surface(surface_id);
uint32 pitch = surface_manager->Get_pitch(surface_id);
- int surface_width = surface_manager->Get_width(surface_id);
- int surface_height = surface_manager->Get_height(surface_id);
+ int32 surface_width = surface_manager->Get_width(surface_id);
+ int32 surface_height = surface_manager->Get_height(surface_id);
BlendedLine(x0, y0, x1, y1, c, surface_width, surface_height, pitch, surface);
surface_manager->Unlock_surface(surface_id);
}
-void BlendedLine(int32 x0, int32 y0, int32 x1, int32 y1, _rgb c, int surface_width, int surface_height, uint32 pitch, uint8 *surface) {
+void BlendedLine(int32 x0, int32 y0, int32 x1, int32 y1, _rgb c, int32 surface_width, int32 surface_height, uint32 pitch, uint8 *surface) {
// Uses Bressnham's incremental algorithm!
// We have a start colour and an end colour
- int dx, dy;
- int dxmod, dymod;
- int ince, incne;
- int d;
- int x, y;
- int addTo;
+ int32 dx, dy;
+ int32 dxmod, dymod;
+ int32 ince, incne;
+ int32 d;
+ int32 x, y;
+ int32 addTo;
// Make sure we're going from left to right
if (x1 < x0) {
diff --git a/engines/icb/health_bar_pc.cpp b/engines/icb/health_bar_pc.cpp
index 225e6ade0a..5cc8e38808 100644
--- a/engines/icb/health_bar_pc.cpp
+++ b/engines/icb/health_bar_pc.cpp
@@ -43,10 +43,10 @@ namespace ICB {
#define MAX_HEALTH 10
void _game_session::Draw_health_bar() {
- static int targetHealth = -1;
- static int barEnd;
- static int barTarget;
- static int healthStep = 0;
+ static int32 targetHealth = -1;
+ static int32 barEnd;
+ static int32 barTarget;
+ static int32 healthStep = 0;
static _rgb healthColours[MAX_HEALTH + 1] = {{254, 0, 0, 0}, // 0
{254, 0, 0, 0}, // 1
{254, 0, 0, 0}, // 2
diff --git a/engines/icb/icon_menu.cpp b/engines/icb/icon_menu.cpp
index a3b5248b1b..968d3c009f 100644
--- a/engines/icb/icon_menu.cpp
+++ b/engines/icb/icon_menu.cpp
@@ -62,8 +62,8 @@ _icon_menu::_icon_menu() {
bool8 _icon_menu::CycleIconMenu(const _input &sKeyboardState) {
bool8 nRetVal = TRUE8;
- static int lastInventoryPress = 0;
- int inventoryPress;
+ static int32 lastInventoryPress = 0;
+ int32 inventoryPress;
// Cycle the transparency for the highlight, to pulse the icon on screen
++m_nHighlightCounter;
@@ -77,8 +77,8 @@ bool8 _icon_menu::CycleIconMenu(const _input &sKeyboardState) {
// FIND GOBACK if there is one
// found is -1 means none found
- int found = -1;
- int i;
+ int32 found = -1;
+ int32 i;
// loop through all the icons or until we find a goback
i = 0;
@@ -364,8 +364,8 @@ bool8 _icon_menu::IsAdding() const {
// Scroll the icons smoothly left or right
// This returns the x-position to start drawing the icons from (nX)
// it also sets the first icon to start drawing (nIconIndex)
-int _icon_menu::GetScrollingPosition(const int nInputX, uint32 &nIconIndex) {
- int nX = nInputX;
+int32 _icon_menu::GetScrollingPosition(const int32 nInputX, uint32 &nIconIndex) {
+ int32 nX = nInputX;
// OK are we scrolling
if (m_nScrollDirection != ICON_MENU_SCROLL_NONE) {
diff --git a/engines/icb/icon_menu.h b/engines/icb/icon_menu.h
index e353cbd730..5f663c477c 100644
--- a/engines/icb/icon_menu.h
+++ b/engines/icb/icon_menu.h
@@ -96,7 +96,7 @@ public:
bool8 CycleIconMenu(const _input &sKeyboardState);
// Draw the special armed inventory
- void DrawArmedMenu(const int nBullets, const int maxBullets, const int nClips, const int maxClips);
+ void DrawArmedMenu(const int nBullets, const int32 maxBullets, const int32 nClips, const int32 maxClips);
// And this draws it each cycle.
void DrawIconMenu();
@@ -144,7 +144,7 @@ public:
void PreloadIcon(const char *pcIconPath, const char *pcIconName);
private:
- int GetScrollingPosition(const int nInputX, uint32 &nIconIndex);
+ int32 GetScrollingPosition(const int32 nInputX, uint32 &nIconIndex);
enum IconMenuGameState { INACTIVE = 0, ACTIVE };
diff --git a/engines/icb/icon_menu_pc.cpp b/engines/icb/icon_menu_pc.cpp
index afd8857b6f..6fcde36df5 100644
--- a/engines/icb/icon_menu_pc.cpp
+++ b/engines/icb/icon_menu_pc.cpp
@@ -123,7 +123,7 @@ void _icon_menu::Activate(const _icon_list *pIconList, const _icon_menu_duplicat
uint32 *icon_ad = (uint32 *)pyIconBitmap;
for (uint32 y = 0; y < ICON_Y_SIZE; y++) {
uint32 *rowAd = icon_ad;
- for (int x = 0; x < ICON_X_SIZE; x++) {
+ for (int32 x = 0; x < ICON_X_SIZE; x++) {
uint32 col = *rowAd;
if (col != m_nTransparentKey) {
(*((uint8 *)rowAd + 0)) >>= 1;
@@ -164,7 +164,7 @@ void _icon_menu::Activate(const _icon_list *pIconList, const _icon_menu_duplicat
}
void _icon_menu::ReActivate() {
- int i;
+ int32 i;
// Free up all the previous icon surfaces
for (i = m_pIconList->GetIconCount() - 1; i >= 0; --i) {
@@ -211,7 +211,7 @@ void _icon_menu::ReActivate() {
uint32 *icon_ad = (uint32 *)pyIconBitmap;
for (uint32 y = 0; y < ICON_Y_SIZE; y++) {
uint32 *rowAd = icon_ad;
- for (int x = 0; x < ICON_X_SIZE; x++) {
+ for (int32 x = 0; x < ICON_X_SIZE; x++) {
uint32 col = *rowAd;
if (col != m_nTransparentKey) {
(*((uint8 *)rowAd + 0)) >>= 1;
@@ -250,7 +250,7 @@ void _icon_menu::DrawIconMenu() {
LRECT sFromRectangle;
uint32 nIconCount;
uint32 nMaxDrawableIcons, nIconsToDraw;
- int scrolling = 0;
+ int32 scrolling = 0;
char pcDigits[16];
const char *pcIconLabel;
char pcIconName[MAXLEN_ICON_NAME];
@@ -271,7 +271,7 @@ void _icon_menu::DrawIconMenu() {
nIconIndex = m_nSelectedIcon;
nStartX = ICON_MENU_PIXEL_X;
- int scrollyX = GetScrollingPosition(nStartX, nIconIndex);
+ int32 scrollyX = GetScrollingPosition(nStartX, nIconIndex);
if ((nStartX != scrollyX) || (nIconIndex != m_nSelectedIcon)) {
scrolling = 1;
@@ -334,7 +334,7 @@ void _icon_menu::DrawIconMenu() {
nIconsToDraw = (nIconCount < nMaxDrawableIcons) ? nIconCount : nMaxDrawableIcons;
// Where to draw them
- int x = nStartX;
+ int32 x = nStartX;
// Loop for each icon to be drawn.
for (i = 0; i < nIconsToDraw; ++i) {
@@ -561,7 +561,7 @@ void _icon_menu::SetEmailArrived() {
SetupAdding(EMAIL_ARRIVED_NAME, m_nEmailArrivedSurface);
}
-void _icon_menu::DrawArmedMenu(const int nBullets, const int maxBullets, const int nClips, const int maxClips) {
+void _icon_menu::DrawArmedMenu(const int32 nBullets, const int32 maxBullets, const int32 nClips, const int32 maxClips) {
// Ok, let's see just how selfcontained, yet inefficient we can make one function :o)
uint32 gunSurface = 0;
uint32 clipSurface = 0;
diff --git a/engines/icb/jpeg.cpp b/engines/icb/jpeg.cpp
index adadae63c4..31df012be1 100644
--- a/engines/icb/jpeg.cpp
+++ b/engines/icb/jpeg.cpp
@@ -49,11 +49,11 @@ namespace ICB {
// A.3.6 Figure A.6
// These values are the inverse of those shown in the
// JPEG standard.
-const unsigned int JpegZigZagInputOrderCodes[JpegSampleSize] = {0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48,
+const uint32 JpegZigZagInputOrderCodes[JpegSampleSize] = {0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48,
41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23,
30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63};
-const unsigned int JpegZigZagOutputOrderCodes[JpegSampleSize] = {0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30,
+const uint32 JpegZigZagOutputOrderCodes[JpegSampleSize] = {0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30,
41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 21, 33, 38,
46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63};
@@ -84,7 +84,7 @@ void JpegDecoder::Initialize() {
quantization_tables = new JpegDecoderQuantizationTable[MaxQuantizationTables];
components = new JpegDecoderComponent[JpegMaxComponentsPerFrame];
- component_indices = new unsigned int[JpegMaxComponentsPerFrame];
+ component_indices = new uint32[JpegMaxComponentsPerFrame];
scan_components = new JpegDecoderComponent *[JpegMaxComponentsPerScan];
@@ -144,14 +144,14 @@ void JpegDecoder::ReadMarker() {
void JpegDecoder::ReadHuffmanTable() {
// Section B.2.4.2
uint16 length = ReadWord();
- unsigned int remaining = length - sizeof(length);
+ uint32 remaining = length - sizeof(length);
while (remaining > 0) {
uint8 data = ReadByte();
--remaining;
// Tc in standard 0=>DC, 1=>AC
- unsigned int tableclass = data >> 4;
- unsigned int id = data & 0x0F; // Th in standard
+ uint32 tableclass = data >> 4;
+ uint32 id = data & 0x0F; // Th in standard
JpegHuffmanDecoder *table;
if (tableclass != 0)
@@ -171,13 +171,13 @@ void JpegDecoder::ReadQuantization() {
// Maintain a counter for the number of bytes remaining to be read in
// the quantization table.
- int remaining = length - sizeof(length);
+ uint32 remaining = length - sizeof(length);
while (remaining > 0) {
data = ReadByte();
--remaining;
- unsigned int precision = data >> 4; // Pq in standard
- unsigned int index = data & 0x0F; // Tq in standard
+ uint32 precision = data >> 4; // Pq in standard
+ uint32 index = data & 0x0F; // Tq in standard
switch (precision) {
case 1:
@@ -196,8 +196,8 @@ void JpegDecoder::ReadQuantization() {
void JpegDecoder::ReadStartOfFrame(uint8 type) {
// Section B.2.2
// Read in the image dimensions
- /* unsigned int length = */ ReadWord();
- /* unsigned int dataprecision = */ ReadByte(); // P in standard
+ /* uint32 length = */ ReadWord();
+ /* uint32 dataprecision = */ ReadByte(); // P in standard
component_count = ReadByte(); // Nf in standard
@@ -206,9 +206,9 @@ void JpegDecoder::ReadStartOfFrame(uint8 type) {
// Rread the component descriptions
max_horizontal_frequency = 0;
max_vertical_frequency = 0;
- for (unsigned int ii = 0; ii < component_count; ++ii) {
- unsigned int ID = ReadByte(); // Ci in standard
- unsigned int qtable;
+ for (uint32 ii = 0; ii < component_count; ++ii) {
+ uint32 ID = ReadByte(); // Ci in standard
+ uint32 qtable;
component_indices[ii] = ID;
@@ -236,7 +236,7 @@ void JpegDecoder::ReadStartOfFrame(uint8 type) {
}
void JpegDecoder::ReadStartOfScan() {
- unsigned int ii;
+ uint32 ii;
// Section B.2.3
/*uint16 length = */ ReadWord();
@@ -251,18 +251,18 @@ void JpegDecoder::ReadStartOfScan() {
// If the horizontal frequency is zero then the component was not
// defined in the SOFx marker.
uint8 rb = ReadByte();
- unsigned int actable = rb & 0x0F;
- unsigned int dctable = rb >> 4;
+ uint32 actable = rb & 0x0F;
+ uint32 dctable = rb >> 4;
scan_components[ii]->SetHuffmanTables(dc_tables[dctable], ac_tables[actable]);
}
- /* unsigned int spectralselectionstart =*/ReadByte(); // Ss in standard
- /* unsigned int spectralselectionend = */ ReadByte(); // Se in standard
+ /* uint32 spectralselectionstart =*/ReadByte(); // Ss in standard
+ /* uint32 spectralselectionend = */ ReadByte(); // Se in standard
/* uint8 ssa = */ ReadByte();
- // unsigned int successiveapproximationhigh = ssa >> 4; // Ah in standard
- // unsigned int successiveapproximationlow = ssa & 0x0F; // Al in standard
+ // uint32 successiveapproximationhigh = ssa >> 4; // Ah in standard
+ // uint32 successiveapproximationlow = ssa & 0x0F; // Al in standard
for (ii = 0; ii < scan_component_count; ++ii) {
scan_components[ii]->AllocateComponentBuffers(*this);
@@ -283,19 +283,19 @@ void JpegDecoder::CalculateMcuDimensions() {
void JpegDecoder::ReadSequentialNonInterleavedScan() {
ResetDcDifferences();
- for (unsigned int row = 0; row < scan_components[0]->noninterleaved_rows; ++row) {
- for (unsigned int col = 0; col < scan_components[0]->noninterleaved_cols; ++col) {
+ for (uint32 row = 0; row < scan_components[0]->noninterleaved_rows; ++row) {
+ for (uint32 col = 0; col < scan_components[0]->noninterleaved_cols; ++col) {
scan_components[0]->DecodeSequential(*this, row, col);
}
}
}
void JpegDecoder::ResetDcDifferences() {
- for (unsigned int ii = 0; ii < scan_component_count; ++ii)
+ for (uint32 ii = 0; ii < scan_component_count; ++ii)
scan_components[ii]->last_dc_value = 0;
}
-void JpegDecoder::ReadImage(unsigned char *inputData, uint32 surface_Id) {
+void JpegDecoder::ReadImage(uint8 *inputData, uint32 surface_Id) {
uint8 data;
input_buffer = inputData;
@@ -338,12 +338,12 @@ void JpegDecoder::UpdateImage() {
}
void JpegDecoder::FreeAllocatedResources() {
- for (unsigned int ii = 0; ii < component_count; ++ii) {
+ for (uint32 ii = 0; ii < component_count; ++ii) {
components[component_indices[ii]].FreeComponentBuffers();
}
}
-int JpegDecoder::cGetBit() {
+int32 JpegDecoder::cGetBit() {
// Section F.2.2.5 Figure F.18.
// CNT is called bitposition
// B is called bitdata
@@ -370,15 +370,15 @@ int JpegDecoder::cGetBit() {
return result;
}
-int JpegDecoder::NextBit() {
- int result = cGetBit();
+int32 JpegDecoder::NextBit() {
+ int32 result = cGetBit();
return result;
}
// Extracts the next "count" bits from the input stream.
-int JpegDecoder::Receive(unsigned int count) {
- int result = 0;
- for (unsigned int ii = 0; ii < count; ++ii) {
+int32 JpegDecoder::Receive(uint32 count) {
+ int32 result = 0;
+ for (uint32 ii = 0; ii < count; ++ii) {
result <<= 1;
result |= cGetBit();
}
@@ -387,15 +387,15 @@ int JpegDecoder::Receive(unsigned int count) {
JpegHuffmanDecoder::JpegHuffmanDecoder() {}
-unsigned int JpegHuffmanDecoder::ReadTable(JpegDecoder &decoder) {
+uint32 JpegHuffmanDecoder::ReadTable(JpegDecoder &decoder) {
// We declare this here because MSVC++ does not handle for
// statement scoping rules correctly.
- unsigned int jj;
+ uint32 jj;
// B.2.4.2
uint8 huffbits[JpegMaxHuffmanCodeLength];
- unsigned int count = 0; // Count of codes in the Huffman table.
+ uint32 count = 0; // Count of codes in the Huffman table.
// Read the 16 1-byte length counts and count the number of
// codes in the table.
@@ -420,14 +420,14 @@ unsigned int JpegHuffmanDecoder::ReadTable(JpegDecoder &decoder) {
void JpegHuffmanDecoder::MakeTable(uint8 huffbits[JpegMaxHuffmanCodeLength]) {
// We have to declare the loop indices here because MSVC++ does not
// handle scoping in for statements correctly.
- unsigned int ii, jj, kk;
+ uint32 ii, jj, kk;
// These values in these arrays correspond to the elements of the
// "values" array. The Huffman code for values [N] is huffcodes [N]
// and the length of the code is huffsizes [N].
uint16 huffcodes[JpegMaxNumberOfHuffmanCodes];
- unsigned int huffsizes[JpegMaxNumberOfHuffmanCodes + 1];
+ uint32 huffsizes[JpegMaxNumberOfHuffmanCodes + 1];
// Section C.2 Figure C.1
// Convert the array "huff_bits" containing the count of codes
@@ -444,7 +444,7 @@ void JpegHuffmanDecoder::MakeTable(uint8 huffbits[JpegMaxHuffmanCodeLength]) {
// Section C.2 Figure C.2
// Calculate the Huffman code for each Huffman value.
uint16 code = 0;
- unsigned int si;
+ uint32 si;
for (kk = 0, si = huffsizes[0]; huffsizes[kk] != 0; ++si, code <<= 1) {
for (; huffsizes[kk] == si; ++code, ++kk) {
huffcodes[kk] = code;
@@ -477,14 +477,14 @@ void JpegHuffmanDecoder::MakeTable(uint8 huffbits[JpegMaxHuffmanCodeLength]) {
}
}
-int JpegHuffmanDecoder::Decode(JpegDecoder &decoder) {
+int32 JpegHuffmanDecoder::Decode(JpegDecoder &decoder) {
// This function decodes the next byte in the input stream using this
// Huffman table.
// Section A F.2.2.3 Figure F.16
uint16 code = (uint16)decoder.NextBit();
- int codelength; // Called I in the standard.
+ int32 codelength; // Called I in the standard.
// Here we are taking advantage of the fact that 1 bits are used as
// a prefix to the longer codes.
@@ -497,11 +497,11 @@ int JpegHuffmanDecoder::Decode(JpegDecoder &decoder) {
// mincode [codelength]..maxcode [codelength].
// This code is the (offset + 1)'th code of (codelength + 1);
- int offset = code - mincode[codelength];
+ int32 offset = code - mincode[codelength];
// valptr [codelength] is the first code of length (codelength + 1)
// so now we can look up the value for the Huffman code in the table.
- int index = valptr[codelength] + offset;
+ int32 index = valptr[codelength] + offset;
return huff_values[index];
}
@@ -581,9 +581,9 @@ JpegDecoderQuantizationTable::JpegDecoderQuantizationTable() { memset(data_value
// decoder: The JPEG decoder that owns the table and the JPEG stream.
// precision: The quantization table precision
//
-void JpegDecoderQuantizationTable::ReadTable(JpegDecoder &decoder, unsigned int) {
+void JpegDecoderQuantizationTable::ReadTable(JpegDecoder &decoder, uint32) {
// Read 8-bit values.
- for (unsigned int ii = 0; ii < JpegSampleSize; ++ii) {
+ for (uint32 ii = 0; ii < JpegSampleSize; ++ii) {
data_values[ii] = decoder.ReadByte();
}
@@ -600,16 +600,16 @@ void JpegDecoderQuantizationTable::ReadTable(JpegDecoder &decoder, unsigned int)
// merge that constant with the quantization table valus.
//
void JpegDecoderQuantizationTable::BuildScaledTables() {
- unsigned int ii; // Overcome MSVC++ Wierdness
+ uint32 ii; // Overcome MSVC++ Wierdness
for (ii = 0; ii < JpegSampleWidth; ++ii) {
- for (int jj = 0; jj < JpegSampleWidth; ++jj) {
+ for (int32 jj = 0; jj < JpegSampleWidth; ++jj) {
float_scaling[ii][jj] = data_values[JpegZigZagOutputOrderCodes[ii * 8 + jj]] * floatscaling[ii][jj];
}
}
for (ii = 0; ii < JpegSampleWidth; ++ii) {
- for (int jj = 0; jj < JpegSampleWidth; ++jj) {
+ for (int32 jj = 0; jj < JpegSampleWidth; ++jj) {
integer_scaling[ii][jj] = (int32)((1 << QuantizationIntegerScale) * floatscaling[ii][jj] * data_values[JpegZigZagOutputOrderCodes[ii * 8 + jj]]);
}
}
@@ -635,7 +635,7 @@ void JpegDecoderQuantizationTable::BuildScaledTables() {
//
JpegDecoderDataUnit::IDctFunction JpegDecoderDataUnit::idct_function = &JpegDecoderDataUnit::IntegerInverseDCT;
-const int IntegerScale = 6;
+const int32 IntegerScale = 6;
const int32 IC4 = (int32)((1 << IntegerScale) * cos(M_PI * 4.0 / 16.0));
const int32 ISEC2 = (int32)((1 << (IntegerScale - 1)) / cos(M_PI * 2.0 / 16.0));
@@ -672,7 +672,7 @@ const double FSEC6 = 0.5 / cos(M_PI * 6.0 / 16.0);
//
JpegDecoderDataUnit &JpegDecoderDataUnit::FloatInverseDCT(JpegDecoderCoefficientBlock data, const JpegDecoderQuantizationTable &qt) {
double tmp[JpegSampleWidth][JpegSampleWidth];
- unsigned int ii;
+ uint32 ii;
for (ii = 0; ii < JpegSampleWidth; ++ii) {
double a0 = data[ii][0] * qt.float_scaling[ii][0];
double a1 = data[ii][4] * qt.float_scaling[ii][4];
@@ -868,7 +868,7 @@ JpegDecoderDataUnit &JpegDecoderDataUnit::FloatInverseDCT(JpegDecoderCoefficient
// qt: The prescaled quantization table.
//
JpegDecoderDataUnit &JpegDecoderDataUnit::IntegerInverseDCT(JpegDecoderCoefficientBlock data, const JpegDecoderQuantizationTable &qt) {
- unsigned int ii;
+ uint32 ii;
int32 tmp[JpegSampleWidth][JpegSampleWidth];
for (ii = 0; ii < JpegSampleWidth; ++ii) {
@@ -1007,11 +1007,11 @@ JpegDecoderDataUnit &JpegDecoderDataUnit::IntegerInverseDCT(JpegDecoderCoefficie
// vv: The bit value
// tt: The length of the bit value
//
-static inline int Extend(int vv, int t) {
+static inline int32 Extend(int32 vv, int32 t) {
// Extend function defined in Section F.2.2.1 Figure F.12
// The tt'th bit of vv is the sign bit. One is for
// positive values and zero is for negative values.
- int vt = 1 << (t - 1);
+ int32 vt = 1 << (t - 1);
if (vv < vt) {
vt = (-1 << t) + 1;
return vv + vt;
@@ -1126,25 +1126,25 @@ void JpegDecoderComponent::SetHuffmanTables(JpegHuffmanDecoder &dc, JpegHuffmanD
// decoder: The decoder that owns this component
// mcurow, mcucol: The row and column for this data unit.
//
-void JpegDecoderComponent::DecodeSequential(JpegDecoder &decoder, unsigned int mcurow, unsigned int mcucol) {
+void JpegDecoderComponent::DecodeSequential(JpegDecoder &decoder, uint32 mcurow, uint32 mcucol) {
JpegDecoderCoefficientBlock data;
memset(&data, 0, sizeof(data));
// Decode the DC differce value.
// Section F.2.2.1
- unsigned int count; // called T in F.2.2.1
+ uint32 count; // called T in F.2.2.1
count = dc_table->Decode(decoder);
- int bits = decoder.Receive(count);
- int diff = Extend(bits, count);
+ uint32 bits = decoder.Receive(count);
+ uint32 diff = Extend(bits, count);
// Create the DC value from the difference and the previous DC value.
- int dc = diff + last_dc_value;
+ int32 dc = diff + last_dc_value;
last_dc_value = dc;
data[0][0] = (int16)dc;
// Decode the AC coefficients.
// Section F.2.2.2 Figure F.13
- for (unsigned int kk = 1; kk < JpegSampleSize; ++kk) {
+ for (uint32 kk = 1; kk < JpegSampleSize; ++kk) {
uint16 rs = (uint16)ac_table->Decode(decoder);
uint16 ssss = (uint16)(rs & 0xF);
uint16 rrrr = (uint16)(rs >> 0x4);
@@ -1166,8 +1166,8 @@ void JpegDecoderComponent::DecodeSequential(JpegDecoder &decoder, unsigned int m
// Receive and extend the additional bits.
// Section F2.2.2 Figure F.14
- int bit = decoder.Receive(ssss);
- int value = Extend(bit, ssss);
+ int32 bit = decoder.Receive(ssss);
+ int32 value = Extend(bit, ssss);
(&data[0][0])[JpegZigZagInputOrderCodes[kk]] = (int16)value;
}
}
@@ -1184,7 +1184,7 @@ void JpegDecoderComponent::DecodeSequential(JpegDecoder &decoder, unsigned int m
// stretch the data during the copy.
//
void JpegDecoderComponent::Upsample() {
- unsigned int imagesize = du_rows * v_sampling * du_cols * h_sampling * JpegSampleSize;
+ uint32 imagesize = du_rows * v_sampling * du_cols * h_sampling * JpegSampleSize;
if (imagesize == 0)
return; // No data for this component yet.
@@ -1193,12 +1193,12 @@ void JpegDecoderComponent::Upsample() {
// Simple case where component does not need to be upsampled.
if (v_sampling == 1 && h_sampling == 1) {
- unsigned output = 0;
- unsigned int startdu = 0;
- for (unsigned int durow = 0; durow < du_rows; ++durow) {
- for (unsigned int ii = 0; ii < JpegSampleWidth; ++ii) {
- unsigned int du = startdu;
- for (unsigned int ducol = 0; ducol < du_cols; ++ducol) {
+ uint32 output = 0;
+ uint32 startdu = 0;
+ for (uint32 durow = 0; durow < du_rows; ++durow) {
+ for (uint32 ii = 0; ii < JpegSampleWidth; ++ii) {
+ uint32 du = startdu;
+ for (uint32 ducol = 0; ducol < du_cols; ++ducol) {
upsample_data[output] = data_units[du].values[ii][0];
++output;
upsample_data[output] = data_units[du].values[ii][1];
@@ -1221,14 +1221,14 @@ void JpegDecoderComponent::Upsample() {
startdu += du_cols;
}
} else {
- unsigned output = 0;
- unsigned int startdu = 0;
- for (unsigned int durow = 0; durow < du_rows; ++durow) {
- for (unsigned int ii = 0; ii < JpegSampleWidth; ++ii) {
- for (unsigned int vv = 0; vv < v_sampling; ++vv) {
- unsigned int du = startdu;
- for (unsigned int ducol = 0; ducol < du_cols; ++ducol) {
- unsigned int jj;
+ uint32 output = 0;
+ uint32 startdu = 0;
+ for (uint32 durow = 0; durow < du_rows; ++durow) {
+ for (uint32 ii = 0; ii < JpegSampleWidth; ++ii) {
+ for (uint32 vv = 0; vv < v_sampling; ++vv) {
+ uint32 du = startdu;
+ for (uint32 ducol = 0; ducol < du_cols; ++ducol) {
+ uint32 jj;
for (jj = 0; jj < h_sampling; ++jj) {
upsample_data[output] = data_units[du].values[ii][0];
++output;
@@ -1288,13 +1288,13 @@ void JpegDecoderComponent::RGBConvert(JpegDecoderComponent &c1, JpegDecoderCompo
uint32 pitch = surface_manager->Get_pitch(surfaceId);
uint32 bpp = surface_manager->Get_BytesPP(surfaceId);
- unsigned int rowstart = 0;
- for (unsigned int ii = 480; ii; ii--) {
- unsigned int offset = rowstart;
+ uint32 rowstart = 0;
+ for (uint32 ii = 480; ii; ii--) {
+ uint32 offset = rowstart;
uint8 *outrow = pDst8;
pDst8 += pitch;
- for (unsigned int jj = 0; jj < (uint32)(bpp * 640); jj += bpp) {
+ for (uint32 jj = 0; jj < (uint32)(bpp * 640); jj += bpp) {
YCbCr_To_RGB(c1.upsample_data[offset], c2.upsample_data[offset], c3.upsample_data[offset], outrow[jj + 2], outrow[jj + 1], outrow[jj + 0]);
++offset;
}
diff --git a/engines/icb/jpeg.h b/engines/icb/jpeg.h
index fabc8977b3..d6f5311fb7 100644
--- a/engines/icb/jpeg.h
+++ b/engines/icb/jpeg.h
@@ -38,25 +38,25 @@ static uint32 _bit_count;
static uint32 *_buf_pointer;
static uint32 *_end_buf;
-const int JpegMaxHuffmanTables = 4;
-const int MaxQuantizationTables = 4;
-const int JpegMaxComponentsPerFrame = 255;
-const int JpegMaxComponentsPerScan = 4;
-const int JpegMinSamplingFrequency = 1;
-const int JpegMaxSamplingFrequency = 4;
-const int JpegSampleWidth = 8;
-const int JpegSampleSize = JpegSampleWidth * JpegSampleWidth;
-const int JpegMinSampleValue = 0;
-const int JpegMaxSampleValue = 255; // For 12-Bits this would be 4095
-const int JpegMidpointSampleValue = 128; // For 12-Bits this 2048
-const int JpegMaxDataUnitsPerMCU = 10;
-const int JpegMaxSuccessiveApproximation = 13;
-const int JpegMax8BitQuantizationValue = 255;
-const int JpegMinQuantizationValue = 1;
-const unsigned int JpegMaxHuffmanCodeLength = 16;
-const unsigned int JpegMaxNumberOfHuffmanCodes = 256;
-extern const unsigned int JpegZigZagInputOrderCodes[JpegSampleSize];
-extern const unsigned int JpegZigZagOutputOrderCodes[JpegSampleSize];
+const int32 JpegMaxHuffmanTables = 4;
+const int32 MaxQuantizationTables = 4;
+const int32 JpegMaxComponentsPerFrame = 255;
+const int32 JpegMaxComponentsPerScan = 4;
+const int32 JpegMinSamplingFrequency = 1;
+const int32 JpegMaxSamplingFrequency = 4;
+const int32 JpegSampleWidth = 8;
+const int32 JpegSampleSize = JpegSampleWidth * JpegSampleWidth;
+const int32 JpegMinSampleValue = 0;
+const int32 JpegMaxSampleValue = 255; // For 12-Bits this would be 4095
+const int32 JpegMidpointSampleValue = 128; // For 12-Bits this 2048
+const int32 JpegMaxDataUnitsPerMCU = 10;
+const int32 JpegMaxSuccessiveApproximation = 13;
+const int32 JpegMax8BitQuantizationValue = 255;
+const int32 JpegMinQuantizationValue = 1;
+const uint32 JpegMaxHuffmanCodeLength = 16;
+const uint32 JpegMaxNumberOfHuffmanCodes = 256;
+extern const uint32 JpegZigZagInputOrderCodes[JpegSampleSize];
+extern const uint32 JpegZigZagOutputOrderCodes[JpegSampleSize];
typedef int16 JpegDecoderCoefficientBlock[JpegSampleWidth][JpegSampleWidth];
// These definitions do not include the preceding 0xFF byte.
@@ -129,11 +129,11 @@ enum JpegMarkers {
#define JPEGSAMPLE_GREEN_CONST2 2925
#define JPEGSAMPLE_BLUE_CONST 7258
-inline void YCbCr_To_RGB(int yy, int cb, int cr, uint8 &r, uint8 &g, uint8 &b) {
- int mcr = cr - JpegMidpointSampleValue;
- int mcb = cb - JpegMidpointSampleValue;
+inline void YCbCr_To_RGB(int32 yy, int32 cb, int32 cr, uint8 &r, uint8 &g, uint8 &b) {
+ int32 mcr = cr - JpegMidpointSampleValue;
+ int32 mcb = cb - JpegMidpointSampleValue;
- int a = yy + ((JPEGSAMPLE_RED_CONST * mcr + JPEGSAMPLE_ROUNDING) >> JPEGSAMPLE_SCALEFACTOR);
+ int32 a = yy + ((JPEGSAMPLE_RED_CONST * mcr + JPEGSAMPLE_ROUNDING) >> JPEGSAMPLE_SCALEFACTOR);
r = (uint8)((a < 0) ? 0 : (a > 255) ? 255 : a);
a = yy - ((JPEGSAMPLE_GREEN_CONST1 * mcb + JPEGSAMPLE_GREEN_CONST2 * mcr + JPEGSAMPLE_ROUNDING) >> JPEGSAMPLE_SCALEFACTOR);
@@ -153,10 +153,10 @@ public:
JpegDecoder();
virtual ~JpegDecoder();
- virtual void ReadImage(unsigned char *inputData, uint32 surface_Id);
+ virtual void ReadImage(uint8 *inputData, uint32 surface_Id);
virtual void UpdateImage();
- int cGetBit();
+ int32 cGetBit();
inline uint8 ReadByte() {
uint8 value = input_buffer[iPos];
@@ -172,8 +172,8 @@ public:
return value;
}
- int NextBit();
- int Receive(unsigned int count);
+ int32 NextBit();
+ int32 Receive(uint32 count);
void Initialize();
void ReadStreamHeader();
@@ -187,7 +187,7 @@ public:
void FreeAllocatedResources();
void ReadSequentialNonInterleavedScan();
void ResetDcDifferences();
- void RefineAcCoefficient(int16 &value, unsigned int ssa);
+ void RefineAcCoefficient(int16 &value, uint32 ssa);
// Huffman tables
JpegHuffmanDecoder *ac_tables;
@@ -197,36 +197,36 @@ public:
JpegDecoderQuantizationTable *quantization_tables;
// Bit I/O state
- int bit_position; // Called CNT in Section F.2.2.5
- unsigned char bit_data; // Called B in Section F.2.2.5
+ int32 bit_position; // Called CNT in Section F.2.2.5
+ uint8 bit_data; // Called B in Section F.2.2.5
bool eoi_found;
bool sof_found;
- unsigned char *input_buffer;
- unsigned int iPos;
- unsigned int surfaceId;
+ uint8 *input_buffer;
+ uint32 iPos;
+ uint32 surfaceId;
- unsigned int frame_type;
+ uint32 frame_type;
- unsigned max_horizontal_frequency;
- unsigned max_vertical_frequency;
+ uint32 max_horizontal_frequency;
+ uint32 max_vertical_frequency;
- unsigned int component_count;
+ uint32 component_count;
JpegDecoderComponent *components;
- unsigned int *component_indices;
+ uint32 *component_indices;
// Progress Counters
- unsigned int current_scan;
- unsigned int scan_count;
+ uint32 current_scan;
+ uint32 scan_count;
- unsigned int mcu_rows;
- unsigned int mcu_cols;
+ uint32 mcu_rows;
+ uint32 mcu_cols;
- unsigned int mcu_height;
- unsigned int mcu_width;
+ uint32 mcu_height;
+ uint32 mcu_width;
- unsigned int scan_component_count;
+ uint32 scan_component_count;
JpegDecoderComponent **scan_components;
friend class JpegDecoderQuantizationTable;
@@ -245,7 +245,7 @@ public:
virtual ~JpegHuffmanDecoder() {}
// This function reads a Huffman table from the input stream.
- unsigned int ReadTable(JpegDecoder &);
+ uint32 ReadTable(JpegDecoder &);
// Function to decode the next value in the input stream.
int Decode(JpegDecoder &);
@@ -271,7 +271,7 @@ public:
~JpegDecoderQuantizationTable() {}
// Function to read the quantization table from the input stream.
- void ReadTable(JpegDecoder &decoder, unsigned int precision);
+ void ReadTable(JpegDecoder &decoder, uint32 precision);
// This function builds the scaled quantization tables used in
// fast IDCT implementations.
@@ -299,7 +299,7 @@ public:
//
//
class JpegDecoderDataUnit {
- public:
+public:
// Declaration of a type for pointers to member functions
// for implementing the IDCT. The input parameters are
// The IDCT coefficients and the [de]quantization table.
@@ -316,7 +316,7 @@ class JpegDecoderDataUnit {
JpegDecoderDataUnit &IntegerInverseDCT(JpegDecoderCoefficientBlock, const JpegDecoderQuantizationTable &);
// Operators to retrieve the individual IDCT values.
- // uint8 const* operator [] (unsigned int ii) const;
+ // uint8 const* operator [] (uint32 ii) const;
// The IDCT values.
uint8 values[JpegSampleWidth][JpegSampleWidth];
@@ -375,20 +375,20 @@ public:
void SetHuffmanTables(JpegHuffmanDecoder &dc, JpegHuffmanDecoder &ac);
void Upsample();
- void DecodeSequential(JpegDecoder &decoder, unsigned int mcurow, unsigned int mcucol);
+ void DecodeSequential(JpegDecoder &decoder, uint32 mcurow, uint32 mcucol);
void ProgressiveInverseDct();
// Sampling Frequencies
- unsigned int horizontal_frequency;
- unsigned int vertical_frequency;
+ uint32 horizontal_frequency;
+ uint32 vertical_frequency;
// These values are the numnber of samples to take for each data
// point. They come from the sampling frequencies and the maximum
// sampling frequencies of all the components in the image.
// sampling frequencies of all the components in the image.
- unsigned int v_sampling;
- unsigned int h_sampling;
+ uint32 v_sampling;
+ uint32 h_sampling;
// Last encoded DC value.
int last_dc_value;
@@ -401,11 +401,11 @@ public:
JpegDecoderQuantizationTable *quantization_table;
// Non-interleaved dimensions.
- unsigned int noninterleaved_rows;
- unsigned int noninterleaved_cols;
+ uint32 noninterleaved_rows;
+ uint32 noninterleaved_cols;
- unsigned int du_rows;
- unsigned int du_cols;
+ uint32 du_rows;
+ uint32 du_cols;
JpegDecoderDataUnit *data_units;
uint8 *upsample_data;
diff --git a/engines/icb/light_pc.cpp b/engines/icb/light_pc.cpp
index 7406617c96..46503947bf 100644
--- a/engines/icb/light_pc.cpp
+++ b/engines/icb/light_pc.cpp
@@ -66,7 +66,7 @@ int32 lampBounce[3];
// GTE light matrix and the lightDirects matrix
//
-int prepareLightsPC(VECTOR *pos, PSXrgb *ambient, PSXLampList *lamplist, PSXShadeList *shadelist, MATRIXPC *lDirects, LampInfo *linfo) {
+int32 prepareLightsPC(VECTOR *pos, PSXrgb *ambient, PSXLampList *lamplist, PSXShadeList *shadelist, MATRIXPC *lDirects, LampInfo *linfo) {
// Disable the slow features as default
useLampBounce = 0;
useLampWidth = 0;
@@ -415,7 +415,7 @@ int prepareLightsPC(VECTOR *pos, PSXrgb *ambient, PSXLampList *lamplist, PSXShad
}
// Account for decay
- int decaym = 4096;
+ int32 decaym = 4096;
if (plamp->decay == DECAY_INV_SQR) {
decaym = ((4096 * RLP_DECAY_CONSTANT * RLP_DECAY_CONSTANT) / rr);
More information about the Scummvm-git-logs
mailing list