Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Standard Gaming Platform/Button Sound Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ void SpecifyButtonSoundScheme( INT32 iButtonID, INT8 bSoundScheme )
ButtonList[ iButtonID ]->ubSoundSchemeID = (UINT8)bSoundScheme;
if( bSoundScheme == BUTTON_SOUND_SCHEME_GENERIC )
{
#ifdef JA2
switch( guiCurrentScreen )
{
case MAINMENU_SCREEN:
Expand Down Expand Up @@ -46,7 +45,6 @@ void SpecifyButtonSoundScheme( INT32 iButtonID, INT8 bSoundScheme )
//DEBUG_SCREEN,
//SEX_SCREEN,
}
#endif
if( bSoundScheme == BUTTON_SOUND_SCHEME_GENERIC )
bSoundScheme = BUTTON_SOUND_SCHEME_NONE;
}
Expand All @@ -65,7 +63,6 @@ void PlayButtonSound( INT32 iButtonID, INT32 iSoundType )
case BUTTON_SOUND_SCHEME_GENERIC:
break;

#ifdef JA2

case BUTTON_SOUND_SCHEME_VERYSMALLSWITCH1:
switch( iSoundType )
Expand Down Expand Up @@ -180,7 +177,6 @@ void PlayButtonSound( INT32 iButtonID, INT32 iSoundType )
}
break;

#endif

}

Expand Down
52 changes: 0 additions & 52 deletions Standard Gaming Platform/Button System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "Button System.h"
#include "line.h"
#include <stdarg.h>
#if defined( JA2 ) || defined( UTIL )
#include "WordWrap.h"
#include "video.h"
#include "Button Sound Control.h"
Expand All @@ -27,32 +26,11 @@
#include "Render Dirty.h"
#include "utilities.h"
#endif
#else
#include "video2.h"
#endif
#include <vector>


//ATE: Added to let Wiz default creating mouse regions with no cursor, JA2 default to a cursor ( first one )
#ifdef JA2
#define MSYS_STARTING_CURSORVAL 0
#else
#define MSYS_STARTING_CURSORVAL MSYS_NO_CURSOR
// The following should be moved from here
#define GETPIXELDEPTH( ) ( gbPixelDepth ) // From "utilities.h" in JA2
#define COLOR_RED 162 // From "lighting.h" in JA2
#define COLOR_BLUE 203
#define COLOR_YELLOW 144
#define COLOR_GREEN 184
#define COLOR_LTGREY 134
#define COLOR_BROWN 80
#define COLOR_PURPLE 160
#define COLOR_ORANGE 76
#define COLOR_WHITE 208
#define COLOR_BLACK 72
// this doesn't exactly belong here either... (From "Font Control.h" in JA2)
#define FONT_MCOLOR_BLACK 0
#endif
#define COLOR_DKGREY 136


Expand All @@ -72,11 +50,9 @@ CHAR8 str[128];
//an already deleted button, or it's images, etc. It will also ensure that you don't create
//the same button that already exists.
//TO REMOVE ALL DEBUG FUNCTIONALITY: simply comment out BUTTONSYSTEM_DEBUGGING definition
#ifdef JA2
#ifdef _DEBUG
#define BUTTONSYSTEM_DEBUGGING
#endif
#endif

#ifdef BUTTONSYSTEM_DEBUGGING
BOOLEAN gfIgnoreShutdownAssertions; // symbol already declared globally in mousesystem.cpp (jonathanl)
Expand Down Expand Up @@ -2866,9 +2842,7 @@ void QuickButtonCallbackMButn( MOUSE_REGION *reg, INT32 reason )

if( StateBefore != StateAfter )
{
#ifdef JA2
InvalidateRegion(b->Area.RegionTopLeftX, b->Area.RegionTopLeftY, b->Area.RegionBottomRightX, b->Area.RegionBottomRightY);
#endif
}

if( gfPendingButtonDeletion )
Expand Down Expand Up @@ -2931,11 +2905,9 @@ void RenderButtons(void)
b->uiFlags &= (~BUTTON_DIRTY);
DrawButtonFromPtr(b);

