[Scummvm-cvs-logs] SF.net SVN: scummvm:[40101] scummvm/trunk/engines/sci

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Apr 24 12:43:42 CEST 2009


Revision: 40101
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40101&view=rev
Author:   fingolfin
Date:     2009-04-24 10:43:42 +0000 (Fri, 24 Apr 2009)

Log Message:
-----------
SCI: Some const corrections, removed dead stuff, cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel.h
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/kmovement.cpp
    scummvm/trunk/engines/sci/engine/vm.h
    scummvm/trunk/engines/sci/scicore/vocabulary.cpp
    scummvm/trunk/engines/sci/scicore/vocabulary.h

Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h	2009-04-24 10:42:53 UTC (rev 40100)
+++ scummvm/trunk/engines/sci/engine/kernel.h	2009-04-24 10:43:42 UTC (rev 40101)
@@ -388,7 +388,7 @@
 reg_t kCheckSaveGame(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kSaveGame(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kRestoreGame(EngineState *s, int funct_nr, int argc, reg_t *argv);
-reg_t kFileIO(EngineState *s, int funct_nr, int argc, reg_t *argp);
+reg_t kFileIO(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kGetTime(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kHaveMouse(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kJoystick(EngineState *s, int funct_nr, int argc, reg_t *argv);
@@ -400,8 +400,8 @@
 reg_t kAvoidPath(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kParse(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kSaid(EngineState *s, int funct_nr, int argc, reg_t *argv);
-reg_t kStrCpy(EngineState *s, int funct_nr, int argc, reg_t *argp);
-reg_t kStrAt(EngineState *s, int funct_nr, int argc, reg_t *argp);
+reg_t kStrCpy(EngineState *s, int funct_nr, int argc, reg_t *argv);
+reg_t kStrAt(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kEditControl(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kDrawControl(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kHiliteControl(EngineState *s, int funct_nr, int argc, reg_t *argv);
@@ -411,7 +411,7 @@
 reg_t kSetNowSeen(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kInitBresen(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kDoBresen(EngineState *s, int funct_nr, int argc, reg_t *argv);
-reg_t kBaseSetter(EngineState *s, int funct_nr, int argc, reg_t *argp);
+reg_t kBaseSetter(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kAddToPic(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kAnimate(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv);

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-04-24 10:42:53 UTC (rev 40100)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-04-24 10:43:42 UTC (rev 40101)
@@ -40,27 +40,30 @@
 #define MAX_TEXT_WIDTH_MAGIC_VALUE 192
 
 // Graph subfunctions
-#define K_GRAPH_GET_COLORS_NR 2
-#define K_GRAPH_DRAW_LINE 4
-#define K_GRAPH_SAVE_BOX 7
-#define K_GRAPH_RESTORE_BOX 8
-#define K_GRAPH_FILL_BOX_BACKGROUND 9
-#define K_GRAPH_FILL_BOX_FOREGROUND 10
-#define K_GRAPH_FILL_BOX_ANY 11
-#define K_GRAPH_UPDATE_BOX 12
-#define K_GRAPH_REDRAW_BOX 13
-#define K_GRAPH_ADJUST_PRIORITY 14
+enum {
+	K_GRAPH_GET_COLORS_NR = 2,
+	K_GRAPH_DRAW_LINE = 4,
+	K_GRAPH_SAVE_BOX = 7,
+	K_GRAPH_RESTORE_BOX = 8,
+	K_GRAPH_FILL_BOX_BACKGROUND = 9,
+	K_GRAPH_FILL_BOX_FOREGROUND = 10,
+	K_GRAPH_FILL_BOX_ANY = 11,
+	K_GRAPH_UPDATE_BOX = 12,
+	K_GRAPH_REDRAW_BOX = 13,
+	K_GRAPH_ADJUST_PRIORITY = 14
+};
 
 // Control types and flags
-#define K_CONTROL_BUTTON 1
-#define K_CONTROL_TEXT 2
-#define K_CONTROL_EDIT 3
-#define K_CONTROL_ICON 4
-#define K_CONTROL_CONTROL 6
-#define K_CONTROL_CONTROL_ALIAS 7
-#define K_CONTROL_BOX 10
+enum {
+	K_CONTROL_BUTTON = 1,
+	K_CONTROL_TEXT = 2,
+	K_CONTROL_EDIT = 3,
+	K_CONTROL_ICON = 4,
+	K_CONTROL_CONTROL = 6,
+	K_CONTROL_CONTROL_ALIAS = 7,
+	K_CONTROL_BOX = 10
+};
 
-
 #define ADD_TO_CURRENT_PORT(widget) \
 	{if (s->port)				   \
 		s->port->add(GFXWC(s->port), GFXW(widget)); \

Modified: scummvm/trunk/engines/sci/engine/kmovement.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-04-24 10:42:53 UTC (rev 40100)
+++ scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-04-24 10:43:42 UTC (rev 40101)
@@ -65,7 +65,6 @@
 Still, what we compute in the end is of course not a real velocity anymore, but an integer approximation,
 used in an iterative stepping algorithm
 */
-
 reg_t kSetJump(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	// Input data
 	reg_t object = argv[0];
@@ -163,7 +162,7 @@
 #define _K_BRESEN_AXIS_X 0
 #define _K_BRESEN_AXIS_Y 1
 
-void initialize_bresen(EngineState *s, int funct_nr, int argc, reg_t *argv, reg_t mover, int step_factor, int deltax, int deltay) {
+static void initialize_bresen(EngineState *s, int argc, reg_t *argv, reg_t mover, int step_factor, int deltax, int deltay) {
 	reg_t client = GET_SEL32(mover, client);
 	int stepx = GET_SEL32SV(client, xStep) * step_factor;
 	int stepy = GET_SEL32SV(client, yStep) * step_factor;
@@ -223,7 +222,7 @@
 	int deltax = GET_SEL32SV(mover, x) - GET_SEL32SV(client, x);
 	int deltay = GET_SEL32SV(mover, y) - GET_SEL32SV(client, y);
 
-	initialize_bresen(s, funct_nr, argc, argv, mover, KP_UINT(KP_ALT(1, make_reg(0, 1))), deltax, deltay);
+	initialize_bresen(s, argc, argv, mover, KP_UINT(KP_ALT(1, make_reg(0, 1))), deltax, deltay);
 
 	return s->r_acc;
 }

Modified: scummvm/trunk/engines/sci/engine/vm.h
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.h	2009-04-24 10:42:53 UTC (rev 40100)
+++ scummvm/trunk/engines/sci/engine/vm.h	2009-04-24 10:43:42 UTC (rev 40101)
@@ -673,22 +673,6 @@
 */
 
 
-int game_save_state(EngineState *s, char *name, int coredump);
-/* Saves the game state to the harddisk
-** Parameters: (EngineState *) s: The game state to save
-**             (char *) name: Name of the subdirectory (relative to s->save_dir)
-**             (int) coredump: Set to non-zero in order to write additional debug information
-** Returns   : (int) 0 on success, 1 otherwise
-*/
-
-
-EngineState *game_restore_state(char *name);
-/* Restores the game state from a file
-** Parameters: (char *) name: Name of the saved game state to restore
-** Returns   : (EngineState *): The restored game state, or NULL on failure
-*/
-
-
 int game_init(EngineState *s);
 /* Initializes an SCI game
 ** Parameters: (EngineState *) s: The state to operate on

Modified: scummvm/trunk/engines/sci/scicore/vocabulary.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/vocabulary.cpp	2009-04-24 10:42:53 UTC (rev 40100)
+++ scummvm/trunk/engines/sci/scicore/vocabulary.cpp	2009-04-24 10:43:42 UTC (rev 40101)
@@ -163,7 +163,7 @@
 	while ((seeker < resource->size - 1) && (resource->data[seeker + 1] != 0xff)) {
 		suffix_t suffix;
 
-		suffix.alt_suffix = (char *)resource->data + seeker;
+		suffix.alt_suffix = (const char *)resource->data + seeker;
 		suffix.alt_suffix_length = strlen(suffix.alt_suffix);
 		seeker += suffix.alt_suffix_length + 1; // Hit end of string
 
@@ -173,7 +173,7 @@
 		// Beginning of next string - skip leading '*'
 		seeker++;
 
-		suffix.word_suffix = (char *)resource->data + seeker;
+		suffix.word_suffix = (const char *)resource->data + seeker;
 		suffix.word_suffix_length = strlen(suffix.word_suffix);
 		seeker += suffix.word_suffix_length + 1;
 
@@ -230,7 +230,7 @@
 }
 
 
-ResultWord vocab_lookup_word(char *word, int word_len, const WordMap &words, const SuffixList &suffixes) {
+ResultWord vocab_lookup_word(const char *word, int word_len, const WordMap &words, const SuffixList &suffixes) {
 	Common::String tempword(word, word_len);
 
 	// Remove all dashes from tempword
@@ -432,9 +432,9 @@
 }
 #endif
 
-bool vocab_tokenize_string(ResultWordList &retval, char *sentence, const WordMap &words,
+bool vocab_tokenize_string(ResultWordList &retval, const char *sentence, const WordMap &words,
 	const SuffixList &suffixes, char **error) {
-	char *lastword = sentence;
+	const char *lastword = sentence;
 	int pos_in_sentence = 0;
 	char c;
 	int wordlen = 0;

Modified: scummvm/trunk/engines/sci/scicore/vocabulary.h
===================================================================
--- scummvm/trunk/engines/sci/scicore/vocabulary.h	2009-04-24 10:42:53 UTC (rev 40100)
+++ scummvm/trunk/engines/sci/scicore/vocabulary.h	2009-04-24 10:43:42 UTC (rev 40101)
@@ -150,8 +150,8 @@
 	int alt_suffix_length; /* String length of the suffix */
 	int word_suffix_length; /* String length of the other suffix */
 
-	char *alt_suffix; /* The alternative suffix */
-	char *word_suffix; /* The suffix as used in the word vocabulary */
+	const char *alt_suffix; /* The alternative suffix */
+	const char *word_suffix; /* The suffix as used in the word vocabulary */
 
 };
 
@@ -251,7 +251,7 @@
  */
 bool vocab_get_branches(ResourceManager *resmgr, Common::Array<parse_tree_branch_t> &branches);
 
-ResultWord vocab_lookup_word(char *word, int word_len,
+ResultWord vocab_lookup_word(const char *word, int word_len,
 	const WordMap &words, const SuffixList &suffixes);
 /* Looks up a single word in the words and suffixes list
 ** Parameters: (char *) word: Pointer to the word to look up
@@ -262,7 +262,7 @@
 */
 
 
-bool vocab_tokenize_string(ResultWordList &retval, char *sentence,
+bool vocab_tokenize_string(ResultWordList &retval, const char *sentence,
 	const WordMap &words, const SuffixList &suffixes, char **error);
 /* Tokenizes a string and compiles it into word_ts.
 ** Parameters: (char *) sentence: The sentence to examine


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list