aboutsummaryrefslogtreecommitdiff
path: root/engines/cryo
diff options
context:
space:
mode:
authorFilippos Karapetis2019-05-27 02:30:15 +0300
committerFilippos Karapetis2019-05-27 14:53:38 +0300
commit5724a1f3852676903c2aa8474c44db655f84813b (patch)
tree2900fed039744ef38e0629c19066a48d8a9236d4 /engines/cryo
parente412bf5ee44c7c1fb2be634e9db6aaa2322818e3 (diff)
downloadscummvm-rg350-5724a1f3852676903c2aa8474c44db655f84813b.tar.gz
scummvm-rg350-5724a1f3852676903c2aa8474c44db655f84813b.tar.bz2
scummvm-rg350-5724a1f3852676903c2aa8474c44db655f84813b.zip
CRYO: Fix MSVC warnings
- Add missing default switch cases - Specify packing for structs with pointers to complex objects - Change literal suffixes to uppercase - Replace uses of malloc() with new []
Diffstat (limited to 'engines/cryo')
-rw-r--r--engines/cryo/eden.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index bf8fbe4e4a..04191ffdeb 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -559,6 +559,8 @@ void EdenGame::move(Direction dir) {
case kCryoWest:
newLoc = room->_exits[3];
break;
+ default:
+ break;
}
deplaval((roomNum & 0xFF00) | newLoc);
}
@@ -582,6 +584,8 @@ void EdenGame::move2(Direction dir) {
case kCryoWest:
newLoc = room->_exits[3];
break;
+ default:
+ break;
}
deplaval((roomNum & 0xFF00) | newLoc);
}
@@ -3125,12 +3129,17 @@ void EdenGame::tyranDies(perso_t *perso) {
}
void EdenGame::specialObjects(perso_t *perso, char objid) {
+
+#include "common/pack-start.h" // START STRUCT PACKING
+
struct SpecialObject {
int8 _characterType;
int8 _objectId;
void (EdenGame::*dispFct)(perso_t *perso);
};
+#include "common/pack-end.h" // END STRUCT PACKING
+
static SpecialObject kSpecialObjectActions[] = {
// persoType, objectId, dispFct
{ PersonFlags::pfType8, Objects::obShroom, &EdenGame::specialMushroom },
@@ -7090,9 +7099,9 @@ void EdenGame::projectionFix(Cube *cubep, int n) {
int y = cubep->_vertices[i].y;
int z = cubep->_vertices[i].z;
- int transformX = _passMat31 * x + _passMat21 * y + _passMat11 * z + (int)(_translationX * 256.0f);
- int transformY = _passMat32 * x + _passMat22 * y + _passMat12 * z + (int)(_translationY * 256.0f);
- int transformZ = _passMat33 * x + _passMat23 * y + _passMat13 * z + (int)(_translationZ * 256.0f);
+ int transformX = _passMat31 * x + _passMat21 * y + _passMat11 * z + (int)(_translationX * 256.0F);
+ int transformY = _passMat32 * x + _passMat22 * y + _passMat12 * z + (int)(_translationY * 256.0F);
+ int transformZ = _passMat33 * x + _passMat23 * y + _passMat13 * z + (int)(_translationZ * 256.0F);
transformZ >>= 8;
if (transformZ == -256)
@@ -7166,7 +7175,7 @@ void EdenGame::loadMap(int file_id, byte *buffer) {
}
void EdenGame::NEWcharge_objet_mob(Cube *cubep, int fileNum, byte *texturePtr) {
- char *tmp1 = (char *)malloc(454);
+ char *tmp1 = new char[454];
if (_vm->getPlatform() == Common::kPlatformMacintosh)
loadpartoffile(fileNum, tmp1, 0, 454);
else {
@@ -7214,7 +7223,7 @@ void EdenGame::NEWcharge_objet_mob(Cube *cubep, int fileNum, byte *texturePtr) {
} else
tmp4[i]->ff_4 = 0;
}
- free(tmp1);
+ delete[] tmp1;
cubep->_num = count2;
cubep->_faces = tmp4;
cubep->_projection = projection;