#ifdef JA2
InvalidateRegion(b->Area.RegionTopLeftX, b->Area.RegionTopLeftY, b->Area.RegionBottomRightX, b->Area.RegionBottomRightY);
//#else
// InvalidateRegion(b->Area.RegionTopLeftX, b->Area.RegionTopLeftY, b->Area.RegionBottomRightX, b->Area.RegionBottomRightY, FALSE);
#endif

}
}
Expand Down Expand Up @@ -3208,9 +3180,7 @@ void DrawDefaultOnButton( GUI_BUTTON *b )
//bottom (two thick)
LineDraw( TRUE, b->Area.RegionTopLeftX-1, b->Area.RegionBottomRightY, b->Area.RegionBottomRightX+1, b->Area.RegionBottomRightY, 0, pDestBuf );
LineDraw( TRUE, b->Area.RegionTopLeftX-1, b->Area.RegionBottomRightY+1, b->Area.RegionBottomRightX+1, b->Area.RegionBottomRightY+1, 0, pDestBuf );
#ifdef JA2
InvalidateRegion( b->Area.RegionTopLeftX-1, b->Area.RegionTopLeftY-1, b->Area.RegionBottomRightX+1, b->Area.RegionBottomRightY+1 );
#endif
}
if( b->bDefaultStatus == DEFAULT_STATUS_DOTTEDINTERIOR || b->bDefaultStatus == DEFAULT_STATUS_WINDOWS95 )
{ //Draw an internal dotted rectangle.
Expand Down Expand Up @@ -3553,7 +3523,6 @@ void DrawTextOnButton(GUI_BUTTON *b)
xp++;
yp++;
}
#ifdef JA2
if( b->sWrappedWidth != -1 )
{
UINT8 bJustified=0;
Expand Down Expand Up @@ -3600,12 +3569,6 @@ void DrawTextOnButton(GUI_BUTTON *b)
xp+= b->bTextXSubOffSet;
mprintf(xp, yp, b->string);
}
#else
if(b->fMultiColor)
gprintf(xp, yp, b->string);
else
mprintf(xp, yp, b->string);
#endif
// Restore the old text printing settings
}
}
Expand Down Expand Up @@ -3674,11 +3637,6 @@ void DrawGenericButton(GUI_BUTTON *b)
// The 3x2 size was a bit limiting. JA2 should default to the original
// size, unchanged

#ifndef JA2
pTrav = &(BPic->pETRLEObject[0] );
iBorderHeight = (INT32)pTrav->usHeight;
iBorderWidth = (INT32)pTrav->usWidth;
#endif

// Compute the number of button "chunks" needed to be blitted
width = b->Area.RegionBottomRightX - b->Area.RegionTopLeftX;
Expand Down Expand Up @@ -4198,9 +4156,7 @@ void BtnGenericMouseMoveButtonCallback(GUI_BUTTON *btn,INT32 reason)
}
}

#ifdef JA2
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
#endif
}
else if( reason & MSYS_CALLBACK_REASON_GAIN_MOUSE )
{
Expand All @@ -4210,9 +4166,7 @@ void BtnGenericMouseMoveButtonCallback(GUI_BUTTON *btn,INT32 reason)
PlayButtonSound( btn->IDNum, BUTTON_SOUND_CLICKED_ON );
}

#ifdef JA2
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
#endif
}
}

Expand All @@ -4231,9 +4185,7 @@ void ReleaseAnchorMode()
gpAnchoredButton->uiFlags |= BUTTON_CLICKED_ON;
else
gpAnchoredButton->uiFlags &= ( ~BUTTON_CLICKED_ON );
#ifdef JA2
InvalidateRegion(gpAnchoredButton->Area.RegionTopLeftX, gpAnchoredButton->Area.RegionTopLeftY, gpAnchoredButton->Area.RegionBottomRightX, gpAnchoredButton->Area.RegionBottomRightY);
#endif
}
gpPrevAnchoredButton = gpAnchoredButton;
gpAnchoredButton = NULL;
Expand Down Expand Up @@ -4302,9 +4254,7 @@ void HideButton( INT32 iButtonNum )

