mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 13:13:58 +00:00
ICB: Fixed several compiler warnings
This commit is contained in:
parent
ba2a57af8f
commit
ed4ae57063
@ -138,9 +138,6 @@ scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to
|
|||||||
int32 parameter1, parameter2, value;
|
int32 parameter1, parameter2, value;
|
||||||
bool8 isInExpression = FALSE8;
|
bool8 isInExpression = FALSE8;
|
||||||
|
|
||||||
// Reset the fn routine control return value
|
|
||||||
int32 fn_routines_control_return_flag = (-1);
|
|
||||||
|
|
||||||
// Variable to prevent infinite loops
|
// Variable to prevent infinite loops
|
||||||
uint32 infiniteLoopCounter = 0;
|
uint32 infiniteLoopCounter = 0;
|
||||||
|
|
||||||
@ -265,7 +262,6 @@ scriptInterpreterReturnCodes RunScript(const char *&scriptData, // A pointer to
|
|||||||
// Push the fn_routine return value
|
// Push the fn_routine return value
|
||||||
PushOnStack(routineReturnParameter);
|
PushOnStack(routineReturnParameter);
|
||||||
// save the mcode return value
|
// save the mcode return value
|
||||||
fn_routines_control_return_flag = mcodeRetVal;
|
|
||||||
} else {
|
} else {
|
||||||
// Check return value in case we want to pause the script
|
// Check return value in case we want to pause the script
|
||||||
|
|
||||||
|
@ -32,8 +32,6 @@
|
|||||||
|
|
||||||
namespace ICB {
|
namespace ICB {
|
||||||
|
|
||||||
#define SLEN_CHECK (slen < 0)
|
|
||||||
|
|
||||||
const char *pxString::operator=(const char *str) {
|
const char *pxString::operator=(const char *str) {
|
||||||
// Assign a value
|
// Assign a value
|
||||||
|
|
||||||
@ -236,7 +234,7 @@ const pxString &pxString::Format(const char *format, ...) {
|
|||||||
uint32 slen;
|
uint32 slen;
|
||||||
|
|
||||||
// Keep doubling the size of the buffer until it fits
|
// 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) {
|
while (va_start(arglist, format), slen = vsnprintf(s, startBufferSize, const_cast<char *>(format), arglist)) {
|
||||||
delete[] s;
|
delete[] s;
|
||||||
|
|
||||||
startBufferSize += startBufferSize;
|
startBufferSize += startBufferSize;
|
||||||
|
@ -108,7 +108,7 @@ public:
|
|||||||
~pxFlexiCharBuffer();
|
~pxFlexiCharBuffer();
|
||||||
|
|
||||||
char &operator[](uint); // Allow array access
|
char &operator[](uint); // Allow array access
|
||||||
void CheckSize(uint); // Make sure we have enough room
|
void CheckSize(uint32); // Make sure we have enough room
|
||||||
char *GetBuffer() {
|
char *GetBuffer() {
|
||||||
return (m_buffer); // Make it a little more difficult to pass the pointer
|
return (m_buffer); // Make it a little more difficult to pass the pointer
|
||||||
}
|
}
|
||||||
|
@ -307,10 +307,6 @@ void JpegDecoder::ReadImage(uint8 *inputData, uint32 surface_Id) {
|
|||||||
eoi_found = false;
|
eoi_found = false;
|
||||||
sof_found = false;
|
sof_found = false;
|
||||||
|
|
||||||
_bit_count = 0;
|
|
||||||
_buf_pointer = (uint32 *)input_buffer;
|
|
||||||
_end_buf = (uint32 *)(input_buffer + (1024 * 1024)); // blantantly wrong... need to make cash sized buffer
|
|
||||||
|
|
||||||
data = ReadByte();
|
data = ReadByte();
|
||||||
while (!eoi_found) {
|
while (!eoi_found) {
|
||||||
if (data == SOB) {
|
if (data == SOB) {
|
||||||
|
@ -34,10 +34,6 @@ namespace ICB {
|
|||||||
|
|
||||||
class _surface;
|
class _surface;
|
||||||
|
|
||||||
static uint32 _bit_count;
|
|
||||||
static uint32 *_buf_pointer;
|
|
||||||
static uint32 *_end_buf;
|
|
||||||
|
|
||||||
const int32 JpegMaxHuffmanTables = 4;
|
const int32 JpegMaxHuffmanTables = 4;
|
||||||
const int32 MaxQuantizationTables = 4;
|
const int32 MaxQuantizationTables = 4;
|
||||||
const int32 JpegMaxComponentsPerFrame = 255;
|
const int32 JpegMaxComponentsPerFrame = 255;
|
||||||
|
@ -70,17 +70,6 @@ void Credits() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InitisliaseScrollingText(const char *textFileName, const char *movieFileName, int32 frameStart) {
|
void InitisliaseScrollingText(const char *textFileName, const char *movieFileName, int32 frameStart) {
|
||||||
// Movies are streamed from the CD
|
|
||||||
char *_root;
|
|
||||||
|
|
||||||
#if 1 // was ifdef FROM_PC_CD
|
|
||||||
#ifndef PC_DEMO
|
|
||||||
|
|
||||||
_root = g_theClusterManager->GetCDRoot();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Find movie to play
|
// Find movie to play
|
||||||
pxString fullMovieName;
|
pxString fullMovieName;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
namespace ICB {
|
namespace ICB {
|
||||||
|
|
||||||
int32 LoadMission(int32 m, void *usr) {
|
int32 LoadMission(int32 m, void * /*usr*/) {
|
||||||
int32 demo = g_globalScriptVariables.GetVariable("demo");
|
int32 demo = g_globalScriptVariables.GetVariable("demo");
|
||||||
Init_globals(); // reload the global vars for the new mission
|
Init_globals(); // reload the global vars for the new mission
|
||||||
g_globalScriptVariables.SetVariable("missionelapsedtime", 0);
|
g_globalScriptVariables.SetVariable("missionelapsedtime", 0);
|
||||||
@ -60,9 +60,6 @@ int32 LoadMission(int32 m, void *usr) {
|
|||||||
rs_anims->Res_purge_all();
|
rs_anims->Res_purge_all();
|
||||||
rs_bg->Res_purge_all();
|
rs_bg->Res_purge_all();
|
||||||
|
|
||||||
// To remove compiler warning
|
|
||||||
usr = NULL;
|
|
||||||
|
|
||||||
warning("rs_anims %d files %dKB rs_bg %d files %dKB", rs_anims->Fetch_files_open(), (rs_anims->Fetch_mem_used() / 1024), rs_bg->Fetch_files_open(),
|
warning("rs_anims %d files %dKB rs_bg %d files %dKB", rs_anims->Fetch_files_open(), (rs_anims->Fetch_mem_used() / 1024), rs_bg->Fetch_files_open(),
|
||||||
(rs_bg->Fetch_mem_used() / 1024));
|
(rs_bg->Fetch_mem_used() / 1024));
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ uint32 MovieManager::drawFrame(uint32 surface_id) {
|
|||||||
uint32 height = surface_manager->Get_height(surface_id);
|
uint32 height = surface_manager->Get_height(surface_id);
|
||||||
|
|
||||||
for (int32 i = 0; i < surface->h; i++) {
|
for (int32 i = 0; i < surface->h; i++) {
|
||||||
if (i + _y >= height) {
|
if (i + _y >= (int32)height) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
memcpy(surface_address + (i + _y) * pitch, surface->getBasePtr(0, i), MIN(surface->pitch, pitch));
|
memcpy(surface_address + (i + _y) * pitch, surface->getBasePtr(0, i), MIN(surface->pitch, pitch));
|
||||||
|
@ -255,16 +255,6 @@ void _remora::ActivateRemora(RemoraMode eMode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _remora::DoPlatformSpecificInitialisation() {
|
void _remora::DoPlatformSpecificInitialisation() {
|
||||||
|
|
||||||
uint32 nFileNameHash, nClusterHash;
|
|
||||||
char pcFileName[ENGINE_STRING_LEN];
|
|
||||||
|
|
||||||
// Load the Map Data. When clustered the session files have the base stripped.
|
|
||||||
strcpy(pcFileName, REMORA_MAP_FILENAME);
|
|
||||||
|
|
||||||
nClusterHash = MS->Fetch_session_cluster_hash();
|
|
||||||
nFileNameHash = NULL_HASH;
|
|
||||||
|
|
||||||
// Allocate a text buffer if one hasn't been allocated already.
|
// Allocate a text buffer if one hasn't been allocated already.
|
||||||
if (!m_pDisplayBuffer)
|
if (!m_pDisplayBuffer)
|
||||||
m_pDisplayBuffer = new _remora_line[REMORA_TEXT_BUFFER_ROWS];
|
m_pDisplayBuffer = new _remora_line[REMORA_TEXT_BUFFER_ROWS];
|
||||||
@ -1372,11 +1362,6 @@ void _remora::ColourToRGB(uint8 nAttributes, uint8 &nRed, uint8 &nGreen, uint8 &
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _remora::SetUpM08LockControl() {
|
void _remora::SetUpM08LockControl() {
|
||||||
uint32 oBitmapNameHash;
|
|
||||||
|
|
||||||
// We need the size of the scan screen for clipping the barriers.
|
|
||||||
oBitmapNameHash = NULL_HASH;
|
|
||||||
|
|
||||||
// Here we build a list of the door names and what object ID they are.
|
// Here we build a list of the door names and what object ID they are.
|
||||||
BuildM08DoorList();
|
BuildM08DoorList();
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ namespace ICB {
|
|||||||
|
|
||||||
void _remora_sprite::GenericSpriteDraw(int32 nX, int32 nY, bool8 bPosition, const _rs_params *pParams) {
|
void _remora_sprite::GenericSpriteDraw(int32 nX, int32 nY, bool8 bPosition, const _rs_params *pParams) {
|
||||||
_pxBitmap *psBitmap;
|
_pxBitmap *psBitmap;
|
||||||
_pxSprite *psSprite;
|
|
||||||
uint8 *pSurfaceBitmap;
|
uint8 *pSurfaceBitmap;
|
||||||
uint32 nPitch;
|
uint32 nPitch;
|
||||||
uint32 nSurfaceWidth, nSurfaceHeight;
|
uint32 nSurfaceWidth, nSurfaceHeight;
|
||||||
@ -64,8 +63,6 @@ void _remora_sprite::GenericSpriteDraw(int32 nX, int32 nY, bool8 bPosition, cons
|
|||||||
if (psBitmap->schema != PC_BITMAP_SCHEMA)
|
if (psBitmap->schema != PC_BITMAP_SCHEMA)
|
||||||
Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", m_pcName, PC_BITMAP_SCHEMA, psBitmap->schema);
|
Fatal_error("Incorrect versions loading [%s] (engine has %d, data has %d", m_pcName, PC_BITMAP_SCHEMA, psBitmap->schema);
|
||||||
|
|
||||||
psSprite = psBitmap->Fetch_item_by_number(m_nFramePC);
|
|
||||||
|
|
||||||
// Lock the surface and get the pitch.
|
// Lock the surface and get the pitch.
|
||||||
uint32 remoraSurfaceId = g_oRemora->GetRemoraSurfaceId();
|
uint32 remoraSurfaceId = g_oRemora->GetRemoraSurfaceId();
|
||||||
pSurfaceBitmap = surface_manager->Lock_surface(remoraSurfaceId);
|
pSurfaceBitmap = surface_manager->Lock_surface(remoraSurfaceId);
|
||||||
|
@ -1209,16 +1209,16 @@ _linked_data_file *LoadTranslatedFile(const char *mission, const char *session)
|
|||||||
uint32 len = stream->size();
|
uint32 len = stream->size();
|
||||||
|
|
||||||
// make space for file
|
// make space for file
|
||||||
char *mem = new char[len + 1];
|
char *memPtr = new char[len + 1];
|
||||||
|
|
||||||
// read it in
|
// read it in
|
||||||
stream->read(mem, len);
|
stream->read(memPtr, len);
|
||||||
delete stream; // close the file
|
delete stream; // close the file
|
||||||
|
|
||||||
// 0 terminate the string
|
// 0 terminate the string
|
||||||
mem[len] = 0;
|
memPtr[len] = 0;
|
||||||
|
|
||||||
return ((_linked_data_file *)mem);
|
return ((_linked_data_file *)memPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of namespace ICB
|
} // End of namespace ICB
|
||||||
|
@ -144,7 +144,7 @@ mcodeFunctionReturnCodes _game_session::fn_request_speech(int32 &result, int32 *
|
|||||||
|
|
||||||
// conversation script doesnt exist
|
// conversation script doesnt exist
|
||||||
if (!S.script_pc)
|
if (!S.script_pc)
|
||||||
Fatal_error("object [%d] tried to start conversation script [%s] which doesnt exist", cur_id, (const char *const)temp_buf);
|
Fatal_error("object [%d] tried to start conversation script [%s] which doesnt exist", cur_id, (const char *)temp_buf);
|
||||||
|
|
||||||
// reset number of subs
|
// reset number of subs
|
||||||
S.total_subscribers = 0; // everyone but us initially
|
S.total_subscribers = 0; // everyone but us initially
|
||||||
|
@ -58,6 +58,7 @@ _TSrtn text_sprite::GetRenderCoords(const int32 pinX, // screen x-coor
|
|||||||
case PIN_AT_CENTRE:
|
case PIN_AT_CENTRE:
|
||||||
renderX = pinX - spriteWidth / 2;
|
renderX = pinX - spriteWidth / 2;
|
||||||
renderY = pinY - spriteHeight / 2;
|
renderY = pinY - spriteHeight / 2;
|
||||||
|
break;
|
||||||
|
|
||||||
case PIN_AT_CENTRE_OF_TOP:
|
case PIN_AT_CENTRE_OF_TOP:
|
||||||
renderX = pinX - spriteWidth / 2;
|
renderX = pinX - spriteWidth / 2;
|
||||||
|
@ -43,7 +43,7 @@ bool8 _tracer::Trace(const px3DRealPoint &oFrom, // IN: Point to plot from
|
|||||||
const px3DRealPoint &oTo, // IN: Point to plot to.
|
const px3DRealPoint &oTo, // IN: Point to plot to.
|
||||||
_barrier_ray_type eRayType, // IN: The type of the ray being plotted.
|
_barrier_ray_type eRayType, // IN: The type of the ray being plotted.
|
||||||
px3DRealPoint &oPointOfImpact, // OUT: The first point of impact.
|
px3DRealPoint &oPointOfImpact, // OUT: The first point of impact.
|
||||||
_barrier_logic_value eImpactType // OUT: For interpretation by high-level logic.
|
_barrier_logic_value /*eImpactType*/ // OUT: For interpretation by high-level logic.
|
||||||
) {
|
) {
|
||||||
uint32 i;
|
uint32 i;
|
||||||
uint32 nLoopCount;
|
uint32 nLoopCount;
|
||||||
@ -98,7 +98,7 @@ bool8 _tracer::Trace(const px3DRealPoint &oFrom, // IN: Point to plot from
|
|||||||
if (!GetCubeAndIndices(oCurrentPoint, oThisIndex, oThisCube)) {
|
if (!GetCubeAndIndices(oCurrentPoint, oThisIndex, oThisCube)) {
|
||||||
// We have gone outside the game world, so we can't have hit anything.
|
// We have gone outside the game world, so we can't have hit anything.
|
||||||
oPointOfImpact = oCurrentPoint;
|
oPointOfImpact = oCurrentPoint;
|
||||||
eImpactType = BLOCKS;
|
//eImpactType = BLOCKS;
|
||||||
return (FALSE8);
|
return (FALSE8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ bool8 _tracer::Trace(const px3DRealPoint &oFrom, // IN: Point to plot from
|
|||||||
((int32)oCurrentPoint.GetZ() >= (int32)psFloor->rect.z1) && ((int32)oCurrentPoint.GetZ() <= (int32)psFloor->rect.z2)) {
|
((int32)oCurrentPoint.GetZ() >= (int32)psFloor->rect.z1) && ((int32)oCurrentPoint.GetZ() <= (int32)psFloor->rect.z2)) {
|
||||||
// The ray has hit a floor rectangle.
|
// The ray has hit a floor rectangle.
|
||||||
oPointOfImpact = oCurrentPoint;
|
oPointOfImpact = oCurrentPoint;
|
||||||
eImpactType = BLOCKS;
|
//eImpactType = BLOCKS;
|
||||||
return (FALSE8);
|
return (FALSE8);
|
||||||
}
|
}
|
||||||
} // end if
|
} // end if
|
||||||
@ -203,7 +203,7 @@ bool8 _tracer::Trace(const px3DRealPoint &oFrom, // IN: Point to plot from
|
|||||||
// In final release, we'll let this go back, but it may have the wrong answer. The effects of
|
// In final release, we'll let this go back, but it may have the wrong answer. The effects of
|
||||||
// this should be benign enough to allow this.
|
// this should be benign enough to allow this.
|
||||||
oPointOfImpact = oTo;
|
oPointOfImpact = oTo;
|
||||||
eImpactType = NO_IMPACT;
|
//eImpactType = NO_IMPACT;
|
||||||
return (FALSE8);
|
return (FALSE8);
|
||||||
}
|
}
|
||||||
} // end while
|
} // end while
|
||||||
|
Loading…
x
Reference in New Issue
Block a user