aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--Makefile.common4
-rw-r--r--Makefile.mingw2
-rw-r--r--common/engine.cpp6
-rw-r--r--common/engine.h10
-rw-r--r--common/gameDetector.cpp14
-rwxr-xr-xconfigure4
-rw-r--r--sword2/anims.cpp56
-rw-r--r--sword2/build_display.cpp46
-rw-r--r--sword2/build_display.h2
-rw-r--r--sword2/console.cpp4
-rw-r--r--sword2/console.h6
-rw-r--r--sword2/controls.cpp84
-rw-r--r--sword2/debug.cpp8
-rw-r--r--sword2/debug.h6
-rw-r--r--sword2/driver/d_sound.cpp100
-rw-r--r--sword2/driver/d_sound.h6
-rw-r--r--sword2/driver/driver96.h4
-rw-r--r--sword2/driver/misc.cpp2
-rw-r--r--sword2/driver/rdwin.cpp6
-rw-r--r--sword2/function.cpp10
-rw-r--r--sword2/icons.cpp2
-rw-r--r--sword2/interpreter.h6
-rw-r--r--sword2/layers.cpp6
-rw-r--r--sword2/logic.cpp2
-rw-r--r--sword2/maketext.cpp10
-rw-r--r--sword2/mouse.cpp24
-rw-r--r--sword2/protocol.cpp10
-rw-r--r--sword2/resman.cpp24
-rw-r--r--sword2/router.cpp10
-rw-r--r--sword2/save_rest.cpp2
-rw-r--r--sword2/sound.cpp58
-rw-r--r--sword2/speech.cpp54
-rw-r--r--sword2/startup.cpp6
-rw-r--r--sword2/sword2.cpp66
-rw-r--r--sword2/sword2.h12
36 files changed, 337 insertions, 337 deletions
diff --git a/Makefile b/Makefile
index cbb34fba62..acf02e4f19 100644
--- a/Makefile
+++ b/Makefile
@@ -71,7 +71,7 @@ LIBS += -lmad
# DISABLE_SCUMM = 1
# DISABLE_SIMON = 1
# DISABLE_SKY = 1
-DISABLE_BS2 = 1
+DISABLE_SWORD2 = 1
#######################################################################
diff --git a/Makefile.common b/Makefile.common
index 255accfa8c..48b83ee4f9 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -42,8 +42,8 @@ else
MODULES += sky
endif
-ifdef DISABLE_BS2
-DEFINES += -DDISABLE_BS2
+ifdef DISABLE_SWORD
+DEFINES += -DDISABLE_SWORD2
else
MODULES += bs2
endif
diff --git a/Makefile.mingw b/Makefile.mingw
index 7ffabe4102..966dddb518 100644
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -53,7 +53,7 @@ LIBS += -lvorbisfile -lvorbis -logg
# DISABLE_SCUMM = 1
# DISABLE_SIMON = 1
# DISABLE_SKY = 1
-DISABLE_BS2 = 1
+DISABLE_SWORD2 = 1
#######################################################################
diff --git a/common/engine.cpp b/common/engine.cpp
index 8c1132431e..1955df16fd 100644
--- a/common/engine.cpp
+++ b/common/engine.cpp
@@ -144,10 +144,10 @@ Engine *Engine::createFromDetector(GameDetector *detector, OSystem *syst) {
}
#endif
-#ifndef DISABLE_BS2
- if (detector->_game.id >= GID_BS2_FIRST && detector->_game.id <= GID_BS2_LAST) {
+#ifndef DISABLE_SWORD2
+ if (detector->_game.id >= GID_SWORD2_FIRST && detector->_game.id <= GID_SWORD2_LAST) {
// Broken Sword 2
- engine = Engine_BS2_create(detector, syst);
+ engine = Engine_SWORD2_create(detector, syst);
}
#endif
diff --git a/common/engine.h b/common/engine.h
index 5015f670e8..e1385ea428 100644
--- a/common/engine.h
+++ b/common/engine.h
@@ -41,8 +41,8 @@ enum GameId {
GID_SKY_LAST = GID_SKY_FIRST + 49,
// Broken Sword 2
- GID_BS2_FIRST,
- GID_BS2_LAST = GID_BS2_FIRST + 49
+ GID_SWORD2_FIRST,
+ GID_SWORD2_LAST = GID_SWORD2_FIRST + 49
};
@@ -116,9 +116,9 @@ extern const VersionSettings *Engine_SKY_targetList();
extern Engine *Engine_SKY_create(GameDetector *detector, OSystem *syst);
#endif
-#ifndef DISABLE_BS2
-extern const VersionSettings *Engine_BS2_targetList();
-extern Engine *Engine_BS2_create(GameDetector *detector, OSystem *syst);
+#ifndef DISABLE_SWORD2
+extern const VersionSettings *Engine_SWORD2_targetList();
+extern Engine *Engine_SWORD2_create(GameDetector *detector, OSystem *syst);
#endif
#endif
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp
index 15ca149510..af2061a712 100644
--- a/common/gameDetector.cpp
+++ b/common/gameDetector.cpp
@@ -231,10 +231,10 @@ GameDetector::GameDetector() {
totalCount += skyCount;
#endif
-#ifndef DISABLE_BS2
- const VersionSettings *bs2Versions = Engine_BS2_targetList();
- int bs2Count = countVersions(bs2Versions);
- totalCount += bs2Count;
+#ifndef DISABLE_SWORD2
+ const VersionSettings *sword2Versions = Engine_SWORD2_targetList();
+ int sword2Count = countVersions(sword2Versions);
+ totalCount += sword2Count;
#endif
VersionSettings *v = (VersionSettings *)calloc(totalCount + 1, sizeof(VersionSettings));
@@ -255,9 +255,9 @@ GameDetector::GameDetector() {
v += skyCount;
#endif
-#ifndef DISABLE_BS2
- memcpy(v, bs2Versions, bs2Count * sizeof(VersionSettings));
- v += bs2Count;
+#ifndef DISABLE_SWORD2
+ memcpy(v, sword2Versions, sword2Count * sizeof(VersionSettings));
+ v += sword2Count;
#endif
}
diff --git a/configure b/configure
index 55edfe7633..ed2b52507d 100755
--- a/configure
+++ b/configure
@@ -282,9 +282,9 @@ else
fi
if test "$_build_bs2" = no ; then
- _def_bs2='#define DISABLE_BS2'
+ _def_bs2='#define DISABLE_SWORD2'
else
- _def_bs2='#undef DISABLE_BS2'
+ _def_bs2='#undef DISABLE_SWORD2'
fi
#
diff --git a/sword2/anims.cpp b/sword2/anims.cpp
index cd31e429fd..7850af0af7 100644
--- a/sword2/anims.cpp
+++ b/sword2/anims.cpp
@@ -107,7 +107,7 @@ int32 Animate(int32 *params, uint8 reverse_flag)
_animHeader *anim_head;
int32 res = params[2];
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
_standardHeader *head; // for animation testing & checking for correct file type
#endif
@@ -123,7 +123,7 @@ int32 Animate(int32 *params, uint8 reverse_flag)
if (ob_logic->looping==0)
{
//-----------------------------------------------------------
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
// For testing all anims! (James18apr97)
// A script loop can send every resource number to the anim function
// & it will only run the valid ones
@@ -153,7 +153,7 @@ int32 Animate(int32 *params, uint8 reverse_flag)
//-----------------------------------------------------------
//---------------------
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
// check that we haven't been passed a zero resource number
if (res==0)
Con_fatal_error("Animate: %s (id %d) passed zero anim resource (%s line %u)", FetchObjectName(ID), ID, __FILE__, __LINE__);
@@ -163,7 +163,7 @@ int32 Animate(int32 *params, uint8 reverse_flag)
anim_file = res_man.Res_open(res); // open anim file
//---------------------
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
// check this this resource is actually an animation file!
head = (_standardHeader*) anim_file;
if (head->fileType!=ANIMATION_FILE) // if it's not an animation file
@@ -175,7 +175,7 @@ int32 Animate(int32 *params, uint8 reverse_flag)
//---------------------
/*
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
// check there's at least one frame
if (anim_head->noAnimFrames==0)
Con_fatal_error("Animate: %s (%d) has zero frame count! (%s line %u)", FetchObjectName(res), res, __FILE__, __LINE__);
@@ -289,12 +289,12 @@ int32 FN_set_frame(int32 *params)
_animHeader *anim_head;
int32 res = params[1];
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
_standardHeader *head; // for checking for correct file type
#endif
//---------------------
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
// check that we haven't been passed a zero resource number
if (res==0)
Con_fatal_error("FN_set_frame: %s (id %d) passed zero anim resource (%s line %u)", FetchObjectName(ID), ID, __FILE__, __LINE__);
@@ -307,7 +307,7 @@ int32 FN_set_frame(int32 *params)
anim_file = res_man.Res_open(res); // open anim file
//---------------------
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
// check this this resource is actually an animation file!
head = (_standardHeader*) anim_file;
if (head->fileType!=ANIMATION_FILE) // if it's not an animation file
@@ -319,7 +319,7 @@ int32 FN_set_frame(int32 *params)
//---------------------
/*
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
// check there's at least one frame
if (anim_head->noAnimFrames==0)
Con_fatal_error("FN_set_frame: %s (%d) has zero frame count! (%s line %u)", FetchObjectName(res), res, __FILE__, __LINE__);
@@ -515,7 +515,7 @@ int32 FN_add_sequence_text(int32 *params) // (James22may97)
// 1 frame number to start the text displaying
// 2 frame number to stop the text dispalying
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (sequenceTextLines == MAX_SEQUENCE_TEXT_LINES)
Con_fatal_error("FN_add_sequence_text ran out of lines (%s line %u)",__FILE__,__LINE__);
#endif
@@ -563,7 +563,7 @@ void CreateSequenceSpeech(_movieTextObject *sequenceText[]) // (James23may97)
//--------------------------------------
// Write to walkthrough file (zebug0.txt)
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
Zdebug(0,"(%d) SEQUENCE TEXT: %s", *(uint16*)text, text+2); // 1st word of text line is the official line number
#endif
//--------------------------------------
@@ -579,11 +579,11 @@ void CreateSequenceSpeech(_movieTextObject *sequenceText[]) // (James23may97)
// set up path to speech cluster
// first checking if we have speech1.clu or speech2.clu in current directory (for translators to test)
- if (g_bs2->_gameId == GID_BS2_DEMO) {
+ if (g_sword2->_gameId == GID_SWORD2_DEMO) {
strcpy(speechFile,"SPEECH.CLU");
} else {
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if ((res_man.WhichCd()==1) && (!access("speech1.clu",0))) // if 0 ie. if it's there
{
strcpy(speechFile,"speech1.clu");
@@ -593,7 +593,7 @@ void CreateSequenceSpeech(_movieTextObject *sequenceText[]) // (James23may97)
strcpy(speechFile,"speech2.clu");
}
else
- #endif // _BS2_DEBUG
+ #endif // _SWORD2_DEBUG
{
strcpy(speechFile,res_man.GetCdPath());
strcat(speechFile,"CLUSTERS\\SPEECH.CLU");
@@ -601,7 +601,7 @@ void CreateSequenceSpeech(_movieTextObject *sequenceText[]) // (James23may97)
}
//------------------------------
- wavSize = g_bs2->_sound->GetCompSpeechSize(speechFile, wavId); // returns size of decompressed wav, or 0 if wav not found
+ wavSize = g_sword2->_sound->GetCompSpeechSize(speechFile, wavId); // returns size of decompressed wav, or 0 if wav not found
if (wavSize) // if we've got the wav
{
// allocate memory for speech buffer
@@ -609,7 +609,7 @@ void CreateSequenceSpeech(_movieTextObject *sequenceText[]) // (James23may97)
if (sequence_text_list[line].speech_mem) // if mem allocated ok (should be fine, but worth checking)
{
- if (g_bs2->_sound->PreFetchCompSpeech(speechFile, wavId, sequence_text_list[line].speech_mem->ad) == RD_OK) // Load speech & decompress to our buffer
+ if (g_sword2->_sound->PreFetchCompSpeech(speechFile, wavId, sequence_text_list[line].speech_mem->ad) == RD_OK) // Load speech & decompress to our buffer
{
Float_mem (sequence_text_list[line].speech_mem); // now float this buffer so we can make space for the next text sprites and/or speech samples
speechRunning=1; // ok, we've got speech!
@@ -706,7 +706,7 @@ int32 FN_smacker_lead_in(int32 *params) // James(21july97)
{
uint8 *leadIn;
uint32 rv;
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
_standardHeader *header;
#endif
@@ -714,7 +714,7 @@ int32 FN_smacker_lead_in(int32 *params) // James(21july97)
leadIn = res_man.Res_open(params[0]);
//-----------------------------------------
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
header = (_standardHeader*)leadIn;
if (header->fileType != WAV_FILE)
Con_fatal_error("FN_smacker_lead_in() given invalid resource (%s line %u)",__FILE__,__LINE__);
@@ -722,10 +722,10 @@ int32 FN_smacker_lead_in(int32 *params) // James(21july97)
//-----------------------------------------
leadIn += sizeof(_standardHeader);
- rv = g_bs2->_sound->PlayFx( 0, leadIn, 0, 0, RDSE_FXLEADIN ); // wav data gets copied to sound memory
+ rv = g_sword2->_sound->PlayFx( 0, leadIn, 0, 0, RDSE_FXLEADIN ); // wav data gets copied to sound memory
//-----------------------------------------
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (rv)
Zdebug("SFX ERROR: PlayFx() returned %.8x (%s line %u)", rv, __FILE__, __LINE__);
#endif
@@ -755,7 +755,7 @@ int32 FN_play_sequence(int32 *params) // James(09apr97)
uint32 rv; // drivers return value
_movieTextObject *sequenceSpeechArray[MAX_SEQUENCE_TEXT_LINES+1];
uint8 *leadOut = NULL;
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
_standardHeader *header;
#endif
@@ -794,14 +794,14 @@ int32 FN_play_sequence(int32 *params) // James(09apr97)
//--------------------------------------------------
// check that the name paseed from script is 8 chars or less
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (strlen((char *)params[0]) > 8)
Con_fatal_error("Sequence filename too long (%s line %u)",__FILE__,__LINE__);
#endif
//--------------------------------------------------
// add the appropriate file extension & play it
- if (g_bs2->_gameId == GID_BS2_DEMO)
+ if (g_sword2->_gameId == GID_SWORD2_DEMO)
sprintf(filename,"%s.smk", (char *)params[0]);
else
sprintf(filename,"%sSMACKS\\%s.smk", res_man.GetCdPath(), (char *)params[0]);
@@ -809,7 +809,7 @@ int32 FN_play_sequence(int32 *params) // James(09apr97)
//--------------------------------------
// Write to walkthrough file (zebug0.txt)
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
Zdebug(0,"PLAYING SEQUENCE \"%s\"", filename);
#endif
//--------------------------------------
@@ -826,7 +826,7 @@ int32 FN_play_sequence(int32 *params) // James(09apr97)
leadOut = res_man.Res_open(smackerLeadOut);
//---------------------------
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
header = (_standardHeader*)leadOut;
if (header->fileType != WAV_FILE)
Con_fatal_error("FN_smacker_lead_out() given invalid resource (%s line %u)",__FILE__,__LINE__);
@@ -840,7 +840,7 @@ int32 FN_play_sequence(int32 *params) // James(09apr97)
// play the smacker
FN_stop_music(NULL); // don't want to carry on streaming game music when smacker starts!
- g_bs2->_sound->PauseFxForSequence(); // pause sfx during sequence, except the one used for lead-in music
+ g_sword2->_sound->PauseFxForSequence(); // pause sfx during sequence, except the one used for lead-in music
if (sequenceTextLines) // if we have some text to accompany this sequence
rv = PlaySmacker(filename, sequenceSpeechArray, leadOut);
@@ -857,7 +857,7 @@ int32 FN_play_sequence(int32 *params) // James(09apr97)
}
*/
- g_bs2->_sound->UnpauseFx(); // unpause sound fx again, in case we're staying in same location
+ g_sword2->_sound->UnpauseFx(); // unpause sound fx again, in case we're staying in same location
//--------------------------------------
// close the lead-out music resource
@@ -869,7 +869,7 @@ int32 FN_play_sequence(int32 *params) // James(09apr97)
}
//--------------------------
// check the error return-value
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (rv)
Zdebug("PlaySmacker(\"%s\") returned 0x%.8x", filename, rv);
#endif
diff --git a/sword2/build_display.cpp b/sword2/build_display.cpp
index f13a1eede3..76c6624164 100644
--- a/sword2/build_display.cpp
+++ b/sword2/build_display.cpp
@@ -70,7 +70,7 @@ uint32 cur_fore;
uint32 cur_fgp0;
uint32 cur_fgp1;
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
uint32 largest_layer_area=0; // should be reset to zero at start of each screen change
uint32 largest_sprite_area=0; // - " -
char largest_layer_info[128] = {"largest layer: none registered"};
@@ -119,13 +119,13 @@ void Send_fore_par1_frames(void); //James23Jan97
void Build_display(void) //Tony21Sept96
{
BOOL end;
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
uint8 pal[12]={0,0,0,0,0,0,0,0,0,255,0,0};
#endif
uint8 *file;
_multiScreenHeader *screenLayerTable;
-#ifdef _BS2_DEBUG // only used by console
+#ifdef _SWORD2_DEBUG // only used by console
_spriteInfo spriteInfo;
uint32 rv; // drivers error return value
#endif
@@ -136,7 +136,7 @@ void Build_display(void) //Tony21Sept96
{
Start_new_palette(); // start the layer palette fading up
- #ifdef _BS2_DEBUG // (James23jun97)
+ #ifdef _SWORD2_DEBUG // (James23jun97)
largest_layer_area=0; // should be reset to zero at start of each screen change
largest_sprite_area=0; // - " -
#endif
@@ -283,7 +283,7 @@ void Build_display(void) //Tony21Sept96
}
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
else if (console_status)
{
spriteInfo.x = 0;
@@ -312,7 +312,7 @@ void Build_display(void) //Tony21Sept96
SetPalette(0, 3, pal, RDPAL_INSTANT); //force the palette
Print_to_console("no valid screen?");
}
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
}
@@ -585,7 +585,7 @@ void Process_layer(uint32 layer_number) //Tony24Sept96
_spriteInfo spriteInfo;
uint32 rv;
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
uint32 current_layer_area=0;
#endif
@@ -610,7 +610,7 @@ void Process_layer(uint32 layer_number) //Tony24Sept96
//------------------------------------------
// check for largest layer for debug info
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
current_layer_area = layer_head->width * layer_head->height;
if (current_layer_area > largest_layer_area)
@@ -640,7 +640,7 @@ void Process_image(buildit *build_unit) // (5nov96 JEL)
uint32 spriteType;
uint32 rv;
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
uint32 current_sprite_area=0;
#endif
@@ -702,7 +702,7 @@ void Process_image(buildit *build_unit) // (5nov96 JEL)
//------------------------------------------
// check for largest layer for debug info
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
current_sprite_area = frame_head->width * frame_head->height;
if (current_sprite_area > largest_sprite_area)
@@ -715,7 +715,7 @@ void Process_image(buildit *build_unit) // (5nov96 JEL)
//-----------------------------------------------------------
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (SYSTEM_TESTING_ANIMS) // see anims.cpp
{
if ((spriteInfo.x + spriteInfo.scaledWidth) >= 639) // bring the anim into the visible screen
@@ -739,7 +739,7 @@ void Process_image(buildit *build_unit) // (5nov96 JEL)
//-----------------------------------------------------------
//--------------------------------------------------
-// #ifdef _BS2_DEBUG
+// #ifdef _SWORD2_DEBUG
// if (frame_head->width <= 1)
// {
// Zdebug(8,"WARNING: 1-pixel-wide frame found in %s (%d)", FetchObjectName(build_unit->anim_resource), build_unit->anim_resource);
@@ -817,7 +817,7 @@ void Register_frame(int32 *params, buildit *build_unit) // (1nov96JEL)
ob_graph = (Object_graphic *) params[1];
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (ob_graph->anim_resource == 0)
Con_fatal_error("ERROR: %s(%d) has no anim resource in Register_frame [line=%d file=%s]", FetchObjectName(ID), ID, __LINE__, __FILE__);
#endif
@@ -829,7 +829,7 @@ void Register_frame(int32 *params, buildit *build_unit) // (1nov96JEL)
frame_head = FetchFrameHeader( file, ob_graph->anim_pc );
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (ID == CUR_PLAYER_ID) // update player graphic details for on-screen debug info
{
playerGraphic.type = ob_graph->type;
@@ -891,7 +891,7 @@ void Register_frame(int32 *params, buildit *build_unit) // (1nov96JEL)
if (ob_mouse->pointer) // only if 'pointer' isn't NULL (James13feb97)
{
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (cur_mouse==TOTAL_mouse_list)
Con_fatal_error("ERROR: mouse_list full [%s line %u]",__FILE__,__LINE__);
#endif
@@ -942,7 +942,7 @@ int32 FN_register_frame(int32 *params) // (27nov96 JEL)
//---------------
case BGP0_SPRITE:
{
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (cur_bgp0==MAX_bgp0_sprites)
Con_fatal_error("ERROR: bgp0_list full in FN_register_frame [line=%d file=%s]",__LINE__,__FILE__);
#endif
@@ -954,7 +954,7 @@ int32 FN_register_frame(int32 *params) // (27nov96 JEL)
//---------------
case BGP1_SPRITE:
{
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (cur_bgp1==MAX_bgp1_sprites)
Con_fatal_error("ERROR: bgp1_list full in FN_register_frame [line=%d file=%s]",__LINE__,__FILE__);
#endif
@@ -966,7 +966,7 @@ int32 FN_register_frame(int32 *params) // (27nov96 JEL)
//---------------
case BACK_SPRITE:
{
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (cur_back==MAX_back_sprites)
Con_fatal_error("ERROR: back_list full in FN_register_frame [line=%d file=%s]",__LINE__,__FILE__);
#endif
@@ -978,7 +978,7 @@ int32 FN_register_frame(int32 *params) // (27nov96 JEL)
//---------------
case SORT_SPRITE:
{
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (cur_sort==MAX_sort_sprites)
Con_fatal_error("ERROR: sort_list full in FN_register_frame [line=%d file=%s]",__LINE__,__FILE__);
#endif
@@ -992,7 +992,7 @@ int32 FN_register_frame(int32 *params) // (27nov96 JEL)
//---------------
case FORE_SPRITE:
{
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (cur_fore==MAX_fore_sprites)
Con_fatal_error("ERROR: fore_list full in FN_register_frame [line=%d file=%s]",__LINE__,__FILE__);
#endif
@@ -1004,7 +1004,7 @@ int32 FN_register_frame(int32 *params) // (27nov96 JEL)
//---------------
case FGP0_SPRITE:
{
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (cur_fgp0==MAX_fgp0_sprites)
Con_fatal_error("ERROR: fgp0_list full in FN_register_frame [line=%d file=%s]",__LINE__,__FILE__);
#endif
@@ -1016,7 +1016,7 @@ int32 FN_register_frame(int32 *params) // (27nov96 JEL)
//---------------
case FGP1_SPRITE:
{
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (cur_fgp1==MAX_fgp1_sprites)
Con_fatal_error("ERROR: fgp1_list full in FN_register_frame [line=%d file=%s]",__LINE__,__FILE__);
#endif
@@ -1178,7 +1178,7 @@ void SetFullPalette(int32 palRes) // James17jun97
{
head = (_standardHeader*)res_man.Res_open(palRes); // open the palette file
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (head->fileType != PALETTE_FILE)
Con_fatal_error("FN_set_palette() called with invalid resource! (%s line %u)",__FILE__,__LINE__);
#endif
diff --git a/sword2/build_display.h b/sword2/build_display.h
index 2fbfb3b313..fa48933bd0 100644
--- a/sword2/build_display.h
+++ b/sword2/build_display.h
@@ -58,7 +58,7 @@ extern uint32 cur_fore;
extern uint32 cur_fgp0;
extern uint32 cur_fgp1;
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
extern char largest_layer_info[128];
extern char largest_sprite_info[128];
#endif
diff --git a/sword2/console.cpp b/sword2/console.cpp
index 66f4bd7a11..d6bed2ce34 100644
--- a/sword2/console.cpp
+++ b/sword2/console.cpp
@@ -23,7 +23,7 @@
uint32 console_status=0; //0 off // LEFT IN RELEASE VERSION
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
//-----------------------------------------------------------------------------------------------------------------------
//its the console! <great>
@@ -1339,4 +1339,4 @@ void Scroll_console(void) {};
void Init_console(void) {};
void StartConsole(void) {};
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
diff --git a/sword2/console.h b/sword2/console.h
index 7f68174996..ffec1d51d8 100644
--- a/sword2/console.h
+++ b/sword2/console.h
@@ -23,7 +23,7 @@
#include "driver/driver96.h"
#include "memory.h"
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
void Init_console(void); //Tony9Sept96
uint32 One_console(void); //Tony12Aug96
@@ -45,7 +45,7 @@ extern uint8 grabbingSequences;
extern uint8 wantSfxDebug; // sfx debug file enabled/disabled from console
-#else // _BS2_DEBUG
+#else // _SWORD2_DEBUG
/*
#define Init_console NULL
#define One_console NULL
@@ -73,7 +73,7 @@ void Scroll_console(void);
//#define Var_check NULL
//#define Var_set NULL
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
extern uint32 console_status;
diff --git a/sword2/controls.cpp b/sword2/controls.cpp
index 3c004427ab..2e9ac6941d 100644
--- a/sword2/controls.cpp
+++ b/sword2/controls.cpp
@@ -1566,7 +1566,7 @@ void Restart_control(void) //Tony4Apr97
FreeAllRouteMem(); // free all the route memory blocks from previous game
- g_bs2->Start_game(); // call the same function that first started us up
+ g_sword2->Start_game(); // call the same function that first started us up
//prime system with a game cycle
@@ -1929,12 +1929,12 @@ int32 ReadOptionSettings(void) //pete10Jun97
fclose(fp);
- g_bs2->_sound->SetMusicVolume(buff[0]);
- g_bs2->_sound->SetSpeechVolume(buff[1]);
- g_bs2->_sound->SetFxVolume(buff[2]);
- g_bs2->_sound->MuteMusic(buff[3]);
- g_bs2->_sound->MuteSpeech(buff[4]);
- g_bs2->_sound->MuteFx(buff[5]);
+ g_sword2->_sound->SetMusicVolume(buff[0]);
+ g_sword2->_sound->SetSpeechVolume(buff[1]);
+ g_sword2->_sound->SetFxVolume(buff[2]);
+ g_sword2->_sound->MuteMusic(buff[3]);
+ g_sword2->_sound->MuteSpeech(buff[4]);
+ g_sword2->_sound->MuteFx(buff[5]);
UpdateGraphicsLevel(GetRenderType(), buff[6]); // (James13jun97)
@@ -1944,7 +1944,7 @@ int32 ReadOptionSettings(void) //pete10Jun97
pointerTextSelected = buff[8];
if (buff[9] != stereoReversed)
- g_bs2->_sound->ReverseStereo();
+ g_sword2->_sound->ReverseStereo();
stereoReversed = buff[9];
@@ -1956,12 +1956,12 @@ int32 WriteOptionSettings(void) //pete10Jun97
uint8 buff[10];
FILE *fp;
- buff[0] = g_bs2->_sound->GetMusicVolume();
- buff[1] = g_bs2->_sound->GetSpeechVolume();
- buff[2] = g_bs2->_sound->GetFxVolume();
- buff[3] = g_bs2->_sound->IsMusicMute();
- buff[4] = g_bs2->_sound->IsSpeechMute();
- buff[5] = g_bs2->_sound->IsFxMute();
+ buff[0] = g_sword2->_sound->GetMusicVolume();
+ buff[1] = g_sword2->_sound->GetSpeechVolume();
+ buff[2] = g_sword2->_sound->GetFxVolume();
+ buff[3] = g_sword2->_sound->IsMusicMute();
+ buff[4] = g_sword2->_sound->IsSpeechMute();
+ buff[5] = g_sword2->_sound->IsFxMute();
buff[6] = GetRenderType();
buff[7] = subtitles;
buff[8] = pointerTextSelected;
@@ -2094,9 +2094,9 @@ void Option_control(void) //Pete6Jun97
int title_len, subtitle_len, ok_len, cancel_len, left_align, test_len;
// slider values
- uint8 musicVolume = g_bs2->_sound->GetMusicVolume();
- uint8 speechVolume = g_bs2->_sound->GetSpeechVolume();
- uint8 fxVolume = g_bs2->_sound->GetFxVolume();
+ uint8 musicVolume = g_sword2->_sound->GetMusicVolume();
+ uint8 speechVolume = g_sword2->_sound->GetSpeechVolume();
+ uint8 fxVolume = g_sword2->_sound->GetFxVolume();
uint8 grfxLevel = GetRenderType();
// safe slider values for restoring on cancel
@@ -2197,9 +2197,9 @@ void Option_control(void) //Pete6Jun97
uint8 subtitle_state = subtitles;
uint8 stereo_state = stereoReversed;
- uint8 music_mute_state = g_bs2->_sound->IsMusicMute();
- uint8 speech_mute_state = g_bs2->_sound->IsSpeechMute();
- uint8 fx_mute_state = g_bs2->_sound->IsFxMute();
+ uint8 music_mute_state = g_sword2->_sound->IsMusicMute();
+ uint8 speech_mute_state = g_sword2->_sound->IsSpeechMute();
+ uint8 fx_mute_state = g_sword2->_sound->IsFxMute();
//build the button surfaces surfaces
@@ -2359,19 +2359,19 @@ void Option_control(void) //Pete6Jun97
}
if (!music_mute_state)
- g_bs2->_sound->SetMusicVolume(musicVolume);
+ g_sword2->_sound->SetMusicVolume(musicVolume);
else
- g_bs2->_sound->SetMusicVolume(0);
+ g_sword2->_sound->SetMusicVolume(0);
if (!fx_mute_state)
- g_bs2->_sound->SetFxVolume(fxVolume);
+ g_sword2->_sound->SetFxVolume(fxVolume);
else
- g_bs2->_sound->SetFxVolume(0);
+ g_sword2->_sound->SetFxVolume(0);
if (!speech_mute_state)
- g_bs2->_sound->SetSpeechVolume(speechVolume);
+ g_sword2->_sound->SetSpeechVolume(speechVolume);
else
- g_bs2->_sound->SetSpeechVolume(0);
+ g_sword2->_sound->SetSpeechVolume(0);
//--------------------------------------------------
// Service windows
@@ -2555,19 +2555,19 @@ void Option_control(void) //Pete6Jun97
{
UpdateGraphicsLevel(safe_grfxLevel, grfxLevel); // (James13jun97)
- g_bs2->_sound->MuteMusic(music_mute_state); // Ensure all the levels are recorded correctly (Pete21Aug97)
- g_bs2->_sound->MuteSpeech(speech_mute_state);
- g_bs2->_sound->MuteFx(fx_mute_state);
- g_bs2->_sound->SetMusicVolume(music_target);
- g_bs2->_sound->SetSpeechVolume(speech_target);
- g_bs2->_sound->SetFxVolume(fx_target);
+ g_sword2->_sound->MuteMusic(music_mute_state); // Ensure all the levels are recorded correctly (Pete21Aug97)
+ g_sword2->_sound->MuteSpeech(speech_mute_state);
+ g_sword2->_sound->MuteFx(fx_mute_state);
+ g_sword2->_sound->SetMusicVolume(music_target);
+ g_sword2->_sound->SetSpeechVolume(speech_target);
+ g_sword2->_sound->SetFxVolume(fx_target);
subtitles = subtitle_state; // Save object label and subtitle settings
pointerTextSelected = object_state;
speechSelected = !speech_mute_state;
if (stereo_state != stereoReversed)
- g_bs2->_sound->ReverseStereo();
+ g_sword2->_sound->ReverseStereo();
stereoReversed = stereo_state;
WriteOptionSettings();
@@ -2591,17 +2591,17 @@ void Option_control(void) //Pete6Jun97
if (touching_music_mute && dmusic_mute_state) {
music_mute_state = dmusic_mute_state = 0; // if the button was in now let it out
- g_bs2->_sound->MuteMusic(0);
+ g_sword2->_sound->MuteMusic(0);
}
if (touching_fx_mute && dfx_mute_state) {
fx_mute_state = dfx_mute_state = 0; // if the button was in now let it out
- g_bs2->_sound->MuteFx(0);
+ g_sword2->_sound->MuteFx(0);
}
if (touching_speech_mute && dspeech_mute_state) {
speech_mute_state = dspeech_mute_state = 0; // if the button was in now let it out
- g_bs2->_sound->MuteSpeech(0);
+ g_sword2->_sound->MuteSpeech(0);
}
// Stop tracking any sliders
@@ -2649,7 +2649,7 @@ void Option_control(void) //Pete6Jun97
else
{
music_mute_state = 1;
- g_bs2->_sound->MuteMusic(1);
+ g_sword2->_sound->MuteMusic(1);
}
}
@@ -2660,7 +2660,7 @@ void Option_control(void) //Pete6Jun97
else
{
fx_mute_state=1;
- g_bs2->_sound->MuteFx(1);
+ g_sword2->_sound->MuteFx(1);
}
}
@@ -2671,7 +2671,7 @@ void Option_control(void) //Pete6Jun97
else
{
speech_mute_state=1;
- g_bs2->_sound->MuteSpeech(1);
+ g_sword2->_sound->MuteSpeech(1);
}
}
@@ -2680,7 +2680,7 @@ void Option_control(void) //Pete6Jun97
if (music_mute_state)
{
music_mute_state = 0;
- g_bs2->_sound->MuteMusic(0);
+ g_sword2->_sound->MuteMusic(0);
}
if (mousex>(slab_sprite[0].x+SLIDER_W))
@@ -2707,7 +2707,7 @@ void Option_control(void) //Pete6Jun97
if (speech_mute_state)
{
speech_mute_state = 0;
- g_bs2->_sound->MuteSpeech(0);
+ g_sword2->_sound->MuteSpeech(0);
}
if (mousex>(slab_sprite[1].x+SLIDER_W))
@@ -2734,7 +2734,7 @@ void Option_control(void) //Pete6Jun97
if (fx_mute_state)
{
fx_mute_state = 0;
- g_bs2->_sound->MuteFx(0);
+ g_sword2->_sound->MuteFx(0);
}
if (mousex>(slab_sprite[2].x+SLIDER_W))
diff --git a/sword2/debug.cpp b/sword2/debug.cpp
index 9c2274fe18..3264eafb84 100644
--- a/sword2/debug.cpp
+++ b/sword2/debug.cpp
@@ -26,7 +26,7 @@
#include "debug.h"
//--------------------------------------------------------------------------------------
-#ifdef _BS2_DEBUG // this whole file (except ExitWithReport) only included on debug versions
+#ifdef _SWORD2_DEBUG // this whole file (except ExitWithReport) only included on debug versions
#include <stdlib.h>
@@ -86,7 +86,7 @@ void Make_debug_text_block( char *text, int16 x, int16 y );
void Plot_cross_hair( int16 x, int16 y, uint8 pen );
void DrawRect( int16 x, int16 y, int16 x2, int16 y2, uint8 pen );
//--------------------------------------------------------------------------------------
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
// THIS FUNCTION STAYS IN THE RELEASE VERSION
// IN FACT, CON_FATAL_ERROR IS MAPPED TO THIS AS WELL, SO WE HAVE A MORE PRESENTABLE ERROR REPORT
@@ -113,7 +113,7 @@ void ExitWithReport(const char *format,...) // (6dec96 JEL)
exit(0);
}
-#ifdef _BS2_DEBUG // all other functions only for _BS2_DEBUG version
+#ifdef _SWORD2_DEBUG // all other functions only for _SWORD2_DEBUG version
//--------------------------------------------------------------------------------------
void Zdebug(const char *format,...) //Tony's special debug logging file March96
{
@@ -550,5 +550,5 @@ void Print_current_info(void) //Tony30Oct96
void Draw_debug_graphics(void) {};
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
//--------------------------------------------------------------------------------------
diff --git a/sword2/debug.h b/sword2/debug.h
index a9593d6198..fcf537e8d1 100644
--- a/sword2/debug.h
+++ b/sword2/debug.h
@@ -21,7 +21,7 @@
#define D_DEBUG
//--------------------------------------------------------------------------------------
-#ifdef _BS2_DEBUG // this whole file only included on debug versions
+#ifdef _SWORD2_DEBUG // this whole file only included on debug versions
//#include "src\driver96.h"
@@ -69,7 +69,7 @@ void Draw_debug_graphics(void); // James's debug graphics display
void Print_current_info(void); //Tony30Oct96
-#else // ie. not _BS2_DEBUG
+#else // ie. not _SWORD2_DEBUG
/* gcc doesn't like this - khalek
#define Zdebug NULL
@@ -82,7 +82,7 @@ void Zdebug(const char * ,...); // Tony's special debug logging file March96
void Build_debug_text(void); // James's debug text display
void Draw_debug_graphics(void); // James's debug graphics display
-#endif // _BS2_DEBUG // this whole file only included on debug versions
+#endif // _SWORD2_DEBUG // this whole file only included on debug versions
//--------------------------------------------------------------------------------------
void ExitWithReport(const char *format,...); // (6dec96 JEL) IN BOTH DEBUG & RELEASE VERSIONS
diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp
index 6fb8ac6274..64117f6d26 100644
--- a/sword2/driver/d_sound.cpp
+++ b/sword2/driver/d_sound.cpp
@@ -225,7 +225,7 @@
//
// --------------------------------------------------------------------------
//
-// int32 StopSpeechBS2(void)
+// int32 StopSpeechSword2(void)
//
// Stops the speech from playing.
//
@@ -405,7 +405,7 @@ int32 musicVolTable[17] = {
-BS2Sound::BS2Sound(void) {
+Sword2Sound::Sword2Sound(void) {
soundOn = 0;
speechStatus = 0;
@@ -461,7 +461,7 @@ int16 ExpandSpeech(int16 sample)
// --------------------------------------------------------------------------
// This function reverse the pan table, thus reversing the stereo.
// --------------------------------------------------------------------------
-int32 BS2Sound::ReverseStereo(void)
+int32 Sword2Sound::ReverseStereo(void)
{
int32 i,j;
@@ -480,7 +480,7 @@ int32 BS2Sound::ReverseStereo(void)
// --------------------------------------------------------------------------
// This function returns the index of the sound effect with the ID passed in.
// --------------------------------------------------------------------------
-int32 BS2Sound::GetFxIndex(int32 id)
+int32 Sword2Sound::GetFxIndex(int32 id)
{
@@ -498,7 +498,7 @@ int32 BS2Sound::GetFxIndex(int32 id)
}
-int32 BS2Sound::IsFxOpen(int32 id)
+int32 Sword2Sound::IsFxOpen(int32 id)
{
int32 i = 0;
@@ -523,7 +523,7 @@ int32 BS2Sound::IsFxOpen(int32 id)
// out the ones which are no longer required in a buffer. It is called on
// a slow timer from rdwin.c
// --------------------------------------------------------------------------
-void BS2Sound::FxServer(void)
+void Sword2Sound::FxServer(void)
{
warning("stub FxServer");
@@ -586,7 +586,7 @@ void BS2Sound::FxServer(void)
-int32 BS2Sound::InitialiseSound(uint16 freq, uint16 channels, uint16 bitDepth)
+int32 Sword2Sound::InitialiseSound(uint16 freq, uint16 channels, uint16 bitDepth)
{
warning("stub InitaliseSound( %d, %d, %d )", freq, channels, bitDepth);
@@ -672,7 +672,7 @@ int32 BS2Sound::InitialiseSound(uint16 freq, uint16 channels, uint16 bitDepth)
}
-int32 BS2Sound::PlaySpeech(uint8 *data, uint8 vol, int8 pan)
+int32 Sword2Sound::PlaySpeech(uint8 *data, uint8 vol, int8 pan)
{
warning("stub PlaySpeech");
@@ -776,7 +776,7 @@ int32 BS2Sound::PlaySpeech(uint8 *data, uint8 vol, int8 pan)
}
-int32 BS2Sound::AmISpeaking()
+int32 Sword2Sound::AmISpeaking()
{
warning("stub AmISpeaking");
/*
@@ -820,7 +820,7 @@ int32 BS2Sound::AmISpeaking()
}
-int32 BS2Sound::GetCompSpeechSize(const char *filename, uint32 speechid)
+int32 Sword2Sound::GetCompSpeechSize(const char *filename, uint32 speechid)
{
int32 i;
uint32 speechIndex[2];
@@ -857,7 +857,7 @@ int32 BS2Sound::GetCompSpeechSize(const char *filename, uint32 speechid)
}
-int32 BS2Sound::PreFetchCompSpeech(const char *filename, uint32 speechid, uint8 *waveMem)
+int32 Sword2Sound::PreFetchCompSpeech(const char *filename, uint32 speechid, uint8 *waveMem)
{
uint32 i;
uint16 *data16;
@@ -951,7 +951,7 @@ int32 BS2Sound::PreFetchCompSpeech(const char *filename, uint32 speechid, uint8
}
-int32 BS2Sound::PlayCompSpeech(const char *filename, uint32 speechid, uint8 vol, int8 pan)
+int32 Sword2Sound::PlayCompSpeech(const char *filename, uint32 speechid, uint8 vol, int8 pan)
{
warning("stub PlayCompSpeech( %s, %d, %d, %d )", filename, speechid, vol, pan);
/*
@@ -1114,10 +1114,10 @@ int32 BS2Sound::PlayCompSpeech(const char *filename, uint32 speechid, uint8 vol,
}
-int32 BS2Sound::StopSpeechBS2(void)
+int32 Sword2Sound::StopSpeechSword2(void)
{
- warning("stub StopSpeechBS2");
+ warning("stub StopSpeechSword2");
/*
int32 status;
@@ -1146,7 +1146,7 @@ int32 BS2Sound::StopSpeechBS2(void)
-int32 BS2Sound::GetSpeechStatus(void)
+int32 Sword2Sound::GetSpeechStatus(void)
{
warning("stub GetSpeechStatus");
/*
@@ -1175,7 +1175,7 @@ int32 BS2Sound::GetSpeechStatus(void)
}
-void BS2Sound::SetSpeechVolume(uint8 volume)
+void Sword2Sound::SetSpeechVolume(uint8 volume)
{
warning("stub SetSpeechVolume");
/*
@@ -1186,13 +1186,13 @@ void BS2Sound::SetSpeechVolume(uint8 volume)
}
-uint8 BS2Sound::GetSpeechVolume()
+uint8 Sword2Sound::GetSpeechVolume()
{
return speechVol;
}
-void BS2Sound::MuteSpeech(uint8 mute)
+void Sword2Sound::MuteSpeech(uint8 mute)
{
warning("stub MuteSpeech( %d )", mute);
/*
@@ -1209,13 +1209,13 @@ void BS2Sound::MuteSpeech(uint8 mute)
}
-uint8 BS2Sound::IsSpeechMute(void)
+uint8 Sword2Sound::IsSpeechMute(void)
{
return (speechMuted);
}
-int32 BS2Sound::PauseSpeech(void)
+int32 Sword2Sound::PauseSpeech(void)
{
warning("PauseSpeech");
/*
@@ -1228,7 +1228,7 @@ int32 BS2Sound::PauseSpeech(void)
return(RD_OK);
}
-int32 BS2Sound::UnpauseSpeech(void)
+int32 Sword2Sound::UnpauseSpeech(void)
{
warning("UnpauseSpeech");
/*
@@ -1242,7 +1242,7 @@ int32 BS2Sound::UnpauseSpeech(void)
}
-int32 BS2Sound::OpenFx(int32 id, uint8 *data)
+int32 Sword2Sound::OpenFx(int32 id, uint8 *data)
{
warning("stub OpenFx( %d )", id);
@@ -1357,7 +1357,7 @@ int32 BS2Sound::OpenFx(int32 id, uint8 *data)
}
-int32 BS2Sound::PlayFx(int32 id, uint8 *data, uint8 vol, int8 pan, uint8 type)
+int32 Sword2Sound::PlayFx(int32 id, uint8 *data, uint8 vol, int8 pan, uint8 type)
{
warning("stub PlayFx( %d, %d, %d, %d )", id, vol, pan, type);
@@ -1463,7 +1463,7 @@ int32 BS2Sound::PlayFx(int32 id, uint8 *data, uint8 vol, int8 pan, uint8 type)
}
-int32 BS2Sound::SetFxVolumePan(int32 id, uint8 vol, int8 pan)
+int32 Sword2Sound::SetFxVolumePan(int32 id, uint8 vol, int8 pan)
{
warning("stub SetFxVolumePan( %d, %d, %d )", id, vol, pan);
/*
@@ -1479,7 +1479,7 @@ int32 BS2Sound::SetFxVolumePan(int32 id, uint8 vol, int8 pan)
return RD_OK;
}
-int32 BS2Sound::SetFxIdVolume(int32 id, uint8 vol)
+int32 Sword2Sound::SetFxIdVolume(int32 id, uint8 vol)
{
warning("stub SetFxIdVolume( %d, %d )", id, vol);
/*
@@ -1496,7 +1496,7 @@ int32 BS2Sound::SetFxIdVolume(int32 id, uint8 vol)
-int32 BS2Sound::ClearAllFx(void)
+int32 Sword2Sound::ClearAllFx(void)
{
warning("stub ClearAllFx");
@@ -1531,7 +1531,7 @@ int32 BS2Sound::ClearAllFx(void)
}
-int32 BS2Sound::CloseFx(int32 id)
+int32 Sword2Sound::CloseFx(int32 id)
{
warning("stub CloseFx( %d )", id);
@@ -1562,7 +1562,7 @@ int32 BS2Sound::CloseFx(int32 id)
}
-int32 BS2Sound::PauseFx(void)
+int32 Sword2Sound::PauseFx(void)
{
warning("stub PauseFx");
@@ -1597,7 +1597,7 @@ int32 BS2Sound::PauseFx(void)
}
-int32 BS2Sound::PauseFxForSequence(void)
+int32 Sword2Sound::PauseFxForSequence(void)
{
warning("stub PauseFxForSequence");
@@ -1632,7 +1632,7 @@ int32 BS2Sound::PauseFxForSequence(void)
-int32 BS2Sound::UnpauseFx(void)
+int32 Sword2Sound::UnpauseFx(void)
{
warning("stub UnpauseFx");
@@ -1657,13 +1657,13 @@ int32 BS2Sound::UnpauseFx(void)
-uint8 BS2Sound::GetFxVolume()
+uint8 Sword2Sound::GetFxVolume()
{
return fxVol;
}
-void BS2Sound::SetFxVolume(uint8 volume)
+void Sword2Sound::SetFxVolume(uint8 volume)
{
warning("stub SetFxVolume( %d )", volume);
/*
@@ -1680,7 +1680,7 @@ void BS2Sound::SetFxVolume(uint8 volume)
}
-void BS2Sound::MuteFx(uint8 mute)
+void Sword2Sound::MuteFx(uint8 mute)
{
warning("stub MuteFx( %d )");
/*
@@ -1702,7 +1702,7 @@ void BS2Sound::MuteFx(uint8 mute)
*/
}
-uint8 BS2Sound::IsFxMute(void)
+uint8 Sword2Sound::IsFxMute(void)
{
return (fxMuted);
}
@@ -1710,7 +1710,7 @@ uint8 BS2Sound::IsFxMute(void)
-void BS2Sound::StartMusicFadeDown(int i)
+void Sword2Sound::StartMusicFadeDown(int i)
{
@@ -1723,7 +1723,7 @@ void BS2Sound::StartMusicFadeDown(int i)
}
-int32 BS2Sound::StreamMusic(uint8 *filename, int32 looping)
+int32 Sword2Sound::StreamMusic(uint8 *filename, int32 looping)
{
warning("stub StreamMusic( %s, %d )", filename, looping);
@@ -1966,7 +1966,7 @@ int32 BS2Sound::StreamMusic(uint8 *filename, int32 looping)
}
-void BS2Sound::UpdateSampleStreaming(void)
+void Sword2Sound::UpdateSampleStreaming(void)
{
warning("stub UpdateSampleStreaming");
@@ -2122,7 +2122,7 @@ void BS2Sound::UpdateSampleStreaming(void)
-int32 BS2Sound::StreamCompMusic(const char *filename, uint32 musicId, int32 looping)
+int32 Sword2Sound::StreamCompMusic(const char *filename, uint32 musicId, int32 looping)
{
warning("stub StreamCompMusic( %s, %d, %d )", filename, musicId, looping);
/*
@@ -2533,7 +2533,7 @@ int32 BS2Sound::StreamCompMusic(const char *filename, uint32 musicId, int32 loop
}
-void BS2Sound::UpdateCompSampleStreaming(void)
+void Sword2Sound::UpdateCompSampleStreaming(void)
{
warning("stub UpdateCompSampleStreaming");
/*
@@ -2743,7 +2743,7 @@ void BS2Sound::UpdateCompSampleStreaming(void)
*/
}
-int32 BS2Sound::DipMusic()
+int32 Sword2Sound::DipMusic()
{
warning("stub DipMusic");
/*
@@ -2818,7 +2818,7 @@ int32 BS2Sound::DipMusic()
return RD_OK;
}
-int32 BS2Sound::MusicTimeRemaining()
+int32 Sword2Sound::MusicTimeRemaining()
{
warning("stub MusicTimeRemaaining");
/*
@@ -2845,7 +2845,7 @@ int32 BS2Sound::MusicTimeRemaining()
-void BS2Sound::StopMusic(void)
+void Sword2Sound::StopMusic(void)
{
int32 i;
@@ -2880,7 +2880,7 @@ void BS2Sound::StopMusic(void)
}
-int32 BS2Sound::PauseMusic(void)
+int32 Sword2Sound::PauseMusic(void)
{
warning("stub PauseMusic");
/*
@@ -2907,7 +2907,7 @@ int32 BS2Sound::PauseMusic(void)
return(RD_OK);
}
-int32 BS2Sound::UnpauseMusic(void)
+int32 Sword2Sound::UnpauseMusic(void)
{
warning("stub UnpauseMusic");
/*
@@ -2932,7 +2932,7 @@ int32 BS2Sound::UnpauseMusic(void)
}
-void BS2Sound::SetMusicVolume(uint8 volume)
+void Sword2Sound::SetMusicVolume(uint8 volume)
{
warning("stub SetMusicVolume( %d )", volume);
/*
@@ -2947,13 +2947,13 @@ void BS2Sound::SetMusicVolume(uint8 volume)
}
-uint8 BS2Sound::GetMusicVolume()
+uint8 Sword2Sound::GetMusicVolume()
{
return (uint8) volMusic[0];
}
-void BS2Sound::MuteMusic(uint8 mute)
+void Sword2Sound::MuteMusic(uint8 mute)
{
warning("stub MuteMusic( %d )", mute);
/*
@@ -2981,14 +2981,14 @@ void BS2Sound::MuteMusic(uint8 mute)
}
-uint8 BS2Sound::IsMusicMute(void)
+uint8 Sword2Sound::IsMusicMute(void)
{
return (musicMuted);
}
-void BS2Sound::GetSoundStatus(_drvSoundStatus *s)
+void Sword2Sound::GetSoundStatus(_drvSoundStatus *s)
{
int i;
@@ -3033,7 +3033,7 @@ void BS2Sound::GetSoundStatus(_drvSoundStatus *s)
}
-void BS2Sound::SetSoundStatus(_drvSoundStatus *s)
+void Sword2Sound::SetSoundStatus(_drvSoundStatus *s)
{
int i;
diff --git a/sword2/driver/d_sound.h b/sword2/driver/d_sound.h
index cdfc740650..2ba6cc8fd2 100644
--- a/sword2/driver/d_sound.h
+++ b/sword2/driver/d_sound.h
@@ -40,9 +40,9 @@
#include "sound/mixer.h"
-class BS2Sound {
+class Sword2Sound {
public:
- BS2Sound(void);
+ Sword2Sound(void);
void FxServer(void);
int32 InitialiseSound(uint16 freq, uint16 channels, uint16 bitDepth);
int32 PlaySpeech(uint8 *data, uint8 vol, int8 pan);
@@ -50,7 +50,7 @@ class BS2Sound {
int32 PreFetchCompSpeech(const char *filename, uint32 speechid, uint8 *waveMem);
int32 GetCompSpeechSize(const char *filename, uint32 speechid);
int32 AmISpeaking();
- int32 StopSpeechBS2(void);
+ int32 StopSpeechSword2(void);
int32 GetSpeechStatus(void);
int32 PauseSpeech(void);
int32 UnpauseSpeech(void);
diff --git a/sword2/driver/driver96.h b/sword2/driver/driver96.h
index bff1dd29c4..0e10ff3b06 100644
--- a/sword2/driver/driver96.h
+++ b/sword2/driver/driver96.h
@@ -824,7 +824,7 @@
//
// --------------------------------------------------------------------------
//
-// int32 StopSpeechBS2(void)
+// int32 StopSpeechSword2(void)
//
// Stops the speech from playing.
//
@@ -1582,7 +1582,7 @@ extern void SVM_GetModuleFileName(void *module, char *destStr, uint32 maxLen);
//-----------------------------------------------------------------------------
// Macro for reporting a non-fatal driver error
//-----------------------------------------------------------------------------
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
static int32 rderror;
#define Driver(f) \
if (rderror = f) \
diff --git a/sword2/driver/misc.cpp b/sword2/driver/misc.cpp
index efd35ecf2a..87ce34e989 100644
--- a/sword2/driver/misc.cpp
+++ b/sword2/driver/misc.cpp
@@ -22,7 +22,7 @@
#include "../sword2.h"
uint32 SVM_timeGetTime(void) {
- return g_bs2->_syst->get_msecs();
+ return g_sword2->_syst->get_msecs();
}
void SVM_VirtualUnlock(uint8 *free_memman, uint32 total_free_memory) {
diff --git a/sword2/driver/rdwin.cpp b/sword2/driver/rdwin.cpp
index 8791a793fa..e2a2f52fe5 100644
--- a/sword2/driver/rdwin.cpp
+++ b/sword2/driver/rdwin.cpp
@@ -149,7 +149,7 @@ void Message(LPSTR fmt, ...)
//-----------------------------------------------------------------------------
// OSystem Event Handler. Full of cross platform goodness and 99% fat free!
//-----------------------------------------------------------------------------
-void BS2State::parseEvents() {
+void Sword2State::parseEvents() {
OSystem::Event event;
while (_system->poll_event(&event)) {
@@ -537,7 +537,7 @@ int32 CloseAppWindow(void)
DestroyWindow(hwnd);
*/
// just quit for now
- g_bs2->_syst->quit();
+ g_sword2->_syst->quit();
return(RD_OK);
}
@@ -547,7 +547,7 @@ int32 CloseAppWindow(void)
int32 ServiceWindows(void)
{
- g_bs2->parseEvents();
+ g_sword2->parseEvents();
// warning("stub ServiceWindows"); // too noisy
/*
MSG msg;
diff --git a/sword2/function.cpp b/sword2/function.cpp
index 80b4abb98a..aa9720be3b 100644
--- a/sword2/function.cpp
+++ b/sword2/function.cpp
@@ -284,7 +284,7 @@ int32 FN_flash(int32 *params) // (James14feb97)
{
// params 0: colour to flash
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
uint32 count;
@@ -315,7 +315,7 @@ int32 FN_flash(int32 *params) // (James14feb97)
SetPalette(0, 1, black, RDPAL_INSTANT);
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
return(IR_CONT);
}
@@ -327,7 +327,7 @@ int32 FN_colour(int32 *params) // (James14feb97)
{
// params 0: colour (see defines above)
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
switch (params[0]) // what colour?
{
@@ -352,7 +352,7 @@ int32 FN_colour(int32 *params) // (James14feb97)
break;
}
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
return(IR_CONT);
}
@@ -430,7 +430,7 @@ int32 FN_play_credits(int32 *params)
StopMusic(); // Stop any streaming music
for (int i = 0; i<16; i++)
- g_bs2->_sound->UpdateCompSampleStreaming(); // And wait for it to die
+ g_sword2->_sound->UpdateCompSampleStreaming(); // And wait for it to die
GetDrawStatus (&ds);
GetSoundStatus(&ss);
diff --git a/sword2/icons.cpp b/sword2/icons.cpp
index 0671fe26e7..7df435ac1c 100644
--- a/sword2/icons.cpp
+++ b/sword2/icons.cpp
@@ -44,7 +44,7 @@ int32 FN_add_menu_object(int32 *params) //Tony1Oct96
// Zdebug("FN_add_menu_object icon res");
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (total_temp == TOTAL_engine_pockets)
Con_fatal_error("TOTAL_engine_pockets exceeded! (%s line %u)",__FILE__,__LINE__);
#endif
diff --git a/sword2/interpreter.h b/sword2/interpreter.h
index eea59f744e..9c8a2ce173 100644
--- a/sword2/interpreter.h
+++ b/sword2/interpreter.h
@@ -30,19 +30,19 @@
extern int g_debugFlag;
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
#define DEBUG1(x,y) if(g_debugFlag){engine.AddTextLine(CVString(x,y),VS_COL_DEBUG);}
#define DEBUG2(x,y,z) if(g_debugFlag){engine.AddTextLine(CVString(x,y,z),VS_COL_DEBUG);}
#define DEBUG3(x,y,z,a) if(g_debugFlag){engine.AddTextLine(CVString(x,y,z,a),VS_COL_DEBUG);}
-#else //_BS2_DEBUG
+#else //_SWORD2_DEBUG
#define DEBUG1
#define DEBUG2
#define DEBUG3
-#endif //_BS2_DEBUG
+#endif //_SWORD2_DEBUG
#else //INSIDE_LINC
diff --git a/sword2/layers.cpp b/sword2/layers.cpp
index d4286a895b..7930a7acb9 100644
--- a/sword2/layers.cpp
+++ b/sword2/layers.cpp
@@ -65,7 +65,7 @@ int32 FN_init_background(int32 *params) //Tony11Sept96
//--------------------------------------
// Write to walkthrough file (zebug0.txt)
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
Zdebug(0,"=====================================");
Zdebug(0,"CHANGED TO LOCATION \"%s\"", FetchObjectName(*params));
Zdebug(0,"=====================================");
@@ -80,14 +80,14 @@ int32 FN_init_background(int32 *params) //Tony11Sept96
Clear_fx_queue(); // stops all fx & clears the queue (James22july97)
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
Zdebug("FN_init_background(%d)", *params);
if (!*params)
{
Con_fatal_error("ERROR: FN_set_background cannot have 0 for background layer id! (%s line=%u)",__FILE__,__LINE__);
}
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
//-------------------------------------------------------
diff --git a/sword2/logic.cpp b/sword2/logic.cpp
index db0f2e280b..9b8f790557 100644
--- a/sword2/logic.cpp
+++ b/sword2/logic.cpp
@@ -401,7 +401,7 @@ int32 FN_add_to_kill_list(int32 *params) //James9jan97
if (entry == kills) // if this ID isn't already in the list, then add it, (otherwise finish) (05mar97 James)
{
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (kills == OBJECT_KILL_LIST_SIZE) // no room at the inn
Con_fatal_error("List full in FN_add_to_kill_list(%u) (%s line %u)",ID,__FILE__,__LINE__);
#endif
diff --git a/sword2/maketext.cpp b/sword2/maketext.cpp
index ddb6313b94..4f22632eab 100644
--- a/sword2/maketext.cpp
+++ b/sword2/maketext.cpp
@@ -284,7 +284,7 @@ mem* BuildTextSprite( uint8 *sentence, uint32 fontRes, uint8 pen, _lineInfo *lin
{
charPtr = FindChar( sentence[pos++], charSet );
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if ((charPtr->height) != charHeight)
Con_fatal_error("FONT ERROR: '%c' is not same height as the space (%s line %u)",sentence[pos-1],__FILE__,__LINE__);
#endif
@@ -425,11 +425,11 @@ void CopyChar( _frameHeader *charPtr, uint8 *spritePtr, uint16 spriteWidth, uint
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
#define MAX_text_blocs MAX_DEBUG_TEXT_BLOCKS+1 // allow enough for all the debug text blocks (see debug.cpp)
#else
#define MAX_text_blocs 2 // only need one for speech, and possibly one for "PAUSED"
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
typedef struct
{
@@ -469,7 +469,7 @@ uint32 Build_new_block(uint8 *ascii, int16 x, int16 y, uint16 width, uint8 pen,
while((j<MAX_text_blocs)&&(text_sprite_list[j].text_mem))
j++;
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (j==MAX_text_blocs) //we've run out
Con_fatal_error("Build_new_block ran out of blocks! (%s line %u)",__FILE__,__LINE__); //might as well stop the system
#endif
@@ -644,7 +644,7 @@ void InitialiseFontResourceFlags(void) // (James31july97)
//---------------------------------------------------------------------------------
// Get the game name for the windows application
- if (g_bs2->_gameId == GID_BS2_DEMO)
+ if (g_sword2->_gameId == GID_SWORD2_DEMO)
textLine = FetchTextLine(textFile, 451 )+2; // get the text line (& skip the 2 chars containing the wavId)
else
textLine = FetchTextLine(textFile, 54 )+2; // get the text line (& skip the 2 chars containing the wavId)
diff --git a/sword2/mouse.cpp b/sword2/mouse.cpp
index e286872ba3..0a107940c8 100644
--- a/sword2/mouse.cpp
+++ b/sword2/mouse.cpp
@@ -235,7 +235,7 @@ void System_menu(void) //Tony19Mar97
}
//------------------------
- rv = g_bs2->_sound->PauseFx();
+ rv = g_sword2->_sound->PauseFx();
if (rv != RD_OK)
Zdebug("ERROR: PauseFx() returned %.8x in SystemMenu()", rv);
//------------------------
@@ -309,7 +309,7 @@ void System_menu(void) //Tony19Mar97
this_screen.new_palette=1;
//------------------------
- rv = g_bs2->_sound->UnpauseFx();
+ rv = g_sword2->_sound->UnpauseFx();
if (rv != RD_OK)
Zdebug("ERROR: UnpauseFx() returned %.8x in SystemMenu()", rv);
//------------------------
@@ -392,7 +392,7 @@ void Drag_mouse(void) //Tony21Nov96
//--------------------------------------
// Write to walkthrough file (zebug0.txt)
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
Zdebug(0,"USED \"%s\" ICON ON %s", FetchObjectName(OBJECT_HELD), FetchObjectName(CLICKED_ID));
#endif
//--------------------------------------
@@ -429,7 +429,7 @@ void Drag_mouse(void) //Tony21Nov96
//--------------------------------------
// Write to walkthrough file (zebug0.txt)
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
Zdebug(0,"USED \"%s\" ICON ON \"%s\" ICON", FetchObjectName(OBJECT_HELD), FetchObjectName(COMBINE_BASE));
#endif
//--------------------------------------
@@ -488,7 +488,7 @@ void Top_menu_mouse(void) //Tony3Oct96
//--------------------------------------
// Write to walkthrough file (zebug0.txt)
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
Zdebug(0,"RIGHT-CLICKED ON \"%s\" ICON", FetchObjectName(OBJECT_HELD));
#endif
//--------------------------------------
@@ -600,7 +600,7 @@ void Normal_mouse(void) //Tony30Sept96
me = MouseEvent(); //get mouse event
//-----------------------------------------------------
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (definingRectangles)
{
if (draggingRectangle==0) // not yet dragging a rectangle, so need click to start
@@ -633,7 +633,7 @@ void Normal_mouse(void) //Tony30Sept96
}
}
else
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
//-----------------------------------------------------
{
@@ -697,7 +697,7 @@ void Normal_mouse(void) //Tony30Sept96
//--------------------------------------
// Write to walkthrough file (zebug0.txt)
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (OBJECT_HELD)
Zdebug(0,"USED \"%s\" ICON ON %s", FetchObjectName(OBJECT_HELD), FetchObjectName(CLICKED_ID));
else if (LEFT_BUTTON)
@@ -1170,7 +1170,7 @@ void No_human(void) //Tony4June97
int32 FN_add_human(int32 *params) //Tony30Sept96
{
//param none
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
uint8 black[4] = {0,0,0,0};
uint8 white[4] = {255,255,255,0};
#endif // ('0' means don't print to console, but console isn't up anyway)
@@ -1215,7 +1215,7 @@ int32 FN_add_human(int32 *params) //Tony30Sept96
//----------------------------------------------------------------------------------------------
// enabled/disabled from console; status printed with on-screen debug info
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (testingSnR) // testing logic scripts by simulating an instant Save & Restore
{
SetPalette(0, 1, white, RDPAL_INSTANT);
@@ -1249,7 +1249,7 @@ int32 FN_register_mouse(int32 *params) //Tony29Oct96
if (ob_mouse->pointer) // only if 'pointer' isn't NULL
{
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (cur_mouse==TOTAL_mouse_list)
Con_fatal_error("ERROR: mouse_list full [%s line %u]",__FILE__,__LINE__);
#endif
@@ -1290,7 +1290,7 @@ int32 FN_register_pointer_text(int32 *params) // James16jun97
{
// param 0 local id of text line to use as pointer text
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (cur_mouse==TOTAL_mouse_list)
Con_fatal_error("ERROR: mouse_list full [%s line %u]",__FILE__,__LINE__);
#endif
diff --git a/sword2/protocol.cpp b/sword2/protocol.cpp
index 857036f809..a10049ebbe 100644
--- a/sword2/protocol.cpp
+++ b/sword2/protocol.cpp
@@ -82,7 +82,7 @@ _layerHeader *FetchLayerHeader(uint8 *screenFile, uint16 layerNo) //Chris 04Oct9
screenHead = FetchScreenHeader(screenFile);
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (layerNo > (screenHead->noLayers-1)) // layer number too large!
Con_fatal_error("FetchLayerHeader(%d) invalid layer number! (%s line %u)",layerNo,__FILE__,__LINE__);
#endif
@@ -123,7 +123,7 @@ _cdtEntry *FetchCdtEntry(uint8 *animFile, uint16 frameNo) // Chris 09Oct96
animHead = FetchAnimHeader(animFile);
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (frameNo > (animHead->noAnimFrames-1)) // frame number too large!
Con_fatal_error("FetchCdtEntry(animFile,%d) - anim only %d frames (%s line %u)",frameNo,animHead->noAnimFrames,__FILE__,__LINE__);
#endif
@@ -147,7 +147,7 @@ _parallax *FetchBackgroundParallaxLayer(uint8 *screenFile, int layer) // Chris 0
{
_multiScreenHeader *mscreenHeader = (_multiScreenHeader *) (screenFile + sizeof(_standardHeader));
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (mscreenHeader->bg_parallax[layer] == 0)
Con_fatal_error("FetchBackgroundParallaxLayer(%d) - No parallax layer exists (%s line %u)",layer,__FILE__,__LINE__);
#endif
@@ -159,7 +159,7 @@ _parallax *FetchBackgroundLayer(uint8 *screenFile) // Chris 04Oct96
{
_multiScreenHeader *mscreenHeader = (_multiScreenHeader *) (screenFile + sizeof(_standardHeader));
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (mscreenHeader->screen == 0)
Con_fatal_error("FetchBackgroundLayer (%d) - No background layer exists (%s line %u)",__FILE__,__LINE__);
#endif
@@ -171,7 +171,7 @@ _parallax *FetchForegroundParallaxLayer(uint8 *screenFile, int layer) // Chris 0
{
_multiScreenHeader *mscreenHeader = (_multiScreenHeader *) (screenFile + sizeof(_standardHeader));
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (mscreenHeader->fg_parallax[layer] == 0)
Con_fatal_error("FetchForegroundParallaxLayer(%d) - No parallax layer exists (%s line %u)",layer,__FILE__,__LINE__);
#endif
diff --git a/sword2/resman.cpp b/sword2/resman.cpp
index ae28a30317..6e6ef28fb8 100644
--- a/sword2/resman.cpp
+++ b/sword2/resman.cpp
@@ -100,7 +100,7 @@ void resMan::InitResMan(void) //Tony29May96
total_clusters=0;
- if (file.open("resource.inf", g_bs2->getGameDataPath()) == false) {
+ if (file.open("resource.inf", g_sword2->getGameDataPath()) == false) {
Zdebug("InitResMan cannot *OPEN* resource.inf");
ExitWithReport("InitResMan cannot *OPEN* resource.inf [file=%s line=%u]",__FILE__,__LINE__);
}
@@ -150,7 +150,7 @@ void resMan::InitResMan(void) //Tony29May96
//now load in the binary id to res conversion table
- if (file.open("resource.tab", g_bs2->getGameDataPath()) == false) {
+ if (file.open("resource.tab", g_sword2->getGameDataPath()) == false) {
Zdebug("InitResMan cannot *OPEN* resource.tab");
ExitWithReport("InitResMan cannot *OPEN* resource.tab [file=%s line=%u]",__FILE__,__LINE__);
}
@@ -175,7 +175,7 @@ void resMan::InitResMan(void) //Tony29May96
file.close();
- if (file.open("cd.inf", g_bs2->getGameDataPath()) == false) {
+ if (file.open("cd.inf", g_sword2->getGameDataPath()) == false) {
Zdebug("InitResMan cannot *OPEN* cd.inf");
ExitWithReport("InitResMan cannot *OPEN* cd.inf [file=%s line=%u]",__FILE__,__LINE__);
}
@@ -242,7 +242,7 @@ void resMan::InitResMan(void) //Tony29May96
*/
- if (file.open("revcd1.id", g_bs2->getGameDataPath()) == false) {
+ if (file.open("revcd1.id", g_sword2->getGameDataPath()) == false) {
int index = 0;
/*
// Scan for CD drives.
@@ -306,7 +306,7 @@ uint8 *resMan::Res_open( uint32 res ) //BHTony30May96
uint32 table_offset;
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (res>=total_res_files)
Con_fatal_error("Res_open illegal resource %d (there are %d resources 0-%d)", res, total_res_files, total_res_files-1);
#endif
@@ -319,7 +319,7 @@ uint8 *resMan::Res_open( uint32 res ) //BHTony30May96
parent_res_file = res_conv_table[res*2]; //points to the number of the ascii filename
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (parent_res_file==0xffff)
Con_fatal_error("Res_open tried to open null & void resource number %d", res);
#endif
@@ -344,7 +344,7 @@ uint8 *resMan::Res_open( uint32 res ) //BHTony30May96
}
//open the cluster file
- if (file.open(resource_files[parent_res_file], g_bs2->getGameDataPath()) == false)
+ if (file.open(resource_files[parent_res_file], g_sword2->getGameDataPath()) == false)
Con_fatal_error("Res_open cannot *OPEN* %s", resource_files[parent_res_file]);
@@ -420,13 +420,13 @@ void resMan::Res_next_cycle( void ) //Tony8Feb97
{
//increment the cycle and calculate actual per-cycle memory useage
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
uint32 j;
#endif
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
current_memory_useage=0;
for (j=1;j<total_res_files;j++)
@@ -460,7 +460,7 @@ void resMan::Res_close( uint32 res ) //Tony30May96
//resource floats when count=0
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (res>=total_res_files)
Con_fatal_error("Res_closeing illegal resource %d (there are %d resources 0-%d)", res, total_res_files, total_res_files-1);
@@ -742,7 +742,7 @@ void resMan::Kill_res(uint8 *input) //Tony23Oct96
res = atoi((char*)input);
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (!res)
Print_to_console("illegal resource");
@@ -1372,7 +1372,7 @@ void resMan::GetCd(int cd)
uint8 *textRes;
//----------------------------------------------------------------------------------------
- if (g_bs2->_gameId == GID_BS2_DEMO)
+ if (g_sword2->_gameId == GID_SWORD2_DEMO)
return; // don't ask for CD's in the playable demo downloaded from our web-site!
#ifdef _PCGUIDE
diff --git a/sword2/router.cpp b/sword2/router.cpp
index 8e77cb4b1d..04c0acdd57 100644
--- a/sword2/router.cpp
+++ b/sword2/router.cpp
@@ -319,7 +319,7 @@ void AllocateRouteMem(void)
{
slotNo++;
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (slotNo == TOTAL_ROUTE_SLOTS)
Con_fatal_error("ERROR: route_slots[] full in AllocateRouteMem() (%s line %u)",__FILE__,__LINE__);
#endif
@@ -722,7 +722,7 @@ int32 SmoothestPath()
options = NewCheck(1, route[p].x, route[p].y, route[p + 1].x, route[p + 1].y);
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (options == 0)
{
Zdebug("BestTurns fail %d %d %d %d",route[p].x, route[p].y, route[p + 1].x, route[p + 1].y);
@@ -756,7 +756,7 @@ int32 SmoothestPath()
#endif
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (steps == 0)
{
Zdebug("BestTurns failed %d %d %d %d",route[p].x, route[p].y, route[p + 1].x, route[p + 1].y);
@@ -1459,7 +1459,7 @@ void SlidyWalkAnimator(_walkData *walkAnim)
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (lastRealDir == 99)
{
Con_fatal_error("SlidyWalkAnimatorlast direction error (%s line %u)",__FILE__,__LINE__);
@@ -2988,7 +2988,7 @@ void LoadWalkGrid(void)
//-------------------------------
// check that we're not going to exceed the max allowed in the complete walkgrid arrays
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if ((nbars+theseBars) >= O_GRID_SIZE)
Con_fatal_error("Adding walkgrid(%d): %d+%d bars exceeds max %d (%s line %u)", walkGridList[entry], nbars, theseBars, O_GRID_SIZE, __FILE__, __LINE__);
diff --git a/sword2/save_rest.cpp b/sword2/save_rest.cpp
index e3019264f6..f22b3234e3 100644
--- a/sword2/save_rest.cpp
+++ b/sword2/save_rest.cpp
@@ -367,7 +367,7 @@ uint32 RestoreFromBuffer(mem *buffer, uint32 size)
//--------------------------------------
// Write to walkthrough file (zebug0.txt)
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
Zdebug(0,"*************************************");
Zdebug(0,"RESTORED GAME \"%s\"", header.description);
Zdebug(0,"*************************************");
diff --git a/sword2/sound.cpp b/sword2/sound.cpp
index 99ac8e0a5c..a61ae971c5 100644
--- a/sword2/sound.cpp
+++ b/sword2/sound.cpp
@@ -111,7 +111,7 @@ void Process_fx_queue(void)
}
else if (fxq[j].type == FX_SPOT2)
{
- if (g_bs2->_sound->IsFxOpen(j+1))
+ if (g_sword2->_sound->IsFxOpen(j+1))
fxq[j].resource = 0; // Once the Fx has finished remove it from the queue.
}
}
@@ -131,7 +131,7 @@ void Trigger_fx(uint8 j) // called from Process_fx_queue only
{
data = res_man.Res_open(fxq[j].resource); // load in the sample
data += sizeof(_standardHeader);
- rv = g_bs2->_sound->PlayFx( id, data, fxq[j].volume, fxq[j].pan, RDSE_FXSPOT ); // wav data gets copied to sound memory
+ rv = g_sword2->_sound->PlayFx( id, data, fxq[j].volume, fxq[j].pan, RDSE_FXSPOT ); // wav data gets copied to sound memory
res_man.Res_close(fxq[j].resource); // release the sample
// fxq[j].resource = 0; // clear spot fx from queue
}
@@ -139,12 +139,12 @@ void Trigger_fx(uint8 j) // called from Process_fx_queue only
{ // - to be referenced by 'j', so pass NULL data
if (fxq[j].type == FX_RANDOM)
- rv = g_bs2->_sound->PlayFx( id, NULL, fxq[j].volume, fxq[j].pan, RDSE_FXSPOT ); // not looped
+ rv = g_sword2->_sound->PlayFx( id, NULL, fxq[j].volume, fxq[j].pan, RDSE_FXSPOT ); // not looped
else // FX_LOOP
- rv = g_bs2->_sound->PlayFx( id, NULL, fxq[j].volume, fxq[j].pan, RDSE_FXLOOP ); // looped
+ rv = g_sword2->_sound->PlayFx( id, NULL, fxq[j].volume, fxq[j].pan, RDSE_FXLOOP ); // looped
}
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (rv)
Zdebug("SFX ERROR: PlayFx() returned %.8x (%s line %u)", rv, __FILE__, __LINE__);
#endif
@@ -172,7 +172,7 @@ int32 FN_play_fx(int32 *params) // called from script only
uint32 rv;
//----------------------------------
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
_standardHeader *header;
char type[10];
@@ -201,7 +201,7 @@ int32 FN_play_fx(int32 *params) // called from script only
Zdebug("SFX (sample=\"%s\", vol=%d, pan=%d, delay=%d, type=%s)", FetchObjectName(params[0]), params[3], params[4], params[2], type);
}
- #endif //_BS2_DEBUG
+ #endif //_SWORD2_DEBUG
//----------------------------------
while ((j < FXQ_LENGTH) && (fxq[j].resource != 0))
@@ -228,7 +228,7 @@ int32 FN_play_fx(int32 *params) // called from script only
if (fxq[j].type == FX_SPOT) // spot fx
{
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
data = res_man.Res_open(fxq[j].resource); // "pre-load" the sample; this gets it into memory
header = (_standardHeader*)data;
if (header->fileType != WAV_FILE)
@@ -244,16 +244,16 @@ int32 FN_play_fx(int32 *params) // called from script only
data = res_man.Res_open(fxq[j].resource); // load in the sample
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
header = (_standardHeader*)data;
if (header->fileType != WAV_FILE)
Con_fatal_error("FN_play_fx given invalid resource (%s line %u)",__FILE__,__LINE__);
#endif
data += sizeof(_standardHeader);
- rv = g_bs2->_sound->OpenFx(id,data); // copy it to sound memory, using position in queue as 'id'
+ rv = g_sword2->_sound->OpenFx(id,data); // copy it to sound memory, using position in queue as 'id'
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (rv)
Zdebug("SFX ERROR: OpenFx() returned %.8x (%s line %u)", rv, __FILE__, __LINE__);
#endif
@@ -289,7 +289,7 @@ int32 FN_set_fx_vol_and_pan(int32 *params)
// 2 new pan (-16..16)
// SetFxVolumePan(int32 id, uint8 vol, uint8 pan);
- g_bs2->_sound->SetFxVolumePan(1+params[0], params[1], params[2]); // driver fx_id is 1+<pos in queue>
+ g_sword2->_sound->SetFxVolumePan(1+params[0], params[1], params[2]); // driver fx_id is 1+<pos in queue>
// Zdebug("%d",params[2]);
return (IR_CONT);
@@ -302,7 +302,7 @@ int32 FN_set_fx_vol(int32 *params)
// 1 new volume (0..16)
// SetFxIdVolume(int32 id, uint8 vol);
- g_bs2->_sound->SetFxIdVolume(1+params[0], params[1]);
+ g_sword2->_sound->SetFxIdVolume(1+params[0], params[1]);
return (IR_CONT);
}
@@ -321,9 +321,9 @@ int32 FN_stop_fx(int32 *params) // called from script only
if ((fxq[j].type == FX_RANDOM) || (fxq[j].type == FX_LOOP))
{
id = (uint32)j+1; // because 0 is not a valid id
- rv = g_bs2->_sound->CloseFx(id); // stop fx & remove sample from sound memory
+ rv = g_sword2->_sound->CloseFx(id); // stop fx & remove sample from sound memory
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (rv)
Zdebug("SFX ERROR: CloseFx() returned %.8x (%s line %u)", rv, __FILE__, __LINE__);
#endif
@@ -350,7 +350,7 @@ int32 FN_stop_all_fx(int32 *params) // called from script only
void Clear_fx_queue(void)
{
- g_bs2->_sound->ClearAllFx(); // stop all fx & remove the samples from sound memory
+ g_sword2->_sound->ClearAllFx(); // stop all fx & remove the samples from sound memory
Init_fx_queue(); // clean out the queue
}
@@ -410,14 +410,14 @@ int32 FN_play_music(int32 *params) // updated by James on 10apr97
// add the appropriate file extension & play it
- if (g_bs2->_gameId == GID_BS2_DEMO)
+ if (g_sword2->_gameId == GID_SWORD2_DEMO)
sprintf(filename,"MUSIC.CLU");
else
sprintf(filename,"%sCLUSTERS\\MUSIC.CLU", res_man.GetCdPath());
- rv = g_bs2->_sound->StreamCompMusic(filename, params[0], loopFlag);
+ rv = g_sword2->_sound->StreamCompMusic(filename, params[0], loopFlag);
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (rv)
Zdebug("ERROR: StreamCompMusic(%s, %d, %d) returned error 0x%.8x", filename, params[0], loopFlag, rv);
#endif
@@ -435,7 +435,7 @@ int32 FN_stop_music(int32 *params) // called from script only
looping_music_id=0; // clear the 'looping' flag
- g_bs2->_sound->StopMusic();
+ g_sword2->_sound->StopMusic();
if (params);
@@ -448,11 +448,11 @@ void Kill_music(void) // James22aug97
uint8 count;
looping_music_id=0; // clear the 'looping' flag
- g_bs2->_sound->StopMusic();
+ g_sword2->_sound->StopMusic();
// THIS BIT CAUSES THE MUSIC TO STOP INSTANTLY!
for(count=0; count<16; count++)
- g_bs2->_sound->UpdateCompSampleStreaming();
+ g_sword2->_sound->UpdateCompSampleStreaming();
}
//--------------------------------------------------------------------------------------
int32 FN_check_music_playing(int32 *params) // James (30july97)
@@ -462,7 +462,7 @@ int32 FN_check_music_playing(int32 *params) // James (30july97)
// sets result to no. of seconds of current tune remaining
// or 0 if no music playing
- RESULT = g_bs2->_sound->MusicTimeRemaining(); // in seconds, rounded up to the nearest second
+ RESULT = g_sword2->_sound->MusicTimeRemaining(); // in seconds, rounded up to the nearest second
return(IR_CONT); // continue script
}
@@ -471,15 +471,15 @@ void PauseAllSound(void) // James25july97
{
uint32 rv; // for drivers return value
- rv = g_bs2->_sound->PauseMusic();
+ rv = g_sword2->_sound->PauseMusic();
if (rv != RD_OK)
Zdebug("ERROR: PauseMusic() returned %.8x in PauseAllSound()", rv);
- rv = g_bs2->_sound->PauseSpeech();
+ rv = g_sword2->_sound->PauseSpeech();
if (rv != RD_OK)
Zdebug("ERROR: PauseSpeech() returned %.8x in PauseAllSound()", rv);
- rv = g_bs2->_sound->PauseFx();
+ rv = g_sword2->_sound->PauseFx();
if (rv != RD_OK)
Zdebug("ERROR: PauseFx() returned %.8x in PauseAllSound()", rv);
}
@@ -488,15 +488,15 @@ void UnpauseAllSound(void) // James25july97
{
uint32 rv; // for drivers return value
- rv = g_bs2->_sound->UnpauseMusic();
+ rv = g_sword2->_sound->UnpauseMusic();
if (rv != RD_OK)
Zdebug("ERROR: UnpauseMusic() returned %.8x in UnpauseAllSound()", rv);
- rv = g_bs2->_sound->UnpauseSpeech();
+ rv = g_sword2->_sound->UnpauseSpeech();
if (rv != RD_OK)
Zdebug("ERROR: UnpauseSpeech() returned %.8x in UnpauseAllSound()", rv);
- rv = g_bs2->_sound->UnpauseFx();
+ rv = g_sword2->_sound->UnpauseFx();
if (rv != RD_OK)
Zdebug("ERROR: UnpauseFx() returned %.8x in UnpauseAllSound()", rv);
}
diff --git a/sword2/speech.cpp b/sword2/speech.cpp
index b2196bcede..b79d426f95 100644
--- a/sword2/speech.cpp
+++ b/sword2/speech.cpp
@@ -94,7 +94,7 @@ void Form_text(int32 *params); //Tony18Oct96
BOOL Is_anim_boxed(uint32 res); //Tony20Oct96
uint8 WantSpeechForLine(uint32 wavId); // James (29july97)
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
void GetCorrectCdForSpeech(int32 wavId); // for testing speech & text
#endif
@@ -257,7 +257,7 @@ int32 FN_choose(int32 *params) //Tony19Nov96
{
//--------------------------------------
// Write to walkthrough file (zebug0.txt)
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
Zdebug(0,"----------------------");
Zdebug(0,"Icons available:");
#endif
@@ -267,7 +267,7 @@ int32 FN_choose(int32 *params) //Tony19Nov96
{
//--------------------------------------
// Write to walkthrough file (zebug0.txt)
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
Zdebug(0,"%s", FetchObjectName(subject_list[j].res));
#endif
//--------------------------------------
@@ -282,7 +282,7 @@ int32 FN_choose(int32 *params) //Tony19Nov96
//--------------------------------------
// Write to walkthrough file (zebug0.txt)
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
Zdebug(0,"Selected: %s", FetchObjectName(subject_list[hit].res));
Zdebug(0,"----------------------");
#endif
@@ -1350,7 +1350,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
char speechFile[256];
static uint8 cycle_skip=0;
- #ifdef _BS2_DEBUG // (James26jun97)
+ #ifdef _SWORD2_DEBUG // (James26jun97)
_standardHeader *head; // for text/speech testing & checking for correct file type
static uint32 currentTextResource=0; // for text/speech testing - keeping track of text resource currently being tested
#endif
@@ -1373,7 +1373,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
// New fudge to wait for smacker samples to finish (James31july97)
// since they can over-run into the game
- if (g_bs2->_sound->GetSpeechStatus()!=RDSE_SAMPLEFINISHED) // has it finished?
+ if (g_sword2->_sound->GetSpeechStatus()!=RDSE_SAMPLEFINISHED) // has it finished?
return (IR_REPEAT);
//-------------------------
@@ -1396,7 +1396,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
//-------------------------
//-----------------------------------------------------------
- #ifdef _BS2_DEBUG // (James26jun97)
+ #ifdef _SWORD2_DEBUG // (James26jun97)
textNumber = params[S_TEXT]; // for debug info
@@ -1437,10 +1437,10 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
}
}
- #endif // _BS2_DEBUG
+ #endif // _SWORD2_DEBUG
//-----------------------------------------------------------
// pull out the text line to get the official text number (for wav id)
- // Once the wav id's go into all script text commands, we'll only need this for _BS2_DEBUG
+ // Once the wav id's go into all script text commands, we'll only need this for _SWORD2_DEBUG
text_res = params[S_TEXT]/SIZE;
local_text = params[S_TEXT]&0xffff;
@@ -1452,7 +1452,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
res_man.Res_close(text_res); // now ok to close the text file
//--------------------------------------
- #ifdef _BS2_DEBUG // (James09jul97)
+ #ifdef _SWORD2_DEBUG // (James09jul97)
// prevent dud lines from appearing while testing text & speech
// since these will not occur in the game anyway
@@ -1466,7 +1466,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
}
}
- #endif // _BS2_DEBUG
+ #endif // _SWORD2_DEBUG
//--------------------------------------
// set the 'looping_flag' & the text-click-delay
@@ -1477,7 +1477,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
//----------------------------------------------------------
// Write to walkthrough file (zebug0.txt)
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (PLAYER_ID!=CUR_PLAYER_ID) // if (player_id != george), then player is controlling Nico
Zdebug(0,"(%d) Nico: %s", officialTextNumber, text+2); // so write 'Nico' instead of George
else // ok, it's George anyway
@@ -1547,7 +1547,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
else if (speech_pan>16)
speech_pan=16;
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (SYSTEM_TESTING_TEXT) // if we're testing text & speech
{
// if we've moved onto a new text resource, we will want to check
@@ -1565,17 +1565,17 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
// set up path to speech cluster
// first checking if we have speech1.clu or speech2.clu in current directory (for translators to test)
- if (g_bs2->_gameId == GID_BS2_DEMO)
+ if (g_sword2->_gameId == GID_SWORD2_DEMO)
strcpy(speechFile,"SPEECH.CLU");
else {
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if ((res_man.WhichCd()==1) && (!access("speech1.clu",0))) { // if 0 ie. if it's there
strcpy(speechFile,"speech1.clu");
} else if ((res_man.WhichCd()==2) && (!access("speech2.clu",0))) { // if 0 ie. if it's there
strcpy(speechFile,"speech2.clu");
} else
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
{
strcpy(speechFile,res_man.GetCdPath());
strcat(speechFile,"CLUSTERS\\SPEECH.CLU");
@@ -1584,13 +1584,13 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
//------------------------------
- rv = g_bs2->_sound->PlayCompSpeech(speechFile, params[S_WAV], SPEECH_VOLUME, speech_pan); // Load speech but don't start playing yet
+ rv = g_sword2->_sound->PlayCompSpeech(speechFile, params[S_WAV], SPEECH_VOLUME, speech_pan); // Load speech but don't start playing yet
if (rv == RD_OK)
{
speechRunning=1; // ok, we've got something to play (2 means not playing yet - see below)
- g_bs2->_sound->UnpauseSpeech(); // set it playing now (we might want to do this next cycle, don't know yet)
+ g_sword2->_sound->UnpauseSpeech(); // set it playing now (we might want to do this next cycle, don't know yet)
}
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
else
{
Zdebug("ERROR: PlayCompSpeech(speechFile=\"%s\", wav=%d (res=%d pos=%d)) returned %.8x", speechFile, params[S_WAV], text_res, local_text, rv);
@@ -1628,7 +1628,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
else if (speechRunning) // if playing a sample
{
if (!unpause_zone)
- { if (g_bs2->_sound->AmISpeaking()==RDSE_QUIET) // if we're at a quiet bit
+ { if (g_sword2->_sound->AmISpeaking()==RDSE_QUIET) // if we're at a quiet bit
ob_graphic->anim_pc=0; // restart from frame 0 ('closed mouth' frame)
}
}
@@ -1655,7 +1655,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
if (speechRunning==1) // if playing a sample (note that value of '2' means about to play!)
{
if (!unpause_zone)
- { if (g_bs2->_sound->GetSpeechStatus()==RDSE_SAMPLEFINISHED) // has it finished?
+ { if (g_sword2->_sound->GetSpeechStatus()==RDSE_SAMPLEFINISHED) // has it finished?
speechFinished=1; // James25feb97
}
else unpause_zone--;
@@ -1672,7 +1672,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
//-----------------------------------------------------------------------
// ok, all is running along smoothly - but a click means stop unnaturally
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if ((SYSTEM_TESTING_TEXT==0)||(mousey>0)) // so that we can go to the options panel while text & speech is being tested
#endif
{
@@ -1685,7 +1685,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
// we ignore mouse releases
//-----------------------------------------------------------
- #ifdef _BS2_DEBUG // (James26jun97)
+ #ifdef _SWORD2_DEBUG // (James26jun97)
if (SYSTEM_TESTING_TEXT) // if testing text & speech
{
if (me->buttons&RD_RIGHTBUTTONDOWN) // and RB used to click past text
@@ -1704,7 +1704,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
if (speechRunning) // if speech sample playing
{
- g_bs2->_sound->StopSpeechBS2(); // halt the sample prematurely
+ g_sword2->_sound->StopSpeechSword2(); // halt the sample prematurely
}
}
}
@@ -1730,9 +1730,9 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
ob_logic->looping=0; // no longer in a script function loop
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
textNumber = 0; // reset for debug info
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
officialTextNumber = 0; // reset to zero, in case text line not even extracted (since this number comes from the text line)
RESULT=0; // ok (James09july97)
@@ -1909,7 +1909,7 @@ void Form_text(int32 *params) //Tony18Oct96
}
}
//------------------------------------------------------------------------------------
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
void GetCorrectCdForSpeech(int32 wavId)
{
diff --git a/sword2/startup.cpp b/sword2/startup.cpp
index 4524402deb..8ab80e0225 100644
--- a/sword2/startup.cpp
+++ b/sword2/startup.cpp
@@ -163,7 +163,7 @@ int32 FN_register_start_point(int32 *params) //Tony14Oct96
// Zdebug(" FN_register_start_point %d %s", params[0], params[1]);
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
if (total_startups==MAX_starts)
Con_fatal_error("ERROR: start_list full [%s line %u]",__FILE__,__LINE__);
@@ -290,8 +290,8 @@ uint32 Con_start(uint8 *input) //Tony15Oct96
FN_stop_music(NULL); // fade out any music that is currently playing
//---------------------------------------------
- g_bs2->_sound->UnpauseSpeech();
- g_bs2->_sound->StopSpeechBS2(); // halt the sample prematurely
+ g_sword2->_sound->UnpauseSpeech();
+ g_sword2->_sound->StopSpeechSword2(); // halt the sample prematurely
//--------------------------------------------------------------
// clean out all resources & flags, ready for a total restart (James24mar97)
diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp
index 288e7f85d0..9c82ae4eff 100644
--- a/sword2/sword2.cpp
+++ b/sword2/sword2.cpp
@@ -80,39 +80,39 @@ uint8 stepOneCycle=0; // for use while game paused
//------------------------------------------------------------------------------------
-static const VersionSettings bs2_settings[] = {
+static const VersionSettings sword2_settings[] = {
/* Broken Sword 2 */
- {"bs2", "Broken Sword II", GID_BS2, 99, VersionSettings::ADLIB_DONT_CARE, GF_DEFAULT_TO_1X_SCALER, "players.clu" },
- {"bs2demo", "Broken Sword II (Demo)", GID_BS2_DEMO, 99, VersionSettings::ADLIB_DONT_CARE, GF_DEFAULT_TO_1X_SCALER, "players.clu" },
+ {"sword2", "Broken Sword II", GID_SWORD2, 99, VersionSettings::ADLIB_DONT_CARE, GF_DEFAULT_TO_1X_SCALER, "players.clu" },
+ {"sword2demo", "Broken Sword II (Demo)", GID_SWORD2_DEMO, 99, VersionSettings::ADLIB_DONT_CARE, GF_DEFAULT_TO_1X_SCALER, "players.clu" },
{NULL, NULL, 0, 0, VersionSettings::ADLIB_DONT_CARE, 0, NULL}
};
-BS2State *g_bs2 = NULL;
+Sword2State *g_sword2 = NULL;
-const VersionSettings *Engine_BS2_targetList() {
- return bs2_settings;
+const VersionSettings *Engine_SWORD2_targetList() {
+ return sword2_settings;
}
-Engine *Engine_BS2_create(GameDetector *detector, OSystem *syst) {
- return new BS2State(detector, syst);
+Engine *Engine_SWORD2_create(GameDetector *detector, OSystem *syst) {
+ return new Sword2State(detector, syst);
}
-BS2State::BS2State(GameDetector *detector, OSystem *syst)
+Sword2State::Sword2State(GameDetector *detector, OSystem *syst)
: Engine(detector, syst) {
_detector = detector;
_syst = syst;
- g_bs2 = this;
+ g_sword2 = this;
_features = detector->_game.features;
_gameId = detector->_game.id;
}
-void BS2State::errorString(const char *buf1, char *buf2) {
+void Sword2State::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
}
-int32 BS2State::InitialiseGame(void)
+int32 Sword2State::InitialiseGame(void)
{
//init engine drivers
@@ -146,11 +146,11 @@ int32 BS2State::InitialiseGame(void)
Init_console(); // set up the console system
Zdebug("RETURNED.");
- #ifdef _BS2_DEBUG
+ #ifdef _SWORD2_DEBUG
Zdebug("CALLING: Init_start_menu");
Init_start_menu(); // read in all the startup information
Zdebug("RETURNED from Init_start_menu");
- #endif // _BS2_DEBUG
+ #endif // _SWORD2_DEBUG
@@ -166,14 +166,14 @@ int32 BS2State::InitialiseGame(void)
Init_event_system();
Zdebug("RETURNED.");
- _sound = new BS2Sound;
+ _sound = new Sword2Sound;
Zdebug("CALLING: Init_fx_queue");
Init_fx_queue(); // initialise the sound fx queue
Zdebug("RETURNED.");
// all demos (not just web)
- if (_gameId == GID_BS2_DEMO)
+ if (_gameId == GID_SWORD2_DEMO)
DEMO=1; // set script variable
return(0);
@@ -234,7 +234,7 @@ int32 GameCycle(void)
//------------------------------------------------------------------------------------
// int main(int argc, char *argv[])
// int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
-void BS2State::go()
+void Sword2State::go()
{
uint32 rv;
uint8 breakOut = 0;
@@ -243,7 +243,7 @@ void BS2State::go()
// Zdebug("[%s]", lpCmdLine);
- #ifndef _BS2_DEBUG
+ #ifndef _SWORD2_DEBUG
DisableQuitKey(); // so cannot use Ctrl-Q from the release versions (full game or demo)
#endif
@@ -344,7 +344,7 @@ void BS2State::go()
// check for events
parseEvents();
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (grabbingSequences && (!console_status))
GrabScreenShot();
#endif
@@ -363,7 +363,7 @@ void BS2State::go()
//-----
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (console_status)
{
if (One_console())
@@ -376,7 +376,7 @@ void BS2State::go()
if (!console_status) //not in console mode - if the console is quit we want to get a logic cycle in before
{ //the screen is build. Mostly because of first scroll cycle stuff
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (stepOneCycle) // if we've just stepped forward one cycle while the game was paused
{
PauseGame();
@@ -386,7 +386,7 @@ void BS2State::go()
if (KeyWaiting())
{
ReadKey(&c);
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if (c==27) // ESC whether paused or not
{
PauseAllSound(); // see sound.cpp
@@ -400,29 +400,29 @@ void BS2State::go()
{
UnpauseGame();
}
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
else if (toupper(c)==' ') // SPACE bar while paused = step one frame!
{
stepOneCycle=1; // step through one game cycle
UnpauseGame();
}
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
}
else if (toupper(c)=='P') // 'P' while not paused = pause!
{
PauseGame();
}
-#ifdef _BS2_DEBUG // frame-skipping only allowed on debug version
+#ifdef _SWORD2_DEBUG // frame-skipping only allowed on debug version
else if (toupper(c)=='S') // 'S' toggles speed up (by skipping display rendering)
{
renderSkip = 1 - renderSkip;
}
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
}
if (gamePaused==0) // skip GameCycle if we're paused
{
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
gameCycle += 1;
#endif
@@ -430,20 +430,20 @@ void BS2State::go()
break; // break out of main game loop
}
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
Build_debug_text(); // creates the debug text blocks
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
}
//-----
// James (24mar97)
-#ifdef _BS2_DEBUG
+#ifdef _SWORD2_DEBUG
if ((console_status)||(renderSkip==0)||(gameCycle%4 == 0)) // if not in console & 'renderSkip' is set, only render display once every 4 game-cycles
Build_display(); // create and flip the screen
#else
Build_display(); // create and flip the screen
-#endif // _BS2_DEBUG
+#endif // _SWORD2_DEBUG
}
@@ -478,7 +478,7 @@ int RunningFromCd()
//------------------------------------------------------------------------------------
-void BS2State::Start_game(void) //Tony29May97
+void Sword2State::Start_game(void) //Tony29May97
{
//boot the game straight into a start script
int screen_manager_id;
@@ -486,7 +486,7 @@ void BS2State::Start_game(void) //Tony29May97
Zdebug("Start_game() STARTING:");
// all demos not just web
- if (_gameId == GID_BS2_DEMO)
+ if (_gameId == GID_SWORD2_DEMO)
screen_manager_id = 19; // DOCKS SECTION START
else
screen_manager_id = 949; // INTRO & PARIS START
diff --git a/sword2/sword2.h b/sword2/sword2.h
index 3488d53b64..42ad3109ab 100644
--- a/sword2/sword2.h
+++ b/sword2/sword2.h
@@ -44,15 +44,15 @@ extern uint8 version_string[]; // for displaying from the console
extern uint8 unencoded_name[];
enum BSGameId {
- GID_BS2 = GID_BS2_FIRST,
- GID_BS2_DEMO
+ GID_SWORD2 = GID_SWORD2_FIRST,
+ GID_SWORD2_DEMO
};
// TODO move stuff into class
-class BS2State : public Engine {
+class Sword2State : public Engine {
void errorString(const char *buf_input, char *buf_output);
public:
- BS2State(GameDetector *detector, OSystem *syst);
+ Sword2State(GameDetector *detector, OSystem *syst);
void go(void);
void parseEvents(void);
void Start_game(void);
@@ -61,11 +61,11 @@ class BS2State : public Engine {
GameDetector *_detector;
uint32 _features;
byte _gameId;
- BS2Sound *_sound;
+ Sword2Sound *_sound;
private:
bool _quit;
};
-extern BS2State *g_bs2;
+extern Sword2State *g_sword2;
#endif