aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2016-12-03 15:26:32 -0800
committerEugene Sandulenko2017-01-25 22:42:10 +0100
commite482209bd33bfb4d7a09bdf60c58ea38253f9cb4 (patch)
tree10001ec15ca851156d3c9adbfdc2b287ee2f44ff /engines
parent6523e3bf9b3d2458f553c22082cd25b658216338 (diff)
downloadscummvm-rg350-e482209bd33bfb4d7a09bdf60c58ea38253f9cb4.tar.gz
scummvm-rg350-e482209bd33bfb4d7a09bdf60c58ea38253f9cb4.tar.bz2
scummvm-rg350-e482209bd33bfb4d7a09bdf60c58ea38253f9cb4.zip
CRYO: Reduce some variable scopes, silent several warnings
Diffstat (limited to 'engines')
-rw-r--r--engines/cryo/defs.h10
-rw-r--r--engines/cryo/eden.cpp92
-rw-r--r--engines/cryo/eden.h4
-rw-r--r--engines/cryo/staticdata.cpp69
4 files changed, 79 insertions, 96 deletions
diff --git a/engines/cryo/defs.h b/engines/cryo/defs.h
index 19e38fc0a5..30ee0ca6b3 100644
--- a/engines/cryo/defs.h
+++ b/engines/cryo/defs.h
@@ -822,7 +822,7 @@ extern uint16 kObjectLocations[100];
extern perso_t kPersons[];
extern cita_t cita_list[];
extern int16 tab_2CB16[];
-extern char tab_2CB1E[8][4];
+extern uint8 tab_2CB1E[8][4];
struct prect_t {
int16 sx, sy, ex, ey;
@@ -859,14 +859,6 @@ extern float flt_2DF7C;
extern float flt_2DF80;
extern float flt_2DF84;
-// Cube faces to texture coords mapping
-// each entry is num_polys(6) * num_faces_per_poly(2) * vertex_per_face(3) * uv(2)
-
-extern int16 cube_texcoords[3][6 * 2 * 3 * 2];
-extern char tab_2E138[4 * 3];
-
-//
-
struct XYZ {
signed short x, y, z;
};
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index 9a3fa46361..ab94faf0bd 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -1790,13 +1790,13 @@ bool EdenGame::canMoveThere(char loc, perso_t *perso) {
}
// Original name: melange1
-void EdenGame::scramble1(char elem[4]) {
+void EdenGame::scramble1(uint8 elem[4]) {
if (_vm->_rnd->getRandomNumber(1) & 1)
SWAP(elem[1], elem[2]);
}
// Original name melange2
-void EdenGame::scramble2(char elem[4]) {
+void EdenGame::scramble2(uint8 elem[4]) {
if (_vm->_rnd->getRandomNumber(1) & 1)
SWAP(elem[0], elem[1]);
@@ -1959,9 +1959,9 @@ void EdenGame::depladino(perso_t *perso) {
int dir = getDirection(perso);
if (dir != -1) {
melangedir();
- char *dirs = tab_2CB1E[dir];
+ uint8 *dirs = tab_2CB1E[dir];
byte loc = perso->_roomNum & 0xFF;
- char dir2 = *dirs++;
+ uint8 dir2 = *dirs++;
if (dir2 & 0x80)
dir2 = -(dir2 & ~0x80);
dir2 += loc;
@@ -4517,25 +4517,21 @@ void EdenGame::wait(int howlong) {
}
void EdenGame::effetpix() {
- byte *scr, *pix;
- int16 x, y;
- int16 r25, r18, r31, r30; //TODO: change to xx/yy
+ byte *scr;
+ uint16 r25, r18, r31, r30; //TODO: change to xx/yy
-// Unused
-// int16 w = _vm->ScreenView->_width;
-// int16 h = _vm->ScreenView->_height;
- int16 ww = _vm->ScreenView->_pitch;
+ uint16 ww = _vm->ScreenView->_pitch;
r25 = ww * 80;
r18 = 640 * 80;
- pix = p_mainview->_bufferPtr + 16 * 640;
+ byte *pix = p_mainview->_bufferPtr + 16 * 640;
if (!_doubledScreen) {
- x = p_mainview->_normal._dstLeft;
- y = p_mainview->_normal._dstTop;
+ int x = p_mainview->_normal._dstLeft;
+ int y = p_mainview->_normal._dstTop;
scr = _vm->ScreenView->_bufferPtr;
scr += (y + 16) * ww + x;
} else {
- x = p_mainview->_zoom._dstLeft;
- y = p_mainview->_zoom._dstTop;
+ int x = p_mainview->_zoom._dstLeft;
+ int y = p_mainview->_zoom._dstTop;
scr = _vm->ScreenView->_bufferPtr;
scr += (y + 16 * 2) * ww + x;
r25 *= 2;
@@ -8529,9 +8525,71 @@ int EdenGame::next_val(char **ptr, char *error) {
}
void EdenGame::selectmap(int16 num) {
+ static const char mapMode[12] = { 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 2, 0 };
+ // Cube faces to texture coords mapping
+ // each entry is num_polys(6) * num_faces_per_poly(2) * vertex_per_face(3) * uv(2)
+
+ static const int16 cube_texcoords[3][6 * 2 * 3 * 2] = {
+ {
+ 32, 32, 0, 32, 0, 0,
+ 32, 32, 0, 0, 32, 0,
+
+ 0, 32, 0, 0, 32, 0,
+ 0, 32, 32, 0, 32, 32,
+
+ 32, 32, 0, 32, 0, 0,
+ 32, 32, 0, 0, 32, 0,
+
+ 32, 0, 32, 32, 0, 32,
+ 32, 0, 0, 32, 0, 0,
+
+ 0, 0, 32, 0, 32, 32,
+ 0, 0, 32, 32, 0, 32,
+
+ 0, 32, 0, 0, 32, 0,
+ 0, 32, 32, 0, 32, 32
+ }, {
+ 32, 32, 0, 32, 0, 0,
+ 32, 32, 0, 0, 32, 0,
+
+ 32, 0, 32, 32, 0, 32,
+ 32, 0, 0, 32, 0, 0,
+
+ 32, 0, 32, 32, 0, 32,
+ 32, 0, 0, 32, 0, 0,
+
+ 0, 32, 0, 0, 32, 0,
+ 0, 32, 32, 0, 32, 32,
+
+ 32, 0, 32, 32, 0, 32,
+ 32, 0, 0, 32, 0, 0,
+
+ 32, 0, 32, 32, 0, 32,
+ 32, 0, 0, 32, 0, 0
+ }, {
+ 30, 30, 2, 30, 2, 2,
+ 30, 30, 2, 2, 30, 2,
+
+ 2, 30, 2, 2, 30, 2,
+ 2, 30, 30, 2, 30, 30,
+
+ 30, 30, 2, 30, 2, 2,
+ 30, 30, 2, 2, 30, 2,
+
+ 30, 2, 30, 30, 2, 30,
+ 30, 2, 2, 30, 2, 2,
+
+ 2, 2, 30, 2, 30, 30,
+ 2, 2, 30, 30, 2, 30,
+
+ 2, 30, 2, 2, 30, 2,
+ 2, 30, 30, 2, 30, 30
+ }
+ };
+
curs_cur_map = num;
int16 k = 0;
- int mode = tab_2E138[num];
+ int mode = mapMode[num];
int16 x = (num & 7) * 32;
int16 y = (num & 0x18) * 4;
for (int i = 0; i < 6 * 2; i++) {
diff --git a/engines/cryo/eden.h b/engines/cryo/eden.h
index 2bca2109f1..55a53bdb49 100644
--- a/engines/cryo/eden.h
+++ b/engines/cryo/eden.h
@@ -141,8 +141,8 @@ private:
void istyranval(area_t *area);
char getDirection(perso_t *perso);
bool canMoveThere(char loc, perso_t *perso);
- void scramble1(char elem[4]);
- void scramble2(char elem[4]);
+ void scramble1(uint8 elem[4]);
+ void scramble2(uint8 elem[4]);
void melangedir();
bool naitredino(char persoType);
void newcita(char arg1, int16 arg2, room_t *room);
diff --git a/engines/cryo/staticdata.cpp b/engines/cryo/staticdata.cpp
index 98550f7e27..9ff0fd2fac 100644
--- a/engines/cryo/staticdata.cpp
+++ b/engines/cryo/staticdata.cpp
@@ -498,7 +498,7 @@ cita_t cita_list[] = {
int16 tab_2CB16[] = { 2075, 2080, 2119, -1};
-char tab_2CB1E[8][4] = {
+uint8 tab_2CB1E[8][4] = {
{ 0x10, 0x81, 1, 0x90},
{ 0x90, 1, 0x81, 0x10},
{ 1, 0x90, 0x10, 0x81},
@@ -620,71 +620,4 @@ float flt_2DF7C = -3400;
float flt_2DF80 = -3400;
float flt_2DF84 = 200;
-// Cube faces to texture coords mapping
-// each entry is num_polys(6) * num_faces_per_poly(2) * vertex_per_face(3) * uv(2)
-
-int16 cube_texcoords[3][6 * 2 * 3 * 2] = {
- {
- 32, 32, 0, 32, 0, 0,
- 32, 32, 0, 0, 32, 0,
-
- 0, 32, 0, 0, 32, 0,
- 0, 32, 32, 0, 32, 32,
-
- 32, 32, 0, 32, 0, 0,
- 32, 32, 0, 0, 32, 0,
-
- 32, 0, 32, 32, 0, 32,
- 32, 0, 0, 32, 0, 0,
-
- 0, 0, 32, 0, 32, 32,
- 0, 0, 32, 32, 0, 32,
-
- 0, 32, 0, 0, 32, 0,
- 0, 32, 32, 0, 32, 32
- }, {
- 32, 32, 0, 32, 0, 0,
- 32, 32, 0, 0, 32, 0,
-
- 32, 0, 32, 32, 0, 32,
- 32, 0, 0, 32, 0, 0,
-
- 32, 0, 32, 32, 0, 32,
- 32, 0, 0, 32, 0, 0,
-
- 0, 32, 0, 0, 32, 0,
- 0, 32, 32, 0, 32, 32,
-
- 32, 0, 32, 32, 0, 32,
- 32, 0, 0, 32, 0, 0,
-
- 32, 0, 32, 32, 0, 32,
- 32, 0, 0, 32, 0, 0
- }, {
- 30, 30, 2, 30, 2, 2,
- 30, 30, 2, 2, 30, 2,
-
- 2, 30, 2, 2, 30, 2,
- 2, 30, 30, 2, 30, 30,
-
- 30, 30, 2, 30, 2, 2,
- 30, 30, 2, 2, 30, 2,
-
- 30, 2, 30, 30, 2, 30,
- 30, 2, 2, 30, 2, 2,
-
- 2, 2, 30, 2, 30, 30,
- 2, 2, 30, 30, 2, 30,
-
- 2, 30, 2, 2, 30, 2,
- 2, 30, 30, 2, 30, 30
- }
-};
-
-char tab_2E138[4 * 3] = {
- 0, 0, 1, 1,
- 0, 0, 0, 1,
- 0, 0, 2, 0
-};
-
} // End of namespace Cryo