[Scummvm-git-logs] scummvm master -> 2ebc6240e726c10848450e6753aea8998086b48d

Strangerke noreply at scummvm.org
Fri Jan 17 22:37:46 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2ebc6240e7 GOT: Rename Header and Level


Commit: 2ebc6240e726c10848450e6753aea8998086b48d
    https://github.com/scummvm/scummvm/commit/2ebc6240e726c10848450e6753aea8998086b48d
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-17T23:37:38+01:00

Commit Message:
GOT: Rename Header and Level

Changed paths:
    engines/got/data/defines.h
    engines/got/data/level.cpp
    engines/got/data/level.h
    engines/got/game/back.cpp
    engines/got/game/boss1.cpp
    engines/got/game/boss2.cpp
    engines/got/game/boss3.cpp
    engines/got/game/init.cpp
    engines/got/game/move.cpp
    engines/got/game/move_patterns.cpp
    engines/got/game/object.cpp
    engines/got/game/script.cpp
    engines/got/game/special_tile.cpp
    engines/got/gfx/image.cpp
    engines/got/gfx/palette.cpp
    engines/got/got.cpp
    engines/got/sound.cpp
    engines/got/sound.h
    engines/got/vars.h
    engines/got/views/game_content.cpp


diff --git a/engines/got/data/defines.h b/engines/got/data/defines.h
index 80486dfba12..ce0ed56960c 100644
--- a/engines/got/data/defines.h
+++ b/engines/got/data/defines.h
@@ -28,13 +28,13 @@
 
 namespace Got {
 
-struct HEADER {
-	long offset = 0;
-	long length = 0;
+struct Header {
+	long _offset = 0;
+	long _length = 0;
 
 	void load(Common::SeekableReadStream *src) {
-		offset = src->readUint32LE();
-		length = src->readUint32LE();
+		_offset = src->readUint32LE();
+		_length = src->readUint32LE();
 	}
 };
 
diff --git a/engines/got/data/level.cpp b/engines/got/data/level.cpp
index 239358f7871..54d9cbd86bd 100644
--- a/engines/got/data/level.cpp
+++ b/engines/got/data/level.cpp
@@ -26,41 +26,41 @@
 
 namespace Got {
 
-void LEVEL::sync(Common::Serializer &s) {
+void Level::sync(Common::Serializer &s) {
 	for (int i = 0; i < 12; ++i)
-		s.syncBytes(icon[i], 20);
+		s.syncBytes(_iconGrid[i], 20);
 
-	s.syncAsByte(bg_color);
-	s.syncAsByte(type);
+	s.syncAsByte(_backgroundColor);
+	s.syncAsByte(_music);
 
-	s.syncBytes(actor_type, 16);
-	s.syncBytes(actor_loc, 16);
-	s.syncBytes(actor_value, 16);
-	s.syncBytes(pal_colors, 3);
-	s.syncBytes(actor_invis, 16);
-	s.syncBytes(extra, 13);
-	s.syncBytes(static_obj, 30);
+	s.syncBytes(_actorType, 16);
+	s.syncBytes(_actorLoc, 16);
+	s.syncBytes(_actorValue, 16);
+	s.syncBytes(_palColors, 3);
+	s.syncBytes(_actorInvis, 16);
+	s.syncBytes(_extra, 13);
+	s.syncBytes(_staticObject, 30);
 
 	for (int i = 0; i < 30; ++i)
-		s.syncAsSint16LE(static_x[i]);
+		s.syncAsSint16LE(_staticX[i]);
 	for (int i = 0; i < 30; ++i)
-		s.syncAsSint16LE(static_y[i]);
+		s.syncAsSint16LE(_staticY[i]);
 
-	s.syncBytes(new_level, 10);
-	s.syncBytes(new_level_loc, 10);
+	s.syncBytes(_newLevel, 10);
+	s.syncBytes(_newLevelLocation, 10);
 
-	s.syncAsByte(area);
-	s.syncBytes(actor_dir, 16);
-	s.syncBytes(future, 3);
+	s.syncAsByte(_area);
+	s.syncBytes(_actorDir, 16);
+	s.syncBytes(_filler, 3);
 }
 
-void LEVEL::load(int level) {
+void Level::load(int level) {
 	Common::MemoryReadStream src(_G(sd_data)[level], 512);
 	Common::Serializer s(&src, nullptr);
 	sync(s);
 }
 
-void LEVEL::save(int level) {
+void Level::save(int level) {
 	Common::MemoryWriteStream dest(_G(sd_data)[level], 512);
 	Common::Serializer s(nullptr, &dest);
 	sync(s);
diff --git a/engines/got/data/level.h b/engines/got/data/level.h
index 1c00c2aef7c..94a26824171 100644
--- a/engines/got/data/level.h
+++ b/engines/got/data/level.h
@@ -28,30 +28,29 @@ namespace Got {
 
 #define OBJECTS_COUNT 30
 
-struct LEVEL { // size=512
+struct Level {
 private:
 	void sync(Common::Serializer &s);
 
 public:
-	byte icon[12][20] = {};    // 0   grid of icons
-	byte bg_color = 0;         // 240 background color
-	byte type = 0;             // 241 music
-	byte actor_type[16] = {};  // 242 type of enemies (12 max)
-	byte actor_loc[16] = {};   // 254 location of enemies
-	byte actor_value[16] = {}; // pass value
-	byte pal_colors[3] = {};   // change 251,253,254 to these three
-	byte actor_invis[16] = {};
-	byte extra[13] = {};
-
-	byte static_obj[OBJECTS_COUNT] = {}; // 302 static objects (treasure, keys,etc)
-	int static_x[OBJECTS_COUNT] = {};    // 332 X coor of static objects
-	int static_y[OBJECTS_COUNT] = {};    // 392 Y coor of static objects
-	byte new_level[10] = {};             // 452 level jump for icon 200-204
-	byte new_level_loc[10] = {};         // 462 grid location to jump in to
-	byte area = 0;                       // 472 game area (1=forest,etc)
-	byte actor_dir[16] = {};             // initial _dir
-	byte future[3] = {};                 // 473
+	byte _iconGrid[12][20] = {};            // Grid of icons
+	byte _backgroundColor = 0;              // Background color
+	byte _music = 0;                        // Music
+	byte _actorType[16] = {};               // Type of enemies (12 max)
+	byte _actorLoc[16] = {};                // Location of enemies
+	byte _actorValue[16] = {};              // Pass value
+	byte _palColors[3] = {};                // Change 251,253,254 to these three
+	byte _actorInvis[16] = {};
+	byte _extra[13] = {};
 
+	byte _staticObject[OBJECTS_COUNT] = {}; // Static objects (treasure, keys,etc)
+	int _staticX[OBJECTS_COUNT] = {};       // X coordinates of static objects
+	int _staticY[OBJECTS_COUNT] = {};       // Y coordinates of static objects
+	byte _newLevel[10] = {};                // Level jump for icon 200-204
+	byte _newLevelLocation[10] = {};        // Grid location to jump in to
+	byte _area = 0;                         // Game area (1=forest,etc)
+	byte _actorDir[16] = {};                // Initial _dir
+	byte _filler[3] = {};
 	/**
      * Loads level data from the global sd_data for the given level
      */
diff --git a/engines/got/game/back.cpp b/engines/got/game/back.cpp
index d0e0f286d2d..89b8b6974d5 100644
--- a/engines/got/game/back.cpp
+++ b/engines/got/game/back.cpp
@@ -52,17 +52,17 @@ void show_level(int new_level) {
 	_G(bomb_flag) = false;
 	_G(slipping) = false;
 
-	if (_G(scrn).icon[_G(thor)->_centerY][_G(thor)->_centerX] == 154)
+	if (_G(scrn)._iconGrid[_G(thor)->_centerY][_G(thor)->_centerX] == 154)
 		_G(thor)->_dir = 0;
 
 	// The original copied 130 bytes from _G(scrn).static_object onwards into sd_data.
-	// This doesn't make sense, because that would put the ending in the middle of static_y.
+	// This doesn't make sense, because that would put the ending in the middle of _staticY.
 	// Plus, it follows with an entire copy of scrn into sd_data anyway, so the first
 	// move seems entirely redundant.
 	_G(scrn).save(_G(current_level));
 	_G(scrn).load(_G(new_level));
 
-	_G(level_type) = _G(scrn).type;
+	_G(levelMusic) = _G(scrn)._music;
 
 	_G(thor)->_nextFrame = 0;
 
@@ -71,7 +71,7 @@ void show_level(int new_level) {
 
 	// The original was probably shortly displaying Thor in direction 0 before switching back to its prior position.
 	// This behavior wasn't noticed during initial playthrough by Dreammaster - Warning has been added so it can be checked eventually.
-	if (_G(scrn).icon[_G(thor)->_centerY][_G(thor)->_centerX] == 154)
+	if (_G(scrn)._iconGrid[_G(thor)->_centerY][_G(thor)->_centerX] == 154)
 		warning("show_level - Potential short move missing");
 
 	if (_G(warp_flag))
@@ -93,7 +93,7 @@ void show_level(int new_level) {
 	if (!_G(setup).scroll_flag)
 		_G(current_level) = new_level; // Force no scroll
 
-	if (_G(music_current) != _G(level_type))
+	if (_G(music_current) != _G(levelMusic))
 		_G(sound).music_pause();
 
 	switch (_G(new_level) - _G(current_level)) {
@@ -174,7 +174,7 @@ void show_level_done() {
 	if (_G(startup))
 		f = false;
 	if (f)
-		music_play(_G(level_type), false);
+		music_play(_G(levelMusic), false);
 }
 
 static void odin_speaks_end() {
@@ -204,15 +204,15 @@ int switch_icons() {
 		for (int x = 0; x < 20; x++) {
 			int ix = x * 16;
 			int iy = y * 16;
-			if (_G(scrn).icon[y][x] == 93) {
+			if (_G(scrn)._iconGrid[y][x] == 93) {
 				place_tile(x, y, 144);
-			} else if (_G(scrn).icon[y][x] == 144) {
+			} else if (_G(scrn)._iconGrid[y][x] == 144) {
 				place_tile(x, y, 93);
 				kill_enemies(iy, ix);
 			}
-			if (_G(scrn).icon[y][x] == 94) {
+			if (_G(scrn)._iconGrid[y][x] == 94) {
 				place_tile(x, y, 146);
-			} else if (_G(scrn).icon[y][x] == 146) {
+			} else if (_G(scrn)._iconGrid[y][x] == 146) {
 				place_tile(x, y, 94);
 				kill_enemies(iy, ix);
 			}
@@ -227,13 +227,13 @@ int rotate_arrows() {
 
 	for (int y = 0; y < 12; y++) {
 		for (int x = 0; x < 20; x++) {
-			if (_G(scrn).icon[y][x] == 205)
+			if (_G(scrn)._iconGrid[y][x] == 205)
 				place_tile(x, y, 208);
-			else if (_G(scrn).icon[y][x] == 206)
+			else if (_G(scrn)._iconGrid[y][x] == 206)
 				place_tile(x, y, 207);
-			else if (_G(scrn).icon[y][x] == 207)
+			else if (_G(scrn)._iconGrid[y][x] == 207)
 				place_tile(x, y, 205);
-			else if (_G(scrn).icon[y][x] == 208)
+			else if (_G(scrn)._iconGrid[y][x] == 208)
 				place_tile(x, y, 206);
 		}
 	}
@@ -285,7 +285,7 @@ void remove_objects(int y, int x) {
 }
 
 void place_tile(int x, int y, int tile) {
-	_G(scrn).icon[y][x] = tile;
+	_G(scrn)._iconGrid[y][x] = tile;
 	remove_objects(y, x);
 }
 
@@ -296,7 +296,7 @@ int bgtile(int x, int y) {
 	x = (x + 1) >> 4;
 	y = (y + 1) >> 4;
 
-	return _G(scrn).icon[y][x];
+	return _G(scrn)._iconGrid[y][x];
 }
 
 void select_item() {
diff --git a/engines/got/game/boss1.cpp b/engines/got/game/boss1.cpp
index 01a5b6aa45b..82cb335ab66 100644
--- a/engines/got/game/boss1.cpp
+++ b/engines/got/game/boss1.cpp
@@ -279,12 +279,12 @@ void closing_sequence1_3() {
 
 void closing_sequence1_4() {
 	for (int rep = 0; rep < 16; rep++)
-		_G(scrn).actor_type[rep] = 0;
+		_G(scrn)._actorType[rep] = 0;
 
 	_G(boss_dead) = false;
 	_G(setup).boss_dead[0] = 1;
 	_G(boss_active) = false;
-	_G(scrn).type = 4;
+	_G(scrn)._music = 4;
 	show_level(BOSS_LEVEL1);
 
 	play_sound(ANGEL, true);
@@ -293,10 +293,10 @@ void closing_sequence1_4() {
 	actor_visible(1);
 	actor_visible(2);
 
-	LEVEL lvl;
+	Level lvl;
 	lvl.load(59);
-	lvl.icon[6][18] = 148;
-	lvl.icon[6][19] = 202;
+	lvl._iconGrid[6][18] = 148;
+	lvl._iconGrid[6][19] = 202;
 	lvl.save(59);
 }
 
diff --git a/engines/got/game/boss2.cpp b/engines/got/game/boss2.cpp
index 2303e64ac4f..7acd353261f 100644
--- a/engines/got/game/boss2.cpp
+++ b/engines/got/game/boss2.cpp
@@ -284,7 +284,7 @@ static int boss2a_movement(Actor *actr) {
 	_G(actor[an])._x = x;
 	_G(actor[an])._y = y;
 
-	_G(scrn).icon[y / 16][x / 16] = _G(scrn).bg_color;
+	_G(scrn)._iconGrid[y / 16][x / 16] = _G(scrn)._backgroundColor;
 
 	_G(actor[3])._i2++;
 	if (_G(actor[3])._i2 > 59) {
@@ -402,13 +402,13 @@ void closing_sequence2_3() {
 
 void closing_sequence2_4() {
 	for (int rep = 0; rep < 16; rep++)
-		_G(scrn).actor_type[rep] = 0;
+		_G(scrn)._actorType[rep] = 0;
 
 	_G(boss_dead) = false;
 	_G(setup).boss_dead[1] = 1;
 	_G(game_over) = true;
 	_G(boss_active) = false;
-	_G(scrn).type = 6;
+	_G(scrn)._music = 6;
 
 	show_level(BOSS_LEVEL2);
 
@@ -422,10 +422,10 @@ void closing_sequence2_4() {
 	_G(actor[8])._x = 304;
 	_G(actor[8])._y = 160;
 
-	LEVEL lvl;
+	Level lvl;
 	lvl.load(BOSS_LEVEL2);
-	lvl.icon[6][18] = 152;
-	lvl.icon[6][19] = 202;
+	lvl._iconGrid[6][18] = 152;
+	lvl._iconGrid[6][19] = 202;
 	lvl.save(BOSS_LEVEL2);
 }
 
diff --git a/engines/got/game/boss3.cpp b/engines/got/game/boss3.cpp
index 296f64cd035..8ab737c0b44 100644
--- a/engines/got/game/boss3.cpp
+++ b/engines/got/game/boss3.cpp
@@ -531,13 +531,13 @@ void closing_sequence3_3() {
 	fill_magic();
 
 	for (int rep = 0; rep < 16; rep++)
-		_G(scrn).actor_type[rep] = 0;
+		_G(scrn)._actorType[rep] = 0;
 
 	_G(boss_dead) = false;
 	_G(setup).boss_dead[2] = 1;
 	_G(game_over) = true;
 	_G(boss_active) = false;
-	_G(scrn).type = 6;
+	_G(scrn)._music = 6;
 	show_level(BOSS_LEVEL3);
 
 	_G(exit_flag) = 0;
@@ -596,7 +596,7 @@ int endgame_one() {
 	_G(actor[34])._nextFrame = 0;
 	_G(actor[34])._currNumShots = 3;
 
-	_G(scrn).icon[y / 16][x / 16] = _G(scrn).bg_color;
+	_G(scrn)._iconGrid[y / 16][x / 16] = _G(scrn)._backgroundColor;
 
 	_G(endgame++);
 	if (_G(endgame) > 32) {
@@ -636,8 +636,8 @@ int endgame_movement() {
 	_G(actor[34])._nextFrame = 0;
 	_G(actor[34])._currNumShots = 3;
 
-	_G(scrn).icon[y / 16][x / 16] = _G(scrn).bg_color;
-	_G(scrn).icon[(y / 16) - 4][x / 16] = _G(scrn).bg_color;
+	_G(scrn)._iconGrid[y / 16][x / 16] = _G(scrn)._backgroundColor;
+	_G(scrn)._iconGrid[(y / 16) - 4][x / 16] = _G(scrn)._backgroundColor;
 
 	_G(endgame++);
 	if (_G(endgame) > 8) {
diff --git a/engines/got/game/init.cpp b/engines/got/game/init.cpp
index 1912b28b4b5..a122e1c9b71 100644
--- a/engines/got/game/init.cpp
+++ b/engines/got/game/init.cpp
@@ -108,7 +108,7 @@ void initialize_game() {
 	show_level(_G(current_level));
 
 	if (!_G(auto_load)) {
-		_G(sound).music_play(_G(level_type), 1);
+		_G(sound).music_play(_G(levelMusic), 1);
 	}
 
 	g_vars->resetEndgameFlags();
diff --git a/engines/got/game/move.cpp b/engines/got/game/move.cpp
index ce1923a897f..ec70c364861 100644
--- a/engines/got/game/move.cpp
+++ b/engines/got/game/move.cpp
@@ -298,25 +298,25 @@ int actor_shoots(Actor *actr, int dir) {
 	switch (dir) {
 	case 0:
 		for (i = ty + 1; i <= cy; i++) {
-			if (_G(scrn).icon[i][cx] < icn)
+			if (_G(scrn)._iconGrid[i][cx] < icn)
 				return 0;
 		}
 		break;
 	case 1:
 		for (i = cy; i <= ty; i++) {
-			if (_G(scrn).icon[i][cx] < icn)
+			if (_G(scrn)._iconGrid[i][cx] < icn)
 				return 0;
 		}
 		break;
 	case 2:
 		for (i = tx; i < cx; i++) {
-			if (_G(scrn).icon[cy][i] < icn)
+			if (_G(scrn)._iconGrid[cy][i] < icn)
 				return 0;
 		}
 		break;
 	case 3:
 		for (i = cx; i < tx; i++) {
-			if (_G(scrn).icon[cy][i] < icn)
+			if (_G(scrn)._iconGrid[cy][i] < icn)
 				return 0;
 		}
 		break;
diff --git a/engines/got/game/move_patterns.cpp b/engines/got/game/move_patterns.cpp
index b5a076ec862..4c057cdc68f 100644
--- a/engines/got/game/move_patterns.cpp
+++ b/engines/got/game/move_patterns.cpp
@@ -232,10 +232,10 @@ int check_move0(int x, int y, Actor *actr) {
 
 	// Check for cheat flying mode
 	if (!actr->_flying) {
-		byte icn1 = _G(scrn).icon[y1][x1];
-		byte icn2 = _G(scrn).icon[y2][x1];
-		byte icn3 = _G(scrn).icon[y1][x2];
-		byte icn4 = _G(scrn).icon[y2][x2];
+		byte icn1 = _G(scrn)._iconGrid[y1][x1];
+		byte icn2 = _G(scrn)._iconGrid[y2][x1];
+		byte icn3 = _G(scrn)._iconGrid[y1][x2];
+		byte icn4 = _G(scrn)._iconGrid[y2][x2];
 		int ti = 0;
 
 		if (icn1 < TILE_FLY) {
@@ -264,22 +264,22 @@ int check_move0(int x, int y, Actor *actr) {
 		if (icn1 > TILE_SPECIAL) {
 			if (!special_tile_thor(y1, x1, icn1))
 				return 0;
-			icn2 = _G(scrn).icon[y2][x1];
-			icn3 = _G(scrn).icon[y1][x2];
-			icn4 = _G(scrn).icon[y2][x2];
+			icn2 = _G(scrn)._iconGrid[y2][x1];
+			icn3 = _G(scrn)._iconGrid[y1][x2];
+			icn4 = _G(scrn)._iconGrid[y2][x2];
 		}
 
 		if (icn2 > TILE_SPECIAL) {
 			if (!special_tile_thor(y2, x1, icn2))
 				return 0;
-			icn3 = _G(scrn).icon[y1][x2];
-			icn4 = _G(scrn).icon[y2][x2];
+			icn3 = _G(scrn)._iconGrid[y1][x2];
+			icn4 = _G(scrn)._iconGrid[y2][x2];
 		}
 
 		if (icn3 > TILE_SPECIAL) {
 			if (!special_tile_thor(y1, x2, icn3))
 				return 0;
-			icn4 = _G(scrn).icon[y2][x2];
+			icn4 = _G(scrn)._iconGrid[y2][x2];
 		}
 
 		if (icn4 > TILE_SPECIAL && !special_tile_thor(y2, x2, icn4))
@@ -364,10 +364,10 @@ int check_move1(int x, int y, Actor *actr) {
 	if (actr->_flying)
 		icn = TILE_SOLID;
 
-	byte icn1 = _G(scrn).icon[y1][x1];
-	byte icn2 = _G(scrn).icon[y2][x1];
-	byte icn3 = _G(scrn).icon[y1][x2];
-	byte icn4 = _G(scrn).icon[y2][x2];
+	byte icn1 = _G(scrn)._iconGrid[y1][x1];
+	byte icn2 = _G(scrn)._iconGrid[y2][x1];
+	byte icn3 = _G(scrn)._iconGrid[y1][x2];
+	byte icn4 = _G(scrn)._iconGrid[y2][x2];
 	if (icn1 < icn || icn2 < icn || icn3 < icn || icn4 < icn) {
 		if (actr->_actorNum == 1 && actr->_moveType == 2)
 			play_sound(CLANG, false);
@@ -460,10 +460,10 @@ int check_move2(int x, int y, Actor *actr) {
 	if (actr->_flying)
 		icn = TILE_SOLID;
 
-	byte icn1 = _G(scrn).icon[y1][x1];
-	byte icn2 = _G(scrn).icon[y2][x1];
-	byte icn3 = _G(scrn).icon[y1][x2];
-	byte icn4 = _G(scrn).icon[y2][x2];
+	byte icn1 = _G(scrn)._iconGrid[y1][x1];
+	byte icn2 = _G(scrn)._iconGrid[y2][x1];
+	byte icn3 = _G(scrn)._iconGrid[y1][x2];
+	byte icn4 = _G(scrn)._iconGrid[y2][x2];
 	if (icn1 < icn || icn2 < icn || icn3 < icn || icn4 < icn)
 		return 0;
 
@@ -538,10 +538,10 @@ int check_move3(int x, int y, Actor *actr) {
 	if (actr->_flying)
 		icn = TILE_SOLID;
 
-	byte icn1 = _G(scrn).icon[y1][x1];
-	byte icn2 = _G(scrn).icon[y2][x1];
-	byte icn3 = _G(scrn).icon[y1][x2];
-	byte icn4 = _G(scrn).icon[y2][x2];
+	byte icn1 = _G(scrn)._iconGrid[y1][x1];
+	byte icn2 = _G(scrn)._iconGrid[y2][x1];
+	byte icn3 = _G(scrn)._iconGrid[y1][x2];
+	byte icn4 = _G(scrn)._iconGrid[y2][x2];
 	if (icn1 < icn || icn2 < icn || icn3 < icn || icn4 < icn)
 		return 0;
 
@@ -818,10 +818,10 @@ int check_special_move1(int x, int y, Actor *actr) {
 	if (actr->_flying)
 		icn = TILE_SOLID;
 
-	byte icn1 = _G(scrn).icon[y1][x1];
-	byte icn2 = _G(scrn).icon[y2][x1];
-	byte icn3 = _G(scrn).icon[y1][x2];
-	byte icn4 = _G(scrn).icon[y2][x2];
+	byte icn1 = _G(scrn)._iconGrid[y1][x1];
+	byte icn2 = _G(scrn)._iconGrid[y2][x1];
+	byte icn3 = _G(scrn)._iconGrid[y1][x2];
+	byte icn4 = _G(scrn)._iconGrid[y2][x2];
 	if (icn1 < icn || icn2 < icn || icn3 < icn || icn4 < icn)
 		return 0;
 
@@ -2236,7 +2236,7 @@ int movement_thirtyone(Actor *actr) {
 		int cy = ((actr->_y + actr->_sizeY) - 2) >> 4;
 		int ty = _G(thor)->_centerY;
 		for (int i = cy; i <= ty; i++)
-			if (_G(scrn).icon[i][cx] < TILE_SOLID)
+			if (_G(scrn)._iconGrid[i][cx] < TILE_SOLID)
 				goto done;
 		actr->_numMoves = actr->_passValue + 1;
 		actr->_temp1 = 1;
diff --git a/engines/got/game/object.cpp b/engines/got/game/object.cpp
index 504170bd424..80e76366b4c 100644
--- a/engines/got/game/object.cpp
+++ b/engines/got/game/object.cpp
@@ -38,10 +38,10 @@ void show_objects() {
 	Common::fill(_G(object_index), _G(object_index) + TILES_COUNT, 0);
 
 	for (int i = 0; i < OBJECTS_COUNT; i++) {
-		if (_G(scrn).static_obj[i]) {
-			int p = _G(scrn).static_x[i] + (_G(scrn).static_y[i] * TILES_X);
+		if (_G(scrn)._staticObject[i]) {
+			int p = _G(scrn)._staticX[i] + (_G(scrn)._staticY[i] * TILES_X);
 			_G(object_index[p]) = i;
-			_G(object_map[p]) = _G(scrn).static_obj[i];
+			_G(object_map[p]) = _G(scrn)._staticObject[i];
 		}
 	}
 }
@@ -168,7 +168,7 @@ void pick_up_object(int p) {
 
 	// Reset so it doesn't reappear on reentry to screen
 	if (_G(object_index[p]) < 30)
-		_G(scrn).static_obj[_G(object_index[p])] = 0;
+		_G(scrn)._staticObject[_G(object_index[p])] = 0;
 	
 	_G(object_index[p]) = 0;
 }
@@ -201,7 +201,7 @@ int drop_object(Actor *actr) {
 
 int _drop_obj(Actor *actr, int o) {
 	int p = (actr->_x + (actr->_sizeX / 2)) / 16 + (((actr->_y + (actr->_sizeY / 2)) / 16) * 20);
-	if (!_G(object_map[p]) && _G(scrn).icon[p / 20][p % 20] >= 140) { //nothing there and solid
+	if (!_G(object_map[p]) && _G(scrn)._iconGrid[p / 20][p % 20] >= 140) { //nothing there and solid
 		_G(object_map[p]) = o;
 		_G(object_index[p]) = 27 + actr->_actorNum; //actor is 3-15
 
diff --git a/engines/got/game/script.cpp b/engines/got/game/script.cpp
index 8c00d3ff58d..7817520be11 100644
--- a/engines/got/game/script.cpp
+++ b/engines/got/game/script.cpp
@@ -453,7 +453,7 @@ int Scripts::get_internal_variable() {
 			_lTemp = 0;
 		break;
 	case 24:
-		_lTemp = _G(scrn).icon[(_G(thor)->_y + 8) / 16][(_G(thor)->_x + 7) / 16];
+		_lTemp = _G(scrn)._iconGrid[(_G(thor)->_y + 8) / 16][(_G(thor)->_x + 7) / 16];
 		break;
 	case 25:
 		_lTemp = (((_G(thor)->_y + 8) / 16) * 20) + ((_G(thor)->_x + 7) / 16);
@@ -899,9 +899,9 @@ int Scripts::cmd_settile() {
 	if (screen == _G(current_level)) {
 		place_tile(pos % 20, pos / 20, tile);
 	} else {
-		LEVEL tmp;
+		Level tmp;
 		tmp.load(screen);
-		tmp.icon[pos / 20][pos % 20] = tile;
+		tmp._iconGrid[pos / 20][pos % 20] = tile;
 		tmp.save(screen);
 	}
 	return 0;
@@ -1045,7 +1045,7 @@ void Scripts::scr_func3() {
 		_G(key_flag[key_magic]) = false;
 		return;
 	}
-	if (_G(scrn).icon[y][x] < 174 || _G(scrn).icon[y][x] > 178) {
+	if (_G(scrn)._iconGrid[y][x] < 174 || _G(scrn)._iconGrid[y][x] > 178) {
 		play_sound(BRAAPP, true);
 		_G(key_flag[key_magic]) = false;
 		return;
@@ -1064,7 +1064,7 @@ void Scripts::scr_func3() {
 
 	if ((g_events->getRandomNumber(99)) < 25 ||
 		(_G(current_level) == 13 && p == 150 && !_G(setup).f26 && _G(setup).f28)) {
-		if (!_G(object_map[p]) && _G(scrn).icon[y][x] >= 140) { // nothing there and solid
+		if (!_G(object_map[p]) && _G(scrn)._iconGrid[y][x] >= 140) { // nothing there and solid
 			int o = g_events->getRandomNumber(1, 5);
 			if (_G(current_level) == 13 && p == 150 && !_G(setup).f26 && _G(setup).f28)
 				o = 20;
@@ -1080,10 +1080,10 @@ void Scripts::scr_func4() {
 }
 
 void Scripts::scr_func5() {
-	_G(scrn).actor_loc[0] -= 2;
-	_G(scrn).actor_loc[1] -= 2;
-	_G(scrn).actor_loc[2] -= 2;
-	_G(scrn).actor_loc[3] -= 2;
+	_G(scrn)._actorLoc[0] -= 2;
+	_G(scrn)._actorLoc[1] -= 2;
+	_G(scrn)._actorLoc[2] -= 2;
+	_G(scrn)._actorLoc[3] -= 2;
 	_G(actor[3])._i1 = 16;
 }
 
diff --git a/engines/got/game/special_tile.cpp b/engines/got/game/special_tile.cpp
index 02301112171..d4a38fff31b 100644
--- a/engines/got/game/special_tile.cpp
+++ b/engines/got/game/special_tile.cpp
@@ -110,7 +110,7 @@ int special_tile_thor(int x, int y, int icon) {
 				actor_visible(3);
 				actor_visible(4);
 				actor_visible(5);
-				Common::fill(_G(scrn).actor_invis, _G(scrn).actor_invis + 16, 0);
+				Common::fill(_G(scrn)._actorInvis, _G(scrn)._actorInvis + 16, 0);
 				_G(thunder_flag) = 60;
 				play_sound(THUNDER, true);
 				_G(setup).f22 = 1;
@@ -130,11 +130,11 @@ int special_tile_thor(int x, int y, int icon) {
 		if ((GAME2 && icon == 217) || GAME3) {
 			cx = (_G(thor_x1) + 7) / 16;
 			cy = (_G(thor_real_y1) + 8) / 16;
-			if (_G(scrn).icon[cy][cx] == icon) {
+			if (_G(scrn)._iconGrid[cy][cx] == icon) {
 				_G(thor)->_vulnerableCountdown = STAMINA;
 				play_sound(WOOP, false);
 
-				int nt = _G(scrn).new_level_loc[icon - 214];
+				int nt = _G(scrn)._newLevelLocation[icon - 214];
 				int display_page = _G(pge);
 				int draw_page = _G(pge) ^ 1;
 
@@ -167,19 +167,19 @@ int special_tile_thor(int x, int y, int icon) {
 		// Hole tiles
 		cx = (_G(thor_x1) + 7) / 16;
 		cy = (_G(thor_real_y1) + 8) / 16;
-		if (_G(scrn).icon[cy][cx] == icon) {
+		if (_G(scrn)._iconGrid[cy][cx] == icon) {
 			_G(thor)->_vulnerableCountdown = STAMINA;
 			if (icon < 224 && icon > 219)
 				play_sound(FALL, false);
 
-			_G(new_level) = _G(scrn).new_level[icon - 220 + (f * 6)];
+			_G(new_level) = _G(scrn)._newLevel[icon - 220 + (f * 6)];
 			_G(warp_scroll) = false;
 			if (_G(new_level) > 119) {
 				_G(warp_scroll) = true;
 				_G(new_level) -= 128;
 			}
 
-			_G(new_level_tile) = _G(scrn).new_level_loc[icon - 220 + (f * 6)];
+			_G(new_level_tile) = _G(scrn)._newLevelLocation[icon - 220 + (f * 6)];
 			_G(warp_flag) = true;
 
 			if (_G(warp_scroll)) {
@@ -243,7 +243,7 @@ int special_tile(Actor *actr, int x, int y, int icon) {
 
 void erase_door(int x, int y) {
 	play_sound(DOOR, false);
-	_G(scrn).icon[y][x] = _G(scrn).bg_color;
+	_G(scrn)._iconGrid[y][x] = _G(scrn)._backgroundColor;
 }
 
 int open_door1(int y, int x) {
diff --git a/engines/got/gfx/image.cpp b/engines/got/gfx/image.cpp
index 96081d1089e..4980d46dab7 100644
--- a/engines/got/gfx/image.cpp
+++ b/engines/got/gfx/image.cpp
@@ -158,17 +158,17 @@ void show_enemies() {
 		_G(enemy_type[i]) = 0;
 
 	for (int i = 0; i < MAX_ENEMIES; i++) {
-		if (_G(scrn).actor_type[i] > 0) {
-			int r = load_enemy(_G(scrn).actor_type[i]);
+		if (_G(scrn)._actorType[i] > 0) {
+			int r = load_enemy(_G(scrn)._actorType[i]);
 			if (r >= 0) {
 				_G(actor[i + 3]) = _G(enemy[r]);
 
-				int d = _G(scrn).actor_dir[i];
+				int d = _G(scrn)._actorDir[i];
 
-				setup_actor(&_G(actor[i + 3]), i + 3, d, (_G(scrn).actor_loc[i] % 20) * 16,
-							(_G(scrn).actor_loc[i] / 20) * 16);
-				_G(actor[i + 3])._initDir = _G(scrn).actor_dir[i];
-				_G(actor[i + 3])._passValue = _G(scrn).actor_value[i];
+				setup_actor(&_G(actor[i + 3]), i + 3, d, (_G(scrn)._actorLoc[i] % 20) * 16,
+							(_G(scrn)._actorLoc[i] / 20) * 16);
+				_G(actor[i + 3])._initDir = _G(scrn)._actorDir[i];
+				_G(actor[i + 3])._passValue = _G(scrn)._actorValue[i];
 
 				if (_G(actor[i + 3])._moveType == 23) {
 					// Spinball
@@ -176,7 +176,7 @@ void show_enemies() {
 						_G(actor[i + 3])._moveType = 24;
 				}
 
-				if (_G(scrn).actor_invis[i])
+				if (_G(scrn)._actorInvis[i])
 					_G(actor[i + 3])._active = false;
 			}
 
@@ -239,16 +239,16 @@ int load_enemy(int type) {
 
 int actor_visible(int invis_num) {
 	for (int i = 0; i < MAX_ENEMIES; i++) {
-		if (_G(scrn).actor_invis[i] == invis_num) {
+		if (_G(scrn)._actorInvis[i] == invis_num) {
 			int etype = _G(etype[i]);
 			if (etype >= 0 && !_G(actor[i + 3])._active) {
 				_G(actor[i + 3]) = _G(enemy[etype]);
 
-				int d = _G(scrn).actor_dir[i];
-				setup_actor(&_G(actor[i + 3]), i + 3, d, (_G(scrn).actor_loc[i] % 20) * 16,
-							(_G(scrn).actor_loc[i] / 20) * 16);
-				_G(actor[i + 3])._initDir = _G(scrn).actor_dir[i];
-				_G(actor[i + 3])._passValue = _G(scrn).actor_value[i];
+				int d = _G(scrn)._actorDir[i];
+				setup_actor(&_G(actor[i + 3]), i + 3, d, (_G(scrn)._actorLoc[i] % 20) * 16,
+							(_G(scrn)._actorLoc[i] / 20) * 16);
+				_G(actor[i + 3])._initDir = _G(scrn)._actorDir[i];
+				_G(actor[i + 3])._passValue = _G(scrn)._actorValue[i];
 				return i;
 			}
 
diff --git a/engines/got/gfx/palette.cpp b/engines/got/gfx/palette.cpp
index 71b7721bf5c..5d8c3ee4830 100644
--- a/engines/got/gfx/palette.cpp
+++ b/engines/got/gfx/palette.cpp
@@ -49,11 +49,11 @@ void load_palette() {
 void set_screen_pal() {
 	byte pal[3];
 
-	xgetpal(pal, 1, _G(scrn).pal_colors[0]);
+	xgetpal(pal, 1, _G(scrn)._palColors[0]);
 	xsetpal(251, pal[0], pal[1], pal[2]);
-	xgetpal(pal, 1, _G(scrn).pal_colors[1]);
+	xgetpal(pal, 1, _G(scrn)._palColors[1]);
 	xsetpal(252, pal[0], pal[1], pal[2]);
-	xgetpal(pal, 1, _G(scrn).pal_colors[2]);
+	xgetpal(pal, 1, _G(scrn)._palColors[2]);
 	xsetpal(253, pal[0], pal[1], pal[2]);
 }
 
diff --git a/engines/got/got.cpp b/engines/got/got.cpp
index 16efa6bcfbc..a4a7d68eca1 100644
--- a/engines/got/got.cpp
+++ b/engines/got/got.cpp
@@ -164,7 +164,7 @@ void GotEngine::savegameLoaded() {
 		if (GAME1 && _G(current_area) == 59) {
 			music_play(5, true);
 		} else {
-			music_play(_G(level_type), true);
+			music_play(_G(levelMusic), true);
 		}
 	} else {
 		_G(setup).music = 1;
diff --git a/engines/got/sound.cpp b/engines/got/sound.cpp
index a7179f37673..1efbeb502f3 100644
--- a/engines/got/sound.cpp
+++ b/engines/got/sound.cpp
@@ -56,7 +56,7 @@ void Sound::play_sound(int index, bool priority_override) {
 
 	// Play the new sound
 	Common::MemoryReadStream *stream = new Common::MemoryReadStream(
-		_soundData + _digiSounds[index].offset, _digiSounds[index].length);
+		_soundData + _digiSounds[index]._offset, _digiSounds[index]._length);
 	Audio::AudioStream *audioStream = Audio::makeVOCStream(stream, Audio::FLAG_UNSIGNED,
 														   DisposeAfterUse::YES);
 	g_engine->_mixer->playStream(Audio::Mixer::kSFXSoundType,
diff --git a/engines/got/sound.h b/engines/got/sound.h
index 2acee0f3565..5ad27c387fe 100644
--- a/engines/got/sound.h
+++ b/engines/got/sound.h
@@ -55,7 +55,7 @@ enum {
 class Sound {
 private:
 	byte *_soundData = nullptr;
-	HEADER _digiSounds[NUM_SOUNDS];
+	Header _digiSounds[NUM_SOUNDS];
 	Audio::SoundHandle _soundHandle;
 	int _currentPriority = 0;
 
diff --git a/engines/got/vars.h b/engines/got/vars.h
index b9976eb5073..7cd45aad994 100644
--- a/engines/got/vars.h
+++ b/engines/got/vars.h
@@ -135,14 +135,14 @@ public:
 	byte _object_map[TILES_COUNT] = {};
 	byte _object_index[TILES_COUNT] = {};
 	int8 _thor_icon1 = 0, _thor_icon2 = 0, _thor_icon3 = 0, _thor_icon4 = 0;
-	int8 _level_type = 0;
+	int8 _levelMusic = 0;
 	int8 _music_current = -1;
 	int8 _boss_loaded = 0;
 	int8 _apple_drop = 0;
 	bool _cheat = false;
 	int8 _area = 1;
 
-	LEVEL _scrn;
+	Level _scrn;
 
 	SETUP _setup;
 	SETUP _last_setup;
diff --git a/engines/got/views/game_content.cpp b/engines/got/views/game_content.cpp
index b0abedb9e38..1d978ffc971 100644
--- a/engines/got/views/game_content.cpp
+++ b/engines/got/views/game_content.cpp
@@ -225,11 +225,11 @@ bool GameContent::tick() {
 void GameContent::drawBackground(GfxSurface &s) {
 	for (int y = 0; y < TILES_Y; y++) {
 		for (int x = 0; x < TILES_X; x++) {
-			if (_G(scrn).icon[y][x] != 0) {
+			if (_G(scrn)._iconGrid[y][x] != 0) {
 				const Common::Point pt(x * TILE_SIZE, y * TILE_SIZE);
-				const LEVEL &screen = _G(scrn);
-				s.simpleBlitFrom(_G(bgPics[screen.bg_color]), pt);
-				s.simpleBlitFrom(_G(bgPics[screen.icon[y][x]]), pt);
+				const Level &screen = _G(scrn);
+				s.simpleBlitFrom(_G(bgPics[screen._backgroundColor]), pt);
+				s.simpleBlitFrom(_G(bgPics[screen._iconGrid[y][x]]), pt);
 			}
 		}
 	}




More information about the Scummvm-git-logs mailing list