[Scummvm-git-logs] scummvm master -> 552629526746a0bd67bf40c9e8f46f1450976ae4
Strangerke
noreply at scummvm.org
Tue Jan 21 21:59:23 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:
5526295267 GOT: More renaming
Commit: 552629526746a0bd67bf40c9e8f46f1450976ae4
https://github.com/scummvm/scummvm/commit/552629526746a0bd67bf40c9e8f46f1450976ae4
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-21T22:58:24+01:00
Commit Message:
GOT: More renaming
Changed paths:
engines/got/data/sd_data.cpp
engines/got/game/init.cpp
engines/got/game/script.cpp
engines/got/gfx/gfx_chunks.cpp
engines/got/gfx/image.cpp
engines/got/gfx/palette.cpp
engines/got/utils/compression.cpp
engines/got/utils/compression.h
engines/got/utils/file.cpp
engines/got/utils/file.h
engines/got/utils/res_archive.cpp
engines/got/vars.cpp
engines/got/views/credits.cpp
engines/got/views/dialogs/high_scores.cpp
engines/got/views/dialogs/say.cpp
engines/got/views/dialogs/select_item.cpp
engines/got/views/dialogs/select_option.cpp
engines/got/views/game_content.cpp
engines/got/views/game_status.cpp
engines/got/views/opening.cpp
engines/got/views/splash_screen.cpp
engines/got/views/story.cpp
diff --git a/engines/got/data/sd_data.cpp b/engines/got/data/sd_data.cpp
index 9c1863ab016..b486d79f75d 100644
--- a/engines/got/data/sd_data.cpp
+++ b/engines/got/data/sd_data.cpp
@@ -36,7 +36,7 @@ SdData::~SdData() {
void SdData::load() {
Common::String fname = Common::String::format("SDAT%d", _area);
- res_read(fname, _data);
+ resourceRead(fname, _data);
}
void SdData::setArea(int area) {
diff --git a/engines/got/game/init.cpp b/engines/got/game/init.cpp
index 955cbd7a1d9..8b164cf1314 100644
--- a/engines/got/game/init.cpp
+++ b/engines/got/game/init.cpp
@@ -129,26 +129,26 @@ int setupBoss(const int num) {
}
Common::String ressourceName = Common::String::format("BOSSV%d1", num);
- _G(boss_sound[0]) = (byte *)res_falloc_read(ressourceName);
+ _G(boss_sound[0]) = (byte *)resourceAllocRead(ressourceName);
if (!_G(boss_sound[0]))
return 0;
_G(dig_sound[NUM_SOUNDS - 3]) = _G(boss_sound[0]);
ressourceName = Common::String::format("BOSSV%d2", num);
- _G(boss_sound[1]) = (byte *)res_falloc_read(ressourceName);
+ _G(boss_sound[1]) = (byte *)resourceAllocRead(ressourceName);
if (!_G(boss_sound[1]))
return 0;
_G(dig_sound[NUM_SOUNDS - 2]) = _G(boss_sound[1]);
ressourceName = Common::String::format("BOSSV%d3", num);
- _G(boss_sound[2]) = (byte *)res_falloc_read(ressourceName);
+ _G(boss_sound[2]) = (byte *)resourceAllocRead(ressourceName);
if (!_G(boss_sound[2]))
return 0;
_G(dig_sound[NUM_SOUNDS - 1]) = _G(boss_sound[2]);
Common::String prefix = (num == 2) ? "BOSSP1" : Common::String::format("BOSSP%d", num);
ressourceName = prefix + "1";
- _G(boss_pcsound[0]) = (byte *)res_falloc_read(ressourceName);
+ _G(boss_pcsound[0]) = (byte *)resourceAllocRead(ressourceName);
if (!_G(boss_pcsound[0]))
return 0;
@@ -163,7 +163,7 @@ int setupBoss(const int num) {
f.close();
ressourceName = prefix + "2";
- _G(boss_pcsound[1]) = (byte *)res_falloc_read(ressourceName);
+ _G(boss_pcsound[1]) = (byte *)resourceAllocRead(ressourceName);
if (!_G(boss_pcsound[1]))
return 0;
@@ -177,7 +177,7 @@ int setupBoss(const int num) {
f.close();
ressourceName = prefix + "3";
- _G(boss_pcsound[2]) = (byte *)res_falloc_read(ressourceName);
+ _G(boss_pcsound[2]) = (byte *)resourceAllocRead(ressourceName);
if (!_G(boss_pcsound[2]))
return 0;
_G(pc_sound[NUM_SOUNDS - 1]) = _G(boss_pcsound[2]);
diff --git a/engines/got/game/script.cpp b/engines/got/game/script.cpp
index c45658f95c5..bb73f88bbce 100644
--- a/engines/got/game/script.cpp
+++ b/engines/got/game/script.cpp
@@ -517,7 +517,7 @@ int Scripts::readScriptFile() {
};
str = Common::String::format("SPEAK%d", _G(area));
- if (res_read(str.c_str(), sb) < 0) {
+ if (resourceRead(str.c_str(), sb) < 0) {
ret = 6;
goto done;
}
diff --git a/engines/got/gfx/gfx_chunks.cpp b/engines/got/gfx/gfx_chunks.cpp
index bb2692b0809..476d658c28a 100644
--- a/engines/got/gfx/gfx_chunks.cpp
+++ b/engines/got/gfx/gfx_chunks.cpp
@@ -46,11 +46,11 @@ void GraphicChunk::enable() {
switch (_compressMode) {
case LZSS:
- lzss_decompress(_data, &_decompressedData[0], _uncompressedSize);
+ decompressLzss(_data, &_decompressedData[0], _uncompressedSize);
break;
case RLE:
- rle_decompress(_data, &_decompressedData[0], _uncompressedSize);
+ decompressRle(_data, &_decompressedData[0], _uncompressedSize);
break;
default:
diff --git a/engines/got/gfx/image.cpp b/engines/got/gfx/image.cpp
index fa9fb4bd5e2..ae114c1fb7f 100644
--- a/engines/got/gfx/image.cpp
+++ b/engines/got/gfx/image.cpp
@@ -93,7 +93,7 @@ void make_actor_surface(Actor *actor) {
}
int loadStandardActors() {
- load_actor(0, 100 + _G(thor_info)._armor); // Load Thor
+ loadActor(0, 100 + _G(thor_info)._armor); // Load Thor
_G(actor[0]).loadFixed(_G(tmp_buff) + 5120);
setupActor(&_G(actor[0]), 0, 0, 100, 100);
_G(thor) = &_G(actor[0]);
@@ -105,7 +105,7 @@ int loadStandardActors() {
_G(thor_x2) = _G(thor)->_x + 14;
_G(thor_y2) = _G(thor)->_y + 14;
- load_actor(0, 103 + _G(thor_info)._armor); // Load hammer
+ loadActor(0, 103 + _G(thor_info)._armor); // Load hammer
_G(actor[1]).loadFixed(_G(tmp_buff) + 5120);
setupActor(&_G(actor[1]), 1, 0, 100, 100);
_G(actor[1])._active = false;
@@ -114,21 +114,21 @@ int loadStandardActors() {
make_actor_surface(&_G(actor[1]));
// Load sparkle
- load_actor(0, 106);
+ loadActor(0, 106);
_G(sparkle).loadFixed(_G(tmp_buff) + 5120);
setupActor(&_G(sparkle), 20, 0, 100, 100);
_G(sparkle)._active = false;
make_actor_surface(&_G(sparkle));
// Load explosion
- load_actor(0, 107);
+ loadActor(0, 107);
_G(explosion).loadFixed(_G(tmp_buff) + 5120);
setupActor(&_G(explosion), 21, 0, 100, 100);
_G(explosion)._active = false;
make_actor_surface(&_G(explosion));
// Load tornado
- load_actor(0, 108);
+ loadActor(0, 108);
_G(magic_item[0]).loadFixed((const byte *)_G(tmp_buff) + 5120);
Common::copy(_G(tmp_buff), _G(tmp_buff) + 1024, _G(magic_pic[0]));
@@ -136,7 +136,7 @@ int loadStandardActors() {
_G(magic_item[0])._active = false;
// Load shield
- load_actor(0, 109);
+ loadActor(0, 109);
_G(magic_item[1]).loadFixed((const byte *)_G(tmp_buff) + 5120);
Common::copy(_G(tmp_buff), _G(tmp_buff) + 1024, _G(magic_pic[1]));
@@ -191,7 +191,7 @@ int loadEnemy(const int type) {
return i;
}
- if (!load_actor(1, type)) {
+ if (!loadActor(1, type)) {
return -1;
}
@@ -265,7 +265,7 @@ void setupMagicItem(const int item) {
}
void loadNewThor() {
- load_actor(0, 100 + _G(thor_info)._armor); // Load Thor
+ loadActor(0, 100 + _G(thor_info)._armor); // Load Thor
make_actor_surface(&_G(actor[0]));
}
diff --git a/engines/got/gfx/palette.cpp b/engines/got/gfx/palette.cpp
index 674b1413fa4..4ef1e256bb1 100644
--- a/engines/got/gfx/palette.cpp
+++ b/engines/got/gfx/palette.cpp
@@ -40,7 +40,7 @@ Palette63::Palette63(const byte *pal) {
}
void loadPalette() {
- if (res_read("PALETTE", saved_palette) < 0)
+ if (resourceRead("PALETTE", saved_palette) < 0)
error("Cannot Read PALETTE");
g_system->getPaletteManager()->setPalette(saved_palette, 0, 256);
diff --git a/engines/got/utils/compression.cpp b/engines/got/utils/compression.cpp
index 790082051c7..00c1fc6620e 100644
--- a/engines/got/utils/compression.cpp
+++ b/engines/got/utils/compression.cpp
@@ -25,7 +25,7 @@
namespace Got {
-void lzss_decompress(const byte *src, byte *dest, size_t destSize) {
+void decompressLzss(const byte *src, byte *dest, const size_t destSize) {
byte *endP = dest + destSize;
for (;;) {
@@ -35,14 +35,14 @@ void lzss_decompress(const byte *src, byte *dest, size_t destSize) {
if (endP == dest)
return;
- bool bit = (v & 1) != 0;
+ const bool bit = (v & 1) != 0;
v >>= 1;
if (bit) {
*dest++ = *src++;
} else {
uint16 offset = READ_LE_UINT16(src);
src += 2;
- int count = (offset >> 12) + 2;
+ const int count = (offset >> 12) + 2;
offset &= 0xfff;
Common::copy(dest - offset, dest - offset + count, dest);
@@ -52,14 +52,14 @@ void lzss_decompress(const byte *src, byte *dest, size_t destSize) {
}
}
-void rle_decompress(const byte *src, byte *dest, size_t destSize) {
+void decompressRle(const byte *src, byte *dest, const size_t destSize) {
byte *endP = dest + destSize;
for (;;) {
byte val = *src++;
if ((val & 0x80) != 0) {
- byte rep = *src++;
+ const byte rep = *src++;
val &= 0x7f;
Common::fill(dest, dest + val, rep);
dest += val;
diff --git a/engines/got/utils/compression.h b/engines/got/utils/compression.h
index 503346880b5..a13e6d4b2bb 100644
--- a/engines/got/utils/compression.h
+++ b/engines/got/utils/compression.h
@@ -29,12 +29,12 @@ namespace Got {
/**
* LZSS decompressor
*/
-void lzss_decompress(const byte *src, byte *dest, size_t destSize);
+void decompressLzss(const byte *src, byte *dest, size_t destSize);
/**
* RLE decoding
*/
-void rle_decompress(const byte *src, byte *dest, size_t destSize);
+void decompressRle(const byte *src, byte *dest, size_t destSize);
} // namespace Got
diff --git a/engines/got/utils/file.cpp b/engines/got/utils/file.cpp
index 0ad529269ce..e12fcafec69 100644
--- a/engines/got/utils/file.cpp
+++ b/engines/got/utils/file.cpp
@@ -31,22 +31,22 @@ bool File::open(const Common::Path &filename) {
return true;
}
-bool load_actor(int /*file*/, int num) {
+bool loadActor(int /*file*/, int num) {
Common::String fname = Common::String::format("ACTOR%d", num);
- if (res_read(fname, _G(tmp_buff), true) < 0)
+ if (resourceRead(fname, _G(tmp_buff), true) < 0)
return false;
return true;
}
-bool load_speech(int index) {
+bool loadSpeech(int index) {
char tmps[5];
Common::String fname = Common::String::format("SPEAK%d", _G(area));
char *sp = new char[30000];
- if (res_read(fname, sp) < 0) {
+ if (resourceRead(fname, sp) < 0) {
delete[] sp;
return false;
}
@@ -106,7 +106,7 @@ bool load_speech(int index) {
return true;
}
-long res_read(const Common::String &name, void *buff, bool failAllowed) {
+long resourceRead(const Common::String &name, void *buff, bool failAllowed) {
Common::File f;
if (f.open(Common::Path(name))) {
return f.read(buff, f.size());
@@ -118,7 +118,7 @@ long res_read(const Common::String &name, void *buff, bool failAllowed) {
return -1;
}
-void *res_falloc_read(const Common::String &name) {
+void *resourceAllocRead(const Common::String &name) {
Common::File f;
if (f.open(Common::Path(name))) {
byte *result = (byte *)malloc(f.size());
diff --git a/engines/got/utils/file.h b/engines/got/utils/file.h
index fd6f71eb5b7..7598b20e59f 100644
--- a/engines/got/utils/file.h
+++ b/engines/got/utils/file.h
@@ -23,16 +23,14 @@
#define GOT_UTILS_FILE_H
#include "common/file.h"
-#include "got/data/defines.h"
namespace Got {
-extern bool load_actor(int, int num);
-extern void setup_filenames(int level);
-extern bool load_speech(int index);
-extern long res_read(const Common::String &name, void *buff,
- bool failAllowed = false);
-extern void *res_falloc_read(const Common::String &name);
+extern bool loadActor(int, int num);
+extern void setupFilenames(int level);
+extern bool loadSpeech(int index);
+extern long resourceRead(const Common::String &name, void *buff, bool failAllowed = false);
+extern void *resourceAllocRead(const Common::String &name);
class File : public Common::File {
public:
diff --git a/engines/got/utils/res_archive.cpp b/engines/got/utils/res_archive.cpp
index 4423a4862c2..34ae3b64b0d 100644
--- a/engines/got/utils/res_archive.cpp
+++ b/engines/got/utils/res_archive.cpp
@@ -107,7 +107,7 @@ const Common::ArchiveMemberPtr ResArchive::getMember(const Common::Path &path) c
Common::SeekableReadStream *ResArchive::createReadStreamForMember(const Common::Path &path) const {
// Get the index of the header entry for this file
- int hdrIndex = indexOf(path.baseName());
+ const int hdrIndex = indexOf(path.baseName());
if (hdrIndex == -1)
return nullptr;
@@ -137,11 +137,11 @@ Common::SeekableReadStream *ResArchive::createReadStreamForMember(const Common::
}
void ResArchive::lzssDecompress(const byte *src, byte *dest) const {
- uint16 size = READ_LE_UINT16(src);
+ const uint16 size = READ_LE_UINT16(src);
assert(READ_LE_UINT16(src + 2) == 1);
src += 4;
- lzss_decompress(src, dest, size);
+ decompressLzss(src, dest, size);
}
} // namespace Got
diff --git a/engines/got/vars.cpp b/engines/got/vars.cpp
index 3f6785a1eb8..13cc340abda 100644
--- a/engines/got/vars.cpp
+++ b/engines/got/vars.cpp
@@ -69,7 +69,7 @@ void Vars::load() {
_tmp_buff = new byte[TMP_SIZE];
- res_read("RANDOM", _rnd_array);
+ resourceRead("RANDOM", _rnd_array);
Gfx::loadPalette();
}
diff --git a/engines/got/views/credits.cpp b/engines/got/views/credits.cpp
index 6457e7e67a0..8204c8e565e 100644
--- a/engines/got/views/credits.cpp
+++ b/engines/got/views/credits.cpp
@@ -35,7 +35,7 @@ bool Credits::msgFocus(const FocusMessage &msg) {
_frameCtr = 0;
draw();
- Gfx::Palette63 pal = _G(gfx[41]);
+ const Gfx::Palette63 pal = _G(gfx[41]);
fadeIn(pal);
return true;
@@ -49,7 +49,7 @@ void Credits::draw() {
s.clear(*(const byte *)bg.getPixels());
s.simpleBlitFrom(bg, Common::Point(0, 24));
- int creditNum = _frameCtr / CREDIT_TIME;
+ const int creditNum = _frameCtr / CREDIT_TIME;
int subNum = _frameCtr % CREDIT_TIME;
if (subNum >= (FADE_FRAMES + DISPLAY_TIME)) {
@@ -59,10 +59,10 @@ void Credits::draw() {
}
if (creditNum < CREDITS_COUNT) {
- int gfxNum1 = 43 + creditNum;
- int gfxNum2 = 67 + creditNum;
- int gfxNum3 = 52 + subNum;
- int gfxNum4 = 76 + subNum;
+ const int gfxNum1 = 43 + creditNum;
+ const int gfxNum2 = 67 + creditNum;
+ const int gfxNum3 = 52 + subNum;
+ const int gfxNum4 = 76 + subNum;
drawCredit(s, gfxNum1, gfxNum3, 16, 40 + 24);
drawCredit(s, gfxNum2, gfxNum4, 16, 40 + 24);
diff --git a/engines/got/views/dialogs/high_scores.cpp b/engines/got/views/dialogs/high_scores.cpp
index 782c20db860..26154660545 100644
--- a/engines/got/views/dialogs/high_scores.cpp
+++ b/engines/got/views/dialogs/high_scores.cpp
@@ -53,17 +53,15 @@ void HighScores::draw() {
for (int area = 2; area <= _currentArea; ++area)
title += 'I';
- int titleStart = (s.w - title.size() * 8) / 2;
+ const int titleStart = (s.w - title.size() * 8) / 2;
s.print(Common::Point(titleStart, 4), title, 54);
for (int i = 0; i < 7; ++i) {
const HighScore &hs = _G(highScores)._scores[_currentArea - 1][i];
// Draw frames for name and score
- s.frameRect(Common::Rect(10, 20 + i * 18, 210, 20 + i * 18 + 16),
- 206);
- s.frameRect(Common::Rect(220, 20 + i * 18, 280, 20 + i * 18 + 16),
- 206);
+ s.frameRect(Common::Rect(10, 20 + i * 18, 210, 20 + i * 18 + 16), 206);
+ s.frameRect(Common::Rect(220, 20 + i * 18, 280, 20 + i * 18 + 16), 206);
// Write out the name and scores
s.print(Common::Point(15, 24 + i * 18), hs._name, 14);
diff --git a/engines/got/views/dialogs/say.cpp b/engines/got/views/dialogs/say.cpp
index c7de7476c3f..37b5e196986 100644
--- a/engines/got/views/dialogs/say.cpp
+++ b/engines/got/views/dialogs/say.cpp
@@ -40,7 +40,7 @@ void Say::show(int item, const Gfx::Pics &speakerIcon, int type) {
bool Say::msgFocus(const FocusMessage &msg) {
if (!_type)
- play_sound(WOOP, 1);
+ play_sound(WOOP, true);
_content = (const char *)_G(tmp_buff);
_contentLength = 0;
@@ -160,7 +160,7 @@ bool Say::tick() {
}
if (_type) {
- play_sound(WOOP, 1);
+ play_sound(WOOP, true);
_woopCtr = 0;
}
diff --git a/engines/got/views/dialogs/select_item.cpp b/engines/got/views/dialogs/select_item.cpp
index b5fbddedff5..08760849ac5 100644
--- a/engines/got/views/dialogs/select_item.cpp
+++ b/engines/got/views/dialogs/select_item.cpp
@@ -54,7 +54,7 @@ void SelectItem::draw() {
if (l < 6)
s.simpleBlitFrom(_G(objects[l + 26]), Common::Point(82 - 56 + (l * _HRZSP), 72 - 48));
else {
- int objId = _G(thor_info)._object + 10;
+ const int objId = _G(thor_info)._object + 10;
s.simpleBlitFrom(_G(objects[objId]), Common::Point(82 - 56 + (l * _HRZSP), 72 - 48));
}
}
@@ -127,7 +127,7 @@ bool SelectItem::msgAction(const ActionMessage &msg) {
break;
}
- play_sound(WOOP, 1);
+ play_sound(WOOP, true);
redraw();
break;
@@ -143,7 +143,7 @@ bool SelectItem::msgAction(const ActionMessage &msg) {
break;
}
- play_sound(WOOP, 1);
+ play_sound(WOOP, true);
redraw();
break;
diff --git a/engines/got/views/dialogs/select_option.cpp b/engines/got/views/dialogs/select_option.cpp
index ffd5df9f4aa..265893c9402 100644
--- a/engines/got/views/dialogs/select_option.cpp
+++ b/engines/got/views/dialogs/select_option.cpp
@@ -48,10 +48,7 @@ void SelectOption::setContent(const Common::String &title,
_title = title;
_options = options;
- // Calculate the bounds for the dialog
- int w, h, x1, y1, x2, y2;
-
- w = title.size();
+ int w = title.size();
for (uint i = 0; i < _options.size(); ++i)
w = MAX(w, (int)_options[i].size());
@@ -59,11 +56,11 @@ void SelectOption::setContent(const Common::String &title,
w++;
w = (w * 8) + 32;
- h = (_options.size() * 16) + 32;
- x1 = (320 - w) / 2;
- x2 = (x1 + w);
- y1 = (192 - h) / 2;
- y2 = (y1 + h);
+ const int h = (_options.size() * 16) + 32;
+ const int x1 = (320 - w) / 2;
+ const int x2 = (x1 + w);
+ const int y1 = (192 - h) / 2;
+ const int y2 = (y1 + h);
_bounds = Common::Rect(x1 - 16, y1 - 16, x2 + 16, y2 + 16);
}
@@ -73,7 +70,7 @@ void SelectOption::draw() {
// Write the title
GfxSurface s = getSurface(true);
- int titleStart = (s.w - _title.size() * 8) / 2;
+ const int titleStart = (s.w - _title.size() * 8) / 2;
s.print(Common::Point(titleStart, 4), _title, 54);
// Write the options
@@ -83,7 +80,7 @@ void SelectOption::draw() {
// Draw selection pointer
if (_smackCtr > 0) {
// Selecting an item
- int xp = 8 + 2 * (_smackCtr < 3 ? (_smackCtr + 1) : (6 - _smackCtr));
+ const int xp = 8 + 2 * (_smackCtr < 3 ? (_smackCtr + 1) : (6 - _smackCtr));
s.simpleBlitFrom(_G(hampic[0]), Common::Point(xp, 24 + (_selectedItem * 16)));
} else {
// Normal animated cursor
@@ -104,13 +101,13 @@ bool SelectOption::msgAction(const ActionMessage &msg) {
switch (msg._action) {
case KEYBIND_UP:
- play_sound(WOOP, 1);
+ play_sound(WOOP, true);
if (--_selectedItem < 0)
_selectedItem = (int)_options.size() - 1;
break;
case KEYBIND_DOWN:
- play_sound(WOOP, 1);
+ play_sound(WOOP, true);
if (++_selectedItem >= (int)_options.size())
_selectedItem = 0;
break;
@@ -142,7 +139,7 @@ bool SelectOption::tick() {
if (_smackCtr != 0) {
++_smackCtr;
if (_smackCtr == 3)
- play_sound(CLANG, 1);
+ play_sound(CLANG, true);
if (_smackCtr == 6) {
_smackCtr = 0;
close();
diff --git a/engines/got/views/game_content.cpp b/engines/got/views/game_content.cpp
index 328e91e162f..5987b7a127e 100644
--- a/engines/got/views/game_content.cpp
+++ b/engines/got/views/game_content.cpp
@@ -179,19 +179,19 @@ bool GameContent::tick() {
if (_G(thor)->_health > 0) {
_G(thor)->_health--;
- play_sound(WOOP, 1);
+ play_sound(WOOP, true);
addHealth(-1);
addScore(10);
} else if (_G(thor_info)._magic > 0) {
_G(thor_info)._magic--;
- play_sound(WOOP, 1);
+ play_sound(WOOP, true);
addMagic(-1);
addScore(10);
} else if (_G(thor_info)._jewels) {
_G(thor_info)._jewels--;
- play_sound(WOOP, 1);
+ play_sound(WOOP, true);
addJewels(-1);
addScore(10);
@@ -495,7 +495,7 @@ void GameContent::thorDies() {
_deathCtr = 0;
_G(shield_on) = false;
- play_sound(DEAD, 1);
+ play_sound(DEAD, true);
}
void GameContent::spinThor() {
@@ -649,7 +649,7 @@ void GameContent::throwLightning() {
for (int i = 0; i < MAX_ACTORS; i++)
_G(actor[i])._show = 0;
- play_sound(ELECTRIC, 1);
+ play_sound(ELECTRIC, true);
}
void GameContent::drawLightning(GfxSurface &s) {
diff --git a/engines/got/views/game_status.cpp b/engines/got/views/game_status.cpp
index 4923e9f44ed..9c9f0080d21 100644
--- a/engines/got/views/game_status.cpp
+++ b/engines/got/views/game_status.cpp
@@ -46,21 +46,21 @@ void GameStatus::draw() {
}
void GameStatus::displayHealth(GfxSurface &s) {
- int b = 59 + _G(thor)->_health;
+ const int x = 59 + _G(thor)->_health;
- s.fillRect(Common::Rect(59, 8, b, 12), 32);
- s.fillRect(Common::Rect(b, 8, 209, 12), STAT_COLOR);
+ s.fillRect(Common::Rect(59, 8, x, 12), 32);
+ s.fillRect(Common::Rect(x, 8, 209, 12), STAT_COLOR);
}
void GameStatus::displayMagic(GfxSurface &s) {
- int b = 59 + _G(thor_info)._magic;
+ const int x = 59 + _G(thor_info)._magic;
- s.fillRect(Common::Rect(59, 20, b, 24), 96);
- s.fillRect(Common::Rect(b, 20, 209, 24), STAT_COLOR);
+ s.fillRect(Common::Rect(59, 20, x, 24), 96);
+ s.fillRect(Common::Rect(x, 20, 209, 24), STAT_COLOR);
}
void GameStatus::displayJewels(GfxSurface &s) {
- Common::String str = Common::String::format("%d", _G(thor_info)._jewels);
+ const Common::String str = Common::String::format("%d", _G(thor_info)._jewels);
int x;
if (str.size() == 1)
x = 70;
@@ -74,15 +74,15 @@ void GameStatus::displayJewels(GfxSurface &s) {
}
void GameStatus::displayScore(GfxSurface &s) {
- Common::String str = Common::String::format("%ld", _G(thor_info)._score);
- int x = 276 - (str.size() * 8);
+ const Common::String str = Common::String::format("%ld", _G(thor_info)._score);
+ const int x = 276 - (str.size() * 8);
s.fillRect(Common::Rect(223, 32, 279, 42), STAT_COLOR);
s.print(Common::Point(x, 32), str, 14);
}
void GameStatus::displayKeys(GfxSurface &s) {
- Common::String str = Common::String::format("%d", _G(thor_info)._keys);
+ const Common::String str = Common::String::format("%d", _G(thor_info)._keys);
int x;
if (str.size() == 1)
diff --git a/engines/got/views/opening.cpp b/engines/got/views/opening.cpp
index 78626fd45b2..aabda928a7d 100644
--- a/engines/got/views/opening.cpp
+++ b/engines/got/views/opening.cpp
@@ -52,7 +52,7 @@ bool Opening::msgFocus(const FocusMessage &msg) {
}
// Fade in the screen
- Gfx::Palette63 pal = _G(gfx[35]);
+ const Gfx::Palette63 pal = _G(gfx[35]);
draw();
fadeIn(pal);
diff --git a/engines/got/views/splash_screen.cpp b/engines/got/views/splash_screen.cpp
index 1fed74f70fb..4ece13e81c9 100644
--- a/engines/got/views/splash_screen.cpp
+++ b/engines/got/views/splash_screen.cpp
@@ -42,7 +42,7 @@ void SplashScreen::draw() {
}
bool SplashScreen::msgFocus(const FocusMessage &msg) {
- Gfx::GraphicChunk chunk = _G(gfx[93]);
+ const Gfx::GraphicChunk chunk = _G(gfx[93]);
_frameCount = READ_LE_UINT16(chunk._data);
_chunkSize = chunk._data + 2;
_chunkPtr = chunk._data + 2 + _frameCount * 4;
@@ -56,7 +56,7 @@ bool SplashScreen::msgFocus(const FocusMessage &msg) {
Gfx::xSetPal(blackPal);
draw();
- Gfx::Palette63 pal = _G(gfx[91]);
+ const Gfx::Palette63 pal = _G(gfx[91]);
Gfx::fadeIn(pal);
return true;
diff --git a/engines/got/views/story.cpp b/engines/got/views/story.cpp
index e5f564dde85..c86c9ac33cb 100644
--- a/engines/got/views/story.cpp
+++ b/engines/got/views/story.cpp
@@ -31,9 +31,9 @@ namespace Views {
#define MAX_Y 236
bool Story::msgFocus(const FocusMessage &msg) {
- res_read(Common::String::format("STORY%d", _G(area)), _G(tmp_buff));
+ resourceRead(Common::String::format("STORY%d", _G(area)), _G(tmp_buff));
- res_read("STORYPAL", _G(pbuff));
+ resourceRead("STORYPAL", _G(pbuff));
for (int i = 0; i < PALETTE_SIZE; ++i)
_G(pbuff[i]) = ((int)_G(pbuff[i]) * 255 + 31) / 63;
More information about the Scummvm-git-logs
mailing list