aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorJonathan Gray2003-07-28 11:21:25 +0000
committerJonathan Gray2003-07-28 11:21:25 +0000
commitc1cbd4605e6a3ae3a28462cdb30482454e1b6da0 (patch)
tree4644905a3160d0c5c34c025f0e12e60eb7f195ef /sword2
parent9e051fa5070cd70ff0e69faa647ad26f66b64560 (diff)
downloadscummvm-rg350-c1cbd4605e6a3ae3a28462cdb30482454e1b6da0.tar.gz
scummvm-rg350-c1cbd4605e6a3ae3a28462cdb30482454e1b6da0.tar.bz2
scummvm-rg350-c1cbd4605e6a3ae3a28462cdb30482454e1b6da0.zip
fix some VC7 warnings
svn-id: r9240
Diffstat (limited to 'sword2')
-rw-r--r--sword2/anims.cpp6
-rw-r--r--sword2/driver/d_sound.cpp2
-rw-r--r--sword2/driver/render.cpp8
-rw-r--r--sword2/speech.cpp14
-rw-r--r--sword2/sync.cpp15
-rw-r--r--sword2/walker.cpp14
6 files changed, 30 insertions, 29 deletions
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;j<MAX_syncs;j++)
- if (sync_list[j].id == ID)
- { RESULT=sync_list[j].sync;
+ if (sync_list[j].id == ID) {
+ RESULT=sync_list[j].sync;
return(IR_CONT); //return sync value waiting
}
RESULT=0;
- if (params);
+ // if (params); what is the point of this... khalek
return(IR_CONT); //no sync found
@@ -163,14 +163,15 @@ int32 FN_wait_sync(int32 *params) //Tony27Nov96
// Zdebug("%d waits", ID);
- for (j=0;j<MAX_syncs;j++)
- if (sync_list[j].id == ID)
- { RESULT=sync_list[j].sync;
+ for (j=0;j<MAX_syncs;j++) {
+ if (sync_list[j].id == ID) {
+ RESULT=sync_list[j].sync;
//Zdebug(" go");
return(IR_CONT); //return sync value waiting
}
+ }
- if (params);
+ // if (params); // what is the point of this... - khalek
return(IR_REPEAT); //back again next cycle
diff --git a/sword2/walker.cpp b/sword2/walker.cpp
index 93033e4862..6430152acd 100644
--- a/sword2/walker.cpp
+++ b/sword2/walker.cpp
@@ -121,9 +121,9 @@ int32 FN_walk(int32 *params) // James (14nov96)
ob_graph = (Object_graphic *)params[1];
ob_mega = (Object_mega *)params[2];
- target_x = params[4];
- target_y = params[5];
- target_dir = params[6];
+ target_x = (int16) params[4];
+ target_y = (int16) params[5];
+ target_dir = (uint8) params[6];
//----------------------------------------------------------------------------------------
// if this is the start of the walk, calculate route
@@ -154,7 +154,7 @@ int32 FN_walk(int32 *params) // James (14nov96)
ob_mega->walk_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
}