From c1cbd4605e6a3ae3a28462cdb30482454e1b6da0 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Mon, 28 Jul 2003 11:21:25 +0000 Subject: fix some VC7 warnings svn-id: r9240 --- sword2/anims.cpp | 6 +++--- sword2/driver/d_sound.cpp | 2 +- sword2/driver/render.cpp | 8 ++++---- sword2/speech.cpp | 14 +++++++------- sword2/sync.cpp | 15 ++++++++------- sword2/walker.cpp | 14 +++++++------- 6 files changed, 30 insertions(+), 29 deletions(-) (limited to 'sword2') diff --git a/sword2/anims.cpp b/sword2/anims.cpp index 69f0144078..918a2ae54e 100644 --- a/sword2/anims.cpp +++ b/sword2/anims.cpp @@ -520,9 +520,9 @@ int32 FN_add_sequence_text(int32 *params) // (James22may97) Con_fatal_error("FN_add_sequence_text ran out of lines (%s line %u)",__FILE__,__LINE__); #endif - sequence_text_list[sequenceTextLines].textNumber = params[0]; - sequence_text_list[sequenceTextLines].startFrame = params[1]; - sequence_text_list[sequenceTextLines].endFrame = params[2]; + sequence_text_list[sequenceTextLines].textNumber = params[0]; + sequence_text_list[sequenceTextLines].startFrame = params[1]; + sequence_text_list[sequenceTextLines].endFrame = (uint16) params[2]; sequenceTextLines++; return(IR_CONT); // continue script diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp index 78c69bf6e7..ed820fbaff 100644 --- a/sword2/driver/d_sound.cpp +++ b/sword2/driver/d_sound.cpp @@ -2966,7 +2966,7 @@ void SetMusicVolume(uint8 volume) uint8 GetMusicVolume() { - return volMusic[0]; + return (uint8) volMusic[0]; } diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp index a7ccabdc61..c4065a2692 100644 --- a/sword2/driver/render.cpp +++ b/sword2/driver/render.cpp @@ -929,8 +929,8 @@ int32 StartRenderCycle(void) } else { - scrollx = scrollxOld + ((scrollxTarget - scrollxOld) * (startTime - initialTime + renderAverageTime)) / (totalTime - initialTime); - scrolly = scrollyOld + ((scrollyTarget - scrollyOld) * (startTime - initialTime + renderAverageTime)) / (totalTime - initialTime); + scrollx = (int16) (scrollxOld + ((scrollxTarget - scrollxOld) * (startTime - initialTime + renderAverageTime)) / (totalTime - initialTime)); + scrolly = (int16) (scrollyOld + ((scrollyTarget - scrollyOld) * (startTime - initialTime + renderAverageTime)) / (totalTime - initialTime)); renderTooSlow = 0; } @@ -973,8 +973,8 @@ int32 EndRenderCycle(BOOL *end) else { *end = FALSE; - scrollx = scrollxOld + ((scrollxTarget - scrollxOld) * (startTime - initialTime + renderAverageTime)) / (totalTime - initialTime); - scrolly = scrollyOld + ((scrollyTarget - scrollyOld) * (startTime - initialTime + renderAverageTime)) / (totalTime - initialTime); + scrollx = (int16) (scrollxOld + ((scrollxTarget - scrollxOld) * (startTime - initialTime + renderAverageTime)) / (totalTime - initialTime)); + scrolly = (int16) (scrollyOld + ((scrollyTarget - scrollyOld) * (startTime - initialTime + renderAverageTime)) / (totalTime - initialTime)); } return(RD_OK); diff --git a/sword2/speech.cpp b/sword2/speech.cpp index 91fc89278c..7558571a6d 100644 --- a/sword2/speech.cpp +++ b/sword2/speech.cpp @@ -215,11 +215,11 @@ int32 FN_choose(int32 *params) //Tony19Nov96 { // Zdebug(" ICON res %d for %d", subject_list[j].res, j); icon = res_man.Res_open( subject_list[j].res ) + sizeof(_standardHeader) + RDMENU_ICONWIDE*RDMENU_ICONDEEP; - SetMenuIcon(RDMENU_BOTTOM, j, icon); + SetMenuIcon(RDMENU_BOTTOM, (uint8) j, icon); res_man.Res_close( subject_list[j].res ); } else - { SetMenuIcon(RDMENU_BOTTOM, j, NULL); //no icon here + { SetMenuIcon(RDMENU_BOTTOM, (uint8) j, NULL); //no icon here //Zdebug(" NULL for %d", j); } } @@ -275,7 +275,7 @@ int32 FN_choose(int32 *params) //Tony19Nov96 if (j!=hit) //change all others to grey { icon = res_man.Res_open( subject_list[j].res ) + sizeof(_standardHeader); //now grey - SetMenuIcon(RDMENU_BOTTOM, j, icon); + SetMenuIcon(RDMENU_BOTTOM, (uint8) j, icon); res_man.Res_close( subject_list[j].res ); } } @@ -360,7 +360,7 @@ int32 FN_end_conversation(int32 *params) //Tony27Nov96 // restart george's base script // LLogic.Total_restart(); - if (params); + // if (params); what is this supposed to do? - khalek return(IR_CONT); //drop out without saving pc and go around again } @@ -1809,11 +1809,11 @@ void LocateTalker(int32 *params) // (James 01july97) ob_mega = (Object_mega*) params[S_OB_MEGA]; // this may be NULL // calc scale at which to print the sprite, based on feet y-coord & scaling constants (NB. 'scale' is actually 256*true_scale, to maintain accuracy) - scale = (ob_mega->scale_a * ob_mega->feet_y + ob_mega->scale_b)/256; // Ay+B gives 256*scale ie. 256*256*true_scale for even better accuracy, ie. scale = (Ay+B)/256 + scale = (uint16) ((ob_mega->scale_a * ob_mega->feet_y + ob_mega->scale_b)/256); // Ay+B gives 256*scale ie. 256*256*true_scale for even better accuracy, ie. scale = (Ay+B)/256 // calc suitable centre point above the head, based on scaled height - text_x = ob_mega->feet_x; // just use 'feet_x' as centre - text_y = ob_mega->feet_y + (cdt_entry->y * scale)/256; // add scaled y-offset to feet_y coord to get top of sprite + text_x = (int16) (ob_mega->feet_x); // just use 'feet_x' as centre + text_y = (int16) (ob_mega->feet_y + (cdt_entry->y * scale)/256); // add scaled y-offset to feet_y coord to get top of sprite } else // it's a non-scaling anim { diff --git a/sword2/sync.cpp b/sword2/sync.cpp index b9ae1add1e..6611a80c3a 100644 --- a/sword2/sync.cpp +++ b/sword2/sync.cpp @@ -135,14 +135,14 @@ int32 FN_get_sync(int32 *params) //Tony27Nov96 for (j=0;jwalk_pc=0; //always AllocateRouteMem(); // set up mem for _walkData in route_slots[] & set mega's 'route_slot_id' accordingly - route = RouteFinder(ob_mega, ob_walkdata, target_x, target_y, target_dir); + route = (int8) RouteFinder(ob_mega, ob_walkdata, target_x, target_y, target_dir); /* if (id == PLAYER) @@ -923,9 +923,9 @@ int32 FN_set_standby_coords(int32 *params) // (10dec97 JEL) //---------------------------------------------------------------------------------------- - standby_x = params[0]; - standby_y = params[1]; - standby_dir = params[2]; + standby_x = (int16) params[0]; + standby_y = (int16) params[1]; + standby_dir = (uint8) params[2]; return(IR_CONT); // continue script } -- cgit v1.2.3