- Remove CD handling code, which is not used anymore.

Patch by Cybersphinx.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@413 4a71c877-e1ca-e34f-864e-861f7616d084
master
Dennis Schridde 2006-04-08 15:58:27 +00:00
parent 628a06067b
commit daf32736ad
10 changed files with 8 additions and 864 deletions

View File

@ -1,184 +1,18 @@
/* Handles the two CD issue */ /* Handles the two CD issue */
/* Alex McLean */ /* Alex McLean */
/* seems to be responsible for playing music in-game,
* move that to somewhere else
*/
#include "frame.h" #include "frame.h"
#include "piedef.h"
#include "piefunc.h"
#include "piemode.h"
#include "piestate.h"
#include "text.h"
#include "displaydef.h"
#include "rendmode.h"
#include "hci.h"
#include "intdisplay.h"
#include "audio.h" #include "audio.h"
#include "cdaudio.h" #include "track.h"
#include "cdspan.h" #include "cdspan.h"
// turn on/off checks
#if 1
#define DONTTEST
#endif
// labels
#define LABEL1 "Wz2100"
#define LABEL2 "Wz2100b"
// Declarations for the positioning of the box */
#define CDSPAN_BOX_WIDTH (300)
#define CDSPAN_BOX_DEPTH (60)
#define CDLEFT (D_W + (CDSPAN_BOX_WIDTH/2))
#define CDRIGHT (DISP_WIDTH - D_W - (CDSPAN_BOX_WIDTH/2))
#define TOP ((DISP_HEIGHT - CDSPAN_BOX_DEPTH)/2)
#define BOTTOM ((DISP_HEIGHT + CDSPAN_BOX_DEPTH)/2)
#define MAX_VOL_NAMES 5
// -----------------------------------------------------------------------
// Static variables
/* Which CD is required */
static CD_INDEX g_CDrequired = DISC_INVALID;
/* CD validated callbacks */
static CDSPAN_CALLBACK g_fpOKCallback = NULL;
static CDSPAN_CALLBACK g_fpCancelCallback = NULL;
static BOOL g_bBoxVisible = FALSE;
static W_SCREEN *g_psCurWScreen = NULL;
static STRING g_szCurDriveName[MAX_STR] = ""; static STRING g_szCurDriveName[MAX_STR] = "";
// -----------------------------------------------------------------------
// Functions.
// -----------------------------------------------------------------------
BOOL
cdspan_GetDriveName( BOOL bCheckAny, STRING szDriveName[], ... )
{ //I use WIN321 to disable these for now -Q
#ifdef WIN321 //Neither linux nor win32 uses this, but maybe sometime in future? --QAMLY
UINT uiRet;
STRING szDrives[MAX_STR],
szVolNameList[MAX_VOL_NAMES][MAX_STR],
seps[] = " ,\t\n",
*token = NULL;
SDWORD i, j, iLabels;
BOOL bFound = FALSE;
va_list vArgList;
char szVolName[MAX_STR], szSysName[MAX_STR];
DWORD dwVolSerialNum, dwFlags, dwMaxlen;
/* get list of volume names */
iLabels = -1;
va_start( vArgList, szDriveName );
do
{
iLabels++;
strcpy( szVolNameList[iLabels], va_arg( vArgList, STRING * ) );
}
while ( strcmp( szVolNameList[iLabels], "" ) != 0 );
va_end( vArgList );
/* check no labels entered */
if ( bCheckAny == FALSE && iLabels == 0 )
{
return FALSE;
}
/* check all drives for CDROMs with matching labels */
if ( GetLogicalDriveStrings( MAX_STR, szDrives ) )
{
/* go through string and remove single NULLs */
for ( i=0; i<MAX_STR; i++ )
{
if ( szDrives[i] == '\0' )
{
if ( szDrives[i+1] == '\0' )
{
break;
}
else
{
szDrives[i] = '\t';
}
}
}
/* strtok it */
token = strtok( szDrives, seps );
while( token != NULL && bFound == FALSE )
{
uiRet = GetDriveType( token );
if ( uiRet == DRIVE_CDROM )
{
if ( bCheckAny == TRUE )
{
strcpy( g_szCurDriveName, token );
strcpy( szDriveName, token );
return TRUE;
}
if ( GetVolumeInformation( token, szVolName, MAX_STR,
&dwVolSerialNum, &dwMaxlen, &dwFlags, szSysName, MAX_STR) )
{
for ( j=0; j<iLabels; j++ )
{
if ( stricmp( szVolName, szVolNameList[j] ) == 0 )
{
bFound = TRUE;
break;
}
}
}
}
/* Get next token: */
if ( bFound == FALSE )
{
token = strtok( NULL, seps );
}
}
}
if ( bFound == TRUE )
{
strcpy( g_szCurDriveName, token );
strcpy( szDriveName, token );
return TRUE;
}
else
{
strcpy( szDriveName, "" );
return FALSE;
}
#else
strcpy( szDriveName, "" );
return FALSE;
#endif
}
// -----------------------------------------------------------------------
BOOL
cdspan_GetCDLetter( STRING szDriveName[], CD_INDEX index )
{
switch ( index )
{
case DISC_ONE:
case DISC_TWO:
return cdspan_GetDriveName( FALSE, szDriveName,
cdspan_GetDiskLabel(index), "" );
case DISC_EITHER:
return cdspan_GetDriveName( FALSE, szDriveName,
cdspan_GetDiskLabel(DISC_ONE),
cdspan_GetDiskLabel(DISC_TWO), "" );
case DISC_INVALID:
return cdspan_GetDriveName( TRUE, szDriveName, "" );
}
return FALSE;
}
// -----------------------------------------------------------------------
void void
cdspan_PlayInGameAudio( STRING szFileName[], SDWORD iVol ) cdspan_PlayInGameAudio( STRING szFileName[], SDWORD iVol )
{ {
@ -197,449 +31,3 @@ cdspan_PlayInGameAudio( STRING szFileName[], SDWORD iVol )
bPlaying = audio_PlayStream( szStream, iVol, NULL ); bPlaying = audio_PlayStream( szStream, iVol, NULL );
} }
} }
// -----------------------------------------------------------------------
static BOOL
cdspan_GetCDLabel( STRING *szLabel )
{
#ifdef WIN321 //Neither linux nor win32 uses this, but maybe sometime in future? --QAMLY
char szVolName[MAX_STR], szSysName[MAX_STR];
DWORD dwVolSerialNum, dwFlags, dwMaxlen;
if ( GetVolumeInformation( g_szCurDriveName, szVolName, MAX_STR,
&dwVolSerialNum, &dwMaxlen, &dwFlags, szSysName, MAX_STR ) )
{
strcpy( szLabel, szVolName );
return TRUE;
}
else
{
strcpy( szLabel, "" );
return FALSE;
}
return TRUE;
#else
strcpy( szLabel, "" );
return FALSE;
#endif
}
// -----------------------------------------------------------------------
static BOOL
cdspan_CheckForCD( STRING szVolumeLabel[] )
{
STRING szVolName[MAX_STR];
if ( cdspan_GetCDLabel( szVolName ) &&
stricmp( szVolumeLabel, szVolName ) == 0 )
{
return TRUE;
}
else
{
return FALSE;
}
return TRUE;
}
/***************************************************************************/
STRING *
cdspan_GetCDStrFromIndex( CD_INDEX index )
{
if ( index == DISC_ONE )
{
return LABEL1;
}
else if ( index == DISC_TWO )
{
return LABEL2;
}
else
{
DBPRINTF( ("cdspan_GetCDStrFromIndex: invalid cd index\n") );
return NULL;
}
}
// -----------------------------------------------------------------------
CD_INDEX
cdspan_GetCDIndexFromStr( STRING *pStr )
{
if ( stricmp( pStr, LABEL1 ) == 0 )
{
return DISC_ONE;
}
else if ( stricmp( pStr, LABEL2 ) == 0 )
{
return DISC_TWO;
}
else
{
DBPRINTF( ("cdspan_GetCDIndexFromStr: invalid cd string\n") );
return DISC_INVALID;
}
}
// -----------------------------------------------------------------------
/* Returns the presently active (in the drive) CD */
BOOL cdspan_CheckCDPresent( CD_INDEX index )
{
STRING szDriveName[MAX_STR];
#ifdef DONTTEST
return TRUE;
#endif
return cdspan_GetDriveName( FALSE, szDriveName,
cdspan_GetDiskLabel(index), "" );
}
// -----------------------------------------------------------------------
BOOL cdspan_CheckCDAvailable( void )
{
STRING szDriveName[MAX_STR];
#ifdef DONTTEST
return TRUE;
#endif
return cdspan_GetDriveName( TRUE, szDriveName, "" );
}
// -----------------------------------------------------------------------
UDWORD getCDRealNumberIndex( CD_INDEX index )
{
if( index == DISC_ONE )
{
return(1);
}
else if( index == DISC_TWO )
{
return(2);
}
else
{
return(100);
}
}
// -----------------------------------------------------------------------
/* Returns the other CD number - uses a UDWORD cos we need the number
from 1 and not from 0
*/
UDWORD getOtherCDRealNumberIndex(void)
{
if( cdspan_CheckCDPresent( DISC_ONE ) )
{
return(2);
}
else
{
return(1);
}
}
// -----------------------------------------------------------------------
/* Establishes whether the cd that's requested is valid - ie - have we
already got it in the drive?
*/
BOOL cdIsValid(CD_INDEX cdRequired)
{
#ifdef DONTTEST
return TRUE;
#endif
/* Make sure it's a good CD */
ASSERT((cdRequired == DISC_ONE OR cdRequired == DISC_TWO,
"Invalid CD name request for cdIsValid"));
/* Look at what we've got in the drive */
if( cdspan_CheckCDPresent( cdRequired ))
{
/* It's the one we want - so return TRUE */
return(TRUE);
}
else
{
/* We need the other CD so return FALSE */
return(FALSE);
}
}
// -----------------------------------------------------------------------
/* Returns the cd index (using the typedef names) for the requested
campaign number 1,2,3 and NOT 0,1,2
*/
CD_INDEX getCDForCampaign(UDWORD camNumber)
{
#ifdef DONTTEST
return DISC_INVALID;
#endif
/* Campaign one is on CD 1, others on CD 2 */
if(camNumber == 1)
{
return(DISC_ONE);
}
else if(camNumber == 2 || camNumber == 3)
{
return(DISC_TWO);
}
else
{
return(DISC_INVALID);
}
}
// -----------------------------------------------------------------------
BOOL showChangeCDBox( W_SCREEN *psCurWScreen, CD_INDEX CDrequired,
CDSPAN_CALLBACK fpOKCallback, CDSPAN_CALLBACK fpCancelCallback )
{
W_FORMINIT sFormInit;
W_BUTINIT sButInit;
W_LABINIT sLabInit;
static STRING szMessage[255];
#ifdef DONTTEST
return TRUE;
#endif
/* stop cd audio */
cdAudio_Stop();
/* save callbacks */
g_fpOKCallback = fpOKCallback;
g_fpCancelCallback = fpCancelCallback;
/* save CD required */
g_CDrequired = CDrequired;
/* save current screen */
g_psCurWScreen = psCurWScreen;
/* set visible flag */
g_bBoxVisible = TRUE;
memset(&sFormInit, 0, sizeof(W_FORMINIT));
memset(&sButInit, 0, sizeof(W_BUTINIT));
memset(&sLabInit, 0, sizeof(W_LABINIT));
/* Add box */
sFormInit.formID = 0;
sFormInit.id = ID_WIDG_CDSPAN_FORM;
sFormInit.style = WFORM_PLAIN;
sFormInit.x = (SWORD)CDLEFT;
sFormInit.y = (SWORD)TOP;
sFormInit.width = (UWORD)(CDSPAN_BOX_WIDTH);
sFormInit.height = (UWORD)(CDSPAN_BOX_DEPTH);
sFormInit.pDisplay = intDisplayPlainForm;
if (!widgAddForm(psCurWScreen, &sFormInit))
{
return FALSE;
}
/* Get the message text */
if ( CDrequired == DISC_EITHER )
{
sprintf( szMessage, strresGetString(psStringRes,STR_CD_CHANGE_1OR2) );
}
else
{
sprintf( szMessage, strresGetString(psStringRes,STR_CD_CHANGE),
getCDRealNumberIndex( CDrequired ) );
}
iV_SetTextColour(PIE_TEXT_WHITE);
/* cd load message label */
sLabInit.formID = ID_WIDG_CDSPAN_FORM;
sLabInit.id = ID_WIDG_CDSPAN_LABEL;
sLabInit.style = WLAB_PLAIN;
sLabInit.x = 20;
sLabInit.y = 10;
sLabInit.width = 40;
sLabInit.height = 20;
sLabInit.pText = szMessage;
// sLabInit.pTip = "";
sLabInit.FontID = WFont;
if (!widgAddLabel(psCurWScreen, &sLabInit))
{
return TRUE;
}
/* OK button */
sButInit.formID = ID_WIDG_CDSPAN_FORM;
sButInit.id = ID_WIDG_CDSPAN_BUTTON_OK;
sButInit.style = WBUT_PLAIN;
sButInit.x = 60;
sButInit.y = 30;
sButInit.width = iV_GetImageWidth(IntImages, IMAGE_CDCHANGE_OK);
sButInit.height = iV_GetImageHeight(IntImages, IMAGE_CDCHANGE_OK);
// sButInit.pTip = "";
sButInit.pDisplay = intDisplayImageHilight;
sButInit.pUserData = (void*)PACKDWORD_TRI(0,IMAGE_CDCHANGE_OK , IMAGE_CDCHANGE_OK);
sButInit.FontID = WFont;
if (!widgAddButton(psCurWScreen, &sButInit))
{
return FALSE;
}
/* cancel button */
sButInit.formID = ID_WIDG_CDSPAN_FORM;
sButInit.id = ID_WIDG_CDSPAN_BUTTON_CANCEL;
sButInit.style = WBUT_PLAIN;
sButInit.x = 200;
sButInit.y = 30;
sButInit.width = iV_GetImageWidth(IntImages, IMAGE_CDCHANGE_CANCEL);
sButInit.height = iV_GetImageHeight(IntImages, IMAGE_CDCHANGE_CANCEL);
// sButInit.pTip = "";
sButInit.pDisplay = intDisplayImageHilight;
sButInit.pUserData = (void*)PACKDWORD_TRI(0,IMAGE_CDCHANGE_CANCEL , IMAGE_CDCHANGE_CANCEL);
sButInit.FontID = WFont;
if (!widgAddButton(psCurWScreen, &sButInit))
{
return FALSE;
}
g_bBoxVisible = TRUE;
return TRUE;
}
// -----------------------------------------------------------------------
void cdspan_RemoveChangeCDBox( void )
{
#ifdef DONTTEST
return;
#endif
widgDelete(g_psCurWScreen, ID_WIDG_CDSPAN_FORM);
g_psCurWScreen = NULL;
intMode = INT_NORMAL;
g_bBoxVisible = FALSE;
}
// -----------------------------------------------------------------------
/* cdspan_ProcessCDChange returns TRUE if event processed */
BOOL cdspan_ProcessCDChange( UDWORD iID )
{
STRING *pStr;
BOOL bOK;
#ifdef DONTTEST
return FALSE;
#endif
switch ( iID )
{
case ID_WIDG_CDSPAN_BUTTON_OK:
if ( g_CDrequired == DISC_EITHER )
{
pStr = cdspan_GetCDStrFromIndex( DISC_ONE );
bOK = cdspan_CheckForCD( pStr );
if ( bOK == FALSE )
{
pStr = cdspan_GetCDStrFromIndex( DISC_TWO );
bOK = cdspan_CheckForCD( pStr );
}
}
else
{
pStr = cdspan_GetCDStrFromIndex(g_CDrequired);
bOK = cdspan_CheckForCD( pStr );
}
/* continue if disc ok else wait for cancel or ok clicked again */
if ( bOK )
{
cdspan_RemoveChangeCDBox();
/* do callback */
if ( g_fpOKCallback != NULL )
{
(g_fpOKCallback)();
}
}
return TRUE;
case ID_WIDG_CDSPAN_BUTTON_CANCEL:
cdspan_RemoveChangeCDBox();
/* do callback */
if ( g_fpCancelCallback != NULL )
{
(g_fpCancelCallback)();
}
return TRUE;
default:
if ( g_bBoxVisible )
{
return TRUE;
}
else
{
return FALSE;
}
}
}
// -----------------------------------------------------------------------
// determine which cd is in, then return TRUE if it's a warzone cd.
BOOL cdspan_initialCDcheck()
{
#ifdef DONTTEST
return TRUE;
#endif
// determine which CD is available.
if ( cdspan_CheckForCD( LABEL1 ) == TRUE ||
cdspan_CheckForCD( LABEL2 ) == TRUE )
{
return TRUE;
}
else
{
return FALSE;
}
}
// -----------------------------------------------------------------------
BOOL cdspan_DontTest( void )
{
#ifdef DONTTEST
return TRUE;
#else
return FALSE;
#endif
}
// -----------------------------------------------------------------------
STRING * cdspan_GetDiskLabel( CD_INDEX cdIndex )
{
switch ( cdIndex )
{
case DISC_ONE:
return LABEL1;
case DISC_TWO:
return LABEL2;
default:
return "";
}
}
// -----------------------------------------------------------------------