b->Area.uiFlags &= (~MSYS_REGION_ENABLED);
b->uiFlags |= BUTTON_DIRTY;
#ifdef JA2
InvalidateRegion(b->Area.RegionTopLeftX, b->Area.RegionTopLeftY, b->Area.RegionBottomRightX, b->Area.RegionBottomRightY);
#endif
}

void ShowButton( INT32 iButtonNum )
Expand All @@ -4320,9 +4270,7 @@ void ShowButton( INT32 iButtonNum )

b->Area.uiFlags |= MSYS_REGION_ENABLED;
b->uiFlags |= BUTTON_DIRTY;
#ifdef JA2
InvalidateRegion(b->Area.RegionTopLeftX, b->Area.RegionTopLeftY, b->Area.RegionBottomRightX, b->Area.RegionBottomRightY);
#endif
}

void DisableButtonHelpTextRestore( void )
Expand Down
7 changes: 0 additions & 7 deletions Standard Gaming Platform/Button System.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,10 @@

// Moved here from Button System.c by DB 99/01/07
// Names of the default generic button image files.
#ifdef JA2
#define DEFAULT_GENERIC_BUTTON_OFF "GENBUTN.STI"
#define DEFAULT_GENERIC_BUTTON_ON "GENBUTN2.STI"
#define DEFAULT_GENERIC_BUTTON_OFF_HI "GENBUTN3.STI"
#define DEFAULT_GENERIC_BUTTON_ON_HI "GENBUTN4.STI"
#else
#define DEFAULT_GENERIC_BUTTON_OFF "Data\\Message Box\\GENBUTN.STI"
#define DEFAULT_GENERIC_BUTTON_ON "Data\\Message Box\\GENBUTN2.STI"
#define DEFAULT_GENERIC_BUTTON_OFF_HI "Data\\Message Box\\GENBUTN3.STI"
#define DEFAULT_GENERIC_BUTTON_ON_HI "Data\\Message Box\\GENBUTN4.STI"
#endif

#define BUTTON_TEXT_LEFT -1
#define BUTTON_TEXT_CENTER 0
Expand Down
16 changes: 0 additions & 16 deletions Standard Gaming Platform/Cursor Control.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#include "Cursor Control.h"

#if defined( JA2 ) || defined( UTIL )
#include "video.h"
#else
#include "video2.h"
#endif


///////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -311,7 +307,6 @@ void CursorDatabaseClear(void)

BOOLEAN SetCurrentCursorFromDatabase( UINT32 uiCursorIndex )
{
#ifdef JA2

BOOLEAN ReturnValue = TRUE;
UINT16 usSubIndex;
Expand Down Expand Up @@ -398,11 +393,7 @@ BOOLEAN SetCurrentCursorFromDatabase( UINT32 uiCursorIndex )
}


#ifdef JA2
SetMouseCursorProperties( (INT16)(usEffWidth/2), (INT16)(usEffHeight/2), (UINT16)(usEffHeight), (UINT16)(usEffWidth ) );
#else
SetMouseCursorProperties( sCenterValY, (INT16)( sCenterValY + gsGlobalCursorYOffset ), MAX_CURSOR_HEIGHT, MAX_CURSOR_WIDTH );
#endif
DirtyCursor( );

}
Expand Down Expand Up @@ -545,11 +536,7 @@ BOOLEAN SetCurrentCursorFromDatabase( UINT32 uiCursorIndex )
sCenterValX = pCurData->sOffsetX;
sCenterValY = pCurData->sOffsetY;

