[Scummvm-git-logs] scummvm master -> 55b64c05d221e7a8b36f33e417c3dd278604a93d
dreammaster
paulfgilbert at gmail.com
Wed Jun 3 03:14:35 UTC 2020
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:
55b64c05d2 GLK: COMPREHEND: astyle formatting
Commit: 55b64c05d221e7a8b36f33e417c3dd278604a93d
https://github.com/scummvm/scummvm/commit/55b64c05d221e7a8b36f33e417c3dd278604a93d
Author: dreammaster (dreammaster at scummvm.org)
Date: 2020-06-03T04:14:20+01:00
Commit Message:
GLK: COMPREHEND: astyle formatting
Changed paths:
engines/glk/comprehend/comprehend.cpp
engines/glk/comprehend/comprehend.h
engines/glk/comprehend/debugger_dumper.cpp
engines/glk/comprehend/detection_tables.h
engines/glk/comprehend/dictionary.cpp
engines/glk/comprehend/dictionary.h
engines/glk/comprehend/draw_surface.cpp
engines/glk/comprehend/draw_surface.h
engines/glk/comprehend/file_buf.cpp
engines/glk/comprehend/file_buf.h
engines/glk/comprehend/game.cpp
engines/glk/comprehend/game_data.cpp
engines/glk/comprehend/game_data.h
engines/glk/comprehend/game_oo.cpp
engines/glk/comprehend/game_tr.cpp
engines/glk/comprehend/pics.cpp
engines/glk/comprehend/pics.h
diff --git a/engines/glk/comprehend/comprehend.cpp b/engines/glk/comprehend/comprehend.cpp
index a661568ef8..32b31b3a56 100644
--- a/engines/glk/comprehend/comprehend.cpp
+++ b/engines/glk/comprehend/comprehend.cpp
@@ -45,15 +45,15 @@ namespace Comprehend {
Comprehend *g_comprehend;
Comprehend::Comprehend(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gameDesc), _topWindow(nullptr), _bottomWindow(nullptr),
- _drawSurface(nullptr), _game(nullptr), _pics(nullptr), _saveSlot(-1),
- _graphicsEnabled(true), _drawFlags(0) {
+ _drawSurface(nullptr), _game(nullptr), _pics(nullptr), _saveSlot(-1),
+ _graphicsEnabled(true), _drawFlags(0) {
g_comprehend = this;
}
Comprehend::~Comprehend() {
delete _drawSurface;
delete _game;
- SearchMan.remove("Pics"); // This also deletes it
+ SearchMan.remove("Pics"); // This also deletes it
g_comprehend = nullptr;
}
@@ -82,8 +82,8 @@ void Comprehend::initialize() {
_bottomWindow = (TextBufferWindow *)glk_window_open(0, 0, 0, wintype_TextBuffer, 1);
_topWindow = (GraphicsWindow *)glk_window_open(_bottomWindow,
- winmethod_Above | winmethod_Fixed,
- 160 * SCALE_FACTOR, wintype_Graphics, 2);
+ winmethod_Above | winmethod_Fixed,
+ 160 * SCALE_FACTOR, wintype_Graphics, 2);
glk_set_window(_bottomWindow);
_topWindow->fillRect(0, Rect(0, 0, _topWindow->_w, _topWindow->_h));
@@ -188,7 +188,7 @@ void Comprehend::drawItemPicture(int pictureNum) {
drawPicture(pictureNum + ITEMS_OFFSET);
}
-void Comprehend::clearScreen(bool isBright) {
+void Comprehend::clearScreen(bool isBright) {
drawPicture(isBright ? BRIGHT_ROOM : DARK_ROOM);
}
diff --git a/engines/glk/comprehend/comprehend.h b/engines/glk/comprehend/comprehend.h
index 25bc6549ba..b2ad87cdc8 100644
--- a/engines/glk/comprehend/comprehend.h
+++ b/engines/glk/comprehend/comprehend.h
@@ -92,7 +92,9 @@ public:
/**
* Returns the running interpreter type
*/
- InterpreterType getInterpreterType() const override { return INTERPRETER_SCOTT; }
+ InterpreterType getInterpreterType() const override {
+ return INTERPRETER_SCOTT;
+ }
/**
* Initialize the graphics
diff --git a/engines/glk/comprehend/debugger_dumper.cpp b/engines/glk/comprehend/debugger_dumper.cpp
index fdb56ee2c4..2b9d0ab232 100644
--- a/engines/glk/comprehend/debugger_dumper.cpp
+++ b/engines/glk/comprehend/debugger_dumper.cpp
@@ -104,7 +104,7 @@ DebuggerDumper::DebuggerDumper() : _game(nullptr) {
}
Common::String DebuggerDumper::dumpInstruction(ComprehendGame *game,
- FunctionState *func_state, Instruction *instr) {
+ FunctionState *func_state, Instruction *instr) {
uint i;
int str_index, str_table;
uint8 *opcode_map, opcode;
@@ -112,8 +112,8 @@ Common::String DebuggerDumper::dumpInstruction(ComprehendGame *game,
if (func_state)
line = Common::String::format("[or=%d,and=%d,test=%d,else=%d]",
- func_state->or_count, func_state->_and,
- func_state->test_result, func_state->else_result);
+ func_state->or_count, func_state->_and,
+ func_state->test_result, func_state->else_result);
opcode_map = game->_opcodeMap;
opcode = opcode_map[instr->opcode];
@@ -128,8 +128,8 @@ Common::String DebuggerDumper::dumpInstruction(ComprehendGame *game,
line += "(";
for (i = 0; i < instr->nr_operands; i++)
line += Common::String::format("%.2x%s",
- instr->operand[i],
- i == (instr->nr_operands - 1) ? ")" : ", ");
+ instr->operand[i],
+ i == (instr->nr_operands - 1) ? ")" : ", ");
}
switch (opcode) {
@@ -272,7 +272,7 @@ void DebuggerDumper::dumpWordMap() {
for (j = 0; j < 3; j++) {
word[j] = dict_find_word_by_index_type(
- _game, map->word[j].index, map->word[j].type);
+ _game, map->word[j].index, map->word[j].type);
if (word[j])
snprintf(str[j], sizeof(str[j]),
"%s", word[j]->_word);
@@ -329,7 +329,7 @@ void DebuggerDumper::dumpItems() {
print(" words: ");
for (j = 0; j < _game->_nr_words; j++)
if (_game->_words[j]._index == item->word &&
- (_game->_words[j]._type & WORD_TYPE_NOUN_MASK))
+ (_game->_words[j]._type & WORD_TYPE_NOUN_MASK))
print("%s ", _game->_words[j]._word);
print("\n");
print(" flags=%.2x (takeable=%d, weight=%d)\n",
diff --git a/engines/glk/comprehend/detection_tables.h b/engines/glk/comprehend/detection_tables.h
index 0e26bbd7de..17af9a09d5 100644
--- a/engines/glk/comprehend/detection_tables.h
+++ b/engines/glk/comprehend/detection_tables.h
@@ -28,13 +28,13 @@ namespace Glk {
namespace Comprehend {
const PlainGameDescriptor COMPREHEND_GAME_LIST[] = {
- {"crimsoncrown", "Crimson Crown"},
- {"ootopis", "OO-Topos"},
+ {"crimsoncrown", "Crimson Crown"},
+ {"ootopis", "OO-Topos"},
#ifndef RELEASE_BUILD
- {"talisman", "Talisman: Challenging the Sands of Time"},
+ {"talisman", "Talisman: Challenging the Sands of Time"},
#endif
- {"transylvania", "Transylvania"},
- {nullptr, nullptr}
+ {"transylvania", "Transylvania"},
+ {nullptr, nullptr}
};
struct ComprehendDetectionEntry {
@@ -44,12 +44,12 @@ struct ComprehendDetectionEntry {
};
const ComprehendDetectionEntry COMPREHEND_GAMES[] = {
- {"crimsoncrown", "cc1.gda", "f2abf019675ac5c9bcfd81032bc7787b"},
- {"ootopis", "g0", "56460c1ee669c253607534155d7e9db4"},
+ {"crimsoncrown", "cc1.gda", "f2abf019675ac5c9bcfd81032bc7787b"},
+ {"ootopis", "g0", "56460c1ee669c253607534155d7e9db4"},
#ifndef RELEASE_BUILD
{"talisman", "g0", "35770d4815e610b5252e3fcd9f11def3"},
#endif
- {"transylvania", "tr.gda", "22e08633eea02ceee49b909dfd982d22"},
+ {"transylvania", "tr.gda", "22e08633eea02ceee49b909dfd982d22"},
{nullptr, nullptr, nullptr}
};
diff --git a/engines/glk/comprehend/dictionary.cpp b/engines/glk/comprehend/dictionary.cpp
index 70959a889e..f7c99f1d48 100644
--- a/engines/glk/comprehend/dictionary.cpp
+++ b/engines/glk/comprehend/dictionary.cpp
@@ -28,8 +28,7 @@
namespace Glk {
namespace Comprehend {
-static bool word_match(Word *word, const char *string)
-{
+static bool word_match(Word *word, const char *string) {
/* Words less than 6 characters must match exactly */
if (strlen(word->_word) < 6 && strlen(string) != strlen(word->_word))
return false;
@@ -38,8 +37,7 @@ static bool word_match(Word *word, const char *string)
}
Word *dict_find_word_by_string(ComprehendGame *game,
- const char *string)
-{
+ const char *string) {
uint i;
if (!string)
@@ -53,13 +51,12 @@ Word *dict_find_word_by_string(ComprehendGame *game,
}
Word *dict_find_word_by_index_type(ComprehendGame *game,
- uint8 index, uint8 type)
-{
+ uint8 index, uint8 type) {
uint i;
for (i = 0; i < game->_nr_words; i++) {
if (game->_words[i]._index == index &&
- game->_words[i]._type == type)
+ game->_words[i]._type == type)
return &game->_words[i];
}
@@ -67,13 +64,12 @@ Word *dict_find_word_by_index_type(ComprehendGame *game,
}
Word *find_dict_word_by_index(ComprehendGame *game,
- uint8 index, uint8 type_mask)
-{
+ uint8 index, uint8 type_mask) {
uint i;
for (i = 0; i < game->_nr_words; i++) {
if (game->_words[i]._index == index &&
- (game->_words[i]._type & type_mask) != 0)
+ (game->_words[i]._type & type_mask) != 0)
return &game->_words[i];
}
@@ -81,14 +77,13 @@ Word *find_dict_word_by_index(ComprehendGame *game,
}
bool dict_match_index_type(ComprehendGame *game, const char *word,
- uint8 index, uint8 type_mask)
-{
+ uint8 index, uint8 type_mask) {
uint i;
for (i = 0; i < game->_nr_words; i++)
if (game->_words[i]._index == index &&
- ((game->_words[i]._type & type_mask) != 0) &&
- word_match(&game->_words[i], word))
+ ((game->_words[i]._type & type_mask) != 0) &&
+ word_match(&game->_words[i], word))
return true;
return false;
diff --git a/engines/glk/comprehend/dictionary.h b/engines/glk/comprehend/dictionary.h
index ed8fb56908..b01860d5df 100644
--- a/engines/glk/comprehend/dictionary.h
+++ b/engines/glk/comprehend/dictionary.h
@@ -30,13 +30,13 @@ class ComprehendGame;
struct Word;
Word *find_dict_word_by_index(ComprehendGame *game,
- uint8 index, uint8 type_mask);
+ uint8 index, uint8 type_mask);
Word *dict_find_word_by_index_type(ComprehendGame *game,
- uint8 index, uint8 type);
+ uint8 index, uint8 type);
Word *dict_find_word_by_string(ComprehendGame *game,
- const char *string);
+ const char *string);
bool dict_match_index_type(ComprehendGame *game, const char *word,
- uint8 index, uint8 type_mask);
+ uint8 index, uint8 type_mask);
} // namespace Comprehend
} // namespace Glk
diff --git a/engines/glk/comprehend/draw_surface.cpp b/engines/glk/comprehend/draw_surface.cpp
index eb9cb99616..5cec0a4ea3 100644
--- a/engines/glk/comprehend/draw_surface.cpp
+++ b/engines/glk/comprehend/draw_surface.cpp
@@ -35,142 +35,144 @@ namespace Comprehend {
#define RENDERER_PIXEL_DATA 1
const uint32 DrawSurface::PEN_COLORS[8] = {
- G_COLOR_BLACK,
- RGB(0x00, 0x66, 0x00),
- RGB(0x00, 0xff, 0x00),
- G_COLOR_WHITE,
- G_COLOR_BLACK,
- RGB(0x00, 0xff, 0xff),
- RGB(0xff, 0x00, 0xff),
- RGB(0xff, 0x00, 0x00),
+ G_COLOR_BLACK,
+ RGB(0x00, 0x66, 0x00),
+ RGB(0x00, 0xff, 0x00),
+ G_COLOR_WHITE,
+ G_COLOR_BLACK,
+ RGB(0x00, 0xff, 0xff),
+ RGB(0xff, 0x00, 0xff),
+ RGB(0xff, 0x00, 0x00),
};
/* Used by Transylvania and Crimson Crown */
const uint32 DrawSurface::DEFAULT_COLOR_TABLE[256] = {
- G_COLOR_WHITE, // 00
- G_COLOR_DARK_BLUE, // 01
- G_COLOR_GRAY1, // 02
- G_COLOR_DARK_RED, // 03
- G_COLOR_GRAY2, // 04
- 0, G_COLOR_GRAY3, 0, 0, 0, 0, 0, 0,
- G_COLOR_BROWN1, G_COLOR_DARK_PURPLE, 0,
-
- 0, 0, G_COLOR_DARK_RED, G_COLOR_BROWN2, 0, 0, 0,
- G_COLOR_DARK_BLUE, G_COLOR_BLACK, 0, 0, 0, 0, 0, 0, G_COLOR_DARK_PURPLE,
-
- G_COLOR_DARK_PURPLE, 0, G_COLOR_DARK_RED, 0, 0, 0, 0, 0,
- 0, 0, 0, G_COLOR_DARK_PURPLE, 0, 0, 0, 0,
-
- 0, 0, 0, 0, G_COLOR_WHITE, G_COLOR_GRAY0, RGB(0xb5, 0x6c, 0x47),
- 0, 0, 0, 0, 0, G_COLOR_CYAN, G_COLOR_DARK_RED,
- G_COLOR_DARK_GREEN1, G_COLOR_DARK_GREEN2,
-
- G_COLOR_DARK_PURPLE, 0, G_COLOR_DITHERED_PINK, 0, 0,
- G_COLOR_BROWN2, G_COLOR_DARK_RED, G_COLOR_DARK_BLUE,
- G_COLOR_DARK_BLUE, G_COLOR_DARK_BLUE, 0, 0, 0,
- G_COLOR_WHITE, G_COLOR_BROWN2, G_COL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K, 0, 0, 0, 0, 0, 0, G_COLOR_DARK_PURPLE,
+
+ G_COLOR_DARK_PURPLE, 0, G_COLOR_DARK_RED, 0, 0, 0, 0, 0,
+ 0, 0, 0, G_COLOR_DARK_PURPLE, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, G_COLOR_WHITE, G_COLOR_GRAY0, RGB(0xb5, 0x6c, 0x47),
+ 0, 0, 0, 0, 0, G_COLOR_CYAN, G_COLOR_DARK_RED,
+ G_COLOR_DARK_GREEN1, G_COLOR_DARK_GREEN2,
+
+ G_COLOR_DARK_PURPLE, 0, G_COLOR_DITHERED_PINK, 0, 0,
+ G_COLOR_BROWN2, G_COLOR_DARK_RED, G_COLOR_DARK_BLUE,
+ G_COLOR_DARK_BLUE, G_COLOR_DARK_BLUE, 0, 0, 0,
+ G_COLOR_WHITE, G_COLOR_BROWN2, G_COLOR_BROWN2,
+
+ G_COLOR_BLACK, G_COLOR_DARK_PURPLE, 0, G_COLOR_GRAY2,
+ G_COLOR_BROWN2, 0, 0, G_COLOR_AQUA, 0, 0, G_COLOR_GREEN,
+ G_COLOR_DARK_BLUE, G_COLOR_DARK_PURPLE, G_COLOR_BROWN1,
+ G_COLOR_BROWN2, 0,
+
+ G_COLOR_DARK_PURPLE, G_COLOR_LIGHT_ORANGE, 0, 0,
+ G_COLOR_ORANGE, G_COLOR_RED, G_COLOR_DARK_RED, 0, 0, 0,
+ G_COLOR_DARK_BLUE, G_COLOR_DARK_PURPLE, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ G_COLOR_BLACK, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
/* Used by OO-topos */
/* FIXME - incomplete */
const uint32 DrawSurface::COLOR_TABLE_1[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- RGB(0x80, 0x00, 0x00),
- 0,
- RGB(0xe6, 0xe6, 0x00),
- 0,
- 0,
- 0,
- 0,
- RGB(0xc0, 0x00, 0x00),
- RGB(0x80, 0x00, 0x00),
- G_COLOR_ORANGE,
- 0,
-
- 0,
- G_COLOR_BROWN1,
- RGB(0x00, 0x00, 0x66),
- RGB(0x33, 0x99, 0xff),
- 0,
- RGB(0xe8, 0xe8, 0xe8),
- RGB(0x99, 0xcc, 0xff),
- 0,
- RGB(0x99, 0x33, 0x33),
- RGB(0xcc, 0x66, 0x00),
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
-
- G_COLOR_GRAY3,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- RGB(0x99, 0x33, 0x00),
- G_COLOR_CYAN,
- 0,
- 0,
- RGB(0x66, 0x00, 0x33),
- 0,
- 0,
- 0,
- 0,
-
- G_COLOR_AQUA,
- G_COLOR_GRAY2,
- 0,
- 0,
- 0,
- G_COLOR_DARK_BLUE,
- 0,
- 0,
- 0,
- 0,
- G_COLOR_GRAY1,
- 0,
- 0,
- 0,
- 0,
- 0,
-
- 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
const uint32 *DrawSurface::COLOR_TABLES[2] = {
- DEFAULT_COLOR_TABLE,
- COLOR_TABLE_1,
+ DEFAULT_COLOR_TABLE,
+ COLOR_TABLE_1,
};
/*-------------------------------------------------------*/
@@ -308,19 +310,19 @@ void DrawSurface::drawShape(int x, int y, int shape_type, uint32 fill_color) {
case IMAGE_OP_SHAPE_SPRAY: {
char spray[13][13] = {
- {0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0},
- {0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
- {0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1},
- {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
- {1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0},
- {0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0},
- {1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0},
- {0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0},
- {1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0},
- {0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0},
- {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0},
+ {0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0},
+ {0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
+ {0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1},
+ {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
+ {1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0},
+ {0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0},
+ {1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0},
+ {0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0},
+ {1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0},
+ {0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0},
+ {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0},
};
for (i = 0; i < 13; i++)
for (j = 0; j < 13; j++)
diff --git a/engines/glk/comprehend/draw_surface.h b/engines/glk/comprehend/draw_surface.h
index 2ed332b063..6d2f08f78e 100644
--- a/engines/glk/comprehend/draw_surface.h
+++ b/engines/glk/comprehend/draw_surface.h
@@ -29,10 +29,10 @@
namespace Glk {
namespace Comprehend {
-#define G_RENDER_WIDTH 280
-#define G_RENDER_HEIGHT 200
+#define G_RENDER_WIDTH 280
+#define G_RENDER_HEIGHT 200
-#define RGB(r, g, b) (uint32)(((r) << 24) | ((g) << 16) | ((b) << 8) | 0xff)
+#define RGB(r, g, b) (uint32)(((r) << 24) | ((g) << 16) | ((b) << 8) | 0xff)
#define G_COLOR_BLACK 0x000000ff
#define G_COLOR_WHITE 0xffffffff
diff --git a/engines/glk/comprehend/file_buf.cpp b/engines/glk/comprehend/file_buf.cpp
index e20dc0fc9f..c2d4e43465 100644
--- a/engines/glk/comprehend/file_buf.cpp
+++ b/engines/glk/comprehend/file_buf.cpp
@@ -67,7 +67,7 @@ bool FileBuffer::seek(int32 offset, int whence) {
}
uint32 FileBuffer::read(void *dataPtr, uint32 dataSize) {
- int32 bytesRead = CLIP((int32)dataSize, 0, (int32)_data.size() - _pos);
+ int32 bytesRead = CLIP((int32)dataSize, (int32)0, (int32)_data.size() - _pos);
if (bytesRead) {
Common::fill(&_readBytes[_pos], &_readBytes[_pos] + bytesRead, true);
Common::copy(&_data[_pos], &_data[_pos] + bytesRead, (byte *)dataPtr);
diff --git a/engines/glk/comprehend/file_buf.h b/engines/glk/comprehend/file_buf.h
index ed66911a36..769634ed80 100644
--- a/engines/glk/comprehend/file_buf.h
+++ b/engines/glk/comprehend/file_buf.h
@@ -42,8 +42,12 @@ public:
static bool exists(const Common::String &filename);
void close();
- int32 pos() const override { return _pos; }
- int32 size() const override { return _data.size(); }
+ int32 pos() const override {
+ return _pos;
+ }
+ int32 size() const override {
+ return _data.size();
+ }
bool seek(int32 offset, int whence = SEEK_SET) override;
bool eos() const override {
@@ -51,7 +55,9 @@ public:
}
uint32 read(void *dataPtr, uint32 dataSize) override;
- const byte *dataPtr() const { return &_data[_pos]; }
+ const byte *dataPtr() const {
+ return &_data[_pos];
+ }
size_t strlen(bool *eof = nullptr);
/*
diff --git a/engines/glk/comprehend/game.cpp b/engines/glk/comprehend/game.cpp
index 8941a069b4..5ac00138fc 100644
--- a/engines/glk/comprehend/game.cpp
+++ b/engines/glk/comprehend/game.cpp
@@ -112,7 +112,7 @@ Common::String ComprehendGame::stringLookup(uint16 index) {
case 0x81:
case 0x01:
string += 0x100;
- /* Fall-through */
+ /* Fall-through */
case 0x00:
case 0x80:
if (string < _strings.size())
@@ -121,7 +121,7 @@ Common::String ComprehendGame::stringLookup(uint16 index) {
case 0x83:
string += 0x100;
- /* Fall-through */
+ /* Fall-through */
case 0x02:
case 0x82:
if (string < _strings2.size())
@@ -139,7 +139,7 @@ Common::String ComprehendGame::instrStringLookup(uint8 index, uint8 table) {
/*-------------------------------------------------------*/
static void console_init(void) {
- // ioctl(STDOUT_FILENO, TIOCGWINSZ, &console_winsize);
+ // ioctl(STDOUT_FILENO, TIOCGWINSZ, &console_winsize);
}
int console_get_key(void) {
@@ -304,9 +304,9 @@ static WordIndex *is_word_pair(ComprehendGame *game,
map = &game->_wordMaps[i];
if (map->word[0].index == word1->_index &&
- map->word[0].type == word1->_type &&
- map->word[1].index == word2->_index &&
- map->word[1].type == word2->_type)
+ map->word[0].type == word1->_type &&
+ map->word[1].index == word2->_index &&
+ map->word[1].type == word2->_type)
return &map->word[2];
}
@@ -361,12 +361,12 @@ static void update_graphics(ComprehendGame *game) {
}
if ((game->_updateFlags & UPDATE_GRAPHICS) ||
- (game->_updateFlags & UPDATE_GRAPHICS_ITEMS)) {
+ (game->_updateFlags & UPDATE_GRAPHICS_ITEMS)) {
for (i = 0; i < game->_items.size(); i++) {
item = &game->_items[i];
if (item->room == game->_currentRoom &&
- item->graphic != 0)
+ item->graphic != 0)
g_comprehend->drawItemPicture(item->graphic - 1);
}
}
@@ -383,7 +383,7 @@ static void describe_objects_in_current_room(ComprehendGame *game) {
item = &game->_items[i];
if (item->room == game->_currentRoom &&
- item->string_desc != 0)
+ item->string_desc != 0)
count++;
}
@@ -394,7 +394,7 @@ static void describe_objects_in_current_room(ComprehendGame *game) {
item = &game->_items[i];
if (item->room == game->_currentRoom &&
- item->string_desc != 0)
+ item->string_desc != 0)
console_println(game, game->stringLookup(item->string_desc).c_str());
}
}
@@ -415,7 +415,7 @@ static void update(ComprehendGame *game) {
console_println(game, game->stringLookup(room_desc_string).c_str());
if ((game->_updateFlags & UPDATE_ITEM_LIST) &&
- room_type == ROOM_IS_NORMAL)
+ room_type == ROOM_IS_NORMAL)
describe_objects_in_current_room(game);
game->_updateFlags = 0;
@@ -568,7 +568,7 @@ static void eval_instruction(ComprehendGame *game,
case OPCODE_VAR_EQ:
func_set_test_result(func_state,
game->_variables[instr->operand[0]] ==
- game->_variables[instr->operand[1]]);
+ game->_variables[instr->operand[1]]);
break;
case OPCODE_TURN_TICK:
@@ -577,8 +577,8 @@ static void eval_instruction(ComprehendGame *game,
case OPCODE_PRINT:
console_println(game, game->instrStringLookup(
- instr->operand[0], instr->operand[1])
- .c_str());
+ instr->operand[0], instr->operand[1])
+ .c_str());
break;
case OPCODE_TEST_NOT_ROOM_FLAG:
@@ -664,8 +664,8 @@ static void eval_instruction(ComprehendGame *game,
item = get_item_by_noun(game, noun);
func_set_test_result(func_state,
game->_variables[VAR_INVENTORY_WEIGHT] +
- (item->flags & ITEMF_WEIGHT_MASK) >
- game->_variables[VAR_INVENTORY_LIMIT]);
+ (item->flags & ITEMF_WEIGHT_MASK) >
+ game->_variables[VAR_INVENTORY_LIMIT]);
break;
case OPCODE_DESCRIBE_CURRENT_OBJECT:
@@ -686,7 +686,7 @@ static void eval_instruction(ComprehendGame *game,
Item *itemP = &game->_items[i];
if (itemP->word == noun->_index &&
- itemP->room == instr->operand[0]) {
+ itemP->room == instr->operand[0]) {
test = true;
break;
}
@@ -793,7 +793,7 @@ static void eval_instruction(ComprehendGame *game,
case OPCODE_OBJECT_NOT_VALID:
/* FIXME - should be called OPCODE_CURRENT_OBJECT_NOT_VALID */
func_set_test_result(func_state, !noun ||
- (noun->_type & WORD_TYPE_NOUN_MASK) == 0);
+ (noun->_type & WORD_TYPE_NOUN_MASK) == 0);
break;
case OPCODE_CURRENT_IS_OBJECT:
@@ -1093,10 +1093,10 @@ static bool handle_sentence(ComprehendGame *game,
action = &game->_actions[i];
if (action->type == ACTION_VERB_OPT_NOUN &&
- sentence->nr_words > action->nr_words + 1)
+ sentence->nr_words > action->nr_words + 1)
continue;
if (action->type != ACTION_VERB_OPT_NOUN &&
- sentence->nr_words != action->nr_words)
+ sentence->nr_words != action->nr_words)
continue;
/*
@@ -1105,7 +1105,7 @@ static bool handle_sentence(ComprehendGame *game,
*/
for (j = 0; j < action->nr_words; j++) {
if (sentence->words[j]._index == action->word[j] &&
- (sentence->words[j]._type & action->word_type[j]))
+ (sentence->words[j]._type & action->word_type[j]))
continue;
/* Word didn't match */
@@ -1176,7 +1176,7 @@ static void read_sentence(ComprehendGame *game, char **line,
}
if (sentence->nr_words >= ARRAY_SIZE(sentence->words) ||
- sentence_end)
+ sentence_end)
break;
}
diff --git a/engines/glk/comprehend/game_data.cpp b/engines/glk/comprehend/game_data.cpp
index 4dbe472e0c..d9694d09b5 100644
--- a/engines/glk/comprehend/game_data.cpp
+++ b/engines/glk/comprehend/game_data.cpp
@@ -833,12 +833,12 @@ static void parse_header(ComprehendGame *game, FileBuffer *fb) {
case 0x93f0: /* OO-Topos */
game->_comprehendVersion = 2;
- magic_offset = (uint16)-0x5a00;
+ magic_offset = (uint16) - 0x5a00;
break;
case 0xa429: /* Talisman */
game->_comprehendVersion = 2;
- magic_offset = (uint16)-0x5a00;
+ magic_offset = (uint16) - 0x5a00;
break;
default:
@@ -990,7 +990,7 @@ void comprehend_load_game(ComprehendGame *game) {
if (g_comprehend->_graphicsEnabled) {
// Set up the picture archive
g_comprehend->_pics->load(game->_locationGraphicFiles,
- game->_itemGraphicFiles, game->_titleGraphicFile);
+ game->_itemGraphicFiles, game->_titleGraphicFile);
if (game->_colorTable)
g_comprehend->_drawSurface->setColorTable(game->_colorTable);
diff --git a/engines/glk/comprehend/game_data.h b/engines/glk/comprehend/game_data.h
index 6f887135aa..dad58d527d 100644
--- a/engines/glk/comprehend/game_data.h
+++ b/engines/glk/comprehend/game_data.h
@@ -380,7 +380,7 @@ enum {
#define WORD_TYPE_NOUN 0x40
#define WORD_TYPE_NOUN_PLURAL 0x80
#define WORD_TYPE_NOUN_MASK (WORD_TYPE_FEMALE | WORD_TYPE_MALE | \
- WORD_TYPE_NOUN | WORD_TYPE_NOUN_PLURAL)
+ WORD_TYPE_NOUN | WORD_TYPE_NOUN_PLURAL)
void comprehend_load_game(ComprehendGame *game);
void comprehend_restore_game(ComprehendGame *game,
diff --git a/engines/glk/comprehend/game_oo.cpp b/engines/glk/comprehend/game_oo.cpp
index 4283488203..4e52d0daa6 100644
--- a/engines/glk/comprehend/game_oo.cpp
+++ b/engines/glk/comprehend/game_oo.cpp
@@ -57,12 +57,12 @@ OOToposGame::OOToposGame() : ComprehendGame() {
}
int OOToposGame::roomIsSpecial(unsigned room_index,
- unsigned *roomDescString) {
+ unsigned *roomDescString) {
Room *room = &_rooms[room_index];
// Is the room dark
if ((room->flags & OO_ROOM_FLAG_DARK) &&
- !(_flags[OO_FLAG_FLASHLIGHT_ON])) {
+ !(_flags[OO_FLAG_FLASHLIGHT_ON])) {
if (roomDescString)
*roomDescString = 0xb3;
return ROOM_IS_DARK;
@@ -70,7 +70,7 @@ int OOToposGame::roomIsSpecial(unsigned room_index,
// Is the room too bright
if (room_index == OO_BRIGHT_ROOM &&
- !_flags[OO_FLAG_WEARING_GOGGLES]) {
+ !_flags[OO_FLAG_WEARING_GOGGLES]) {
if (roomDescString)
*roomDescString = 0x1c;
return ROOM_IS_TOO_BRIGHT;
@@ -84,12 +84,12 @@ bool OOToposGame::beforeTurn() {
static bool flashlight_was_on = false, googles_were_worn = false;
Room *room = &_rooms[_currentRoom];
- /*
+ /*
* Check if the room needs to be redrawn because the flashlight
* was switch off or on.
*/
if (_flags[OO_FLAG_FLASHLIGHT_ON] != flashlight_was_on &&
- (room->flags & OO_ROOM_FLAG_DARK)) {
+ (room->flags & OO_ROOM_FLAG_DARK)) {
flashlight_was_on = _flags[OO_FLAG_FLASHLIGHT_ON];
_updateFlags |= UPDATE_GRAPHICS | UPDATE_ROOM_DESC;
}
@@ -99,7 +99,7 @@ bool OOToposGame::beforeTurn() {
* put on or removed.
*/
if (_flags[OO_FLAG_WEARING_GOGGLES] != googles_were_worn &&
- _currentRoom == OO_BRIGHT_ROOM) {
+ _currentRoom == OO_BRIGHT_ROOM) {
googles_were_worn = _flags[OO_FLAG_WEARING_GOGGLES];
_updateFlags |= UPDATE_GRAPHICS | UPDATE_ROOM_DESC;
}
@@ -110,11 +110,11 @@ bool OOToposGame::beforeTurn() {
void OOToposGame::handleSpecialOpcode(uint8 operand) {
switch (operand) {
case 0x03:
- // Game over - failure
- // fall through
+ // Game over - failure
+ // fall through
case 0x05:
- // Won the game
- // fall through
+ // Won the game
+ // fall through
case 0x04:
// Restart game
game_restart(this);
diff --git a/engines/glk/comprehend/game_tr.cpp b/engines/glk/comprehend/game_tr.cpp
index 06953dc3de..80ffe499b1 100644
--- a/engines/glk/comprehend/game_tr.cpp
+++ b/engines/glk/comprehend/game_tr.cpp
@@ -37,7 +37,7 @@ const TransylvaniaMonster TransylvaniaGame::VAMPIRE = {
};
static const GameStrings TR_STRINGS = {
- EXTRA_STRING_TABLE(0x8a)
+ EXTRA_STRING_TABLE(0x8a)
};
@@ -50,7 +50,7 @@ TransylvaniaGame::TransylvaniaGame() : ComprehendGame() {
_stringFiles.push_back(StringFile("MD.MS1", 0x88));
_stringFiles.push_back(StringFile("ME.MS1", 0x88));
- _locationGraphicFiles.push_back("RA.MS1");
+ _locationGraphicFiles.push_back("RA.MS1");
_locationGraphicFiles.push_back("RB.MS1");
_locationGraphicFiles.push_back("RC.MS1");
@@ -77,8 +77,8 @@ void TransylvaniaGame::updateMonster(const TransylvaniaMonster *monsterInfo) {
}
if ((room->flags & monsterInfo->room_allow_flag) &&
- !_flags[monsterInfo->dead_flag] &&
- turn_count > monsterInfo->min_turns_before) {
+ !_flags[monsterInfo->dead_flag] &&
+ turn_count > monsterInfo->min_turns_before) {
/*
* The monster is alive and allowed to move to the current
* room. Randomly decide whether on not to. If not, move
@@ -94,8 +94,7 @@ void TransylvaniaGame::updateMonster(const TransylvaniaMonster *monsterInfo) {
}
int TransylvaniaGame::roomIsSpecial(unsigned room_index,
- unsigned *roomDescString)
-{
+ unsigned *roomDescString) {
Room *room = &_rooms[room_index];
if (room_index == 0x28) {
@@ -113,8 +112,7 @@ bool TransylvaniaGame::beforeTurn() {
return false;
}
-void TransylvaniaGame::handleSpecialOpcode(uint8 operand)
-{
+void TransylvaniaGame::handleSpecialOpcode(uint8 operand) {
switch (operand) {
case 0x01:
// FIXME: Called when the mice are dropped and the cat chases them.
@@ -133,11 +131,11 @@ void TransylvaniaGame::handleSpecialOpcode(uint8 operand)
break;
case 0x03:
- // Game over - failure
- // fall through
+ // Game over - failure
+ // fall through
case 0x05:
- // Won the game
- // fall through
+ // Won the game
+ // fall through
case 0x08:
// Restart game
game_restart(this);
diff --git a/engines/glk/comprehend/pics.cpp b/engines/glk/comprehend/pics.cpp
index fcb77eccba..c29a2f89e1 100644
--- a/engines/glk/comprehend/pics.cpp
+++ b/engines/glk/comprehend/pics.cpp
@@ -304,7 +304,7 @@ void Pics::load(const Common::StringArray &roomFiles,
int Pics::getPictureNumber(const Common::String &filename) const {
// Ensure prefix and suffix
if (!filename.hasPrefixIgnoreCase("pic") ||
- !filename.hasSuffixIgnoreCase(".raw"))
+ !filename.hasSuffixIgnoreCase(".raw"))
return -1;
// Get the number part
diff --git a/engines/glk/comprehend/pics.h b/engines/glk/comprehend/pics.h
index 9140b959b3..bb96a6fc5e 100644
--- a/engines/glk/comprehend/pics.h
+++ b/engines/glk/comprehend/pics.h
@@ -149,8 +149,8 @@ public:
void clear();
void load(const Common::StringArray &roomFiles,
- const Common::StringArray &itemFiles,
- const Common::String &titleFile);
+ const Common::StringArray &itemFiles,
+ const Common::String &titleFile);
/**
* Check if a member with the given name is present in the Archive.
More information about the Scummvm-git-logs
mailing list