View File

@ -1,41 +1,6 @@
#ifndef _cdspan_h #ifndef _cdspan_h
#define _cdspan_h #define _cdspan_h
#define ID_WIDG_CDSPAN_FORM 9800
#define ID_WIDG_CDSPAN_LABEL 9801
#define ID_WIDG_CDSPAN_BUTTON_OK 9802
#define ID_WIDG_CDSPAN_BUTTON_CANCEL 9803
// -----------------------------------------------------------------------
// Typedefs
/* The types of CD we can use and make sure ye bloody use 'em!! */
typedef enum
{
DISC_ONE,
DISC_TWO,
DISC_EITHER,
DISC_INVALID
}CD_INDEX;
/* callback func to call after CD validated */
typedef void (* CDSPAN_CALLBACK) ( void );
extern BOOL cdspan_CheckCDPresent( CD_INDEX cdIndex );
extern BOOL showChangeCDBox( W_SCREEN *psCurWScreen,
CD_INDEX CDrequired,
CDSPAN_CALLBACK fpOKCallback,
CDSPAN_CALLBACK fpCancelCallback );
extern BOOL cdIsValid( CD_INDEX cdRequired );
extern CD_INDEX getCDForCampaign( UDWORD camNumber );
extern void cdspan_RemoveChangeCDBox( void );
extern BOOL cdspan_ProcessCDChange( UDWORD iID );
extern BOOL cdspan_initialCDcheck();
extern BOOL cdspan_DontTest( void );
extern STRING * cdspan_GetDiskLabel( CD_INDEX cdIndex );
extern void cdspan_PlayInGameAudio( STRING szFileName[], SDWORD iVol ); extern void cdspan_PlayInGameAudio( STRING szFileName[], SDWORD iVol );
extern BOOL cdspan_GetCDLetter( STRING szDriveName[], CD_INDEX index );
extern BOOL cdspan_CheckCDAvailable( void );
#endif #endif