#ifdef JA2
SetMouseCursorProperties( sCenterValX, (INT16)( sCenterValY + gsGlobalCursorYOffset ), pCurData->usHeight, pCurData->usWidth );
#else
SetMouseCursorProperties( sCenterValY, (INT16)( sCenterValY + gsGlobalCursorYOffset ), MAX_CURSOR_HEIGHT, MAX_CURSOR_WIDTH );
#endif
DirtyCursor( );
}
}
Expand All @@ -575,9 +562,6 @@ BOOLEAN SetCurrentCursorFromDatabase( UINT32 uiCursorIndex )
}

return ( ReturnValue );
#else
return(0);
#endif

}

Expand Down
4 changes: 0 additions & 4 deletions Standard Gaming Platform/Cursor Control.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
#include "VObject.h"
#include "VSurface.h"

#if defined( JA2 ) || defined( UTIL )
#include "Video.h"
#else
#include "video2.h"
#endif

#ifdef __cplusplus
extern "C" {
Expand Down
4 changes: 0 additions & 4 deletions Standard Gaming Platform/DEBUG.H
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,8 @@ extern void _DebugMessage(const char *pSourceFile, unsigned uiLineNum, const cha
#define DbgTopicRegistration(a, b, c); ((void *)0)
#define DbgMessage(a, b, c) ((void *)0)

#if defined( JA2 ) || defined( UTIL )
#define RegisterJA2DebugTopic(a, b) ((void *)0)
#define DebugMsg(a, b, c) ((void *)0)
#else
#define DebugMsg(a) ((void *)0)
#endif

//*******************************************************************************************
#endif
Expand Down
2 changes: 0 additions & 2 deletions Standard Gaming Platform/DEBUG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@
#include "debug.h"

//Kris addition
#ifdef JA2
#include "screenids.h"
#include "Sys Globals.h"
#include "jascreens.h"
#include "gameloop.h"
#include "input.h"
#endif

// CJC added
#ifndef _NO_DEBUG_TXT
Expand Down
21 changes: 0 additions & 21 deletions Standard Gaming Platform/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
#include "Font.h"
#include "Debug.h"

#if defined( JA2 ) || defined( UTIL )
#include "video.h"
#else
#include "video2.h"
#endif

#include "himage.h"
#include "vobject.h"
Expand Down Expand Up @@ -397,9 +393,7 @@ UINT32 LoadIndex;
if((LoadIndex=FindFreeFont())==(-1))
{
DbgMessage(TOPIC_FONT_HANDLER, DBG_LEVEL_0, String("Out of font slots (%s)", filename));
#ifdef JA2
FatalError( "Cannot init FONT file %s", filename );
#endif
return(-1);
}

Expand All @@ -409,9 +403,7 @@ UINT32 LoadIndex;
if((FontObjs[LoadIndex]=CreateVideoObject(&vo_desc))==NULL)
{
DbgMessage(TOPIC_FONT_HANDLER, DBG_LEVEL_0, String("Error creating VOBJECT (%s)", filename));
#ifdef JA2
FatalError( "Cannot init FONT file %s", filename );
#endif
return(-1);
}

Expand Down Expand Up @@ -1237,16 +1229,9 @@ UINT8 *pDestBuf;
// Unlock buffer
UnLockVideoSurface( FontDestBuffer );

#if defined ( JA2 ) || defined( UTIL )
InvalidateRegion(x, y,
x + StringPixLength(string, FontDefault),
y + GetFontHeight(FontDefault));
#else
InvalidateRegion(x, y,
x + StringPixLength(string, FontDefault),
y + GetFontHeight(FontDefault),
INVAL_SRC_TRANS);
#endif

return(0);
}
Expand Down Expand Up @@ -1621,12 +1606,6 @@ FontTranslationTable *CreateEnglishTransTable( )
pTable = (FontTranslationTable *)MemAlloc(sizeof(FontTranslationTable));
memset(pTable, 0, sizeof(FontTranslationTable) );

//#ifdef JA2
// // ha ha, we have more than Wizardry now (again)
// pTable->usNumberOfSymbols = 255;
//#else
// pTable->usNumberOfSymbols = 255;
//#endif

pTable->usNumberOfSymbols = 255;

Expand Down
Loading