aboutsummaryrefslogtreecommitdiff
path: root/engines/griffon
diff options
context:
space:
mode:
authorStrangerke2019-08-25 23:24:45 +0200
committerEugene Sandulenko2019-11-13 22:07:08 +0100
commit20270594f73d12ff8ce942d5cc01b0205d5c15b4 (patch)
tree202588d2a5d7f2656e4c26a6431c0bb0d780b520 /engines/griffon
parent5f8b6851e0871527afdd4fd9e8b9b8cf6d0e08c5 (diff)
downloadscummvm-rg350-20270594f73d12ff8ce942d5cc01b0205d5c15b4.tar.gz
scummvm-rg350-20270594f73d12ff8ce942d5cc01b0205d5c15b4.tar.bz2
scummvm-rg350-20270594f73d12ff8ce942d5cc01b0205d5c15b4.zip
GRIFFON: Fix some warning in MSVC9 by enforcing the use of float numbers.
Also, add a couple of comments
Diffstat (limited to 'engines/griffon')
-rw-r--r--engines/griffon/engine.cpp34
-rw-r--r--engines/griffon/griffon.h20
2 files changed, 27 insertions, 27 deletions
diff --git a/engines/griffon/engine.cpp b/engines/griffon/engine.cpp
index 0bd147c04d..226658ea49 100644
--- a/engines/griffon/engine.cpp
+++ b/engines/griffon/engine.cpp
@@ -298,7 +298,7 @@ Graphics::TransparentSurface *IMG_Load(const char *name, bool colorkey = false)
// copypaste from hRnd_CRT()
float GriffonEngine::RND() {
/* return between 0 and 1 (but never 1) */
- return (float)_rnd->getRandomNumber(32767) * (1.0 / 32768.0f);
+ return (float)_rnd->getRandomNumber(32767) * (1.0f / 32768.0f);
}
void GriffonEngine::game_addFloatIcon(int ico, float xloc, float yloc) {
@@ -730,11 +730,11 @@ void GriffonEngine::game_castspell(int spellnum, float homex, float homey, float
spellinfo[i].damagewho = dw;
spellinfo[i].npc = npc;
- spellinfo[i].frame = 32;
+ spellinfo[i].frame = 32.0f;
if (damagewho == 0) {
spellinfo[i].strength = player.spellstrength / 100;
if (player.spellstrength == 100)
- spellinfo[i].strength = 1.5;
+ spellinfo[i].strength = 1.5f;
}
// set earthslide vars
@@ -3136,7 +3136,7 @@ void GriffonEngine::game_endofgame() {
ticks = g_system->getMillis();
- float spd = 0.2;
+ float spd = 0.2f;
if (menabled == 1 && config.music == 1) {
Mix_HaltChannel(-1);
@@ -3267,9 +3267,9 @@ void GriffonEngine::game_endofgame() {
xofs = xofs - 320;
if (event.type == Common::EVENT_KEYDOWN)
- spd = 1;
+ spd = 1.0f;
if (event.type == Common::EVENT_KEYUP)
- spd = 0.2;
+ spd = 0.2f;
if (event.kbd.keycode == Common::KEYCODE_ESCAPE)
break;
@@ -4065,7 +4065,7 @@ void GriffonEngine::game_loadmap(int mapnum) {
npcinfo[i].attackdamage = 24;
npcinfo[i].spelldamage = 30;
- npcinfo[i].walkspd = 1.4;
+ npcinfo[i].walkspd = 1.4f;
npcinfo[i].castpause = ticks;
}
@@ -4077,7 +4077,7 @@ void GriffonEngine::game_loadmap(int mapnum) {
npcinfo[i].attackdamage = 0;
npcinfo[i].spelldamage = 30;
- npcinfo[i].walkspd = 1.2;
+ npcinfo[i].walkspd = 1.2f;
}
// black knights
@@ -4099,7 +4099,7 @@ void GriffonEngine::game_loadmap(int mapnum) {
npcinfo[i].attackdamage = 50;
npcinfo[i].spelldamage = 30;
- npcinfo[i].walkspd = 1.3;
+ npcinfo[i].walkspd = 1.3f;
npcinfo[i].swayangle = 0;
}
@@ -4667,10 +4667,10 @@ __exit_do:
roomlocks[73] = 1;
roomlocks[82] = 2;
- player.walkspd = 1.1;
- animspd = 0.5;
+ player.walkspd = 1.1f;
+ animspd = 0.5f;
attacking = 0;
- player.attackspd = 1.5;
+ player.attackspd = 1.5f;
player.sword = 1;
player.level = 1;
@@ -4895,10 +4895,10 @@ void GriffonEngine::game_saveloadnew() {
if (lowerlock == 1 && curcol == 2 && tickpause < ticks) {
if (state_load(currow - 1)) {
- player.walkspd = 1.1;
- animspd = .5;
+ player.walkspd = 1.1f;
+ animspd = 0.5f;
attacking = 0;
- player.attackspd = 1.5;
+ player.attackspd = 1.5f;
pgardens = 0;
ptown = 0;
@@ -7594,7 +7594,7 @@ void GriffonEngine::game_updspellsunder() {
int xdif = spellinfo[i].enemyx - npcinfo[f].x;
int ydif = spellinfo[i].enemyy - npcinfo[f].y;
- float dist = sqrt(xdif * xdif + ydif * ydif);
+ float dist = sqrt((float)(xdif * xdif + ydif * ydif));
if (dist > 20)
dist = 20;
@@ -7901,7 +7901,7 @@ void GriffonEngine::sys_initialize() {
sys_LoadFont();
sys_LoadItemImgs();
- fpsr = 1;
+ fpsr = 1.0f;
nextticks = ticks + 1000;
for (int i = 0; i <= 15; i++) {
diff --git a/engines/griffon/griffon.h b/engines/griffon/griffon.h
index 7c1ec28a0f..c533380e6b 100644
--- a/engines/griffon/griffon.h
+++ b/engines/griffon/griffon.h
@@ -86,7 +86,7 @@ struct PLAYERTYPE {
float py;
float opx;
float opy;
- int walkdir;
+ int walkdir;
float walkframe;
float walkspd;
float attackframe;
@@ -94,7 +94,7 @@ struct PLAYERTYPE {
int hp;
int maxhp;
- float hpflash;
+ float hpflash;
int hpflashb;
int level;
int maxlevel;
@@ -102,10 +102,10 @@ struct PLAYERTYPE {
int shield;
int armour;
int foundspell[5];
- float spellcharge[5];
+ float spellcharge[5];
int inventory[5];
- float attackstrength;
- float spellstrength;
+ float attackstrength;
+ float spellstrength;
int spelldamage;
int sworddamage;
@@ -114,7 +114,7 @@ struct PLAYERTYPE {
int pause;
- float itemselshade;
+ float itemselshade;
int ysort;
};
@@ -199,7 +199,7 @@ struct SPELLTYPE {
int damagewho; // 0 = npc, 1 = player
// for earthslide
- float rocky[9];
+ float rocky[9]; // CHECKME: Looks unused
int rockimg[9];
int rockdeflect[9];
@@ -311,7 +311,7 @@ private:
unsigned int clipsurround[4][4];
int fullscreen;
- float animspd;
+ float animspd; // CHECKME: it seems to always be 0.5
int rampdata[40][24];
int curmap;
@@ -327,7 +327,7 @@ private:
// timer related - move to local later
int ticks, tickspassed, nextticks;
- float fp, fps, fpsr;
+ float fp, fps, fpsr; // CHECKME: fp and fps seems to be integers
int secsingame, secstart;
Graphics::TransparentSurface *mapimg[4];
@@ -335,7 +335,7 @@ private:
Common::Rect rcSrc, rcDest;
// -----------special case
- int dontdrawover; // used in map24 so that the candles dont draw over the boss, default set to 0
+ int dontdrawover; // used in map24 so that the candles don't draw over the boss, default set to 0
// saveload info
Graphics::TransparentSurface *saveloadimg;