View File

@ -406,44 +406,6 @@ static void frontEndCDCancel( void )
changeTitleMode(TITLE); changeTitleMode(TITLE);
} }
void frontEndCheckCD( tMode tModeNext, CD_INDEX cdIndex )
{
BOOL bOK;
/* save next tmode */
g_tModeNext = tModeNext;
if ( !cdspan_DontTest() )
{
if ( cdIndex == DISC_EITHER )
{
bOK = cdspan_initialCDcheck();
}
else
{
if ( cdspan_CheckCDPresent( cdIndex ) )
{
bOK = TRUE;
}
else
{
bOK = FALSE;
}
}
if ( bOK == FALSE )
{
widgDelete( psWScreen,FRONTEND_BACKDROP );
showChangeCDBox( psWScreen, cdIndex,
frontEndCDOK, frontEndCDCancel );
return;
}
}
changeTitleMode( tModeNext );
}
BOOL runTitleMenu(VOID) BOOL runTitleMenu(VOID)
{ {
@ -453,42 +415,26 @@ BOOL runTitleMenu(VOID)
id = widgRunScreen(psWScreen); // Run the current set of widgets id = widgRunScreen(psWScreen); // Run the current set of widgets
if ( !cdspan_ProcessCDChange(id) )
{
switch(id) switch(id)
{ {
case FRONTEND_QUIT: case FRONTEND_QUIT:
changeTitleMode(CREDITS); changeTitleMode(CREDITS);
break; break;
case FRONTEND_MULTIPLAYER: case FRONTEND_MULTIPLAYER:
frontEndCheckCD(MULTI, DISC_EITHER); changeTitleMode(MULTI);
break; break;
case FRONTEND_SINGLEPLAYER: case FRONTEND_SINGLEPLAYER:
changeTitleMode(SINGLE); changeTitleMode(SINGLE);
break; break;
case FRONTEND_OPTIONS: case FRONTEND_OPTIONS:
changeTitleMode(OPTIONS); changeTitleMode(OPTIONS);
break;
case FRONTEND_PLAYINTRO:
frontEndCheckCD(SHOWINTRO, DISC_ONE);
break; break;
case FRONTEND_TUTORIAL: case FRONTEND_TUTORIAL:
changeTitleMode(TUTORIAL);
frontEndCheckCD(TUTORIAL, DISC_ONE);
break; break;
default: default:
break; break;
} }
}
DrawBegin(); DrawBegin();
StartCursorSnap(&InterfaceSnap); StartCursorSnap(&InterfaceSnap);
@ -646,28 +592,12 @@ BOOL runSinglePlayerMenu(VOID)
/* GJ to TC - this call processes the CD change widget box */
if ( !cdspan_ProcessCDChange(id) )
{
switch(id) switch(id)
{ {
case FRONTEND_NEWGAME: case FRONTEND_NEWGAME:
if ( cdspan_CheckCDPresent( getCDForCampaign(1) ) )
{
frontEndNewGame(); frontEndNewGame();
}
else
{
endSinglePlayerMenu();
showChangeCDBox( psWScreen, getCDForCampaign(1),
frontEndNewGame, startSinglePlayerMenu );
}
break; break;
case FRONTEND_LOADCAM2: case FRONTEND_LOADCAM2:
#ifdef PSX_DIFFICULTY_MENU #ifdef PSX_DIFFICULTY_MENU
StartMenuDepth = 1; StartMenuDepth = 1;
@ -713,7 +643,6 @@ BOOL runSinglePlayerMenu(VOID)
default: default:
break; break;
} }
}
if(CancelPressed()) if(CancelPressed())
{ {

View File

@ -1337,9 +1337,6 @@ void intResetScreen(BOOL NoAnim)
intRemoveTrans(); intRemoveTrans();
} }
break; break;
case INT_CDCHANGE:
cdspan_RemoveChangeCDBox();
break;
default: default:
break; break;
} }
@ -1772,15 +1769,6 @@ DBPRINTF(("HCI Quit %d\n",retID));
quitting = TRUE; quitting = TRUE;
break; break;
case ID_WIDG_CDSPAN_BUTTON_CANCEL: // cd span box cancel
cdspan_ProcessCDChange(retID);
intResetScreen(FALSE);
//clearMissionWidgets();
quitting = TRUE;
break;
// Process form tab clicks. // Process form tab clicks.
case IDOBJ_TABFORM: // If tab clicked on in object screen then refresh all rendered buttons. case IDOBJ_TABFORM: // If tab clicked on in object screen then refresh all rendered buttons.
RefreshObjectButtons(); RefreshObjectButtons();
@ -1863,10 +1851,6 @@ DBPRINTF(("HCI Quit %d\n",retID));
intProcessTransporter(retID); intProcessTransporter(retID);
break; break;
case INT_CDCHANGE:
cdspan_ProcessCDChange(retID);
break;
case INT_NORMAL: case INT_NORMAL:
break; break;
default: default:
@ -7434,18 +7418,6 @@ void addTransporterInterface(DROID *psSelected, BOOL onMission)
} }
} }
void addCDChangeInterface( CD_INDEX CDrequired,
CDSPAN_CALLBACK fpOKCallback, CDSPAN_CALLBACK fpCancelCallback )
{
intResetScreen(FALSE);
showChangeCDBox( psWScreen, CDrequired, fpOKCallback,
fpCancelCallback );
intMode = INT_CDCHANGE;
}
/*sets which list of structures to use for the interface*/ /*sets which list of structures to use for the interface*/
STRUCTURE* interfaceStructList(void) STRUCTURE* interfaceStructList(void)
{ {

View File

@ -413,12 +413,6 @@ extern STRUCTURE* interfaceStructList(void);
//sets up the Transporter Screen as far as the interface is concerned //sets up the Transporter Screen as far as the interface is concerned
extern void addTransporterInterface(DROID *psSelected, BOOL onMission); extern void addTransporterInterface(DROID *psSelected, BOOL onMission);
/* CD change box */
extern void addCDChangeInterface( CD_INDEX CDrequired,
CDSPAN_CALLBACK fpOKCallback, CDSPAN_CALLBACK fpCancelCallback );
/*causes a reticule button to start flashing*/ /*causes a reticule button to start flashing*/
extern void flashReticuleButton(UDWORD buttonID); extern void flashReticuleButton(UDWORD buttonID);

View File

@ -399,18 +399,12 @@ static BOOL _runLoadSave(BOOL bResetMissionWidgets)
UDWORD id=0; UDWORD id=0;
W_EDBINIT sEdInit; W_EDBINIT sEdInit;
CHAR sTemp[MAX_STR_LENGTH]; CHAR sTemp[MAX_STR_LENGTH];
CD_INDEX CDrequired;
UDWORD iCampaign,i; UDWORD iCampaign,i;
W_CONTEXT context; W_CONTEXT context;
BOOL bSkipCD = FALSE; BOOL bSkipCD = FALSE;
id = widgRunScreen(psRequestScreen); id = widgRunScreen(psRequestScreen);
if ( cdspan_ProcessCDChange(id) )
{
return bRequestLoad;
}
strcpy(sRequestResult,""); // set returned filename to null; strcpy(sRequestResult,""); // set returned filename to null;
// cancel this operation... // cancel this operation...
@ -438,27 +432,8 @@ static BOOL _runLoadSave(BOOL bResetMissionWidgets)
{ {
goto successforce; // it's a force, dont check the cd. goto successforce; // it's a force, dont check the cd.
} }
/* check correct CD in drive */
iCampaign = getCampaign(sRequestResult,&bSkipCD);
if ( iCampaign == 0 OR bSkipCD )
{
DBPRINTF( ("getCampaign returned 0 or we're loading a skirmish game: assuming correct CD in drive\n") );
}
CDrequired = getCDForCampaign( iCampaign );
if ( (iCampaign == 0) || cdspan_CheckCDPresent( CDrequired ) OR bSkipCD)
{
goto success; goto success;
} }
else
{
bRequestLoad = FALSE;
widgHide(psRequestScreen,LOADSAVE_FORM);
showChangeCDBox( psRequestScreen, CDrequired,
loadSaveCDOK, loadSaveCDCancel );
return FALSE;
}
}
else // SAVING!add edit box at that position. else // SAVING!add edit box at that position.
{ {

View File

@ -392,13 +392,6 @@ init://jump here from the end if re_initialising
quit = FALSE; quit = FALSE;
/* check CDROM drive available */
if ( cdspan_CheckCDAvailable() == FALSE )
{
DBERROR( ("Cannot detect CDROM drive\n") );
quit = TRUE;
}
if (!systemInitialise()) if (!systemInitialise())
{ {
return -1; return -1;

View File

@ -3626,13 +3626,6 @@ void intProcessMissionResult(UDWORD id)
{ {
W_BUTINIT sButInit; W_BUTINIT sButInit;
CD_INDEX CDrequired;
/* GJ to TC - this call processes the CD change widget box */
if ( !cdspan_ProcessCDChange(id) )
switch(id) switch(id)
{ {
@ -3676,24 +3669,7 @@ void intProcessMissionResult(UDWORD id)
closeLoadSave(); // close save interface if it's up. closeLoadSave(); // close save interface if it's up.
} }
/* check correct CD in drive */
CDrequired = getCDForCampaign( getCampaignNumber() );
if ( cdspan_CheckCDPresent( CDrequired ) )
{
missionContineButtonPressed(); missionContineButtonPressed();
}
else
{
widgDelete(psWScreen, IDMISSIONRES_TITLE);
widgDelete(psWScreen, IDMISSIONRES_FORM);
widgDelete(psWScreen, IDMISSIONRES_BACKFORM);
showChangeCDBox( psWScreen, CDrequired,
missionContineButtonPressed, missionCDCancelPressed );
}
break; break;
default: default:

View File

@ -101,7 +101,6 @@ static SDWORD currentPlaySeq = -1;
static SDWORD frameDuration = 40; static SDWORD frameDuration = 40;
static BOOL g_bResumeInGame = FALSE; static BOOL g_bResumeInGame = FALSE;
static CD_INDEX g_CDrequired = DISC_EITHER;
static int videoFrameTime = 0; static int videoFrameTime = 0;
static SDWORD frame = 0; static SDWORD frame = 0;
@ -372,20 +371,6 @@ void seq_SetVideoPath(void)
WIN32_FIND_DATA findData; WIN32_FIND_DATA findData;
HANDLE fileHandle; HANDLE fileHandle;
#endif #endif
/* set up the CD path */
if (!bCDPath)
{
if ( cdspan_GetCDLetter( aCDDrive, g_CDrequired ) == TRUE )
{
if (strlen( aCDDrive ) <= (MAX_STR_LENGTH - 20))//leave enough space to add "\\warzone\\sequences\\"
{
strcpy(aCDPath, aCDDrive);
strcat(aCDPath, "warzone\\sequences\\");
bCDPath = TRUE;
return; //quick fix for vids.
}
}
}
// now set up the hard disc path / // now set up the hard disc path /
if (!bHardPath) if (!bHardPath)
@ -1081,39 +1066,8 @@ void seqDispCDCancel( void )
/*returns the next sequence in the list to play*/ /*returns the next sequence in the list to play*/
void seq_StartNextFullScreenVideo(void) void seq_StartNextFullScreenVideo(void)
{ {
if(bMultiPlayer)
{
seqDispCDOK(); seqDispCDOK();
return; return;
}
/* check correct CD in drive */
g_CDrequired = getCDForCampaign( getCampaignNumber() );
if ( cdspan_CheckCDPresent( g_CDrequired ) )
{
seqDispCDOK();
}
else
{
/* check backdrop already up */
if ( screen_GetBackDrop() == NULL )
{
bBackDropWasAlreadyUp = FALSE;
}
else
{
bBackDropWasAlreadyUp = TRUE;
}
intResetScreen(TRUE);
forceHidePowerBar();
intRemoveReticule();
setDesignPauseState();
if(!bMultiPlayer)
{
addCDChangeInterface( g_CDrequired, seqDispCDOK, seqDispCDCancel );
}
g_bResumeInGame = TRUE;
}
} }
void seq_SetSubtitles(BOOL bNewState) void seq_SetSubtitles(BOOL bNewState)

View File

@ -50,8 +50,6 @@
#include "multistat.h" #include "multistat.h"
#include "multilimit.h" #include "multilimit.h"
extern void frontEndCheckCD( tMode tModeNext, CD_INDEX cdIndex );
typedef struct _star typedef struct _star
{ {
UWORD xPos; UWORD xPos;