aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gob/draw.cpp10
-rw-r--r--gob/game.cpp6
-rw-r--r--gob/goblin.cpp18
-rw-r--r--gob/inter.cpp2
-rw-r--r--gob/mult.cpp9
-rw-r--r--gob/sound.cpp2
-rw-r--r--gob/sound.h2
-rw-r--r--gob/util.cpp2
-rw-r--r--gob/util.h2
9 files changed, 23 insertions, 30 deletions
diff --git a/gob/draw.cpp b/gob/draw.cpp
index 0e9e330288..7cdaa30e86 100644
--- a/gob/draw.cpp
+++ b/gob/draw.cpp
@@ -850,7 +850,7 @@ void draw_printText(void) {
cmd = ptr2[17] & 0x7f;
if (cmd == 0) {
val = READ_LE_UINT16(ptr2 + 18) * 4;
- sprintf(buf, "%ld", READ_LE_UINT32(inter_variables + val));
+ sprintf(buf, "%d", READ_LE_UINT32(inter_variables + val));
} else if (cmd == 1) {
val = READ_LE_UINT16(ptr2 + 18) * 4;
@@ -858,18 +858,18 @@ void draw_printText(void) {
} else {
val = READ_LE_UINT16(ptr2 + 18) * 4;
- sprintf(buf, "%ld", READ_LE_UINT32(inter_variables + val));
+ sprintf(buf, "%d", READ_LE_UINT32(inter_variables + val));
if (buf[0] == '-') {
while (strlen(buf) - 1 < (uint32)ptr2[17]) {
- util_insertStr((char *)"0", buf, 1);
+ util_insertStr("0", buf, 1);
}
} else {
while (strlen(buf) - 1 < (uint32)ptr2[17]) {
- util_insertStr((char *)"0", buf, 0);
+ util_insertStr("0", buf, 0);
}
}
- util_insertStr((char *)",", buf, strlen(buf) + 1 - ptr2[17]);
+ util_insertStr(",", buf, strlen(buf) + 1 - ptr2[17]);
}
draw_textToPrint = buf;
diff --git a/gob/game.cpp b/gob/game.cpp
index 5b3cfeaa0c..25308a1e45 100644
--- a/gob/game.cpp
+++ b/gob/game.cpp
@@ -446,7 +446,7 @@ int16 game_checkKeys(int16 *pMouseX, int16 *pMouseY, int16 *pButtons, char handl
util_processInput();
if (READ_LE_UINT32(inter_variables + 0xe8) != 0) {
- if (mult_frameStart != READ_LE_UINT32(inter_variables + 0xe8) - 1)
+ if (mult_frameStart != (int)READ_LE_UINT32(inter_variables + 0xe8) - 1)
mult_frameStart++;
else
mult_frameStart = 0;
@@ -1793,7 +1793,7 @@ void game_playTot(int16 skipPlay) {
filePtr = (char *)game_totFileData + 0x30;
- if (READ_LE_UINT32(filePtr) != -1) {
+ if (READ_LE_UINT32(filePtr) != (uint32)-1) {
curPtr = game_totFileData;
game_totTextData =
(Game_TotTextTable *) (curPtr +
@@ -1802,7 +1802,7 @@ void game_playTot(int16 skipPlay) {
}
filePtr = (char *)game_totFileData + 0x34;
- if (READ_LE_UINT32(filePtr) != -1) {
+ if (READ_LE_UINT32(filePtr) != (uint32)-1) {
curPtr = game_totFileData;
game_totResourceTable =
diff --git a/gob/goblin.cpp b/gob/goblin.cpp
index c7ebd6b4f5..00f2e87549 100644
--- a/gob/goblin.cpp
+++ b/gob/goblin.cpp
@@ -461,14 +461,10 @@ void gob_animateObjects(void) {
if (objDesc->multState != -1) {
if (objDesc->multState > 39) {
- objDesc->stateMach =
- gob_goblins[objDesc->
- multObjIndex]->stateMach;
- objDesc->state =
- objDesc->multState - 40;
+ objDesc->stateMach = gob_goblins[(int)(objDesc->multObjIndex)]->stateMach;
+ objDesc->state = objDesc->multState - 40;
} else {
- objDesc->stateMach =
- objDesc->realStateMach;
+ objDesc->stateMach = objDesc->realStateMach;
objDesc->state = objDesc->multState;
}
objDesc->animation =
@@ -565,7 +561,7 @@ int16 gob_objIntersected(Gob_Object *obj1, Gob_Object *obj2) {
}
void gob_setMultStates(Gob_Object * gobDesc) {
- gobDesc->stateMach = gob_goblins[gobDesc->multObjIndex]->stateMach;
+ gobDesc->stateMach = gob_goblins[(int)gobDesc->multObjIndex]->stateMach;
}
int16 gob_nextLayer(Gob_Object *gobDesc) {
@@ -2268,12 +2264,10 @@ void gob_placeItem(int16 indexInPocket, int16 idInPocket) {
map_itemPoses[idInPocket].orient = lookDir;
if (map_itemPoses[idInPocket].orient == 0) {
// map_itemPoses[idInPocket].x++;
- if (map_passMap[map_itemPoses[idInPocket].
- y][map_itemPoses[idInPocket].x + 1] == 1)
+ if (map_passMap[(int)map_itemPoses[idInPocket].y][map_itemPoses[idInPocket].x + 1] == 1)
map_itemPoses[idInPocket].x++;
} else {
- if (map_passMap[map_itemPoses[idInPocket].
- y][map_itemPoses[idInPocket].x - 1] == 1)
+ if (map_passMap[(int)map_itemPoses[idInPocket].y][map_itemPoses[idInPocket].x - 1] == 1)
map_itemPoses[idInPocket].x--;
}
}
diff --git a/gob/inter.cpp b/gob/inter.cpp
index 636d02a78c..2054857810 100644
--- a/gob/inter.cpp
+++ b/gob/inter.cpp
@@ -159,7 +159,7 @@ void inter_printText(void) {
switch (*inter_execPtr) {
case 23:
case 26:
- sprintf(buf + i, "%ld", READ_LE_UINT32(inter_variables + parse_parseVarIndex()));
+ sprintf(buf + i, "%d", READ_LE_UINT32(inter_variables + parse_parseVarIndex()));
break;
case 25:
diff --git a/gob/mult.cpp b/gob/mult.cpp
index 9dd75da1fe..32233e8bd0 100644
--- a/gob/mult.cpp
+++ b/gob/mult.cpp
@@ -320,8 +320,7 @@ void mult_animate(void) {
} else {
pAnimData->frame++;
if (pAnimData->frame >=
- scen_animations[pAnimData->animation].
- layers[pAnimData->layer]->framesCount) {
+ scen_animations[(int)pAnimData->animation].layers[pAnimData->layer]->framesCount) {
switch (pAnimData->animType) {
case 0:
pAnimData->frame = 0;
@@ -332,11 +331,11 @@ void mult_animate(void) {
*(mult_objects[i].pPosX) =
*(mult_objects[i].pPosX) +
- scen_animations[pAnimData->animation].layers[pAnimData->layer]->animDeltaX;
+ scen_animations[(int)pAnimData->animation].layers[pAnimData->layer]->animDeltaX;
*(mult_objects[i].pPosY) =
*(mult_objects[i].pPosY) +
- scen_animations[pAnimData->animation].layers[pAnimData->layer]->animDeltaY;
+ scen_animations[(int)pAnimData->animation].layers[pAnimData->layer]->animDeltaY;
break;
case 2:
@@ -1128,7 +1127,7 @@ void mult_loadMult(int16 resId) {
}
void mult_freeMultKeys(void) {
- char i;
+ int i;
char animCount;
char staticCount;
diff --git a/gob/sound.cpp b/gob/sound.cpp
index af4731ba56..176a5d27cc 100644
--- a/gob/sound.cpp
+++ b/gob/sound.cpp
@@ -31,7 +31,7 @@ namespace Gob {
return;
}
- Snd_SoundDesc *snd_loadSoundData(char *path) {
+ Snd_SoundDesc *snd_loadSoundData(const char *path) {
return NULL;
}
void snd_freeSoundData(Snd_SoundDesc * sndDesc) {;}
diff --git a/gob/sound.h b/gob/sound.h
index 21e349ea9f..9a24b08587 100644
--- a/gob/sound.h
+++ b/gob/sound.h
@@ -37,7 +37,7 @@ typedef struct Snd_SoundDesc {
} Snd_SoundDesc;
void snd_playSample(Snd_SoundDesc * soundDesc, int16 repCount, int16 frequency);
-Snd_SoundDesc *snd_loadSoundData(char *path);
+Snd_SoundDesc *snd_loadSoundData(const char *path);
void snd_freeSoundData(Snd_SoundDesc * sndDesc);
void snd_playComposition(Snd_SoundDesc ** samples, int16 *composit, int16 freqVal);
void snd_waitEndPlay(void);
diff --git a/gob/util.cpp b/gob/util.cpp
index b670642164..0fadc6cd51 100644
--- a/gob/util.cpp
+++ b/gob/util.cpp
@@ -286,7 +286,7 @@ void util_clearPalette(void) {
vid_setPalElem(i, 0, 0, 0, 0, videoMode);
}
-void util_insertStr(char *str1, char *str2, int16 pos) {
+void util_insertStr(const char *str1, char *str2, int16 pos) {
int16 len1;
int16 i;
int16 from;
diff --git a/gob/util.h b/gob/util.h
index 95bf935d3e..2aeaee03de 100644
--- a/gob/util.h
+++ b/gob/util.h
@@ -50,7 +50,7 @@ void vid_waitRetrace(int16 mode);
FontDesc *util_loadFont(const char *path);
void util_freeFont(FontDesc * fontDesc);
void util_clearPalette(void);
-void util_insertStr(char *str1, char *str2, int16 pos);
+void util_insertStr(const char *str1, char *str2, int16 pos);
void util_cutFromStr(char *str, int16 from, int16 cutlen);
int16 util_strstr(const char *str1, char *str2);
void util_waitEndFrame(void);