aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/console.cpp5
-rw-r--r--engines/sci/console.h2
-rw-r--r--engines/sci/exereader.cpp9
-rw-r--r--engines/sci/sci.cpp36
-rw-r--r--engines/sci/sci.h4
5 files changed, 23 insertions, 33 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 9891a8e105..aabac90668 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -42,10 +42,7 @@ Console::~Console() {
bool Console::cmdGetVersion(int argc, const char **argv) {
int ver = _vm->getVersion();
- DebugPrintf("SCI version: %d.%03d.%03d\n",
- SCI_VERSION_MAJOR(ver),
- SCI_VERSION_MINOR(ver),
- SCI_VERSION_PATCHLEVEL(ver));
+ DebugPrintf("SCI version: %d.%03d.%03d\n", SCI_VERSION_MAJOR(ver), SCI_VERSION_MINOR(ver), SCI_VERSION_PATCHLEVEL(ver));
return true;
}
diff --git a/engines/sci/console.h b/engines/sci/console.h
index dd7294ac4f..b08bc838d3 100644
--- a/engines/sci/console.h
+++ b/engines/sci/console.h
@@ -37,7 +37,7 @@ class SciEngine;
class Console : public GUI::Debugger {
public:
Console(SciEngine *vm);
- virtual ~Console(void);
+ virtual ~Console();
private:
bool cmdGetVersion(int argc, const char **argv);
diff --git a/engines/sci/exereader.cpp b/engines/sci/exereader.cpp
index 469af3a0ff..260d5704b1 100644
--- a/engines/sci/exereader.cpp
+++ b/engines/sci/exereader.cpp
@@ -160,7 +160,7 @@ uint getBit(Common::SeekableReadStream *input) {
_bits = input->readByte();
_bits |= input->readByte() << 8;
- if (_bitCount == -1) { /* special case for first bit word */
+ if (_bitCount == -1) { // special case for first bit word
bit = _bits & 1;
_bits >>= 1;
}
@@ -268,12 +268,9 @@ Common::String readSciVersionFromExe(Common::SeekableReadStream *exeStream) {
accept = 0;
if (isalnum(ch)) {
- accept = (state != 1
- && state != 5
- && state != 9);
+ accept = (state != 1 && state != 5 && state != 9);
} else if (ch == '.') {
- accept = (state == 1
- || state == 5);
+ accept = (state == 1 || state == 5);
} else if (state == 9) {
// Terminate string
currentString[9] = 0;
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 4473bac695..ff1a51f22a 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -36,23 +36,20 @@ namespace Sci {
extern gfx_driver_t gfx_driver_scummvm;
-int
-c_quit(EngineState *s) {
- script_abort_flag = 1; /* Terminate VM */
+int c_quit(EngineState *s) {
+ script_abort_flag = 1; // Terminate VM
_debugstate_valid = 0;
_debug_seeking = 0;
_debug_step_running = 0;
return 0;
}
-int
-c_die(EngineState *s) {
- exit(0); /* Die */
- return 0; /* ;-P (fixes warning) */
+int c_die(EngineState *s) {
+ exit(0); //
+ return 0;
}
-static void
-init_console() {
+static void init_console() {
#ifdef WANT_CONSOLE
con_gfx_init();
#endif
@@ -78,14 +75,13 @@ init_console() {
con_hook_int(&sci01_priority_table_flags, "sci01_priority_table_flags",
"SCI01 priority table debugging flags: 1:Disable, 2:Print on change\n");
- con_passthrough = 1; /* enables all sciprintf data to be sent to stdout */
+ con_passthrough = 1; // enables all sciprintf data to be sent to stdout
}
-static int
-init_gamestate(EngineState *gamestate, sci_version_t version) {
+static int init_gamestate(EngineState *gamestate, sci_version_t version) {
int errc;
- if ((errc = script_init_engine(gamestate, version))) { /* Initialize game state */
+ if ((errc = script_init_engine(gamestate, version))) { // Initialize game state
int recovered = 0;
if (errc == SCI_ERROR_INVALID_SCRIPT_VERSION) {
@@ -216,7 +212,7 @@ Common::Error SciEngine::go() {
version = getVersion();
char resource_dir[MAXPATHLEN+1] = "";
- getcwd(resource_dir, MAXPATHLEN); /* Store resource directory */
+ getcwd(resource_dir, MAXPATHLEN); // Store resource directory
resmgr = new ResourceManager(res_version, 256 * 1024);
@@ -251,7 +247,7 @@ Common::Error SciEngine::go() {
return Common::kUnknownError;
}
- /* Set the savegame dir */
+ // Set the savegame dir
script_set_gamestate_save_dir(gamestate, ConfMan.get("savepath").c_str());
// Originally, work_dir tried to be ~/.freesci/game_name
@@ -268,7 +264,7 @@ Common::Error SciEngine::go() {
gfx_state.version = resmgr->sci_version;
gamestate->gfx_state = &gfx_state;
- /**** Default config: */
+ // Default config:
gfx_options_t gfx_options;
gfx_options.workarounds = 0;
gfx_options.buffer_pics_nr = 0;
@@ -289,14 +285,14 @@ Common::Error SciEngine::go() {
gfx_options.res_conf.assign[i] = NULL;
gfx_options.res_conf.mod[i] = NULL;
}
- /**** Default config ends */
+ // Default config ends
if (gfxop_init_default(&gfx_state, &gfx_options, resmgr)) {
fprintf(stderr, "Graphics initialization failed. Aborting...\n");
return Common::kUnknownError;
}
- if (game_init_graphics(gamestate)) { /* Init interpreter graphics */
+ if (game_init_graphics(gamestate)) { // Init interpreter graphics
fprintf(stderr, "Game initialization failed: Error in GFX subsystem. Aborting...\n");
return Common::kUnknownError;
}
@@ -311,10 +307,10 @@ Common::Error SciEngine::go() {
SCI_VERSION_MINOR(gamestate->version),
SCI_VERSION_PATCHLEVEL(gamestate->version));
- game_run(&gamestate); /* Run the game */
+ game_run(&gamestate); // Run the game
game_exit(gamestate);
- script_free_engine(gamestate); /* Uninitialize game state */
+ script_free_engine(gamestate); // Uninitialize game state
script_free_breakpoints(gamestate);
free(gamestate->work_dir);
free(gamestate);
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index 48399611af..ec3c51ca0f 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -74,8 +74,8 @@ public:
SciEngine(OSystem *syst, const SciGameDescription *desc);
~SciEngine();
- virtual Common::Error init(void);
- virtual Common::Error go(void);
+ virtual Common::Error init();
+ virtual Common::Error go();
GUI::Debugger *getDebugger() { return _console; }