[Scummvm-cvs-logs] CVS: scummvm/bs2 anims.cpp,1.19,1.20 build_display.cpp,1.26,1.27 console.cpp,1.12,1.13 controls.cpp,1.20,1.21 debug.cpp,1.11,1.12 defs.h,1.2,1.3 function.cpp,1.19,1.20 icons.cpp,1.9,1.10 layers.cpp,1.8,1.9 logic.cpp,1.16,1.17 maketext.cpp,1.15,1.16 mem_view.cpp,1.10,1.11 memory.cpp,1.8,1.9 memory.h,1.2,1.3 mouse.cpp,1.18,1.19 protocol.cpp,1.11,1.12 resman.cpp,1.45,1.46 resman.h,1.4,1.5 router.cpp,1.16,1.17 save_rest.cpp,1.20,1.21 sound.cpp,1.18,1.19 speech.cpp,1.24,1.25 startup.cpp,1.14,1.15 sword2.cpp,1.43,1.44 walker.cpp,1.8,1.9
Torbj?rn Andersson
eriktorbjorn at users.sourceforge.net
Tue Sep 30 02:29:07 CEST 2003
Update of /cvsroot/scummvm/scummvm/bs2
In directory sc8-pr-cvs1:/tmp/cvs-serv13173
Modified Files:
anims.cpp build_display.cpp console.cpp controls.cpp debug.cpp
defs.h function.cpp icons.cpp layers.cpp logic.cpp
maketext.cpp mem_view.cpp memory.cpp memory.h mouse.cpp
protocol.cpp resman.cpp resman.h router.cpp save_rest.cpp
sound.cpp speech.cpp startup.cpp sword2.cpp walker.cpp
Log Message:
Changed the resource manager object to use more ScummVM-like naming.
Index: anims.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/anims.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- anims.cpp 27 Sep 2003 11:02:56 -0000 1.19
+++ anims.cpp 30 Sep 2003 09:27:26 -0000 1.20
@@ -128,8 +128,8 @@
if (res_man.Res_check_valid(res)) {
// Open the resource. Can close it immediately.
// We've got a pointer to the header.
- head = (_standardHeader *) res_man.Res_open(res);
- res_man.Res_close(res);
+ head = (_standardHeader *) res_man.open(res);
+ res_man.close(res);
// if it's not an animation file
if (head->fileType != ANIMATION_FILE) {
@@ -159,7 +159,7 @@
#endif
// open anim file
- anim_file = res_man.Res_open(res);
+ anim_file = res_man.open(res);
#ifdef _SWORD2_DEBUG
// check this this resource is actually an animation file!
@@ -198,7 +198,7 @@
// frame of the anim.
// open anim file and point to anim header
- anim_file = res_man.Res_open(ob_graphic->anim_resource);
+ anim_file = res_man.open(ob_graphic->anim_resource);
anim_head = FetchAnimHeader(anim_file);
if (reverse_flag)
@@ -218,7 +218,7 @@
}
// close the anim file
- res_man.Res_close(ob_graphic->anim_resource);
+ res_man.close(ob_graphic->anim_resource);
// check if we want the script to loop back & call this function again
return ob_logic->looping ? IR_REPEAT : IR_STOP;
@@ -282,7 +282,7 @@
// open the resource (& check it's valid)
- anim_file = res_man.Res_open(res);
+ anim_file = res_man.open(res);
#ifdef _SWORD2_DEBUG
// check this this resource is actually an animation file!
@@ -312,7 +312,7 @@
// Close the anim file and drop out of script
- res_man.Res_close(ob_graphic->anim_resource);
+ res_man.close(ob_graphic->anim_resource);
return IR_CONT;
}
@@ -531,11 +531,11 @@
local_text = sequence_text_list[line].textNumber & 0xffff;
// open text resource & get the line
- text = FetchTextLine(res_man.Res_open(text_res), local_text);
+ text = FetchTextLine(res_man.open(text_res), local_text);
wavId = (int32) READ_LE_UINT16(text);
// now ok to close the text file
- res_man.Res_close(text_res);
+ res_man.close(text_res);
// 1st word of text line is the official line number
debug(5,"(%d) SEQUENCE TEXT: %s", *(uint16 *) text, text + 2);
@@ -557,7 +557,7 @@
File fp;
- sprintf(speechFile, "speech%d.clu", res_man.WhichCd());
+ sprintf(speechFile, "speech%d.clu", res_man.whichCd());
if (fp.open(speechFile))
fp.close();
else
@@ -574,7 +574,7 @@
if (subtitles || !speechRunning) {
// open text resource & get the line
- text = FetchTextLine(res_man.Res_open(text_res), local_text);
+ text = FetchTextLine(res_man.open(text_res), local_text);
// make the sprite
// 'text+2' to skip the first 2 bytes which form the
// line reference number
@@ -585,7 +585,7 @@
sequence_text_list[line].text_mem = MakeTextSprite(text + 2, 600, 255, speech_font_id);
// ok to close the text resource now
- res_man.Res_close(text_res);
+ res_man.close(text_res);
} else {
sequence_text_list[line].text_mem = NULL;
sequenceText[line]->textSprite = NULL;
@@ -660,7 +660,7 @@
_standardHeader *header;
#endif
- leadIn = res_man.Res_open(params[0]);
+ leadIn = res_man.open(params[0]);
#ifdef _SWORD2_DEBUG
header = (_standardHeader *) leadIn;
@@ -675,7 +675,7 @@
if (rv)
debug(5, "SFX ERROR: PlayFx() returned %.8x", rv);
- res_man.Res_close(params[0]);
+ res_man.close(params[0]);
// fade out any music that is currently playing (James22july97)
FN_stop_music(NULL);
@@ -733,7 +733,7 @@
// open the lead-out music resource, if there is one
if (smackerLeadOut) {
- leadOut = res_man.Res_open(smackerLeadOut);
+ leadOut = res_man.open(smackerLeadOut);
#ifdef _SWORD2_DEBUG
header = (_standardHeader *)leadOut;
@@ -763,7 +763,7 @@
// close the lead-out music resource
if (smackerLeadOut) {
- res_man.Res_close(smackerLeadOut);
+ res_man.close(smackerLeadOut);
smackerLeadOut = 0;
}
Index: build_display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/build_display.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- build_display.cpp 27 Sep 2003 15:44:26 -0000 1.26
+++ build_display.cpp 30 Sep 2003 09:27:26 -0000 1.27
@@ -154,46 +154,46 @@
// first background parallax + related anims
// open the screen resource
- file = res_man.Res_open(this_screen.background_layer_id);
+ file = res_man.open(this_screen.background_layer_id);
screenLayerTable = (_multiScreenHeader *) ((uint8 *) file + sizeof(_standardHeader));
if (screenLayerTable->bg_parallax[0]) {
RenderParallax(FetchBackgroundParallaxLayer(file, 0), 0);
// release the screen resource before cacheing
// the sprites
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
Send_back_par0_frames();
} else {
// release the screen resource
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
}
// ---------------------------------------------------
// second background parallax + related anims
// open the screen resource
- file = res_man.Res_open(this_screen.background_layer_id);
+ file = res_man.open(this_screen.background_layer_id);
screenLayerTable = (_multiScreenHeader *) ((uint8 *) file + sizeof(_standardHeader));
if (screenLayerTable->bg_parallax[1]) {
RenderParallax(FetchBackgroundParallaxLayer(file, 1), 1);
// release the screen resource before cacheing
// the sprites
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
Send_back_par1_frames();
} else {
// release the screen resource
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
}
// ---------------------------------------------------
// normal backround layer (just the one!)
// open the screen resource
- file = res_man.Res_open(this_screen.background_layer_id);
+ file = res_man.open(this_screen.background_layer_id);
RenderParallax(FetchBackgroundLayer(file), 2);
// release the screen resource
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
// ---------------------------------------------------
// sprites & layers
@@ -207,36 +207,36 @@
// first foreground parallax + related anims
// open the screen resource
- file = res_man.Res_open(this_screen.background_layer_id);
+ file = res_man.open(this_screen.background_layer_id);
screenLayerTable = (_multiScreenHeader *) ((uint8 *) file + sizeof(_standardHeader));
if (screenLayerTable->fg_parallax[0]) {
RenderParallax(FetchForegroundParallaxLayer(file, 0), 3);
// release the screen resource before cacheing
// the sprites
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
Send_fore_par0_frames();
} else {
// release the screen resource
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
}
//----------------------------------------------------
// second foreground parallax + related anims
// open the screen resource
- file = res_man.Res_open(this_screen.background_layer_id);
+ file = res_man.open(this_screen.background_layer_id);
screenLayerTable = (_multiScreenHeader *) ((uint8 *) file + sizeof(_standardHeader));
if (screenLayerTable->fg_parallax[1]) {
RenderParallax(FetchForegroundParallaxLayer(file, 1), 4);
// release the screen resource before cacheing
// the sprites
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
Send_fore_par1_frames();
} else {
// release the screen resource
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
}
// ---------------------------------------------------
@@ -510,7 +510,7 @@
#endif
// file points to 1st byte in the layer file
- file = res_man.Res_open(this_screen.background_layer_id);
+ file = res_man.open(this_screen.background_layer_id);
// point to layer header
layer_head = FetchLayerHeader(file,layer_number);
@@ -548,7 +548,7 @@
if (rv)
error("Driver Error %.8x in Process_layer(%d)", rv, layer_number);
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
}
void Process_image(buildit *build_unit) {
@@ -565,7 +565,7 @@
#endif
// open anim resource file & point to base
- file = res_man.Res_open(build_unit->anim_resource);
+ file = res_man.open(build_unit->anim_resource);
anim_head = FetchAnimHeader(file);
cdt_entry = FetchCdtEntry(file, build_unit->anim_pc);
@@ -685,7 +685,7 @@
build_unit->anim_resource);
// release the anim resource
- res_man.Res_close(build_unit->anim_resource);
+ res_man.close(build_unit->anim_resource);
}
void Reset_render_lists(void) { //Tony18Sept96
@@ -758,7 +758,7 @@
Con_fatal_error("ERROR: %s(%d) has no anim resource in Register_frame", FetchObjectName(ID), ID);
#endif
- file = res_man.Res_open(ob_graph->anim_resource);
+ file = res_man.open(ob_graph->anim_resource);
anim_head = FetchAnimHeader(file);
cdt_entry = FetchCdtEntry(file, ob_graph->anim_pc);
@@ -875,7 +875,7 @@
}
// close animation file
- res_man.Res_close(ob_graph->anim_resource);
+ res_man.close(ob_graph->anim_resource);
}
int32 FN_register_frame(int32 *params) {
@@ -972,7 +972,7 @@
WaitForFade();
// open the screen file
- screenFile = res_man.Res_open(this_screen.background_layer_id);
+ screenFile = res_man.open(this_screen.background_layer_id);
UpdatePaletteMatchTable((uint8 *) FetchPaletteMatchTable(screenFile));
@@ -982,7 +982,7 @@
lastPaletteRes = 0;
// close screen file
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
// start fade up
// FadeUp((float) 1.75);
@@ -1095,7 +1095,7 @@
// non-zero: set palette to this separate palette file
if (palRes) {
// open the palette file
- head = (_standardHeader*) res_man.Res_open(palRes);
+ head = (_standardHeader*) res_man.open(palRes);
#ifdef _SWORD2_DEBUG
if (head->fileType != PALETTE_FILE)
@@ -1124,12 +1124,12 @@
}
// close palette file
- res_man.Res_close(palRes);
+ res_man.close(palRes);
} else {
// 0: set palette to current screen palette
if (this_screen.background_layer_id) {
// open the screen file
- file = res_man.Res_open(this_screen.background_layer_id);
+ file = res_man.open(this_screen.background_layer_id);
UpdatePaletteMatchTable((uint8 *) FetchPaletteMatchTable(file));
BS2_SetPalette(0, 256, FetchPalette(file), RDPAL_INSTANT);
@@ -1138,7 +1138,7 @@
lastPaletteRes = 0;
// close screen file
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
} else
Con_fatal_error("FN_set_palette(0) called, but no current screen available!");
}
Index: console.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/console.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- console.cpp 30 Sep 2003 06:40:01 -0000 1.12
+++ console.cpp 30 Sep 2003 09:27:26 -0000 1.13
@@ -453,7 +453,7 @@
Print_to_console("What about him?");
return 0;
case 6: // RES
- res_man.Print_console_clusters();
+ res_man.printConsoleClusters();
return 0;
case 7: // STARTS
Con_print_start_menu();
@@ -493,7 +493,7 @@
Print_to_console("player feet marker off");
return 0;
case 13: // RESLOOK
- res_man.Examine_res(&input[1][0]);
+ res_man.examine(&input[1][0]);
return 0;
case 14: // CUR
Print_current_info();
@@ -502,12 +502,12 @@
LLogic.examineRunList();
return 0;
case 16: // KILL
- res_man.Kill_res(&input[1][0]);
+ res_man.kill(&input[1][0]);
return 0;
case 17: // NUKE
Print_to_console("killing all resources except variable file & player object...");
// '1' means we want output to console
- res_man.Kill_all_res(1);
+ res_man.killAll(1);
return 0;
case 19: // VAR
if (total_commands == 2)
@@ -527,7 +527,7 @@
case 21: // CLEAR
Print_to_console("killing all object resources except player...");
// '1' means we want output to console
- res_man.Kill_all_objects(1);
+ res_man.killAllObjects(1);
return 0;
case 22: // DEBUGON
displayDebugText = 1;
@@ -754,7 +754,7 @@
int chr, x = 0;
// open font file
- charSet = res_man.Res_open(CONSOLE_FONT_ID);
+ charSet = res_man.open(CONSOLE_FONT_ID);
do {
chr = (int) *(ascii);
@@ -770,7 +770,7 @@
} while(*(ascii));
// close font file
- res_man.Res_close(CONSOLE_FONT_ID);
+ res_man.close(CONSOLE_FONT_ID);
}
void Con_colour_block(int x, int width, int height, uint32 pen, uint32 paper, uint8 *sprite_data_ad) {
@@ -835,7 +835,7 @@
sscanf((char *) pointer, "%d", &var);
- Print_to_console("%d", *(uint32 *) (res_man.resList[1]->ad + sizeof(_standardHeader) + 4 * var));
+ Print_to_console("%d", *(uint32 *) (res_man._resList[1]->ad + sizeof(_standardHeader) + 4 * var));
}
void Var_set(uint8 *pointer, uint8 *p2) {
@@ -845,9 +845,9 @@
sscanf((char *) pointer, "%d", &var);
sscanf((char *) p2, "%d", &val);
- Print_to_console("was %d", *(uint32 *) (res_man.resList[1]->ad + sizeof(_standardHeader) + 4 * var));
+ Print_to_console("was %d", *(uint32 *) (res_man._resList[1]->ad + sizeof(_standardHeader) + 4 * var));
- *(uint32 *) (res_man.resList[1]->ad + sizeof(_standardHeader) + 4 * var) = val;
+ *(uint32 *) (res_man._resList[1]->ad + sizeof(_standardHeader) + 4 * var) = val;
Print_to_console("now %d", val);
}
Index: controls.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/controls.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- controls.cpp 30 Sep 2003 06:40:01 -0000 1.20
+++ controls.cpp 30 Sep 2003 09:27:26 -0000 1.21
@@ -70,7 +70,7 @@
public:
Sword2FontRenderer(int fontId) : _fontId(fontId) {
- uint8 *font = res_man.Res_open(fontId);
+ uint8 *font = res_man.open(fontId);
_frameHeader *head;
_spriteInfo sprite;
@@ -86,7 +86,7 @@
_glyph[i]._height = head->height;
}
- res_man.Res_close(fontId);
+ res_man.close(fontId);
}
~Sword2FontRenderer() {
@@ -95,7 +95,7 @@
}
void fetchText(int textId, char *buf) {
- uint8 *data = FetchTextLine(res_man.Res_open(textId / SIZE), textId & 0xffff);
+ uint8 *data = FetchTextLine(res_man.open(textId / SIZE), textId & 0xffff);
int i;
for (i = 0; data[i + 2]; i++) {
@@ -104,7 +104,7 @@
}
buf[i] = 0;
- res_man.Res_close(textId / SIZE);
+ res_man.close(textId / SIZE);
}
int getTextWidth(char *text) {
@@ -257,7 +257,7 @@
uint32 spriteType = RDSPR_TRANS;
// open anim resource file, point to base
- file = res_man.Res_open(res);
+ file = res_man.open(res);
anim_head = FetchAnimHeader(file);
cdt_entry = FetchCdtEntry(file, pc);
@@ -302,7 +302,7 @@
_surfaces[state]._original = true;
// Release the anim resource
- res_man.Res_close(res);
+ res_man.close(res);
};
void Sword2Widget::linkSurfaceImage(Sword2Widget *from, int state, int x, int y) {
@@ -1271,7 +1271,7 @@
break;
}
- Control_error((char*) (FetchTextLine(res_man.Res_open(textId / SIZE), textId & 0xffff) + 2));
+ Control_error((char*) (FetchTextLine(res_man.open(textId / SIZE), textId & 0xffff) + 2));
result = 0;
}
} else {
@@ -1292,7 +1292,7 @@
break;
}
- Control_error((char *) (FetchTextLine(res_man.Res_open(textId / SIZE), textId & 0xffff) + 2));
+ Control_error((char *) (FetchTextLine(res_man.open(textId / SIZE), textId & 0xffff) + 2));
result = 0;
} else {
// Prime system with a game cycle
@@ -1366,12 +1366,12 @@
// remove all resources from memory, including player object and
// global variables
- res_man.Remove_all_res();
+ res_man.removeAll();
// reopen global variables resource & send address to interpreter -
// it won't be moving
- SetGlobalInterpreterVariables((int32 *) (res_man.Res_open(1) + sizeof(_standardHeader)));
- res_man.Res_close(1);
+ SetGlobalInterpreterVariables((int32 *) (res_man.open(1) + sizeof(_standardHeader)));
+ res_man.close(1);
DEMO = temp_demo_flag;
Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/debug.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- debug.cpp 30 Sep 2003 06:40:01 -0000 1.11
+++ debug.cpp 30 Sep 2003 09:27:26 -0000 1.12
@@ -332,7 +332,7 @@
showVarPos = 115; // y-coord for first showVar
// res 1 is the global variables resource
- varTable = (int32 *) (res_man.Res_open(1) + sizeof(_standardHeader));
+ varTable = (int32 *) (res_man.open(1) + sizeof(_standardHeader));
for (showVarNo = 0; showVarNo < MAX_SHOWVARS; showVarNo++) {
varNo = showVar[showVarNo]; // get variable number
@@ -348,7 +348,7 @@
}
}
- res_man.Res_close(1); // close global variables resource
+ res_man.close(1); // close global variables resource
// memory indicator - this should come last, to show all the
// sprite blocks above!
Index: defs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/defs.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- defs.h 17 Sep 2003 09:03:40 -0000 1.2
+++ defs.h 30 Sep 2003 09:27:26 -0000 1.3
@@ -29,7 +29,7 @@
// global variable references
// NB. 4 * <number from linc's Global Variables list>
-#define VAR(n) (*(uint32 *) (res_man.resList[1]->ad + sizeof(_standardHeader) + 4 * (n)))
+#define VAR(n) (*(uint32 *) (res_man._resList[1]->ad + sizeof(_standardHeader) + 4 * (n)))
#define ID VAR(0)
#define RESULT VAR(1)
Index: function.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/function.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- function.cpp 30 Sep 2003 06:40:01 -0000 1.19
+++ function.cpp 30 Sep 2003 09:27:26 -0000 1.20
@@ -102,8 +102,8 @@
// "preloading" gets it into memory in advance to avoid the cacheing
// delay that normally occurs before the first frame.
- res_man.Res_open(params[0]); // open resource
- res_man.Res_close(params[0]); // close resource
+ res_man.open(params[0]); // open resource
+ res_man.close(params[0]); // close resource
return IR_CONT; // continue script
}
@@ -336,8 +336,8 @@
// +2 to skip the encoded text number in the first 2 chars; 3 is
// duration in seconds
- DisplayMsg(FetchTextLine(res_man.Res_open(text_res), local_text) + 2, 3);
- res_man.Res_close(text_res);
+ DisplayMsg(FetchTextLine(res_man.open(text_res), local_text) + 2, 3);
+ res_man.close(text_res);
RemoveMsg();
return IR_CONT;
@@ -351,26 +351,26 @@
uint32 *globals;
int j;
- size = res_man.Res_fetch_len(1);
+ size = res_man.fetchLen(1);
size -= sizeof(_standardHeader);
debug(5, "globals size %d", size / 4);
- globals = (uint32*) ((uint8 *) res_man.Res_open(1) + sizeof(_standardHeader));
+ globals = (uint32*) ((uint8 *) res_man.open(1) + sizeof(_standardHeader));
// blank each global variable
for (j = 0; j < size / 4; j++)
globals[j] = 0;
- res_man.Res_close(1);
+ res_man.close(1);
// all objects but george
- res_man.Kill_all_objects(0);
+ res_man.killAllObjects(0);
// reopen global variables resource & send address to interpreter - it
// won't be moving
- // SetGlobalInterpreterVariables((int32 *) (res_man.Res_open(1) + sizeof(_standardHeader)));
- // res_man.Res_close(1);
+ // SetGlobalInterpreterVariables((int32 *) (res_man.open(1) + sizeof(_standardHeader)));
+ // res_man.close(1);
// FOR THE DEMO - FORCE THE SCROLLING TO BE RESET! (James29may97)
// - this is taken from FN_init_background
Index: icons.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/icons.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- icons.cpp 27 Sep 2003 11:02:56 -0000 1.9
+++ icons.cpp 30 Sep 2003 09:27:26 -0000 1.10
@@ -92,9 +92,9 @@
// Call menu builder script which will register all carried menu
// objects. Run the 'build_menu' script in the 'menu_master' object
- head = res_man.Res_open(MENU_MASTER_OBJECT);
+ head = res_man.open(MENU_MASTER_OBJECT);
RunScript((char*) head, (char*) head, &null_pc);
- res_man.Res_close(MENU_MASTER_OBJECT);
+ res_man.close(MENU_MASTER_OBJECT);
// Compare new with old. Anything in master thats not in new gets
// removed from master - if found in new too, remove from temp
@@ -196,7 +196,7 @@
icon_coloured = 1;
}
- icon = res_man.Res_open(master_menu_list[j].icon_resource) + sizeof(_standardHeader);
+ icon = res_man.open(master_menu_list[j].icon_resource) + sizeof(_standardHeader);
// The coloured icon is stored directly after the
// greyed out one.
@@ -205,7 +205,7 @@
icon += (RDMENU_ICONWIDE * RDMENU_ICONDEEP);
SetMenuIcon(RDMENU_BOTTOM, j, icon);
- res_man.Res_close(res);
+ res_man.close(res);
} else {
// no icon here
SetMenuIcon(RDMENU_BOTTOM, j, NULL);
@@ -234,7 +234,7 @@
// rest will grey out
for (j = 0; j < ARRAYSIZE(icon_list); j++) {
- icon = res_man.Res_open(icon_list[j]) + sizeof(_standardHeader);
+ icon = res_man.open(icon_list[j]) + sizeof(_standardHeader);
// The only case when an icon is grayed is when the player
// is dead. Then SAVE is not available.
@@ -243,7 +243,7 @@
icon += (RDMENU_ICONWIDE * RDMENU_ICONDEEP);
SetMenuIcon(RDMENU_TOP, j, icon);
- res_man.Res_close(icon_list[j]);
+ res_man.close(icon_list[j]);
}
ShowMenu(RDMENU_TOP);
Index: layers.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/layers.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- layers.cpp 27 Sep 2003 11:02:56 -0000 1.8
+++ layers.cpp 30 Sep 2003 09:27:26 -0000 1.9
@@ -89,7 +89,7 @@
// each cycle
// file points to 1st byte in the layer file
- file = res_man.Res_open(this_screen.background_layer_id);
+ file = res_man.open(this_screen.background_layer_id);
screen_head = FetchScreenHeader(file);
@@ -186,7 +186,7 @@
}
// close the screen file
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
SetUpBackgroundLayers();
@@ -208,7 +208,7 @@
// open resource & set pointers to headers
// file points to 1st byte in the layer file
- file = res_man.Res_open(this_screen.background_layer_id);
+ file = res_man.open(this_screen.background_layer_id);
screen_head = FetchScreenHeader(file);
@@ -237,6 +237,6 @@
}
// close the screen file
- res_man.Res_close(this_screen.background_layer_id);
+ res_man.close(this_screen.background_layer_id);
}
}
Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/logic.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- logic.cpp 30 Sep 2003 06:40:01 -0000 1.16
+++ logic.cpp 30 Sep 2003 09:27:26 -0000 1.17
@@ -62,7 +62,7 @@
// processing on the current list
while (_pc != 0xffffffff) {
- head = (_standardHeader*) res_man.Res_open(run_list);
+ head = (_standardHeader*) res_man.open(run_list);
if (head->fileType != RUN_LIST)
Con_fatal_error("Logic_engine %d not a run_list", run_list);
@@ -76,7 +76,7 @@
// release the list again so it can float in memory - at this
// point not one thing should be locked
- res_man.Res_close(run_list);
+ res_man.close(run_list);
debug(5, "%d", ID);
@@ -86,7 +86,7 @@
return 0;
}
- head = (_standardHeader*) res_man.Res_open(ID);
+ head = (_standardHeader*) res_man.open(ID);
if (head->fileType != GAME_OBJECT)
Con_fatal_error("Logic_engine %d not an object", ID);
@@ -132,7 +132,7 @@
raw_data_ad = (char*) head;
- far_head = (_standardHeader*) res_man.Res_open(script / SIZE);
+ far_head = (_standardHeader*) res_man.open(script / SIZE);
if (far_head->fileType != GAME_OBJECT && far_head->fileType != SCREEN_MANAGER)
Con_fatal_error("Logic_engine %d not a far object (its a %d)", script / SIZE, far_head->fileType);
@@ -147,7 +147,7 @@
ret = RunScript(raw_script_ad, raw_data_ad, &_curObjectHub->script_pc[LEVEL]);
// close foreign object again
- res_man.Res_close(script / SIZE);
+ res_man.close(script / SIZE);
// reset to us for service script
raw_script_ad = raw_data_ad;
@@ -203,7 +203,7 @@
// and that's it so close the object resource
- res_man.Res_close(ID);
+ res_man.close(ID);
}
// leaving a room so remove all ids that must reboot correctly
@@ -328,14 +328,14 @@
if (_currentRunList) {
// open and lock in place
- game_object_list = (uint32 *) (res_man.Res_open(_currentRunList) + sizeof(_standardHeader));
+ game_object_list = (uint32 *) (res_man.open(_currentRunList) + sizeof(_standardHeader));
Print_to_console("runlist number %d", _currentRunList);
while(*(game_object_list)) {
- file_header = (_standardHeader*) res_man.Res_open(*(game_object_list));
+ file_header = (_standardHeader*) res_man.open(*(game_object_list));
Print_to_console(" %d %s", *(game_object_list), file_header->name);
- res_man.Res_close(*(game_object_list++));
+ res_man.close(*(game_object_list++));
scrolls++;
Build_display();
@@ -361,7 +361,7 @@
}
}
- res_man.Res_close(_currentRunList);
+ res_man.close(_currentRunList);
} else
Print_to_console("no run list set");
@@ -440,7 +440,7 @@
void logic::processKillList(void) {
for (uint32 j = 0; j < kills; j++)
- res_man.Remove_res(object_kill_list[j]);
+ res_man.remove(object_kill_list[j]);
kills = 0;
}
Index: maketext.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/maketext.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- maketext.cpp 29 Sep 2003 06:48:48 -0000 1.15
+++ maketext.cpp 30 Sep 2003 09:27:26 -0000 1.16
@@ -283,7 +283,7 @@
memset(linePtr, NO_COL, sizeOfSprite);
// open font file
- charSet = res_man.Res_open(fontRes);
+ charSet = res_man.open(fontRes);
// fill sprite with characters, one line at a time
@@ -317,7 +317,7 @@
}
// close font file
- res_man.Res_close(fontRes);
+ res_man.close(fontRes);
// unlock the sprite memory block, so it's movable
Float_mem(textSprite);
@@ -334,14 +334,14 @@
uint16 width;
// open font file
- charSet = res_man.Res_open(fontRes);
+ charSet = res_man.open(fontRes);
// move to approp. sprite (header)
charFrame = FindChar(ch, charSet);
width = charFrame->width;
// close font file
- res_man.Res_close(fontRes);
+ res_man.close(fontRes);
// return its width
return width;
@@ -356,14 +356,14 @@
uint16 height;
// open font file
- charSet = res_man.Res_open(fontRes);
+ charSet = res_man.open(fontRes);
// assume all chars the same height, i.e. FIRST_CHAR is as good as any
charFrame = FindChar(FIRST_CHAR, charSet);
height = charFrame->height;
// close font file
- res_man.Res_close(fontRes);
+ res_man.close(fontRes);
// return its height
return height;
@@ -625,7 +625,7 @@
uint8 language;
// open the text resource
- textFile = res_man.Res_open(TEXT_RES);
+ textFile = res_man.open(TEXT_RES);
// If language is Polish or Finnish it requires alternate fonts.
// Otherwise, use regular fonts
@@ -662,7 +662,7 @@
SetWindowName((char*) textLine);
// now ok to close the text file
- res_man.Res_close(TEXT_RES);
+ res_man.close(TEXT_RES);
}
// called from the above function, and also from console.cpp
Index: mem_view.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/mem_view.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- mem_view.cpp 27 Sep 2003 11:02:57 -0000 1.10
+++ mem_view.cpp 30 Sep 2003 09:27:26 -0000 1.11
@@ -44,9 +44,9 @@
j = base_mem_block;
do {
if (mem_list[j].uid < 65536) {
- file_header = (_standardHeader*) res_man.Res_open(mem_list[j].uid);
+ file_header = (_standardHeader*) res_man.open(mem_list[j].uid);
// close immediately so give a true count
- res_man.Res_close(mem_list[j].uid);
+ res_man.close(mem_list[j].uid);
debug(5, "view %d", mem_list[j].uid);
@@ -73,10 +73,10 @@
mem_list[j].size / 1024,
(mem_list[j].size * 100) / total_free_memory,
mem_list[j].uid,
- res_man.Fetch_cluster(mem_list[j].uid),
+ res_man.fetchCluster(mem_list[j].uid),
file_header->name,
- res_man.Fetch_age(mem_list[j].uid),
- res_man.Fetch_count(mem_list[j].uid));
+ res_man.fetchAge(mem_list[j].uid),
+ res_man.fetchCount(mem_list[j].uid));
} else
Print_to_console(" %d is an illegal resource", mem_list[j].uid);
} else {
@@ -182,5 +182,5 @@
sprintf(string,
"locked(%u)+float(%u)+free(%u) = %u/%u blocks (%u%% used)(cur %uk)",
mem_locked, mem_floating, mem_free, blocksUsed, MAX_mem_blocks,
- percent, (res_man.Res_fetch_useage() / 1024));
+ percent, (res_man.fetchUsage() / 1024));
}
Index: memory.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/memory.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- memory.cpp 27 Sep 2003 11:02:57 -0000 1.8
+++ memory.cpp 30 Sep 2003 09:27:26 -0000 1.9
@@ -498,7 +498,7 @@
while (VirtualDefrag(size)) {
// trash the oldest closed resource
- if (!res_man.Help_the_aged_out()) {
+ if (!res_man.helpTheAgedOut()) {
error("Twalloc ran out of memory: size=%d type=%d unique_id=%d", size, type, unique_id);
}
}
Index: memory.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/memory.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- memory.h 17 Sep 2003 06:28:06 -0000 1.2
+++ memory.h 30 Sep 2003 09:27:26 -0000 1.3
@@ -28,7 +28,7 @@
uint32 size;
int32 parent; // who is before us
int32 child; // who is after us
- // id of a position in the resList or some other unique id - for the
+ // id of a position in the _resList or some other unique id - for the
// visual display only
uint32 uid;
uint8 *ad;
Index: mouse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/mouse.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- mouse.cpp 27 Sep 2003 11:02:57 -0000 1.18
+++ mouse.cpp 30 Sep 2003 09:27:26 -0000 1.19
@@ -209,9 +209,9 @@
for (j = 0; j < ARRAYSIZE(icon_list); j++) {
// change all others to grey
if (j != hit) {
- icon = res_man.Res_open(icon_list[j]) + sizeof(_standardHeader);
+ icon = res_man.open(icon_list[j]) + sizeof(_standardHeader);
SetMenuIcon(RDMENU_TOP, j, icon);
- res_man.Res_close( icon_list[j] );
+ res_man.close( icon_list[j] );
}
}
@@ -798,8 +798,8 @@
mouse_pointer_res = res;
if (res) {
- icon = res_man.Res_open(res) + sizeof(_standardHeader);
- len = res_man.resList[res]->size - sizeof(_standardHeader);
+ icon = res_man.open(res) + sizeof(_standardHeader);
+ len = res_man._resList[res]->size - sizeof(_standardHeader);
// don't pulse the normal pointer - just do the regular anim
// loop
@@ -809,7 +809,7 @@
else
SetMouseAnim(icon, len, RDMOUSE_FLASH);
- res_man.Res_close(res);
+ res_man.close(res);
} else {
// blank cursor
SetMouseAnim(NULL, 0, 0);
@@ -823,12 +823,12 @@
real_luggage_item = res;
if (res) {
- icon = res_man.Res_open(res) + sizeof(_standardHeader);
- len = res_man.resList[res]->size - sizeof(_standardHeader);
+ icon = res_man.open(res) + sizeof(_standardHeader);
+ len = res_man._resList[res]->size - sizeof(_standardHeader);
SetLuggageAnim(icon, len);
- res_man.Res_close(res);
+ res_man.close(res);
} else
SetLuggageAnim(NULL, 0);
}
@@ -1017,7 +1017,7 @@
local_text = textId & 0xffff;
// open text file & get the line
- text = FetchTextLine(res_man.Res_open(text_res), local_text);
+ text = FetchTextLine(res_man.open(text_res), local_text);
// 'text+2' to skip the first 2 bytes which form the
// line reference number
@@ -1029,7 +1029,7 @@
speech_font_id, justification);
// now ok to close the text file
- res_man.Res_close(text_res);
+ res_man.close(text_res);
}
}
}
@@ -1153,7 +1153,7 @@
// Trash all object resources so they load in fresh & restart
// their logic scripts
- res_man.Kill_all_objects(0);
+ res_man.killAllObjects(0);
BS2_SetPalette(0, 1, black, RDPAL_INSTANT);
}
Index: protocol.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/protocol.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- protocol.cpp 27 Sep 2003 11:02:57 -0000 1.11
+++ protocol.cpp 30 Sep 2003 09:27:26 -0000 1.12
@@ -204,8 +204,8 @@
uint8 *FetchObjectName(int32 resourceId) {
_standardHeader *header;
- header = (_standardHeader*) res_man.Res_open(resourceId);
- res_man.Res_close(resourceId);
+ header = (_standardHeader*) res_man.open(resourceId);
+ res_man.close(resourceId);
// note this pointer is no longer valid, but it should be ok until
// another resource is opened!
Index: resman.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/resman.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- resman.cpp 27 Sep 2003 15:44:26 -0000 1.45
+++ resman.cpp 30 Sep 2003 09:27:26 -0000 1.46
@@ -39,8 +39,8 @@
#include "mouse.h" // for system Set_mouse & Set_luggage routines
#include "protocol.h"
#include "resman.h"
-#include "sound.h" // (James22july97) for Clear_fx_queue() called from CacheNewCluster()
-#include "sword2.h" // (James11aug97) for CloseGame()
+#include "sound.h" // for Clear_fx_queue() called from cacheNewCluster()
+#include "sword2.h" // for CloseGame()
#include "router.h"
// ---------------------------------------------------------------------------
@@ -59,7 +59,7 @@
[...1025 lines suppressed...]
index = 0;
- while (cdDrives[index] != 0 && !done && index < 24) {
- sprintf(cdPath, "%c:\\", cdDrives[index]);
+ while (_cdDrives[index] != 0 && !done && index < 24) {
+ sprintf(_cdPath, "%c:\\", _cdDrives[index]);
- if (!SVM_GetVolumeInformation(cdPath, sCDName, _MAX_PATH, NULL, &dwMaxCompLength, &dwFSFlags, NULL, 0)) {
+ if (!SVM_GetVolumeInformation(_cdPath, sCDName, _MAX_PATH, NULL, &dwMaxCompLength, &dwFSFlags, NULL, 0)) {
sCDName[0] = 0;
}
- if (!scumm_stricmp(sCDName,CD1_LABEL)) {
+ if (!scumm_stricmp(sCDName, CD1_LABEL)) {
if (cd == CD1)
done = true;
- } else if (!scumm_stricmp(sCDName,CD2_LABEL)) {
+ } else if (!scumm_stricmp(sCDName, CD2_LABEL)) {
if (cd == CD2)
done = true;
}
Index: resman.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/resman.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- resman.h 26 Sep 2003 10:07:18 -0000 1.4
+++ resman.h 30 Sep 2003 09:27:26 -0000 1.5
@@ -24,91 +24,90 @@
#define MAX_res_files 20
+#if 0
#define RES_locked 1
#define RES_perm 2
+#endif
-
-class resMan {
+class ResourceManager {
public:
- void InitResMan(void); // read in the config file
- void Close_ResMan(void);
+ void init(void); // read in the config file
+ void exit(void);
// Returns ad of resource. Loads if not in memory. Retains a count.
// Resource can be aged out of memory if count = 0
// The resource is locked while count != 0
// Resource floats when count = 0
- uint8 *Res_open(uint32 res);
- void Res_close(uint32 res); // decrements the count
+ uint8 *open(uint32 res);
+ void close(uint32 res); // decrements the count
// returns '0' if resource out of range or null, otherwise '1' for ok
- uint8 Res_check_valid(uint32 res);
+ uint8 checkValid(uint32 res);
//for mem_view to query the owners of mem blocs
- char *Fetch_cluster(uint32 res);
- uint32 Fetch_age(uint32 res);
- uint32 Fetch_count(uint32 count);
+ char *fetchCluster(uint32 res);
+ uint32 fetchAge(uint32 res);
+ uint32 fetchCount(uint32 count);
- uint32 Help_the_aged_out(void);
+ uint32 helpTheAgedOut(void);
- uint32 Res_fetch_len(uint32 res);
+ uint32 fetchLen(uint32 res);
- void Res_next_cycle( void );
- uint32 Res_fetch_useage( void );
+ void nextCycle(void);
+ uint32 fetchUsage(void);
// Prompts the user for the specified CD.
- void GetCd(int cd);
+ void getCd(int cd);
- int WhichCd() {
- return curCd;
+ int whichCd() {
+ return _curCd;
}
// ----console commands
- void Print_console_clusters(void);
- void Examine_res(uint8 *input);
- void Kill_all_res(uint8 wantInfo);
- void Kill_all_objects(uint8 wantInfo);
- void Remove_res(uint32 res);
- void Remove_all_res(void);
- void Kill_res(uint8 *res);
- char *GetCdPath(void);
+ void printConsoleClusters(void);
+ void examine(uint8 *input);
+ void kill(uint8 *res);
+ void killAll(uint8 wantInfo);
+ void killAllObjects(uint8 wantInfo);
+ void remove(uint32 res);
+ void removeAll(void);
// pointer to a pointer (or list of pointers in-fact)
- mem **resList;
+ mem **_resList;
private:
- int curCd;
- uint32 total_res_files;
- uint32 total_clusters;
- uint32 current_memory_useage;
+ int _curCd;
+ uint32 _totalResFiles;
+ uint32 _totalClusters;
+ uint32 _currentMemoryUsage;
- // Inc's each time Res_open is called and is given to resource as its
- // age. Ccannot be allowed to start at 0! (A pint if you can tell me
- // why)
+ // Inc's each time open is called and is given to resource as its age.
+ // Cannot be allowed to start at 0! (A pint if you can tell me why)
- uint32 resTime;
+ uint32 _resTime;
- uint32 *age;
+ uint32 *_age;
// Gode generated res-id to res number/rel number conversion table
- uint16 *res_conv_table;
+ uint16 *_resConvTable;
- uint16 *count;
- char resource_files[MAX_res_files][20];
- uint8 cdTab[MAX_res_files]; // Location of each cluster.
+ uint16 *_count;
+ char _resourceFiles[MAX_res_files][20];
+ uint8 _cdTab[MAX_res_files]; // Location of each cluster.
// Drive letter of the CD-ROM drive or false CD path.
- char cdPath[256];
+ char _cdPath[256];
- void CacheNewCluster(uint32 newCluster);
- char cdDrives[24];
+ void cacheNewCluster(uint32 newCluster);
+ char _cdDrives[24];
};
-extern resMan res_man; //declare the object global
+extern ResourceManager res_man; //declare the object global
#endif
Index: router.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/router.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- router.cpp 27 Sep 2003 11:02:57 -0000 1.16
+++ router.cpp 30 Sep 2003 09:27:26 -0000 1.17
@@ -2732,7 +2732,7 @@
for (entry = 0; entry < MAX_WALKGRIDS; entry++) {
if (walkGridList[entry]) {
// open walk grid file
- fPolygrid = res_man.Res_open(walkGridList[entry]);
+ fPolygrid = res_man.open(walkGridList[entry]);
fPolygrid += sizeof(_standardHeader);
memmove((uint8 *) &floorHeader, fPolygrid, sizeof(_walkGridHeader));
fPolygrid += sizeof(_walkGridHeader);
@@ -2774,7 +2774,7 @@
}
// close walk grid file
- res_man.Res_close(walkGridList[entry]);
+ res_man.close(walkGridList[entry]);
// increment counts of total bars & nodes in whole
// walkgrid
Index: save_rest.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/save_rest.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- save_rest.cpp 30 Sep 2003 06:40:01 -0000 1.20
+++ save_rest.cpp 30 Sep 2003 09:27:26 -0000 1.21
@@ -163,7 +163,7 @@
uint32 FindBufferSize(void) {
// size of savegame header + size of global variables
- return (sizeof(g_header) + res_man.Res_fetch_len(1));
+ return (sizeof(g_header) + res_man.fetchLen(1));
}
void FillSaveBuffer(mem *buffer, uint32 size, uint8 *desc) {
@@ -177,7 +177,7 @@
sprintf(g_header.description, "%s", (char*) desc);
// length of global variables resource
- g_header.varLength = res_man.Res_fetch_len(1);
+ g_header.varLength = res_man.fetchLen(1);
// resource id of current screen file
g_header.screenId = this_screen.background_layer_id;
@@ -193,8 +193,8 @@
g_header.music_id = looping_music_id;
// object hub
- memcpy(&g_header.player_hub, res_man.Res_open(CUR_PLAYER_ID) + sizeof(_standardHeader), sizeof(_object_hub));
- res_man.Res_close(CUR_PLAYER_ID);
+ memcpy(&g_header.player_hub, res_man.open(CUR_PLAYER_ID) + sizeof(_standardHeader), sizeof(_object_hub));
+ res_man.close(CUR_PLAYER_ID);
// logic, graphic & mega structures
// copy the 4 essential player object structures into the header
@@ -212,7 +212,7 @@
// copy the global variables to the buffer
// open variables resource
- varsRes = res_man.Res_open(1);
+ varsRes = res_man.open(1);
// copy that to the buffer, following the header
memcpy(buffer->ad + sizeof(g_header), varsRes, FROM_LE_32(g_header.varLength));
@@ -226,7 +226,7 @@
#endif
// close variables resource
- res_man.Res_close(1);
+ res_man.close(1);
// set the checksum & copy that to the buffer (James05aug97)
@@ -368,7 +368,7 @@
// shorter than the current expected length
// if header contradicts actual current size of global variables
- if (g_header.varLength != res_man.Res_fetch_len(1)) {
+ if (g_header.varLength != res_man.fetchLen(1)) {
Free_mem(buffer);
// error: incompatible save-data - can't use!
@@ -379,7 +379,7 @@
// trash all resources from memory except player object & global
// variables
- res_man.Kill_all_res(0);
+ res_man.killAll(0);
// clean out the system kill list (no more objects to kill)
LLogic.resetKillList();
@@ -387,9 +387,9 @@
// get player character data from savegame buffer
// object hub is just after the standard header
- memcpy(res_man.Res_open(CUR_PLAYER_ID) + sizeof(_standardHeader), &g_header.player_hub, sizeof(_object_hub));
+ memcpy(res_man.open(CUR_PLAYER_ID) + sizeof(_standardHeader), &g_header.player_hub, sizeof(_object_hub));
- res_man.Res_close(CUR_PLAYER_ID);
+ res_man.close(CUR_PLAYER_ID);
// fill in the 4 essential player object structures from the header
PutPlayerStructures();
@@ -397,7 +397,7 @@
// get variables resource from the savegame buffer
// open variables resource
- varsRes = res_man.Res_open(1);
+ varsRes = res_man.open(1);
// copy that to the buffer, following the header
memcpy(varsRes, buffer->ad + sizeof(g_header), g_header.varLength );
@@ -411,7 +411,7 @@
#endif
// close variables resource
- res_man.Res_close(1);
+ res_man.close(1);
// free it now, rather than in RestoreGame, to unblock memory before
// new screen & runlist loaded
@@ -515,14 +515,14 @@
char *raw_script_ad;
_standardHeader *head;
- head = (_standardHeader*) res_man.Res_open(CUR_PLAYER_ID);
+ head = (_standardHeader*) res_man.open(CUR_PLAYER_ID);
if (head->fileType != GAME_OBJECT)
Con_fatal_error("incorrect CUR_PLAYER_ID=%d", CUR_PLAYER_ID);
raw_script_ad = (char *) head;
RunScript(raw_script_ad, raw_script_ad, &null_pc);
- res_man.Res_close(CUR_PLAYER_ID);
+ res_man.close(CUR_PLAYER_ID);
}
void PutPlayerStructures(void) {
@@ -534,7 +534,7 @@
char *raw_script_ad;
_standardHeader *head;
- head = (_standardHeader*) res_man.Res_open(CUR_PLAYER_ID);
+ head = (_standardHeader*) res_man.open(CUR_PLAYER_ID);
if (head->fileType != GAME_OBJECT)
Con_fatal_error("incorrect CUR_PLAYER_ID=%d", CUR_PLAYER_ID);
@@ -572,7 +572,7 @@
}
RunScript(raw_script_ad, raw_script_ad, &null_pc);
- res_man.Res_close(CUR_PLAYER_ID);
+ res_man.close(CUR_PLAYER_ID);
}
int32 FN_pass_player_savedata(int32 *params) {
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sound.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- sound.cpp 27 Sep 2003 11:02:57 -0000 1.18
+++ sound.cpp 30 Sep 2003 09:27:26 -0000 1.19
@@ -109,12 +109,12 @@
if (fxq[j].type == FX_SPOT) {
// load in the sample
- data = res_man.Res_open(fxq[j].resource);
+ data = res_man.open(fxq[j].resource);
data += sizeof(_standardHeader);
// wav data gets copied to sound memory
rv = g_sound->PlayFx(id, data, fxq[j].volume, fxq[j].pan, RDSE_FXSPOT);
// release the sample
- res_man.Res_close(fxq[j].resource);
+ res_man.close(fxq[j].resource);
} else {
// random & looped fx are already loaded into sound memory
// by FN_play_fx()
@@ -204,7 +204,7 @@
if (fxq[j].type == FX_SPOT) {
// "pre-load" the sample; this gets it into memory
- data = res_man.Res_open(fxq[j].resource);
+ data = res_man.open(fxq[j].resource);
#ifdef _SWORD2_DEBUG
header = (_standardHeader*) data;
@@ -213,14 +213,14 @@
#endif
// but then releases it to "age" out if the space is needed
- res_man.Res_close(fxq[j].resource);
+ res_man.close(fxq[j].resource);
} else {
// random & looped fx
id = (uint32) j + 1; // because 0 is not a valid id
// load in the sample
- data = res_man.Res_open(fxq[j].resource);
+ data = res_man.open(fxq[j].resource);
#ifdef _SWORD2_DEBUG
header = (_standardHeader*)data;
@@ -237,7 +237,7 @@
debug(5, "SFX ERROR: OpenFx() returned %.8x", rv);
// release the sample
- res_man.Res_close(fxq[j].resource);
+ res_man.close(fxq[j].resource);
}
// (James07uag97)
@@ -399,7 +399,7 @@
} else {
File f;
- sprintf(filename, "music%d.clu", res_man.WhichCd());
+ sprintf(filename, "music%d.clu", res_man.whichCd());
if (f.open(filename))
f.close();
else
Index: speech.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/speech.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- speech.cpp 30 Sep 2003 06:40:01 -0000 1.24
+++ speech.cpp 30 Sep 2003 09:27:26 -0000 1.25
@@ -219,9 +219,9 @@
for (j = 0; j < 15; j++) {
if (j < IN_SUBJECT) {
debug(5, " ICON res %d for %d", subject_list[j].res, j);
- icon = res_man.Res_open(subject_list[j].res) + sizeof(_standardHeader) + RDMENU_ICONWIDE * RDMENU_ICONDEEP;
+ icon = res_man.open(subject_list[j].res) + sizeof(_standardHeader) + RDMENU_ICONWIDE * RDMENU_ICONDEEP;
SetMenuIcon(RDMENU_BOTTOM, (uint8) j, icon);
- res_man.Res_close(subject_list[j].res);
+ res_man.close(subject_list[j].res);
} else {
//no icon here
debug(5, " NULL for %d", j);
@@ -267,9 +267,9 @@
// change all others to grey
if (j != hit) {
- icon = res_man.Res_open( subject_list[j].res ) + sizeof(_standardHeader);
+ icon = res_man.open( subject_list[j].res ) + sizeof(_standardHeader);
SetMenuIcon(RDMENU_BOTTOM, (uint8) j, icon);
- res_man.Res_close(subject_list[j].res);
+ res_man.close(subject_list[j].res);
}
}
@@ -373,7 +373,7 @@
int32 target = params[0];
// request status of target
- head = (_standardHeader*) res_man.Res_open(target);
+ head = (_standardHeader*) res_man.open(target);
if (head->fileType != GAME_OBJECT)
Con_fatal_error("FN_they_do %d not an object", target);
@@ -382,7 +382,7 @@
//call the base script - this is the graphic/mouse service call
RunScript(raw_script_ad, raw_script_ad, &null_pc);
- res_man.Res_close(target);
+ res_man.close(target);
// result is 1 for waiting, 0 for busy
@@ -437,7 +437,7 @@
// ok, see if the target is busy - we must request this info from the
// target object
- head = (_standardHeader*) res_man.Res_open(target);
+ head = (_standardHeader*) res_man.open(target);
if (head->fileType != GAME_OBJECT)
Con_fatal_error("FN_they_do_we_wait %d not an object", target);
@@ -446,7 +446,7 @@
// call the base script - this is the graphic/mouse service call
RunScript(raw_script_ad, raw_script_ad, &null_pc);
- res_man.Res_close(target);
+ res_man.close(target);
ob_logic = (Object_logic *) params[0];
@@ -516,7 +516,7 @@
int32 target = params[0];
// request status of target
- head = (_standardHeader*) res_man.Res_open(target);
+ head = (_standardHeader*) res_man.open(target);
if (head->fileType != GAME_OBJECT)
Con_fatal_error("FN_we_wait %d not an object", target);
@@ -525,7 +525,7 @@
// call the base script - this is the graphic/mouse service call
RunScript(raw_script_ad, raw_script_ad, &null_pc);
- res_man.Res_close(target);
+ res_man.close(target);
// result is 1 for waiting, 0 for busy
@@ -564,7 +564,7 @@
ob_logic->looping = params[2]; //first time in
// request status of target
- head = (_standardHeader*) res_man.Res_open(target);
+ head = (_standardHeader*) res_man.open(target);
if (head->fileType != GAME_OBJECT)
Con_fatal_error("FN_timed_wait %d not an object", target);
@@ -573,7 +573,7 @@
// call the base script - this is the graphic/mouse service call
RunScript(raw_script_ad, raw_script_ad, &null_pc);
- res_man.Res_close(target);
+ res_man.close(target);
// result is 1 for waiting, 0 for busy
@@ -1010,9 +1010,9 @@
// if the resource number is within range & it's not
// a null resource
- if (res_man.Res_check_valid(text_res)) {
+ if (res_man.checkValid(text_res)) {
// open the resource
- head = (_standardHeader*) res_man.Res_open(text_res);
+ head = (_standardHeader*) res_man.open(text_res);
if (head->fileType == TEXT_FILE) {
// if it's not an animation file
@@ -1027,7 +1027,7 @@
}
// close the resource
- res_man.Res_close(text_res);
+ res_man.close(text_res);
if (RESULT)
return IR_CONT;
@@ -1048,11 +1048,11 @@
local_text = params[S_TEXT] & 0xffff;
// open text file & get the line
- text = FetchTextLine(res_man.Res_open(text_res), local_text);
+ text = FetchTextLine(res_man.open(text_res), local_text);
officialTextNumber = READ_LE_UINT16(text);
// now ok to close the text file
- res_man.Res_close(text_res);
+ res_man.close(text_res);
#ifdef _SWORD2_DEBUG
// prevent dud lines from appearing while testing text & speech
@@ -1191,7 +1191,7 @@
File fp;
- sprintf(speechFile, "speech%d.clu", res_man.WhichCd());
+ sprintf(speechFile, "speech%d.clu", res_man.whichCd());
if (fp.open(speechFile))
fp.close();
@@ -1234,7 +1234,7 @@
ob_graphic->anim_pc++;
// open the anim file
- anim_file = res_man.Res_open(ob_graphic->anim_resource);
+ anim_file = res_man.open(ob_graphic->anim_resource);
anim_head = FetchAnimHeader(anim_file);
if (!speech_anim_type) {
@@ -1264,7 +1264,7 @@
}
// close the anim file
- res_man.Res_close(ob_graphic->anim_resource);
+ res_man.close(ob_graphic->anim_resource);
} else if (speech_anim_type) {
// Placed here so we actually display the last frame of the
// anim.
@@ -1436,7 +1436,7 @@
// build_display.cpp
// open animation file & set up the necessary pointers
- file = res_man.Res_open(anim_id);
+ file = res_man.open(anim_id);
anim_head = FetchAnimHeader(file);
@@ -1488,7 +1488,7 @@
text_y -= this_screen.scroll_offset_y;
// release the anim resource
- res_man.Res_close(anim_id);
+ res_man.close(anim_id);
}
}
@@ -1542,7 +1542,7 @@
local_text = params[S_TEXT] & 0xffff;
// open text file & get the line
- text = FetchTextLine(res_man.Res_open(text_res), local_text);
+ text = FetchTextLine(res_man.open(text_res), local_text);
// 'text + 2' to skip the first 2 bytes which form the line
// reference number
@@ -1553,7 +1553,7 @@
POSITION_AT_CENTRE_OF_BASE);
// now ok to close the text file
- res_man.Res_close(text_res);
+ res_man.close(text_res);
// set speech duration, in case not using wav
// no. of cycles = (no. of chars) + 30
@@ -1583,7 +1583,7 @@
// if we specifically need CD1 or CD2 (ie. it's not on both)
// then check it's there (& ask for it if it's not there)
if (cd == 1 || cd == 2)
- res_man.GetCd(cd);
+ res_man.getCd(cd);
}
#endif
Index: startup.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/startup.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- startup.cpp 27 Sep 2003 11:02:57 -0000 1.14
+++ startup.cpp 30 Sep 2003 09:27:27 -0000 1.15
@@ -124,12 +124,12 @@
// - need to check in case un-built sections included in
// start list
- if (res_man.Res_check_valid(res)) {
+ if (res_man.checkValid(res)) {
debug(5, "- resource %d ok", res);
- raw_script = (char*) res_man.Res_open(res);
+ raw_script = (char*) res_man.open(res);
null_pc = 0;
RunScript(raw_script, raw_script, &null_pc);
- res_man.Res_close(res);
+ res_man.close(res);
} else
debug(5, "- resource %d invalid", res);
}
@@ -264,12 +264,12 @@
// remove all resources from memory, including player
// object & global variables
- res_man.Remove_all_res();
+ res_man.removeAll();
// reopen global variables resource & send address to
// interpreter - it won't be moving
- SetGlobalInterpreterVariables((int32 *) (res_man.Res_open(1) + sizeof(_standardHeader)));
- res_man.Res_close(1);
+ SetGlobalInterpreterVariables((int32 *) (res_man.open(1) + sizeof(_standardHeader)));
+ res_man.close(1);
// free all the route memory blocks from previous game
FreeAllRouteMem();
@@ -283,8 +283,8 @@
// set the key
// Open George
- raw_data_ad = (char*) (res_man.Res_open(8));
- raw_script = (char*) (res_man.Res_open(start_list[start].start_res_id));
+ raw_data_ad = (char*) (res_man.open(8));
+ raw_script = (char*) (res_man.open(start_list[start].start_res_id));
// denotes script to run
null_pc = start_list[start].key & 0xffff;
@@ -292,10 +292,10 @@
Print_to_console("running start %d", start);
RunScript(raw_script, raw_data_ad, &null_pc);
- res_man.Res_close(start_list[start].start_res_id);
+ res_man.close(start_list[start].start_res_id);
// Close George
- res_man.Res_close(8);
+ res_man.close(8);
// make sure thre's a mouse, in case restarting while
// mouse not available
Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- sword2.cpp 30 Sep 2003 06:40:01 -0000 1.43
+++ sword2.cpp 30 Sep 2003 09:27:27 -0000 1.44
@@ -138,12 +138,12 @@
Init_memory_manager();
// initialise the resource manager
- debug(5, "CALLING: res_man.InitResMan");
- res_man.InitResMan();
+ debug(5, "CALLING: res_man.init");
+ res_man.init();
// initialise global script variables
// res 1 is the globals list
- file = res_man.Res_open(1);
+ file = res_man.open(1);
debug(5, "CALLING: SetGlobalInterpreterVariables");
SetGlobalInterpreterVariables((int32 * ) (file + sizeof(_standardHeader)));
@@ -153,7 +153,7 @@
// DON'T CLOSE PLAYER OBJECT RESOURCE - KEEP IT OPEN IN MEMORY SO IT
// CAN'T MOVE!
- file = res_man.Res_open(8);
+ file = res_man.open(8);
// Set up font resource variables for this language version
@@ -206,7 +206,7 @@
// free the memory again
Close_memory_manager();
- res_man.Close_ResMan();
+ res_man.exit();
}
int32 GameCycle(void) {
@@ -241,7 +241,7 @@
Process_fx_queue();
// update age and calculate previous cycle memory usage
- res_man.Res_next_cycle();
+ res_man.nextCycle();
if (quitGame)
return 1;
@@ -456,19 +456,19 @@
uint32 null_pc = 1;
// open george object, ready for start script to reference
- raw_data_ad = (char *) res_man.Res_open(8);
+ raw_data_ad = (char *) res_man.open(8);
// open the ScreenManager object
- raw_script = (char *) res_man.Res_open(screen_manager_id);
+ raw_script = (char *) res_man.open(screen_manager_id);
// run the start script now (because no console)
RunScript(raw_script, raw_data_ad, &null_pc);
// close the ScreenManager object
- res_man.Res_close(screen_manager_id);
+ res_man.close(screen_manager_id);
// close george
- res_man.Res_close(8);
+ res_man.close(8);
debug(5, "Start_game() DONE.");
}
@@ -477,10 +477,10 @@
// uint8 *text;
// open text file & get the line "PAUSED"
- // text = FetchTextLine(res_man.Res_open(3258), 449);
+ // text = FetchTextLine(res_man.open(3258), 449);
// pause_text_bloc_no = Build_new_block(text + 2, 320, 210, 640, 184, RDSPR_TRANS | RDSPR_DISPLAYALIGN, SPEECH_FONT_ID, POSITION_AT_CENTRE_OF_BASE);
// now ok to close the text file
- // res_man.Res_close(3258);
+ // res_man.close(3258);
// don't allow Pause while screen fading or while black (James 03sep97)
if (GetFadeStatus() != RDFADE_NONE)
Index: walker.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/walker.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- walker.cpp 27 Sep 2003 11:02:57 -0000 1.8
+++ walker.cpp 30 Sep 2003 09:27:27 -0000 1.9
@@ -270,7 +270,7 @@
if (ob_logic->looping == 0) {
// open anim file
- anim_file = res_man.Res_open(params[4]);
+ anim_file = res_man.open(params[4]);
// point to animation header
anim_head = FetchAnimHeader( anim_file );
@@ -280,7 +280,7 @@
pars[6] = anim_head->feetStartDir; // target_dir
// close anim file
- res_man.Res_close(params[4]);
+ res_man.close(params[4]);
// if start coords not yet set in anim header, use the standby
// coords (which should be set beforehand in the script)
@@ -428,7 +428,7 @@
// open the anim file & set up a pointer to the animation header
// open anim file
- anim_file = res_man.Res_open(params[2]);
+ anim_file = res_man.open(params[2]);
anim_head = FetchAnimHeader(anim_file);
// set up the parameter list for FN_walk_to()
@@ -455,7 +455,7 @@
Con_fatal_error("Invalid direction (%d) in FN_stand_after_anim", pars[4]);
// close the anim file
- res_man.Res_close(params[2]);
+ res_man.close(params[2]);
// call FN_stand_at() with target coords set to anim end position
return FN_stand_at(pars);
@@ -475,7 +475,7 @@
// open the anim file & set up a pointer to the animation header
// open anim file
- anim_file = res_man.Res_open(params[2]);
+ anim_file = res_man.open(params[2]);
anim_head = FetchAnimHeader(anim_file);
// set up the parameter list for FN_walk_to()
@@ -502,7 +502,7 @@
Con_fatal_error("Invalid direction (%d) in FN_stand_after_anim", pars[4]);
// close the anim file
- res_man.Res_close(params[2]);
+ res_man.close(params[2]);
// call FN_stand_at() with target coords set to anim end position
return FN_stand_at(pars);
@@ -599,7 +599,7 @@
if (ob_logic->looping == 0) {
// get targets info
- head = (_standardHeader*) res_man.Res_open(params[4]);
+ head = (_standardHeader*) res_man.open(params[4]);
if (head->fileType != GAME_OBJECT)
Con_fatal_error("FN_face_mega %d not an object", params[4]);
@@ -609,7 +609,7 @@
//call the base script - this is the graphic/mouse service call
RunScript(raw_script_ad, raw_script_ad, &null_pc);
- res_man.Res_close(params[4]);
+ res_man.close(params[4]);
// engine_mega is now the Object_mega of mega we want to turn
// to face
@@ -662,7 +662,7 @@
// not been here before so decide where to walk-to
if (!ob_logic->looping) {
// first request the targets info
- head = (_standardHeader*) res_man.Res_open(params[4]);
+ head = (_standardHeader*) res_man.open(params[4]);
if (head->fileType != GAME_OBJECT)
Con_fatal_error("FN_walk_to_talk_to_mega %d not an object", params[4]);
@@ -673,7 +673,7 @@
// call
RunScript(raw_script_ad, raw_script_ad, &null_pc);
- res_man.Res_close(params[4]);
+ res_man.close(params[4]);
// engine_mega is now the Object_mega of mega we want to
// route to
@@ -739,8 +739,8 @@
AddWalkGrid(params[0]);
// Touch the grid, getting it into memory.
- res_man.Res_open(params[0]);
- res_man.Res_close(params[0]);
+ res_man.open(params[0]);
+ res_man.close(params[0]);
return IR_CONT;
}
More information about the Scummvm-git-logs
mailing list