[Scummvm-git-logs] scummvm master -> d9ae18ecbe9868fe24d25286faca0b96de696241
digitall
noreply at scummvm.org
Sun Jul 10 23:48:07 UTC 2022
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:
d9ae18ecbe ICB: Remove Macro Test Usage of Undefined CD_MODE Symbol
Commit: d9ae18ecbe9868fe24d25286faca0b96de696241
https://github.com/scummvm/scummvm/commit/d9ae18ecbe9868fe24d25286faca0b96de696241
Author: D G Turner (digitall at scummvm.org)
Date: 2022-07-11T00:43:33+01:00
Commit Message:
ICB: Remove Macro Test Usage of Undefined CD_MODE Symbol
This symbol was undefined which meant that it defaulted to being equal
to zero. Since this was the value tested for in all cases, then all
cases of this macro test were enabled which was not very clear.
Looking at the code, it appears this is intended to guard a debugging
mode enabling slower, but more readable rendering code and other graphics
information. This should probably be migrated to a boolean flag of the
engine (since debug already exists) or a ScummVM debug level / flag.
This changes also removes a large number of GCC warnings regarding
use of undefined macro symbols.
Changed paths:
engines/icb/actor_pc.cpp
engines/icb/debug.cpp
engines/icb/drawpoly_pc.cpp
engines/icb/drawpoly_pc.h
engines/icb/mission.cpp
engines/icb/player_interaction.cpp
engines/icb/set.cpp
engines/icb/shadow_pc.cpp
diff --git a/engines/icb/actor_pc.cpp b/engines/icb/actor_pc.cpp
index 8958f13080c..fed56fbb8b4 100644
--- a/engines/icb/actor_pc.cpp
+++ b/engines/icb/actor_pc.cpp
@@ -60,11 +60,8 @@ int32 hiertpc;
int32 shadtpc;
// Local prototypes
-#if CD_MODE == 0
void drawBboxPC(SVECTOR *scrn, CVECTOR colour);
void drawOutlinePC(SVECTOR *min, SVECTOR *max, CVECTOR colour);
-#endif // #if CD_MODE == 0
-
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
@@ -465,44 +462,42 @@ void DrawActor4PC(psxActor *actor, psxCamera *camera, Bone_Frame *frame, rap_API
actor->sPos.vx = (int16)sxy0.vx;
actor->sPos.vy = (int16)sxy0.vy;
-#if CD_MODE == 0
- CVECTOR bboxColour = {(uint8)bboxRed, (uint8)bboxGreen, (uint8)bboxBlue, 0};
- if (_drawBbox)
- drawBboxPC(actor->bboxScrn, bboxColour);
- CVECTOR sbColour = {240, 240, 240, 0};
- if (_drawSolidBbox)
- drawSolidBboxPC(actor->bboxScrn, &sbColour);
-
- bboxColour.r = 255;
- bboxColour.g = 20;
- bboxColour.b = 180;
- if (_drawShadowBbox) {
- for (b = 0; b < actor->nShadows; b++) {
- drawBboxPC(shadowBox[b], bboxColour);
+ if (true) { // FIXME: Enable this with debug level / channel
+ CVECTOR bboxColour = {(uint8)bboxRed, (uint8)bboxGreen, (uint8)bboxBlue, 0};
+ if (_drawBbox)
+ drawBboxPC(actor->bboxScrn, bboxColour);
+ CVECTOR sbColour = {240, 240, 240, 0};
+ if (_drawSolidBbox)
+ drawSolidBboxPC(actor->bboxScrn, &sbColour);
+
+ bboxColour.r = 255;
+ bboxColour.g = 20;
+ bboxColour.b = 180;
+ if (_drawShadowBbox) {
+ for (b = 0; b < actor->nShadows; b++) {
+ drawBboxPC(shadowBox[b], bboxColour);
+ }
}
- }
- // 2 LINE_F3's : e.g. a rectangle
- CVECTOR slColour;
- if (_drawSline) {
- 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 = (uint8)180;
- slColour.g = (uint8)(20 + b * 70);
- slColour.b = (uint8)255;
- drawOutlinePC(actor->shadowMinBox + b, actor->shadowMaxBox + b, slColour);
+ // 2 LINE_F3's : e.g. a rectangle
+ CVECTOR slColour;
+ if (_drawSline) {
+ 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 = (uint8)180;
+ slColour.g = (uint8)(20 + b * 70);
+ slColour.b = (uint8)255;
+ drawOutlinePC(actor->shadowMinBox + b, actor->shadowMaxBox + b, slColour);
+ }
}
}
-#endif // #if CD_MODE == 0
}
-// dont bother in a cd mode
-#if CD_MODE == 0
void drawOutlinePC(SVECTOR *min, SVECTOR *max, CVECTOR colour) {
LINE_F3 *line = (LINE_F3 *)drawpacket;
setLineF3(line);
@@ -520,7 +515,6 @@ void drawOutlinePC(SVECTOR *min, SVECTOR *max, CVECTOR colour) {
myAddPrimClip(min->vz, drawpacket);
myAddPacket(sizeof(LINE_F3));
}
-#endif
// New version using soft-skinning specific data-files
void DrawModel4PC(rap_API *mrap, int32 poseBone, MATRIXPC *lw, MATRIXPC *local2screen, int32 uvframe, uint32 debug, SVECTOR *bbox, SVECTOR *minbbox, SVECTOR *maxbbox) {
@@ -630,90 +624,82 @@ void DrawModel4PC(rap_API *mrap, int32 poseBone, MATRIXPC *lw, MATRIXPC *local2s
nPolys = mrap->nFUS3;
if (nPolys != 0) {
polyStart = mrap->GetFUS3Ptr();
-// Do the drawing using internal C based debugging drawing code
-#if CD_MODE == 0
- if (debug)
+ // Do the drawing using internal C based debugging drawing code
+ if (debug) {
drawFUS3PC(polyStart, nPolys, local);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawFUS3PC(polyStart, nPolys, screen);
+ }
}
nPolys = mrap->nGUS3;
if (nPolys != 0) {
polyStart = mrap->GetGUS3Ptr();
-// Do the drawing using internal C based debugging drawing code
-#if CD_MODE == 0
- if (debug)
+ // Do the drawing using internal C based debugging drawing code
+ if (debug) {
drawGUS3PC(polyStart, nPolys, local);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawGUS3PC(polyStart, nPolys, screen);
+ }
}
nPolys = mrap->nFTS3;
if (nPolys != 0) {
polyStart = mrap->GetFTS3Ptr();
-// Do the drawing using internal C based debugging drawing code
-#if CD_MODE == 0
- if (debug)
+ // Do the drawing using internal C based debugging drawing code
+ if (debug) {
drawFTS3PC(polyStart, nPolys, local);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawFTS3PC(polyStart, nPolys, screen);
+ }
}
nPolys = mrap->nGTS3;
if (nPolys != 0) {
polyStart = mrap->GetGTS3Ptr();
-// Do the drawing using internal C based debugging drawing code
-#if CD_MODE == 0
- if (debug)
+ // Do the drawing using internal C based debugging drawing code
+ if (debug) {
drawGTS3PC(polyStart, nPolys, local);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawGTS3PC(polyStart, nPolys, screen);
+ }
}
nPolys = mrap->nFUL3;
if (nPolys != 0) {
polyStart = mrap->GetFUL3Ptr();
-// Do the drawing using internal C based debugging drawing code
-#if CD_MODE == 0
- if (debug)
+ // Do the drawing using internal C based debugging drawing code
+ if (debug) {
drawFUL3PC(polyStart, nPolys, local, (SVECTOR *)pNormal);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawFUL3PC(polyStart, nPolys, screen, (SVECTOR *)pNormal);
+ }
}
nPolys = mrap->nGUL3;
if (nPolys != 0) {
polyStart = mrap->GetGUL3Ptr();
-// Do the drawing using internal C based debugging drawing code
-#if CD_MODE == 0
- if (debug)
+ // Do the drawing using internal C based debugging drawing code
+ if (debug) {
drawGUL3PC(polyStart, nPolys, local, (SVECTOR *)pNormal);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawGUL3PC(polyStart, nPolys, screen, (SVECTOR *)pNormal);
+ }
}
nPolys = mrap->nFTL3;
if (nPolys != 0) {
polyStart = mrap->GetFTL3Ptr();
-// Do the drawing using internal C based debugging drawing code
-#if CD_MODE == 0
- if (debug)
+ // Do the drawing using internal C based debugging drawing code
+ if (debug) {
drawFTL3PC(polyStart, nPolys, local, (SVECTOR *)pNormal);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawFTL3PC(polyStart, nPolys, screen, (SVECTOR *)pNormal);
+ }
}
nPolys = mrap->nGTL3;
if (nPolys != 0) {
polyStart = mrap->GetGTL3Ptr();
-// Do the drawing using internal C based debugging drawing code
-#if CD_MODE == 0
- if (debug)
+ // Do the drawing using internal C based debugging drawing code
+ if (debug) {
drawGTL3PC(polyStart, nPolys, local, (SVECTOR *)pNormal);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawGTL3PC(polyStart, nPolys, screen, (SVECTOR *)pNormal);
+ }
}
// Now do the animating polygons
@@ -738,89 +724,81 @@ void DrawModel4PC(rap_API *mrap, int32 poseBone, MATRIXPC *lw, MATRIXPC *local2s
switch (*typePtr++) { // ++ skips the type field
case HMD_FUS3: {
nPolys = *typePtr++;
-#if CD_MODE == 0
- if (debug)
+ if (debug) {
drawFUS3PC(polyStart, nPolys, local);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawFUS3PC(polyStart, nPolys, screen);
+ }
polyStart += (nPolys * HMD_FUS3_SIZE); // skip to the next polygon
break;
}
case HMD_GUS3: {
nPolys = *typePtr++;
-#if CD_MODE == 0
- if (debug)
+ if (debug) {
drawGUS3PC(polyStart, nPolys, local);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawGUS3PC(polyStart, nPolys, screen);
+ }
polyStart += (nPolys * HMD_GUS3_SIZE); // skip to the next polygon
break;
}
case HMD_FTS3: {
nPolys = *typePtr++;
-#if CD_MODE == 0
- if (debug)
+ if (debug) {
drawFTS3PC(polyStart, nPolys, local);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawFTS3PC(polyStart, nPolys, screen);
+ }
polyStart += (nPolys * HMD_FTS3_SIZE); // skip to the next polygon
break;
}
case HMD_GTS3: {
nPolys = *typePtr++;
-#if CD_MODE == 0
- if (debug)
+ if (debug) {
drawGTS3PC(polyStart, nPolys, local);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawGTS3PC(polyStart, nPolys, screen);
+ }
polyStart += (nPolys * HMD_GTS3_SIZE); // skip to the next polygon
break;
}
case HMD_FUL3: {
nPolys = *typePtr++;
-#if CD_MODE == 0
- if (debug)
+ if (debug) {
drawFUL3PC(polyStart, nPolys, local, (SVECTOR *)pNormal);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawFUL3PC(polyStart, nPolys, screen, (SVECTOR *)pNormal);
+ }
polyStart += (nPolys * HMD_FUL3_SIZE); // skip to the next polygon
break;
}
case HMD_GUL3: {
nPolys = *typePtr++;
-#if CD_MODE == 0
- if (debug)
+ if (debug) {
drawGUL3PC(polyStart, nPolys, local, (SVECTOR *)pNormal);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawGUL3PC(polyStart, nPolys, screen, (SVECTOR *)pNormal);
+ }
polyStart += (nPolys * HMD_GUL3_SIZE); // skip to the next polygon
break;
}
case HMD_FTL3: {
nPolys = *typePtr++;
-#if CD_MODE == 0
- if (debug)
+ if (debug) {
drawFTL3PC(polyStart, nPolys, local, (SVECTOR *)pNormal);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawFTL3PC(polyStart, nPolys, screen, (SVECTOR *)pNormal);
+ }
polyStart += (nPolys * HMD_FTL3_SIZE); // skip to the next polygon
break;
}
case HMD_GTL3: {
nPolys = *typePtr++;
-#if CD_MODE == 0
- if (debug)
+ if (debug) {
drawGTL3PC(polyStart, nPolys, local, (SVECTOR *)pNormal);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawGTL3PC(polyStart, nPolys, screen, (SVECTOR *)pNormal);
+ }
polyStart += (nPolys * HMD_GTL3_SIZE); // skip to the next polygon
break;
}
@@ -934,8 +912,6 @@ void DrawActorTiePC(psxCamera *camera, SVECTORPC *pos, uint32 size, CVECTOR *) {
}
}
-#if CD_MODE == 0
-
void drawBboxPC(SVECTOR *scrn, CVECTOR colour) {
// 6 LINE_F3's i.e. 6 pairs of lines = 12 lines in total
// The 6 pairs of lines are the following vertex links:
@@ -996,7 +972,6 @@ void drawBboxPC(SVECTOR *scrn, CVECTOR colour) {
myAddPacket(sizeof(LINE_F3));
}
-#endif
void ConvertToScreenCoords(SVECTORPC *local, SVECTORPC *screen, int32 nVertices) {
int32 i;
SVECTORPC *in = local;
diff --git a/engines/icb/debug.cpp b/engines/icb/debug.cpp
index 340dda9fdcb..e0882e2030d 100644
--- a/engines/icb/debug.cpp
+++ b/engines/icb/debug.cpp
@@ -61,8 +61,6 @@ bool8 terminate_debugging = FALSE8;
// This flag indicates whether or not the debug simulated feature is activated or not.
bool8 debug_auto_save = FALSE8;
-#if CD_MODE == 0
-
void _game_session::Show_lit_unlit_diagnostics() {
uint32 j;
uint32 pitch; // backbuffer pitch
@@ -219,10 +217,4 @@ void _game_session::Show_lit_unlit_diagnostics() {
}
}
-#else
-
-void _game_session::Show_lit_unlit_diagnostics() {}
-
-#endif // #if CD_MODE == 0
-
} // End of namespace ICB
diff --git a/engines/icb/drawpoly_pc.cpp b/engines/icb/drawpoly_pc.cpp
index ab6d7e49e2c..51efe7f9335 100644
--- a/engines/icb/drawpoly_pc.cpp
+++ b/engines/icb/drawpoly_pc.cpp
@@ -205,10 +205,6 @@ gte_lcirbk();
//------------------------------------------------------------------------
-#if CD_MODE == 0
-
-//------------------------------------------------------------------------
-
// Flat, Un-Textured, Self-Luminous, triangles
void drawFUS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
@@ -350,8 +346,6 @@ void drawFUS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
}
}
-//------------------------------------------------------------------------
-
// Gouraud, Un-Textured, Self-Luminous, triangles
void drawGUS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
@@ -2621,8 +2615,6 @@ void drawTRI3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
}
}
-#endif // #if CD_MODE == 0
-
// Flat, Un-Textured, Self-Luminous, triangles
void fastDrawFUS3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex) {
SVECTORPC *v0;
@@ -3492,8 +3484,6 @@ void fastDrawGTL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECT
// and do flat & goraud shading
// Assume the GTE lighting registers to be pre-prepared
-#if CD_MODE == 0
-
void drawSolidBboxPC(SVECTOR *scrn, CVECTOR *rgbIn) {
// 6 POLY_F4's i.e. 6 faces
// The 8 verticies are:
@@ -3654,8 +3644,6 @@ void drawSolidBboxPC(SVECTOR *scrn, CVECTOR *rgbIn) {
}
}
-#endif // #if CD_MODE == 0
-
// Simple flat untextured triangles
// draw backfacing triangles as well
// the colour is set by a global variable
diff --git a/engines/icb/drawpoly_pc.h b/engines/icb/drawpoly_pc.h
index 7a451979ce4..6ee490bc0ce 100644
--- a/engines/icb/drawpoly_pc.h
+++ b/engines/icb/drawpoly_pc.h
@@ -36,8 +36,6 @@ extern CVECTOR unlitPoly;
extern uint32 _drawBface;
extern uint32 deadObject;
-#if CD_MODE == 0
-
// Draw a cuboid
void drawSolidBboxPC(SVECTOR *scrn, CVECTOR *rgbIn);
@@ -68,8 +66,6 @@ void drawGTL3PC(uint32 *polyStart, const uint32 n, SVECTORPC *pVertex, SVECTOR *
// Debug : Simple Flat, Un-Textured triangles with no colour in them
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 uint32 n, SVECTORPC *pVertex);
diff --git a/engines/icb/mission.cpp b/engines/icb/mission.cpp
index 7c9e549b6a0..0d7b07b65ad 100644
--- a/engines/icb/mission.cpp
+++ b/engines/icb/mission.cpp
@@ -1185,9 +1185,11 @@ void _mission::Create_display() {
if (g_px->mega_timer)
session->Display_mega_times();
- // Crude Interaction Highlight
- session->player.Render_crude_interact_highlight();
- session->Show_lit_unlit_diagnostics();
+ if (true) { // FIXME: Enable this with debug level / channel
+ session->player.Render_crude_interact_highlight();
+ session->Show_lit_unlit_diagnostics();
+ }
+
session->player.DrawCompass();
}
break;
diff --git a/engines/icb/player_interaction.cpp b/engines/icb/player_interaction.cpp
index ce38299d18c..f93f6a3d21a 100644
--- a/engines/icb/player_interaction.cpp
+++ b/engines/icb/player_interaction.cpp
@@ -228,8 +228,6 @@ void _player::Find_current_player_interact_object() {
}
}
-#if CD_MODE == 0
-
void _player::Render_crude_interact_highlight() {
uint32 pitch; // backbuffer pitch
uint8 *ad;
@@ -280,12 +278,6 @@ void _player::Render_crude_interact_highlight() {
surface_manager->Unlock_surface(working_buffer_id);
}
-#else
-
-void _player::Render_crude_interact_highlight() {}
-
-#endif // #if CD_MODE == 0
-
__mode_return _player::Player_interact() {
// check if the player has pressed the interact button
// if so see if there's a current interact object and if so setup the interaction
diff --git a/engines/icb/set.cpp b/engines/icb/set.cpp
index 74ef0225a95..9c8a802e828 100644
--- a/engines/icb/set.cpp
+++ b/engines/icb/set.cpp
@@ -120,8 +120,6 @@ bool8 _game_session::IsPropSelected(const char *propName) {
return FALSE8;
}
-#if CD_MODE == 0
-
void _game_session::Render_3d_nicos() {
_feature_info *feature;
uint32 j;
@@ -172,10 +170,4 @@ void _game_session::Render_3d_nicos() {
surface_manager->Unlock_surface(working_buffer_id);
}
-#else
-
-void _game_session::Render_3d_nicos() {}
-
-#endif // #if CD_MODE == 0
-
} // End of namespace ICB
diff --git a/engines/icb/shadow_pc.cpp b/engines/icb/shadow_pc.cpp
index d4827f58f07..16a56e31d25 100644
--- a/engines/icb/shadow_pc.cpp
+++ b/engines/icb/shadow_pc.cpp
@@ -353,12 +353,11 @@ void MakeShadowPC(rap_API *srap, SVECTORPC *local, int32 nVertices, SVECTORPC *p
if (nPolys != 0) {
polyStart = srap->GetTRI3Ptr();
// Do the drawing using internal C based debugging drawing code
-#if CD_MODE == 0
- if (debug)
+ if (debug) {
drawTRI3PC(polyStart, nPolys, pvert);
- else
-#endif // #if CD_MODE == 0
+ } else {
fastDrawTRI3PC(polyStart, nPolys, pvert);
+ }
}
st3pc = g_system->getMillis() - st3pc;
}
More information about the Scummvm-git-logs
mailing list