Merged New Inventory Project into main branch

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2008-03-08 15:15:25 +00:00
parent e16d166277
commit 43ca24dda8
649 changed files with 93359 additions and 82507 deletions
+26 -26
View File
@@ -33,7 +33,7 @@ void CreateLoadingScreenProgressBar()
gusLeftmostShaded = 162;
gfUseLoadScreenProgressBar = TRUE;
// Special case -> show small image centered
// Special case->show small image centered
if (bShowSmallImage == TRUE)
{
if (iResolution > 0)
@@ -104,10 +104,10 @@ BOOLEAN CreateProgressBar( UINT8 ubProgressBarID, UINT16 usLeft, UINT16 usTop, U
return TRUE;
}
//You may also define a panel to go in behind the progress bar. You can now assign a title to go with
//You may also define a panel to go in behind the progress bar. You can now assign a title to go with
//the panel.
void DefineProgressBarPanel( UINT32 ubID, UINT8 r, UINT8 g, UINT8 b,
UINT16 usLeft, UINT16 usTop, UINT16 usRight, UINT16 usBottom )
UINT16 usLeft, UINT16 usTop, UINT16 usRight, UINT16 usBottom )
{
PROGRESSBAR *pCurr;
Assert( ubID < MAX_PROGRESSBARS );
@@ -122,9 +122,9 @@ void DefineProgressBarPanel( UINT32 ubID, UINT8 r, UINT8 g, UINT8 b,
pCurr->usPanelBottom = usBottom;
pCurr->usColor = Get16BPPColor( FROMRGB( r, g, b ) );
//Calculate the slightly lighter and darker versions of the same rgb color
pCurr->usLtColor = Get16BPPColor( FROMRGB( (UINT8)min( 255, (UINT16)(r*1.33)),
(UINT8)min( 255, (UINT16)(g*1.33)),
(UINT8)min( 255, (UINT16)(b*1.33)) ));
pCurr->usLtColor = Get16BPPColor( FROMRGB( (UINT8)min( 255, (UINT16)(r*1.33)),
(UINT8)min( 255, (UINT16)(g*1.33)),
(UINT8)min( 255, (UINT16)(b*1.33)) ));
pCurr->usDkColor = Get16BPPColor( FROMRGB( (UINT8)(r*0.75), (UINT8)(g*0.75), (UINT8)(b*0.75) ) );
}
@@ -181,12 +181,12 @@ void RemoveProgressBar( UINT8 ubID )
}
}
//An important setup function. The best explanation is through example. The example being the loading
//of a file -- there are many stages of the map loading. In JA2, the first step is to load the tileset.
//An important setup function. The best explanation is through example. The example being the loading
//of a file -- there are many stages of the map loading. In JA2, the first step is to load the tileset.
//Because it is a large chunk of the total loading of the map, we may gauge that it takes up 30% of the
//total load. Because it is also at the beginning, we would pass in the arguments ( 0, 30, "text" ).
//total load. Because it is also at the beginning, we would pass in the arguments ( 0, 30, "text" ).
//As the process animates using UpdateProgressBar( 0 to 100 ), the total progress bar will only reach 30%
//at the 100% mark within UpdateProgressBar. At that time, you would go onto the next step, resetting the
//at the 100% mark within UpdateProgressBar. At that time, you would go onto the next step, resetting the
//relative start and end percentage from 30 to whatever, until your done.
void SetRelativeStartAndEndPercentage( UINT8 ubID, UINT32 uiRelStartPerc, UINT32 uiRelEndPerc, STR16 str)
{
@@ -205,11 +205,11 @@ void SetRelativeStartAndEndPercentage( UINT8 ubID, UINT32 uiRelStartPerc, UINT32
if( pCurr->fPanel )
{
//Draw panel
ColorFillVideoSurfaceArea( FRAME_BUFFER,
ColorFillVideoSurfaceArea( FRAME_BUFFER,
pCurr->usPanelLeft, pCurr->usPanelTop, pCurr->usPanelRight, pCurr->usPanelBottom, pCurr->usLtColor );
ColorFillVideoSurfaceArea( FRAME_BUFFER,
ColorFillVideoSurfaceArea( FRAME_BUFFER,
pCurr->usPanelLeft+1, pCurr->usPanelTop+1, pCurr->usPanelRight, pCurr->usPanelBottom, pCurr->usDkColor );
ColorFillVideoSurfaceArea( FRAME_BUFFER,
ColorFillVideoSurfaceArea( FRAME_BUFFER,
pCurr->usPanelLeft+1, pCurr->usPanelTop+1, pCurr->usPanelRight-1, pCurr->usPanelBottom-1, pCurr->usColor );
InvalidateRegion( pCurr->usPanelLeft, pCurr->usPanelTop, pCurr->usPanelRight, pCurr->usPanelBottom );
//Draw title
@@ -217,8 +217,8 @@ void SetRelativeStartAndEndPercentage( UINT8 ubID, UINT32 uiRelStartPerc, UINT32
if( pCurr->swzTitle )
{
usStartX = pCurr->usPanelLeft + // left position
(pCurr->usPanelRight - pCurr->usPanelLeft)/2 - // + half width
StringPixLength( pCurr->swzTitle, pCurr->usTitleFont ) / 2; // - half string width
(pCurr->usPanelRight - pCurr->usPanelLeft)/2 - // + half width
StringPixLength( pCurr->swzTitle, pCurr->usTitleFont ) / 2; // - half string width
usStartY = pCurr->usPanelTop + 3;
SetFont( pCurr->usTitleFont );
SetFontForeground( pCurr->ubTitleFontForeColor );
@@ -249,9 +249,9 @@ void SetRelativeStartAndEndPercentage( UINT8 ubID, UINT32 uiRelStartPerc, UINT32
}
}
//This part renders the progress bar at the percentage level that you specify. If you have set relative
//This part renders the progress bar at the percentage level that you specify. If you have set relative
//percentage values in the above function, then the uiPercentage will be reflected based off of the relative
//percentages.
//percentages.
void RenderProgressBar( UINT8 ubID, UINT32 uiPercentage )
{
static UINT32 uiLastTime = 0;
@@ -285,25 +285,25 @@ void RenderProgressBar( UINT8 ubID, UINT32 uiPercentage )
}
if( gfUseLoadScreenProgressBar )
{
ColorFillVideoSurfaceArea( FRAME_BUFFER,
pCurr->usBarLeft, pCurr->usBarTop, end, pCurr->usBarBottom,
ColorFillVideoSurfaceArea( FRAME_BUFFER,
pCurr->usBarLeft, pCurr->usBarTop, end, pCurr->usBarBottom,
Get16BPPColor(FROMRGB( pCurr->ubColorFillRed, pCurr->ubColorFillGreen, pCurr->ubColorFillBlue )) );
//if( pCurr->usBarRight > gusLeftmostShaded )
//{
// ShadowVideoSurfaceRect( FRAME_BUFFER, gusLeftmostShaded+1, pCurr->usBarTop, end, pCurr->usBarBottom );
// ShadowVideoSurfaceRect( FRAME_BUFFER, gusLeftmostShaded+1, pCurr->usBarTop, end, pCurr->usBarBottom );
// gusLeftmostShaded = (UINT16)end;
//}
}
else
{
//Border edge of the progress bar itself in gray
ColorFillVideoSurfaceArea( FRAME_BUFFER,
pCurr->usBarLeft, pCurr->usBarTop, pCurr->usBarRight, pCurr->usBarBottom,
ColorFillVideoSurfaceArea( FRAME_BUFFER,
pCurr->usBarLeft, pCurr->usBarTop, pCurr->usBarRight, pCurr->usBarBottom,
Get16BPPColor(FROMRGB(160, 160, 160)) );
//Interior of progress bar in black
ColorFillVideoSurfaceArea( FRAME_BUFFER,
pCurr->usBarLeft+2, pCurr->usBarTop+2, pCurr->usBarRight-2, pCurr->usBarBottom-2,
Get16BPPColor(FROMRGB( 0, 0, 0)) );
ColorFillVideoSurfaceArea( FRAME_BUFFER,
pCurr->usBarLeft+2, pCurr->usBarTop+2, pCurr->usBarRight-2, pCurr->usBarBottom-2,
Get16BPPColor(FROMRGB( 0, 0, 0)) );
ColorFillVideoSurfaceArea(FRAME_BUFFER, pCurr->usBarLeft+2, pCurr->usBarTop+2, end, pCurr->usBarBottom-2, Get16BPPColor(FROMRGB(72 , 155, 24)));
}
InvalidateRegion( pCurr->usBarLeft, pCurr->usBarTop, pCurr->usBarRight, pCurr->usBarBottom );
@@ -359,4 +359,4 @@ void SetProgressBarTextDisplayFlag( UINT8 ubID, BOOLEAN fDisplayText, BOOLEAN fU
//blit everything to the save buffer ( cause the save buffer can bleed through )
BlitBufferToBuffer(guiRENDERBUFFER, guiSAVEBUFFER, pCurr->usBarLeft, pCurr->usBarBottom, (UINT16)(pCurr->usBarRight-pCurr->usBarLeft), usFontHeight );
}
}
}
+8 -8
View File
@@ -37,10 +37,10 @@ void RemoveLoadingScreenProgressBar();
//A panel is automatically created if you specify a title using SetProgressBarTitle
BOOLEAN CreateProgressBar( UINT8 ubProgressBarID, UINT16 usLeft, UINT16 usTop, UINT16 usRight, UINT16 usBottom );
//You may also define a panel to go in behind the progress bar. You can now assign a title to go with
//You may also define a panel to go in behind the progress bar. You can now assign a title to go with
//the panel.
void DefineProgressBarPanel( UINT32 ubID, UINT8 r, UINT8 g, UINT8 b,
UINT16 usLeft, UINT16 usTop, UINT16 usRight, UINT16 usBottom );
UINT16 usLeft, UINT16 usTop, UINT16 usRight, UINT16 usBottom );
//Assigning a title for the panel will automatically position the text horizontally centered on the
//panel and vertically centered from the top of the panel, to the top of the progress bar.
@@ -54,18 +54,18 @@ void SetProgressBarMsgAttributes( UINT32 ubID, UINT32 usFont, UINT8 ubForeColor,
//When finished, the progress bar needs to be removed.
void RemoveProgressBar( UINT8 ubID );
//An important setup function. The best explanation is through example. The example being the loading
//of a file -- there are many stages of the map loading. In JA2, the first step is to load the tileset.
//An important setup function. The best explanation is through example. The example being the loading
//of a file -- there are many stages of the map loading. In JA2, the first step is to load the tileset.
//Because it is a large chunk of the total loading of the map, we may gauge that it takes up 30% of the
//total load. Because it is also at the beginning, we would pass in the arguments ( 0, 30, "text" ).
//total load. Because it is also at the beginning, we would pass in the arguments ( 0, 30, "text" ).
//As the process animates using UpdateProgressBar( 0 to 100 ), the total progress bar will only reach 30%
//at the 100% mark within UpdateProgressBar. At that time, you would go onto the next step, resetting the
//at the 100% mark within UpdateProgressBar. At that time, you would go onto the next step, resetting the
//relative start and end percentage from 30 to whatever, until your done.
void SetRelativeStartAndEndPercentage( UINT8 ubID, UINT32 uiRelStartPerc, UINT32 uiRelEndPerc, STR16 str);
//This part renders the progress bar at the percentage level that you specify. If you have set relative
//This part renders the progress bar at the percentage level that you specify. If you have set relative
//percentage values in the above function, then the uiPercentage will be reflected based off of the relative
//percentages.
//percentages.
void RenderProgressBar( UINT8 ubID, UINT32 uiPercentage );
+19 -19
View File
@@ -5,9 +5,9 @@
// Stolen from Nemesis by Derek Beland.
// Originally by Derek Beland and Bret Rowden.
//
// ChangeLog:
// 10.12.2005 Lesh ripped everything that refers to MSS
// 15.12.2005 Lesh enabled sound in video
// ChangeLog:
// 10.12.2005 Lesh ripped everything that refers to MSS
// 15.12.2005 Lesh enabled sound in video
//----------------------------------------------------------------------------------
//#include "LocalCodeAll.h"
@@ -60,7 +60,7 @@
#define SMK_FLIC_AUTOCLOSE 0x00000008 // Close when done
//-Globals-------------------------------------------------------------------------
SMKFLIC SmkList[SMK_NUM_FLICS];
SMKFLIC SmkList[SMK_NUM_FLICS];
HWND hDisplayWindow=0;
UINT32 uiDisplayHeight, uiDisplayWidth;
@@ -95,13 +95,13 @@ DDSURFACEDESC SurfaceDescription;
{
if(SmkList[uiCount].uiFlags & SMK_FLIC_PLAYING)
{
fFlicStatus=TRUE;
fFlicStatus=TRUE;
if(!fSuspendFlics)
{
if(!SmackWait(SmkList[uiCount].SmackHandle))
{
DDLockSurface(SmkList[uiCount].lpDDS, NULL, &SurfaceDescription, 0, NULL);
SmackToBuffer(SmkList[uiCount].SmackHandle,SmkList[uiCount].uiLeft,
SmackToBuffer(SmkList[uiCount].SmackHandle,SmkList[uiCount].uiLeft,
SmkList[uiCount].uiTop,
SurfaceDescription.lPitch,
SmkList[uiCount].SmackHandle->Height,
@@ -129,7 +129,7 @@ DDSURFACEDESC SurfaceDescription;
}
if(!fFlicStatus)
SmkShutdownVideo();
return(fFlicStatus);
}
@@ -242,7 +242,7 @@ void SmkSetBlitPosition(SMKFLIC *pSmack, UINT32 uiLeft, UINT32 uiTop)
pSmack->uiLeft=uiLeft;
pSmack->uiTop=uiTop;
}
void SmkCloseFlic(SMKFLIC *pSmack)
{
// Attempt opening the filename
@@ -282,18 +282,18 @@ void SmkSetupVideo(void)
GetVideoSurface( &hVSurface, FRAME_BUFFER );
lpVideoPlayback2 = GetVideoSurfaceDDSurface( hVSurface );
ZEROMEM(SurfaceDescription);
SurfaceDescription.dwSize = sizeof (DDSURFACEDESC);
ReturnCode = IDirectDrawSurface2_GetSurfaceDesc ( lpVideoPlayback2, &SurfaceDescription );
if (ReturnCode != DD_OK)
{
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
return;
}
usRed = (UINT16) SurfaceDescription.ddpfPixelFormat.dwRBitMask;
ZEROMEM(SurfaceDescription);
SurfaceDescription.dwSize = sizeof (DDSURFACEDESC);
ReturnCode = IDirectDrawSurface2_GetSurfaceDesc ( lpVideoPlayback2, &SurfaceDescription );
if (ReturnCode != DD_OK)
{
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
return;
}
usRed = (UINT16) SurfaceDescription.ddpfPixelFormat.dwRBitMask;
usGreen = (UINT16) SurfaceDescription.ddpfPixelFormat.dwGBitMask;
usBlue = (UINT16) SurfaceDescription.ddpfPixelFormat.dwBBitMask;
usBlue = (UINT16) SurfaceDescription.ddpfPixelFormat.dwBBitMask;
if((usRed==0xf800) && (usGreen==0x07e0) && (usBlue==0x001f))
guiSmackPixelFormat=SMACKBUFFER565;
+536 -536
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -52,7 +52,7 @@ typedef enum
CURSOR_KNIFE_NOGO_ON2,
CURSOR_CROSS_REG,
CURSOR_CROSS_ACTIVE,
CURSOR_WWW,
CURSOR_WWW,
CURSOR_LAPTOP_SCREEN,
CURSOR_IBEAM,
CURSOR_LOOK,
@@ -152,8 +152,8 @@ typedef enum
CURSOR_STRATEGIC_BULLSEYE,
CURSOR_JUMP_OVER,
CURSOR_FUEL,
CURSOR_FUEL_RED,
CURSOR_FUEL,
CURSOR_FUEL_RED,
} CursorTypeDefines;
@@ -181,7 +181,7 @@ typedef enum
C_KNIFE2,
C_CROSS1,
C_CROSS2,
C_WWW,
C_WWW,
C_LAPTOPSCREEN,
C_IBEAM,
C_LOOK,
+8 -8
View File
@@ -12,11 +12,11 @@
void AnimDbgMessage( CHAR8 *strMessage)
{
FILE *OutFile;
FILE *OutFile;
if ((OutFile = fopen("AnimDebug.txt", "a+t")) != NULL)
{
fprintf(OutFile, "%s\n", strMessage);
fprintf(OutFile, "%s\n", strMessage);
fclose(OutFile);
}
}
@@ -28,11 +28,11 @@ void AnimDbgMessage( CHAR8 *strMessage)
void PhysicsDbgMessage( CHAR8 *strMessage)
{
FILE *OutFile;
FILE *OutFile;
if ((OutFile = fopen("PhysicsDebug.txt", "a+t")) != NULL)
{
fprintf(OutFile, "%s\n", strMessage);
fprintf(OutFile, "%s\n", strMessage);
fclose(OutFile);
}
}
@@ -45,11 +45,11 @@ void PhysicsDbgMessage( CHAR8 *strMessage)
void AiDbgMessage( CHAR8 *strMessage)
{
FILE *OutFile;
FILE *OutFile;
if ((OutFile = fopen("AiDebug.txt", "a+t")) != NULL)
{
fprintf(OutFile, "%s\n", strMessage);
fprintf(OutFile, "%s\n", strMessage);
fclose(OutFile);
}
}
@@ -59,11 +59,11 @@ void AiDbgMessage( CHAR8 *strMessage)
void LiveMessage( CHAR8 *strMessage)
{
FILE *OutFile;
FILE *OutFile;
if ((OutFile = fopen("Log.txt", "a+t")) != NULL)
{
fprintf(OutFile, "%s\n", strMessage);
fprintf(OutFile, "%s\n", strMessage);
fclose(OutFile);
}
}
+1 -1
View File
@@ -8,7 +8,7 @@
//#define _AISUBSYSTEM_DEBUG
#ifdef JA2BETAVERSION
// #define _ANIMSUBSYSTEM_DEBUG
// #define _ANIMSUBSYSTEM_DEBUG
#endif
+8 -8
View File
@@ -86,16 +86,16 @@ BOOLEAN AddEvent( UINT32 uiEvent, UINT16 usDelay, PTR pEventData, UINT32 uiDataS
CHECKF( pEvent != NULL );
// Set values
pEvent->TimeStamp = GetJA2Clock( );
pEvent->usDelay = usDelay;
pEvent->uiEvent = uiEvent;
pEvent->uiFlags = 0;
pEvent->TimeStamp = GetJA2Clock( );
pEvent->usDelay = usDelay;
pEvent->uiEvent = uiEvent;
pEvent->uiFlags = 0;
pEvent->uiDataSize = uiDataSize;
pEvent->pData = (BYTE*)pEvent;
pEvent->pData = pEvent->pData + uiEventSize;
pEvent->pData = (BYTE*)pEvent;
pEvent->pData = pEvent->pData + uiEventSize;
memcpy( pEvent->pData, pEventData, uiDataSize );
// Add event to queue
hQueue = GetQueue( ubQueueID );
hQueue = AddtoList( hQueue, &pEvent, ListSize( hQueue ) );
@@ -187,7 +187,7 @@ UINT32 EventQueueSize( UINT8 ubQueueID )
// Get Size
uiQueueSize = ListSize( hQueue );
return( uiQueueSize );
}
+656 -656
View File
File diff suppressed because it is too large Load Diff
+33 -33
View File
@@ -34,7 +34,7 @@ enum eJA2Events
S_SENDPATHTONETWORK,
S_UPDATENETWORKSOLDIER,
EVENTS_ONLY_SENT_OVER_NETWORK, // Events above are only sent to the network
EVENTS_ONLY_SENT_OVER_NETWORK, // Events above are only sent to the network
NUM_EVENTS
@@ -59,12 +59,12 @@ typedef struct
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usNewState;
INT16 sXPos;
INT16 sYPos;
UINT16 usStartingAniCode;
UINT16 usStartingAniCode;
BOOLEAN fForce;
} EV_S_CHANGESTATE;
@@ -72,8 +72,8 @@ typedef struct
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usNewDestination;
} EV_S_CHANGEDEST;
@@ -81,31 +81,31 @@ typedef struct
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
FLOAT dNewXPos;
FLOAT dNewYPos;
UINT32 uiUniqueId;
FLOAT dNewXPos;
FLOAT dNewYPos;
} EV_S_SETPOSITION;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
INT16 sDestGridNo;
UINT16 usMovementAnim;
UINT16 usSoldierID;
UINT32 uiUniqueId;
INT16 sDestGridNo;
UINT16 usMovementAnim;
} EV_S_GETNEWPATH;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usSoldierID;
UINT32 uiUniqueId;
} EV_S_BEGINTURN;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT8 ubNewStance;
INT16 sXPos;
INT16 sYPos;
@@ -114,16 +114,16 @@ typedef struct
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usNewDirection;
} EV_S_SETDIRECTION;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usDesiredDirection;
} EV_S_SETDESIREDDIRECTION;
@@ -131,8 +131,8 @@ typedef struct
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usSoldierID;
UINT32 uiUniqueId;
INT16 sTargetGridNo;
INT8 bTargetLevel;
INT8 bTargetCubeLevel;
@@ -141,8 +141,8 @@ typedef struct
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usSoldierID;
UINT32 uiUniqueId;
INT16 sTargetGridNo;
INT8 bTargetLevel;
INT8 bTargetCubeLevel;
@@ -150,8 +150,8 @@ typedef struct
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usWeaponIndex;
INT16 sDamage;
INT16 sBreathLoss;
@@ -173,7 +173,7 @@ typedef struct
INT16 sYPos;
INT16 sZPos;
UINT16 usWeaponIndex;
INT8 bWeaponStatus;
INT16 bWeaponStatus;
UINT8 ubAttackerID;
UINT16 usStructureID;
INT32 iImpact;
@@ -207,8 +207,8 @@ typedef struct
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usSoldierID;
UINT32 uiUniqueId;
INT8 bDirection;
INT16 sGridNo;
INT16 sXPos;
@@ -221,11 +221,11 @@ typedef struct
typedef struct
{
UINT8 usSoldierID;
UINT32 uiUniqueId;
UINT32 uiUniqueId;
UINT8 usPathDataSize; // Size of Path
INT16 sAtGridNo; // Owner merc is at this tile when sending packet
UINT8 usCurrentPathIndex; // Index the owner of the merc is at when sending packet
UINT8 usPathData[ NETWORK_PATH_DATA_SIZE ]; // make define // Next X tile to go to
UINT8 usPathData[ NETWORK_PATH_DATA_SIZE ]; // make define // Next X tile to go to
UINT8 ubNewState; // new movment Anim
// INT8 bActionPoints;
// INT8 bBreath; // current breath value
@@ -237,7 +237,7 @@ typedef struct
typedef struct
{
UINT8 usSoldierID;
UINT32 uiUniqueId;
UINT32 uiUniqueId;
INT16 sAtGridNo; // Owner merc is at this tile when sending packet
INT8 bActionPoints; // current A.P. value
INT8 bBreath; // current breath value
+28 -27
View File
@@ -14,8 +14,8 @@
#include "WinFont.h"
#endif
INT32 giCurWinFont = 0;
BOOLEAN gfUseWinFonts = FALSE;
INT32 giCurWinFont = 0;
BOOLEAN gfUseWinFonts = FALSE;
// Global variables for video objects
@@ -31,14 +31,14 @@ HVOBJECT gvoTinyFontType1;
INT32 gp12PointFont1;
HVOBJECT gvo12PointFont1;
INT32 gpClockFont;
HVOBJECT gvoClockFont;
INT32 gpClockFont;
HVOBJECT gvoClockFont;
INT32 gpCompFont;
HVOBJECT gvoCompFont;
INT32 gpCompFont;
HVOBJECT gvoCompFont;
INT32 gpSmallCompFont;
HVOBJECT gvoSmallCompFont;
INT32 gpSmallCompFont;
HVOBJECT gvoSmallCompFont;
INT32 gp10PointRoman;
HVOBJECT gvo10PointRoman;
@@ -64,10 +64,10 @@ HVOBJECT gvo14PointArial;
INT32 gp12PointArial;
HVOBJECT gvo12PointArial;
INT32 gpBlockyFont;
INT32 gpBlockyFont;
HVOBJECT gvoBlockyFont;
INT32 gpBlockyFont2;
INT32 gpBlockyFont2;
HVOBJECT gvoBlockyFont2;
INT32 gp12PointArialFixedFont;
@@ -87,7 +87,7 @@ HVOBJECT gvo14PointHumanist;
HVOBJECT gvoHugeFont;
#endif
INT32 giSubTitleWinFont;
INT32 giSubTitleWinFont;
@@ -100,8 +100,8 @@ extern UINT16 gzFontName[32];
BOOLEAN InitializeFonts( )
{
//INT16 zWinFontName[128]; // unused (jonathanl)
//COLORVAL Color; // usused (jonathanl)
//INT16 zWinFontName[128]; // unused (jonathanl)
//COLORVAL Color; // usused (jonathanl)
// Initialize fonts
// gpLargeFontType1 = LoadFontFile( "FONTS\\lfont1.sti" );
@@ -180,12 +180,12 @@ BOOLEAN InitializeFonts( )
gp12PointArial = LoadFontFile( "FONTS\\FONT12ARIAL.sti" );
gvo12PointArial = GetFontObject( gp12PointArial);
CHECKF( CreateFontPaletteTables( gvo12PointArial) );
// gpBlockyFont = LoadFontFile( "FONTS\\FONT2.sti" );
gpBlockyFont = LoadFontFile( "FONTS\\BLOCKFONT.sti" );
gvoBlockyFont = GetFontObject( gpBlockyFont);
CHECKF( CreateFontPaletteTables( gvoBlockyFont) );
// gpBlockyFont2 = LoadFontFile( "FONTS\\interface_font.sti" );
gpBlockyFont2 = LoadFontFile( "FONTS\\BLOCKFONT2.sti" );
gvoBlockyFont2 = GetFontObject( gpBlockyFont2);
@@ -195,11 +195,11 @@ BOOLEAN InitializeFonts( )
gp12PointArialFixedFont = LoadFontFile( "FONTS\\FONT12ARIALFIXEDWIDTH.sti" );
gvo12PointArialFixedFont = GetFontObject( gp12PointArialFixedFont );
CHECKF( CreateFontPaletteTables( gvo12PointArialFixedFont ) );
gp16PointArial = LoadFontFile( "FONTS\\FONT16ARIAL.sti" );
gvo16PointArial = GetFontObject( gp16PointArial );
CHECKF( CreateFontPaletteTables( gvo16PointArial ) );
gpBlockFontNarrow = LoadFontFile( "FONTS\\BLOCKFONTNARROW.sti" );
gvoBlockFontNarrow = GetFontObject( gpBlockFontNarrow );
CHECKF( CreateFontPaletteTables( gvoBlockFontNarrow ) );
@@ -213,7 +213,7 @@ BOOLEAN InitializeFonts( )
gvoHugeFont = GetFontObject( gpHugeFont );
CHECKF( CreateFontPaletteTables( gvoHugeFont ) );
#endif
// Set default for font system
SetFontDestBuffer( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
@@ -228,7 +228,7 @@ BOOLEAN InitializeFonts( )
giSubTitleWinFont = CreateWinFont( -16, 0, 0, 0, FALSE, FALSE, FALSE, L"·s²Ó©úÅé", CHINESEBIG5_CHARSET );
SET_USE_WINFONTS( TRUE );
SET_WINFONT( giSubTitleWinFont );
SET_WINFONT( giSubTitleWinFont );
Color = FROMRGB( 255, 255, 255 );
SetWinFontForeColor( giSubTitleWinFont, &Color );
PrintWinFont( FRAME_BUFFER, giSubTitleWinFont, 10, 100, L"Font %s initialized", gzFontName );
@@ -265,7 +265,7 @@ void ShutdownFonts( )
// ATE: Shutdown any win fonts
#ifdef WINFONTS
DeleteWinFont( giSubTitleWinFont );
DeleteWinFont( giSubTitleWinFont );
#endif
}
@@ -316,7 +316,7 @@ UINT16 CreateFontPaletteTables(HVOBJECT pObj )
pObj->pShades[ FONT_SHADE_WHITE ]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 255, 255, 255, TRUE);
// the rest are darkening tables, right down to all-black.
pObj->pShades[0]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 165, 165, 165, FALSE);
pObj->pShades[7]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 135, 135, 135, FALSE);
@@ -334,23 +334,23 @@ UINT16 CreateFontPaletteTables(HVOBJECT pObj )
// check to make sure every table got a palette
//for(count=0; (count < HVOBJECT_SHADE_TABLES) && (pObj->pShades[count]!=NULL); count++);
// return the result of the check
//return(count==HVOBJECT_SHADE_TABLES);
return(TRUE);
}
UINT16 WFGetFontHeight( INT32 FontNum )
UINT16 WFGetFontHeight( INT32 FontNum )
{
if ( USE_WINFONTS( ) )
{
// return how many Y pixels we used
return( GetWinFontHeight( L"a\0", GET_WINFONT( ) ) );
return( GetWinFontHeight( L"a\0", GET_WINFONT( ) ) );
}
else
{
// return how many Y pixels we used
return( GetFontHeight( FontNum ) );
return( GetFontHeight( FontNum ) );
}
}
@@ -360,13 +360,14 @@ INT16 WFStringPixLength( STR16 string,INT32 UseFont )
if ( USE_WINFONTS( ) )
{
// return how many Y pixels we used
return( WinFontStringPixLength( string, GET_WINFONT( ) ) );
return( WinFontStringPixLength( string, GET_WINFONT( ) ) );
}
else
{
// return how many Y pixels we used
return( StringPixLength( string, UseFont ) );
return( StringPixLength( string, UseFont ) );
}
}
+25 -25
View File
@@ -4,25 +4,25 @@
#include "builddefines.h"
#include "font.h"
extern BOOLEAN gfUseWinFonts;
extern INT32 giCurWinFont;
extern BOOLEAN gfUseWinFonts;
extern INT32 giCurWinFont;
// ATE: Use this define to enable winfonts in JA2
// #define WINFONTS
// #define WINFONTS
#ifdef WINFONTS
#define USE_WINFONTS( ) ( gfUseWinFonts )
#define USE_WINFONTS( ) ( gfUseWinFonts )
#else
#define USE_WINFONTS( ) ( FALSE )
#define USE_WINFONTS( ) ( FALSE )
#endif
#define GET_WINFONT( ) ( giCurWinFont )
#define SET_USE_WINFONTS( fSet ) ( gfUseWinFonts = fSet );
#define SET_WINFONT( fFont ) ( giCurWinFont = fFont );
#define GET_WINFONT( ) ( giCurWinFont )
#define SET_USE_WINFONTS( fSet ) ( gfUseWinFonts = fSet );
#define SET_WINFONT( fFont ) ( giCurWinFont = fFont );
// ATE: A few winfont wrappers..
UINT16 WFGetFontHeight( INT32 FontNum );
INT16 WFStringPixLength( STR16 string,INT32 UseFont );
UINT16 WFGetFontHeight( INT32 FontNum );
INT16 WFStringPixLength( STR16 string,INT32 UseFont );
@@ -41,14 +41,14 @@ extern HVOBJECT gvoTinyFontType1;
extern INT32 gp12PointFont1;
extern HVOBJECT gvo12PointFont1;
extern INT32 gpClockFont;
extern HVOBJECT gvoClockFont;
extern INT32 gpClockFont;
extern HVOBJECT gvoClockFont;
extern INT32 gpCompFont;
extern HVOBJECT gvoCompFont;
extern INT32 gpCompFont;
extern HVOBJECT gvoCompFont;
extern INT32 gpSmallCompFont;
extern HVOBJECT gvoSmallCompFont;
extern INT32 gpSmallCompFont;
extern HVOBJECT gvoSmallCompFont;
extern INT32 gp10PointRoman;
extern HVOBJECT gvo10PointRoman;
@@ -97,7 +97,7 @@ extern INT32 gpHugeFont;
extern HVOBJECT gvoHugeFont;
#endif
extern INT32 giSubTitleWinFont;
extern INT32 giSubTitleWinFont;
extern BOOLEAN gfFontsInit;
@@ -105,21 +105,21 @@ extern BOOLEAN gfFontsInit;
// Defines
#define LARGEFONT1 gpLargeFontType1
#define SMALLFONT1 gpSmallFontType1
#define TINYFONT1 gpTinyFontType1
#define TINYFONT1 gpTinyFontType1
#define FONT12POINT1 gp12PointFont1
#define CLOCKFONT gpClockFont
#define COMPFONT gpCompFont
#define SMALLCOMPFONT gpSmallCompFont
#define CLOCKFONT gpClockFont
#define COMPFONT gpCompFont
#define SMALLCOMPFONT gpSmallCompFont
#define FONT10ROMAN gp10PointRoman
#define FONT12ROMAN gp12PointRoman
#define FONT14SANSERIF gp14PointSansSerif
#define MILITARYFONT1 BLOCKFONT //gpMilitaryFont1
#define FONT10ARIAL gp10PointArial
#define FONT14ARIAL gp14PointArial
#define FONT12ARIAL gp12PointArial
#define FONT10ARIALBOLD gp10PointArialBold
#define BLOCKFONT gpBlockyFont
#define BLOCKFONT2 gpBlockyFont2
#define FONT12ARIAL gp12PointArial
#define FONT10ARIALBOLD gp10PointArialBold
#define BLOCKFONT gpBlockyFont
#define BLOCKFONT2 gpBlockyFont2
#define FONT12ARIALFIXEDWIDTH gp12PointArialFixedFont
#define FONT16ARIAL gp16PointArial
#define BLOCKFONTNARROW gpBlockFontNarrow
+15 -14
View File
@@ -7,7 +7,7 @@
// Kaiden: INI reading function definitions:
CIniReader::CIniReader(const STR8 szFileName)
CIniReader::CIniReader(const STR8 szFileName)
{
// Snap: Look for the INI file in the custom Data directory.
// If not there, leave at default location.
@@ -20,15 +20,15 @@ CIniReader::CIniReader(const STR8 szFileName)
}
int CIniReader::ReadInteger(const STR8 szSection, const STR8 szKey, int iDefaultValue)
int CIniReader::ReadInteger(const STR8 szSection, const STR8 szKey, int iDefaultValue)
{
return GetPrivateProfileInt(szSection, szKey, iDefaultValue, m_szFileName);
return GetPrivateProfileInt(szSection, szKey, iDefaultValue, m_szFileName);
}
int CIniReader::ReadInteger(const STR8 szSection, const STR8 szKey, int iDefaultValue, int iMinValue, int iMaxValue)
int CIniReader::ReadInteger(const STR8 szSection, const STR8 szKey, int iDefaultValue, int iMinValue, int iMaxValue)
{
int i = GetPrivateProfileInt(szSection, szKey, iDefaultValue, m_szFileName);
int i = GetPrivateProfileInt(szSection, szKey, iDefaultValue, m_szFileName);
if (i < iMinValue)
return iMinValue;
else if (i > iMaxValue)
@@ -36,39 +36,39 @@ int CIniReader::ReadInteger(const STR8 szSection, const STR8 szKey, int iDefau
return i;
}
int ReadInteger(const STR8 szSection, const STR8 szKey, int iDefaultValue, int iMinValue, int iMaxValue);
int ReadInteger(const STR8 szSection, const STR8 szKey, int iDefaultValue, int iMinValue, int iMaxValue);
float CIniReader::ReadFloat(const STR8 szSection, const STR8 szKey, float fltDefaultValue)
float CIniReader::ReadFloat(const STR8 szSection, const STR8 szKey, float fltDefaultValue)
{
char szResult[255];
char szDefault[255];
float fltResult;
sprintf(szDefault, "%f",fltDefaultValue);
GetPrivateProfileString(szSection, szKey, szDefault, szResult, 255, m_szFileName);
GetPrivateProfileString(szSection, szKey, szDefault, szResult, 255, m_szFileName);
fltResult = (float) atof(szResult);
return fltResult;
}
bool CIniReader::ReadBoolean(const STR8 szSection, const STR8 szKey, bool bolDefaultValue)
bool CIniReader::ReadBoolean(const STR8 szSection, const STR8 szKey, bool bolDefaultValue)
{
char szResult[255];
char szDefault[255];
bool bolResult;
sprintf(szDefault, "%s", bolDefaultValue? "TRUE" : "FALSE");
GetPrivateProfileString(szSection, szKey, szDefault, szResult, 255, m_szFileName);
bolResult = (strcmp(szResult, "TRUE") == 0 || strcmp(szResult, "TRUE") == 0) ? true : false;
GetPrivateProfileString(szSection, szKey, szDefault, szResult, 255, m_szFileName);
bolResult = (strcmp(szResult, "TRUE") == 0 || strcmp(szResult, "TRUE") == 0) ? true : false;
return bolResult;
}
STR8 CIniReader::ReadString(const STR8 szSection, const STR8 szKey, const STR8 szDefaultValue)
STR8 CIniReader::ReadString(const STR8 szSection, const STR8 szKey, const STR8 szDefaultValue)
{
STR8 szResult = new char[255];
STR8 szResult = new char[255];
memset(szResult, 0x00, 255);
GetPrivateProfileString(szSection, szKey, szDefaultValue, szResult, 255, m_szFileName);
GetPrivateProfileString(szSection, szKey, szDefaultValue, szResult, 255, m_szFileName);
return szResult;
}
@@ -77,3 +77,4 @@ STR8 CIniReader::ReadString(const STR8 szSection, const STR8 szKey, const STR
+7 -7
View File
@@ -10,14 +10,14 @@
class CIniReader
{
public:
CIniReader(const STR8 szFileName);
int ReadInteger(const STR8 szSection, const STR8 szKey, int iDefaultValue);
int ReadInteger(const STR8 szSection, const STR8 szKey, int iDefaultValue, int iMinValue, int iMaxValue);
float ReadFloat(const STR8 szSection, const STR8 szKey, float fltDefaultValue);
bool ReadBoolean(const STR8 szSection, const STR8 szKey, bool bolDefaultValue);
STR8 ReadString(const STR8 szSection, const STR8 szKey, const STR8 szDefaultValue);
CIniReader(const STR8 szFileName);
int ReadInteger(const STR8 szSection, const STR8 szKey, int iDefaultValue);
int ReadInteger(const STR8 szSection, const STR8 szKey, int iDefaultValue, int iMinValue, int iMaxValue);
float ReadFloat(const STR8 szSection, const STR8 szKey, float fltDefaultValue);
bool ReadBoolean(const STR8 szSection, const STR8 szKey, bool bolDefaultValue);
STR8 ReadString(const STR8 szSection, const STR8 szKey, const STR8 szDefaultValue);
private:
char m_szFileName[MAX_PATH];
char m_szFileName[MAX_PATH];
};
#endif//INIREADER_H
+18 -18
View File
@@ -23,7 +23,7 @@
#ifdef JA2EDITOR
#include "quantize wrap.h"
#include "quantize wrap.h"
#define MINIMAP_X_SIZE 88
#define MINIMAP_Y_SIZE 44
@@ -61,7 +61,7 @@ UINT32 MapUtilScreenHandle( )
{
static INT16 fNewMap = TRUE;
static INT16 sFileNum = 0;
InputAtom InputEvent;
InputAtom InputEvent;
GETFILESTRUCT FileInfo;
static FDLG_LIST *FListNode;
static INT16 sFiles = 0, sCurFile = 0;
@@ -85,7 +85,7 @@ UINT32 MapUtilScreenHandle( )
INT32 cnt;
INT16 sX1, sX2, sY1, sY2, sTop, sBottom, sLeft, sRight;
FLOAT dX, dY, dStartX, dStartY;
INT32 iX, iY, iSubX1, iSubY1, iSubX2, iSubY2, iWindowX, iWindowY, iCount;
@@ -102,7 +102,7 @@ UINT32 MapUtilScreenHandle( )
if ( fNewMap )
{
fNewMap = FALSE;
// Create render buffer
GetCurrentVideoSettings( &usWidth, &usHeight, &ubBitDepth );
vs_desc.fCreateFlags = VSURFACE_CREATE_DEFAULT | VSURFACE_SYSTEM_MEM_USAGE;
@@ -132,7 +132,7 @@ UINT32 MapUtilScreenHandle( )
//Allocate 24 bit Surface
p24BitValues = (RGBValues *) MemAlloc( MINIMAP_X_SIZE * MINIMAP_Y_SIZE * sizeof( RGBValues ) );
p24BitDest = (UINT8*)p24BitValues;
p24BitDest = (UINT8*)p24BitValues;
//Allocate 8-bit surface
@@ -153,7 +153,7 @@ UINT32 MapUtilScreenHandle( )
//OK, we are here, now loop through files
if ( sCurFile == sFiles || FListNode== NULL )
{
gfProgramIsRunning = FALSE;
gfProgramIsRunning = FALSE;
return( MAPUTILITY_SCREEN );
}
@@ -170,10 +170,10 @@ UINT32 MapUtilScreenHandle( )
gfOverheadMapDirty = TRUE;
RenderOverheadMap( 0, (WORLD_COLS / 2), iOffsetHorizontal,
RenderOverheadMap( 0, (WORLD_COLS / 2), iOffsetHorizontal,
iOffsetVertical, 640 + iOffsetHorizontal, 320 + iOffsetVertical, FALSE );
TrashOverheadMap( );
TrashOverheadMap( );
// OK, NOW PROCESS OVERHEAD MAP ( SHOUIDL BE ON THE FRAMEBUFFER )
gdXStep = (float)640/(float)88;
@@ -185,7 +185,7 @@ UINT32 MapUtilScreenHandle( )
{
CalculateRestrictedMapCoords( NORTH, &sX1, &sY1, &sX2, &sTop, iOffsetHorizontal + 640, iOffsetVertical + 320 );
CalculateRestrictedMapCoords( SOUTH, &sX1, &sBottom, &sX2, &sY2, iOffsetHorizontal + 640, iOffsetVertical + 320 );
CalculateRestrictedMapCoords( WEST, &sX1, &sY1, &sLeft, &sY2, iOffsetHorizontal + 640, iOffsetVertical + 320 );
CalculateRestrictedMapCoords( WEST, &sX1, &sY1, &sLeft, &sY2, iOffsetHorizontal + 640, iOffsetVertical + 320 );
CalculateRestrictedMapCoords( EAST, &sRight, &sY1, &sX2, &sY2, iOffsetHorizontal + 640, iOffsetVertical + 320 );
gdXStep = (float)( sRight - sLeft )/(float)88;
@@ -291,7 +291,7 @@ UINT32 MapUtilScreenHandle( )
UINT16 usLineColor;
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, 640, 480 );
for ( cnt = 0; cnt < 256; cnt++ )
{
usLineColor = Get16BPPColor( FROMRGB( pPalette[ cnt ].peRed, pPalette[ cnt ].peGreen, pPalette[ cnt ].peBlue ) );
@@ -320,19 +320,19 @@ UINT32 MapUtilScreenHandle( )
SetFont( TINYFONT1 );
SetFontBackground( FONT_MCOLOR_BLACK );
SetFontForeground( FONT_MCOLOR_DKGRAY );
SetFontForeground( FONT_MCOLOR_DKGRAY );
mprintf( 10, 340, L"Writing radar image %S", zFilename2 );
mprintf( 10, 350, L"Using tileset %s", gTilesets[ giCurrentTilesetID ].zName );
InvalidateScreen( );
while (DequeueEvent(&InputEvent) == TRUE)
{
if ((InputEvent.usEvent == KEY_DOWN)&&(InputEvent.usParam == ESC))
{ // Exit the program
gfProgramIsRunning = FALSE;
}
while (DequeueEvent(&InputEvent) == TRUE)
{
if ((InputEvent.usEvent == KEY_DOWN)&&(InputEvent.usParam == ESC))
{ // Exit the program
gfProgramIsRunning = FALSE;
}
}
// Set next
@@ -369,4 +369,4 @@ UINT32 MapUtilScreenShutdown( )
return( TRUE );
}
#endif
#endif
+57 -57
View File
@@ -57,11 +57,11 @@ STR8 zMercBorderPopupFilenames[ ] = {
// filenames for background popup .pcx's
STR8 zMercBackgroundPopupFilenames[ ] = {
"INTERFACE\\TactPopupBackground.pcx",
"INTERFACE\\TactPopupWhiteBackground.pcx",
"INTERFACE\\TactPopupGreyBackground.pcx",
"INTERFACE\\TactPopupBackgroundMain.pcx",
"INTERFACE\\LaptopPopupBackground.pcx",
"INTERFACE\\TactPopupBackground.pcx",
"INTERFACE\\TactPopupWhiteBackground.pcx",
"INTERFACE\\TactPopupGreyBackground.pcx",
"INTERFACE\\TactPopupBackgroundMain.pcx",
"INTERFACE\\LaptopPopupBackground.pcx",
"INTERFACE\\imp_popup_background.pcx",
};
@@ -98,7 +98,7 @@ BOOLEAN SetCurrentPopUpBox( UINT32 uiId )
// see if box inited
if( gpPopUpBoxList[ uiId ] != NULL )
{
{
gPopUpTextBox = gpPopUpBoxList[ uiId ];
return( TRUE );
}
@@ -127,7 +127,7 @@ BOOLEAN ResetOverrideMercPopupBox( )
BOOLEAN InitMercPopupBox( )
{
INT32 iCounter = 0;
VOBJECT_DESC VObjectDesc;
VOBJECT_DESC VObjectDesc;
// init the pop up box list
for( iCounter = 0; iCounter < MAX_NUMBER_OF_POPUP_BOXES; iCounter++ )
@@ -174,17 +174,17 @@ void GetMercPopupBoxFontColor( UINT8 ubBackgroundIndex, UINT8 *pubFontColor, UIN
BOOLEAN LoadTextMercPopupImages( UINT8 ubBackgroundIndex, UINT8 ubBorderIndex)
{
VSURFACE_DESC vs_desc;
VOBJECT_DESC VObjectDesc;
VOBJECT_DESC VObjectDesc;
// this function will load the graphics associated with the background and border index values
// this function will load the graphics associated with the background and border index values
// the background
vs_desc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;
strcpy(vs_desc.ImageFile, zMercBackgroundPopupFilenames [ ubBackgroundIndex ]);
vs_desc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;
strcpy(vs_desc.ImageFile, zMercBackgroundPopupFilenames [ ubBackgroundIndex ]);
CHECKF(AddVideoSurface(&vs_desc, &gPopUpTextBox->uiMercTextPopUpBackground));
// border
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
// border
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP( zMercBorderPopupFilenames[ ubBorderIndex ], VObjectDesc.ImageFile );
CHECKF( AddVideoObject( &VObjectDesc, &gPopUpTextBox->uiMercTextPopUpBorder ) );
@@ -206,7 +206,7 @@ void RemoveTextMercPopupImages( )
{
// the background
DeleteVideoSurfaceFromIndex( gPopUpTextBox->uiMercTextPopUpBackground );
// the border
DeleteVideoObjectFromIndex( gPopUpTextBox->uiMercTextPopUpBorder );
@@ -228,28 +228,28 @@ BOOLEAN RenderMercPopUpBoxFromIndex( INT32 iBoxId, INT16 sDestX, INT16 sDestY, U
}
// now attempt to render the box
return( RenderMercPopupBox( sDestX, sDestY, uiBuffer ) );
return( RenderMercPopupBox( sDestX, sDestY, uiBuffer ) );
}
BOOLEAN RenderMercPopupBox(INT16 sDestX, INT16 sDestY, UINT32 uiBuffer )
{
// UINT32 uiDestPitchBYTES;
// UINT32 uiSrcPitchBYTES;
// UINT16 *pDestBuf;
// UINT16 *pSrcBuf;
// UINT32 uiDestPitchBYTES;
// UINT32 uiSrcPitchBYTES;
// UINT16 *pDestBuf;
// UINT16 *pSrcBuf;
// will render/transfer the image from the buffer in the data structure to the buffer specified by user
BOOLEAN fReturnValue = TRUE;
// grab the destination buffer
// pDestBuf = ( UINT16* )LockVideoSurface( uiBuffer, &uiDestPitchBYTES );
// now lock it
// pSrcBuf = ( UINT16* )LockVideoSurface( gPopUpTextBox->uiSourceBufferIndex, &uiSrcPitchBYTES);
//check to see if we are wanting to blit a transparent background
//check to see if we are wanting to blit a transparent background
if ( gPopUpTextBox->uiFlags & MERC_POPUP_PREPARE_FLAGS_TRANS_BACK )
BltVideoSurface( uiBuffer, gPopUpTextBox->uiSourceBufferIndex, 0, sDestX, sDestY, VS_BLT_FAST | VS_BLT_USECOLORKEY, NULL );
else
@@ -257,8 +257,8 @@ BOOLEAN RenderMercPopupBox(INT16 sDestX, INT16 sDestY, UINT32 uiBuffer )
// blt, and grab return value
// fReturnValue = Blt16BPPTo16BPP(pDestBuf, uiDestPitchBYTES, pSrcBuf, uiSrcPitchBYTES, sDestX, sDestY, 0, 0, gPopUpTextBox->sWidth, gPopUpTextBox->sHeight);
// fReturnValue = Blt16BPPTo16BPP(pDestBuf, uiDestPitchBYTES, pSrcBuf, uiSrcPitchBYTES, sDestX, sDestY, 0, 0, gPopUpTextBox->sWidth, gPopUpTextBox->sHeight);
//Invalidate!
if ( uiBuffer == FRAME_BUFFER )
{
@@ -269,12 +269,12 @@ BOOLEAN RenderMercPopupBox(INT16 sDestX, INT16 sDestY, UINT32 uiBuffer )
// source
// UnLockVideoSurface( gPopUpTextBox->uiSourceBufferIndex );
// destination
// UnLockVideoSurface( uiBuffer );
// return success or failure
return fReturnValue;
return fReturnValue;
}
@@ -296,7 +296,7 @@ INT32 AddPopUpBoxToList( MercPopUpBox *pPopUpTextBox )
{
// found a spot, inset
gpPopUpBoxList[ iCounter ] = pPopUpTextBox;
// set as current
SetCurrentPopUpBox( iCounter );
@@ -315,23 +315,23 @@ MercPopUpBox * GetPopUpBoxIndex( INT32 iId )
return( gpPopUpBoxList[ iId ] );
}
INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorderIndex, STR16 pString,
UINT16 usWidth, UINT16 usMarginX, UINT16 usMarginTopY, UINT16 usMarginBottomY,
INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorderIndex, STR16 pString,
UINT16 usWidth, UINT16 usMarginX, UINT16 usMarginTopY, UINT16 usMarginBottomY,
UINT16 *pActualWidth, UINT16 *pActualHeight)
{
UINT16 usNumberVerticalPixels, usNumberOfLines;
UINT16 usTextWidth, usHeight;
UINT16 i;
HVOBJECT hImageHandle;
HVOBJECT hImageHandle;
UINT16 usPosY, usPosX;
VSURFACE_DESC vs_desc;
UINT16 usStringPixLength;
SGPRect DestRect;
HVSURFACE hSrcVSurface;
UINT32 uiDestPitchBYTES;
HVSURFACE hSrcVSurface;
UINT32 uiDestPitchBYTES;
UINT32 uiSrcPitchBYTES;
UINT16 *pDestBuf;
UINT8 *pSrcBuf;
UINT16 *pDestBuf;
UINT8 *pSrcBuf;
UINT8 ubFontColor, ubFontShadowColor;
UINT16 usColorVal;
UINT16 usLoopEnd;
@@ -348,7 +348,7 @@ INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorde
if( iBoxId == -1 )
{
// no box yet
// create box
pPopUpTextBox = (MercPopUpBox *) MemAlloc( sizeof( MercPopUpBox ) );
@@ -365,7 +365,7 @@ INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorde
}
else
{
// has been created already,
// has been created already,
// Check if these images are different
// grab box
@@ -373,7 +373,7 @@ INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorde
// box has valid id and no instance?..error
Assert( pPopUpTextBox );
// copy over ptr
gPopUpTextBox = pPopUpTextBox;
@@ -397,14 +397,14 @@ INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorde
if( usStringPixLength < ( usWidth - ( MERC_TEXT_POPUP_WINDOW_TEXT_OFFSET_X ) * 2 ) )
{
usWidth = usStringPixLength + MERC_TEXT_POPUP_WINDOW_TEXT_OFFSET_X * 2;
usTextWidth = usWidth - ( MERC_TEXT_POPUP_WINDOW_TEXT_OFFSET_X ) * 2 + 1;
usTextWidth = usWidth - ( MERC_TEXT_POPUP_WINDOW_TEXT_OFFSET_X ) * 2 + 1;
}
else
{
usTextWidth = usWidth - ( MERC_TEXT_POPUP_WINDOW_TEXT_OFFSET_X ) * 2 + 1 - usMarginX;
usTextWidth = usWidth - ( MERC_TEXT_POPUP_WINDOW_TEXT_OFFSET_X ) * 2 + 1 - usMarginX;
}
usNumberVerticalPixels = IanWrappedStringHeight(0,0, usTextWidth, 2, TEXT_POPUP_FONT, MERC_TEXT_COLOR, pString, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
usNumberVerticalPixels = IanWrappedStringHeight(0,0, usTextWidth, 2, TEXT_POPUP_FONT, MERC_TEXT_COLOR, pString, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
usNumberOfLines = usNumberVerticalPixels / TEXT_POPUP_GAP_BN_LINES;
@@ -464,12 +464,12 @@ INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorde
{
// Zero with yellow,
// Set source transparcenty
SetVideoSurfaceTransparency( pPopUpTextBox->uiSourceBufferIndex, FROMRGB( 255, 255, 0 ) );
SetVideoSurfaceTransparency( pPopUpTextBox->uiSourceBufferIndex, FROMRGB( 255, 255, 0 ) );
pDestBuf = (UINT16*)LockVideoSurface( pPopUpTextBox->uiSourceBufferIndex, &uiDestPitchBYTES);
pDestBuf = (UINT16*)LockVideoSurface( pPopUpTextBox->uiSourceBufferIndex, &uiDestPitchBYTES);
usColorVal = Get16BPPColor( FROMRGB( 255, 255, 0 ) );
usLoopEnd = ( usWidth * usHeight );
usLoopEnd = ( usWidth * usHeight );
for ( i = 0; i <usLoopEnd; i++ )
{
@@ -483,14 +483,14 @@ INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorde
{
if( !GetVideoSurface( &hSrcVSurface, pPopUpTextBox->uiMercTextPopUpBackground) )
{
AssertMsg( 0, String( "Failed to GetVideoSurface for PrepareMercPopupBox. VSurfaceID: %d",
AssertMsg( 0, String( "Failed to GetVideoSurface for PrepareMercPopupBox. VSurfaceID: %d",
pPopUpTextBox->uiMercTextPopUpBackground ) );
}
pDestBuf = (UINT16*)LockVideoSurface( pPopUpTextBox->uiSourceBufferIndex, &uiDestPitchBYTES);
pSrcBuf = LockVideoSurface( pPopUpTextBox->uiMercTextPopUpBackground, &uiSrcPitchBYTES);
Blt8BPPDataSubTo16BPPBuffer( pDestBuf, uiDestPitchBYTES, hSrcVSurface, pSrcBuf,uiSrcPitchBYTES,0,0, &DestRect);
Blt8BPPDataSubTo16BPPBuffer( pDestBuf, uiDestPitchBYTES, hSrcVSurface, pSrcBuf,uiSrcPitchBYTES,0,0, &DestRect);
UnLockVideoSurface( pPopUpTextBox->uiMercTextPopUpBackground);
UnLockVideoSurface(pPopUpTextBox->uiSourceBufferIndex);
@@ -503,17 +503,17 @@ INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorde
for(i=TEXT_POPUP_GAP_BN_LINES; i< usWidth-TEXT_POPUP_GAP_BN_LINES; i+=TEXT_POPUP_GAP_BN_LINES)
{
//TOP ROW
BltVideoObject(pPopUpTextBox->uiSourceBufferIndex, hImageHandle, 1,i, usPosY, VO_BLT_SRCTRANSPARENCY,NULL);
BltVideoObject(pPopUpTextBox->uiSourceBufferIndex, hImageHandle, 1,i, usPosY, VO_BLT_SRCTRANSPARENCY,NULL);
//BOTTOM ROW
BltVideoObject(pPopUpTextBox->uiSourceBufferIndex, hImageHandle, 6,i, usHeight - TEXT_POPUP_GAP_BN_LINES+6, VO_BLT_SRCTRANSPARENCY,NULL);
BltVideoObject(pPopUpTextBox->uiSourceBufferIndex, hImageHandle, 6,i, usHeight - TEXT_POPUP_GAP_BN_LINES+6, VO_BLT_SRCTRANSPARENCY,NULL);
}
//blit the left and right row of images
usPosX = 0;
for(i=TEXT_POPUP_GAP_BN_LINES; i< usHeight-TEXT_POPUP_GAP_BN_LINES; i+=TEXT_POPUP_GAP_BN_LINES)
{
BltVideoObject(pPopUpTextBox->uiSourceBufferIndex, hImageHandle, 3,usPosX, i, VO_BLT_SRCTRANSPARENCY,NULL);
BltVideoObject(pPopUpTextBox->uiSourceBufferIndex, hImageHandle, 4,usPosX+usWidth-4, i, VO_BLT_SRCTRANSPARENCY,NULL);
BltVideoObject(pPopUpTextBox->uiSourceBufferIndex, hImageHandle, 3,usPosX, i, VO_BLT_SRCTRANSPARENCY,NULL);
BltVideoObject(pPopUpTextBox->uiSourceBufferIndex, hImageHandle, 4,usPosX+usWidth-4, i, VO_BLT_SRCTRANSPARENCY,NULL);
}
//blt the corner images for the row
@@ -547,7 +547,7 @@ INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorde
if ( pPopUpTextBox->uiFlags & ( MERC_POPUP_PREPARE_FLAGS_STOPICON | MERC_POPUP_PREPARE_FLAGS_SKULLICON ) )
{
sDispTextXPos += 30;
sDispTextXPos += 30;
}
@@ -561,7 +561,7 @@ INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorde
}
//Display the text
DisplayWrappedString( sDispTextXPos, (INT16)(( MERC_TEXT_POPUP_WINDOW_TEXT_OFFSET_Y + usMarginTopY ) ), usTextWidth, 2, MERC_TEXT_FONT, ubFontColor, pString, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
DisplayWrappedString( sDispTextXPos, (INT16)(( MERC_TEXT_POPUP_WINDOW_TEXT_OFFSET_Y + usMarginTopY ) ), usTextWidth, 2, MERC_TEXT_FONT, ubFontColor, pString, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
//Disable the use of single word wordwrap
UseSingleCharWordsForWordWrap( FALSE );
@@ -569,7 +569,7 @@ INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorde
#else
{
//Display the text
DisplayWrappedString( sDispTextXPos, (INT16)(( MERC_TEXT_POPUP_WINDOW_TEXT_OFFSET_Y + usMarginTopY ) ), usTextWidth, 2, MERC_TEXT_FONT, ubFontColor, pString, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
DisplayWrappedString( sDispTextXPos, (INT16)(( MERC_TEXT_POPUP_WINDOW_TEXT_OFFSET_Y + usMarginTopY ) ), usTextWidth, 2, MERC_TEXT_FONT, ubFontColor, pString, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
}
#endif
@@ -613,8 +613,8 @@ BOOLEAN RemoveMercPopupBox()
{
if( gpPopUpBoxList[ iCounter ] == gPopUpTextBox )
{
gpPopUpBoxList[ iCounter ] = NULL;
iCounter = MAX_NUMBER_OF_POPUP_BOXES;
gpPopUpBoxList[ iCounter ] = NULL;
iCounter = MAX_NUMBER_OF_POPUP_BOXES;
}
}
// yep, get rid of the bloody...
+5 -5
View File
@@ -13,7 +13,7 @@ BOOLEAN InitMercPopupBox( );
// create a pop up box if needed, return id of box..a -1 means couldn't be added
INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorderIndex, STR16 pString, UINT16 usWidth, UINT16 usMarginX, UINT16 usMarginTopY, UINT16 usMarginBottomY, UINT16 *pActualWidth, UINT16 *pActualHeight);
INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorderIndex, STR16 pString, UINT16 usWidth, UINT16 usMarginX, UINT16 usMarginTopY, UINT16 usMarginBottomY, UINT16 *pActualWidth, UINT16 *pActualHeight);
// remove the current box
@@ -64,10 +64,10 @@ enum{
// border enumeration
enum{
BASIC_MERC_POPUP_BORDER =0,
RED_MERC_POPUP_BORDER,
BLUE_MERC_POPUP_BORDER,
DIALOG_MERC_POPUP_BORDER,
BASIC_MERC_POPUP_BORDER =0,
RED_MERC_POPUP_BORDER,
BLUE_MERC_POPUP_BORDER,
DIALOG_MERC_POPUP_BORDER,
LAPTOP_POP_BORDER
};
+9 -9
View File
@@ -241,25 +241,25 @@ BOOLEAN GetMLGFilename( SGPFILENAME filename, UINT16 usMLGGraphicID )
// "GERMAN\\IMPSymbol_German.sti"
#if defined( DUTCH )
sprintf( zLanguage, "DUTCH" );
sprintf( (char *)zLanguage, "DUTCH" );
#elif defined( FRENCH )
sprintf( zLanguage, "FRENCH" );
sprintf( (char *)zLanguage, "FRENCH" );
#elif defined( GERMAN )
sprintf( zLanguage, "GERMAN" );
sprintf( (char *)zLanguage, "GERMAN" );
#elif defined( ITALIAN )
sprintf( zLanguage, "ITALIAN" );
sprintf( (char *)zLanguage, "ITALIAN" );
#elif defined( JAPANESE )
sprintf( zLanguage, "JAPANESE" );
sprintf( (char *)zLanguage, "JAPANESE" );
#elif defined( KOREAN )
sprintf( zLanguage, "KOREAN" );
sprintf( (char *)zLanguage, "KOREAN" );
#elif defined( POLISH )
sprintf( zLanguage, "POLISH" );
sprintf( (char *)zLanguage, "POLISH" );
#elif defined( RUSSIAN )
sprintf( (char *)zLanguage, "RUSSIAN" );
#elif defined( SPANISH )
sprintf( zLanguage, "SPANISH" );
sprintf( (char *)zLanguage, "SPANISH" );
#elif defined( TAIWANESE )
sprintf( zLanguage, "TAIWANESE" );
sprintf( (char *)zLanguage, "TAIWANESE" );
#endif
//SB: Also check for russian Gold version, like English
+24 -24
View File
@@ -1,11 +1,11 @@
/*
MULTILINGUAL TEXT CODE GENERATOR
This code generator is used to conveniently compare the english master text file with another foreign language
such as German and verify that the appropriate language file is in perfect synch with the English. Verifying
that all of the strings have the correct order of printf format specifiers and the precise number. If
different, the errors are recorded via comments proceeding the string in question in the new file. For
simplicity, the German language will be used in examples throughout this documention. The comments will be
specially marked with "CONFLICT#xxx: error message" which can be searched for. The comment will report
MULTILINGUAL TEXT CODE GENERATOR
This code generator is used to conveniently compare the english master text file with another foreign language
such as German and verify that the appropriate language file is in perfect synch with the English. Verifying
that all of the strings have the correct order of printf format specifiers and the precise number. If
different, the errors are recorded via comments proceeding the string in question in the new file. For
simplicity, the German language will be used in examples throughout this documention. The comments will be
specially marked with "CONFLICT#xxx: error message" which can be searched for. The comment will report
the format specifiers used in the english version.
ASSUMPTIONS
@@ -13,17 +13,17 @@ ASSUMPTIONS
- Users don't use single strings using:
STR16 str[] = L"Single String";
Instead use:
STR16 str[] =
STR16 str[] =
{
L"Single String";
}
- Users don't use comments containing the { character later followed by the L" token. The code generator
will mistaken that for a string.
- Users don't use comments containing the { character later followed by the L" token. The code generator
will mistaken that for a string.
- Users don't use nested braces (2D text arrays)
AUTHOR: Kris Morness
AUTHOR: Kris Morness
CREATED: Feb 16, 1999
*/
@@ -37,8 +37,8 @@ CREATED: Feb 16, 1999
#include "Fileman.h"
//Currently in JA2's _EnglishText, these tokens make up all of the
//format specifiers that are actually used. Feel free to add more,
//but make sure you change NUM_TOKENS accordingly. These tokens assume
//format specifiers that are actually used. Feel free to add more,
//but make sure you change NUM_TOKENS accordingly. These tokens assume
//the previous character is a % character.
UINT8 SupportedTokens[] =
{
@@ -53,11 +53,11 @@ UINT8 SupportedTokens[] =
enum
{
//look for { character followed by L" before } to upgrade to INSIDE_STRING
OUTSIDE_STRING_ARRAY,
OUTSIDE_STRING_ARRAY,
//look for } character to downgrade to OUTSIDE_STRING_ARRAY
//look for L" characters to upgrade to INSIDE_STRING
INSIDE_STRING_ARRAY,
INSIDE_STRING_ARRAY,
//look for " character to downgrade to INSIDE_STRING_ARRAY
INSIDE_STRING,
@@ -67,7 +67,7 @@ enum
#define LCG_WORKINGDIRECTORY "build\\utils"
#define LCG_ENGLISHMASTERFILE "_EnglishText.c"
//The commandline argument (add different one for each language supported
//The commandline argument (add different one for each language supported
//***Only one can exist at a time and it is controlled by Language Defines.h )
#define LCG_COMMANDLINEARGUMENT "-GERMAN"
#define LCG_FOREIGNMASTERFILE "_GermanText.c"
@@ -77,7 +77,7 @@ enum
UINT32 CountDoubleByteStringsInFile( STR8 filename );
//One function does it all. First looks for the cmd line arg, and if it matches
//One function does it all. First looks for the cmd line arg, and if it matches
//the above define, searches for the files, and processes them automatically.
BOOLEAN ProcessIfMultilingualCmdLineArgDetected( STR8 str )
{
@@ -99,7 +99,7 @@ BOOLEAN ProcessIfMultilingualCmdLineArgDetected( STR8 str )
//Build the working directory name
sprintf( Dir, "%s\\%s", ExecDir, LCG_WORKINGDIRECTORY );
//Set the working directory
if( !SetFileManCurrentDirectory( Dir ) )
{ //We failed meaning the directory name is incorrect or non-existant
@@ -119,24 +119,24 @@ BOOLEAN ProcessIfMultilingualCmdLineArgDetected( STR8 str )
return FALSE;
}
//ALL PRELIMINARY CHECKS HAVE SUCCEEDED.
//ALL PRELIMINARY CHECKS HAVE SUCCEEDED.
//Begin file preparation checks...
//STEP1: Read the English master file and count the number of DB strings that exist
//STEP1: Read the English master file and count the number of DB strings that exist
uiEnglishStrings = CountDoubleByteStringsInFile( LCG_ENGLISHMASTERFILE );
//STEP2: Read the Foreigh master file and count the number of DB strings that exist
//STEP2: Read the Foreigh master file and count the number of DB strings that exist
uiForeignStrings = CountDoubleByteStringsInFile( LCG_FOREIGNMASTERFILE );
//Make sure they match, otherwise, we can't continue.
if( uiEnglishStrings != uiForeignStrings )
{
AssertMsg( 0, String( "Mismatch during LCG preparation: English DB strings: %d, Foreign DB strings: %d",
AssertMsg( 0, String( "Mismatch during LCG preparation: English DB strings: %d, Foreign DB strings: %d",
uiEnglishStrings, uiForeignStrings ) );
return FALSE;
}
//Mission complete! Reset the previously known directory, and return TRUE;
//Mission complete! Reset the previously known directory, and return TRUE;
SetFileManCurrentDirectory( CurrDir );
return TRUE;
}
+58 -57
View File
@@ -36,7 +36,7 @@ INT8 bBattleModeSong;
INT8 gbFadeSpeed = 1;
CHAR8 *szMusicList[NUM_MUSIC]=
CHAR8 *szMusicList[NUM_MUSIC]=
{
"MUSIC\\marimbad 2.wav",
"MUSIC\\menumix1.wav",
@@ -56,7 +56,7 @@ CHAR8 *szMusicList[NUM_MUSIC]=
};
BOOLEAN gfForceMusicToTense = FALSE;
BOOLEAN gfDontRestartSong = FALSE;
BOOLEAN gfDontRestartSong = FALSE;
BOOLEAN StartMusicBasedOnMode( );
void DoneFadeOutDueToEndMusic( void );
@@ -65,25 +65,25 @@ extern void HandleEndDemoInCreatureLevel( );
BOOLEAN NoEnemiesInSight( )
{
SOLDIERTYPE *pSoldier;
SOLDIERTYPE *pSoldier;
INT32 cnt;
// Loop through our guys
// End the turn of player charactors
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
// look for all mercs on the same team,
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++, pSoldier++ )
{
if ( pSoldier->bActive && pSoldier->bLife >= OKLIFE )
// look for all mercs on the same team,
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++, pSoldier++ )
{
if ( pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE )
{
if ( pSoldier->bOppCnt != 0 )
if ( pSoldier->aiData.bOppCnt != 0 )
{
return( FALSE );
return( FALSE );
}
}
}
return( TRUE );
}
@@ -100,18 +100,18 @@ void MusicStopCallback( void *pData );
BOOLEAN MusicPlay(UINT32 uiNum)
{
// WANNE: We want music in windowed mode
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
// return FALSE;
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
//return FALSE;
SOUNDPARMS spParms;
SOUNDPARMS spParms;
if(fMusicPlaying)
MusicStop();
memset(&spParms, 0xff, sizeof(SOUNDPARMS));
spParms.uiPriority=PRIORITY_MAX;
spParms.uiVolume=0;
spParms.uiLoop=1; // Lesh: only 1 line added
spParms.uiLoop=1; // Lesh: only 1 line added
spParms.EOSCallback = MusicStopCallback;
@@ -121,7 +121,7 @@ BOOLEAN MusicPlay(UINT32 uiNum)
if(uiMusicHandle!=SOUND_ERROR)
{
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music PLay %d %d", uiMusicHandle, gubMusicMode ) );
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music PLay %d %d", uiMusicHandle, gubMusicMode ) );
gfMusicEnded = FALSE;
fMusicPlaying=TRUE;
@@ -129,7 +129,7 @@ BOOLEAN MusicPlay(UINT32 uiNum)
return(TRUE);
}
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music PLay %d %d", uiMusicHandle, gubMusicMode ) );
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music PLay %d %d", uiMusicHandle, gubMusicMode ) );
return(FALSE);
}
@@ -143,36 +143,36 @@ BOOLEAN MusicPlay(UINT32 uiNum)
//********************************************************************************
BOOLEAN MusicSetVolume(UINT32 uiVolume)
{
INT32 uiOldMusicVolume = uiMusicVolume;
INT32 uiOldMusicVolume = uiMusicVolume;
// WANNE: We want music in windowed mode
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
// return FALSE;
// WANNE: We want music in windowed mode
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
//return FALSE;
uiMusicVolume=__min(uiVolume, 127);
uiMusicVolume=__min(uiVolume, 127);
if(uiMusicHandle!=NO_SAMPLE)
{
// get volume and if 0 stop music!
if ( uiMusicVolume == 0 )
{
gfDontRestartSong = TRUE;
MusicStop( );
return( TRUE );
}
// get volume and if 0 stop music!
if ( uiMusicVolume == 0 )
{
gfDontRestartSong = TRUE;
MusicStop( );
return( TRUE );
}
SoundSetVolume(uiMusicHandle, uiMusicVolume);
return(TRUE);
}
// If here, check if we need to re-start music
// Have we re-started?
if ( uiMusicVolume > 0 && uiOldMusicVolume == 0 )
{
StartMusicBasedOnMode( );
}
// If here, check if we need to re-start music
// Have we re-started?
if ( uiMusicVolume > 0 && uiOldMusicVolume == 0 )
{
StartMusicBasedOnMode( );
}
return(FALSE);
}
@@ -201,8 +201,8 @@ UINT32 MusicGetVolume(void)
BOOLEAN MusicStop(void)
{
// WANNE: We want music in windowed mode
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
// return(FALSE);
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
// return(FALSE);
if(uiMusicHandle!=NO_SAMPLE)
@@ -269,8 +269,8 @@ BOOLEAN MusicPoll( BOOLEAN fForce )
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"MusicPoll");
// WANNE: We want music in windowed mode
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
//return(TRUE);
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
// return(TRUE);
INT32 iVol;
@@ -281,7 +281,7 @@ BOOLEAN MusicPoll( BOOLEAN fForce )
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"MusicPoll: Handle Sound every sound overhead time");
// Handle Sound every sound overhead time....
if ( COUNTERDONE( MUSICOVERHEAD ) )
if ( COUNTERDONE( MUSICOVERHEAD ) )
{
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"MusicPoll: Reset counter");
// Reset counter
@@ -343,17 +343,17 @@ BOOLEAN MusicPoll( BOOLEAN fForce )
SetMusicMode( MUSIC_TACTICAL_NOTHING );
}
}
else
else
{
if ( !gfDontRestartSong )
{
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"MusicPoll: don't restart song, StartMusicBasedOnMode");
StartMusicBasedOnMode( );
}
}
}
gfMusicEnded = FALSE;
gfDontRestartSong = FALSE;
gfDontRestartSong = FALSE;
}
}
@@ -370,10 +370,10 @@ BOOLEAN SetMusicMode( UINT8 ubMusicMode )
// OK, check if we want to restore
if ( ubMusicMode == MUSIC_RESTORE )
{
if ( bPreviousMode == MUSIC_TACTICAL_VICTORY || bPreviousMode == MUSIC_TACTICAL_DEATH )
{
bPreviousMode = MUSIC_TACTICAL_NOTHING;
}
if ( bPreviousMode == MUSIC_TACTICAL_VICTORY || bPreviousMode == MUSIC_TACTICAL_DEATH )
{
bPreviousMode = MUSIC_TACTICAL_NOTHING;
}
ubMusicMode = bPreviousMode;
}
@@ -382,19 +382,19 @@ BOOLEAN SetMusicMode( UINT8 ubMusicMode )
// Save previous mode...
bPreviousMode = gubOldMusicMode;
}
// if different, start a new music song
if ( gubOldMusicMode != ubMusicMode )
{
// Set mode....
gubMusicMode = ubMusicMode;
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music New Mode %d %d", uiMusicHandle, gubMusicMode ) );
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music New Mode %d %d", uiMusicHandle, gubMusicMode ) );
gbVictorySongCount = 0;
gbDeathSongCount = 0;
if(uiMusicHandle!=NO_SAMPLE )
if(uiMusicHandle!=NO_SAMPLE )
{
// Fade out old music
MusicFadeOut( );
@@ -435,7 +435,7 @@ BOOLEAN StartMusicBasedOnMode( )
switch( gubMusicMode )
{
case MUSIC_MAIN_MENU:
// ATE: Don't fade in
// ATE: Don't fade in
gbFadeSpeed = (INT8)uiMusicVolume;
MusicPlay( MENUMIX_MUSIC );
break;
@@ -446,7 +446,7 @@ BOOLEAN StartMusicBasedOnMode( )
break;
case MUSIC_TACTICAL_NOTHING:
// ATE: Don't fade in
// ATE: Don't fade in
gbFadeSpeed = (INT8)uiMusicVolume;
if( gfUseCreatureMusic )
{
@@ -474,7 +474,7 @@ BOOLEAN StartMusicBasedOnMode( )
break;
case MUSIC_TACTICAL_BATTLE:
// ATE: Don't fade in
// ATE: Don't fade in
gbFadeSpeed = (INT8)uiMusicVolume;
if( gfUseCreatureMusic )
{
@@ -519,9 +519,9 @@ BOOLEAN StartMusicBasedOnMode( )
void MusicStopCallback( void *pData )
{
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music EndCallback %d %d", uiMusicHandle, gubMusicMode ) );
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music EndCallback %d %d", uiMusicHandle, gubMusicMode ) );
gfMusicEnded = TRUE;
gfMusicEnded = TRUE;
uiMusicHandle = NO_SAMPLE;
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Music EndCallback completed" );
@@ -555,3 +555,4 @@ void DoneFadeOutDueToEndMusic( void )
//SetPendingNewScreen( MAINMENU_SCREEN );
}
+190 -190
View File
@@ -6,14 +6,14 @@
#endif
#define BORDER_WIDTH 16
#define BORDER_HEIGHT 8
#define TOP_LEFT_CORNER 0
#define TOP_EDGE 4
#define TOP_RIGHT_CORNER 1
#define SIDE_EDGE 5
#define BOTTOM_LEFT_CORNER 2
#define BOTTOM_EDGE 4
#define BORDER_WIDTH 16
#define BORDER_HEIGHT 8
#define TOP_LEFT_CORNER 0
#define TOP_EDGE 4
#define TOP_RIGHT_CORNER 1
#define SIDE_EDGE 5
#define BOTTOM_LEFT_CORNER 2
#define BOTTOM_EDGE 4
#define BOTTOM_RIGHT_CORNER 3
@@ -74,7 +74,7 @@ void SpecifyBoxMinWidth( INT32 hBoxHandle, INT32 iMinWidth )
Assert( PopUpBoxList[ hBoxHandle ] );
PopUpBoxList[hBoxHandle]->uiBoxMinWidth = iMinWidth;
// check if the box is currently too small
if( PopUpBoxList[hBoxHandle]->Dimensions.iRight < iMinWidth )
{
@@ -105,7 +105,7 @@ BOOLEAN CreatePopUpBox(INT32 *phBoxHandle, SGPRect Dimensions, SGPPoint Position
iCount=iCounter;
*phBoxHandle=iCount;
pBox= (PopUpBoxPt) MemAlloc(sizeof(PopUpBo));
pBox= (PopUpBoxPt) MemAlloc(sizeof(PopUpBo));
if (pBox == NULL)
{
return FALSE;
@@ -119,8 +119,8 @@ BOOLEAN CreatePopUpBox(INT32 *phBoxHandle, SGPRect Dimensions, SGPPoint Position
for(iCounter=0; iCounter < MAX_POPUP_BOX_STRING_COUNT; iCounter++)
{
PopUpBoxList[iCount]->Text[iCounter]=NULL;
PopUpBoxList[iCount]->pSecondColumnString[iCounter]=NULL;
PopUpBoxList[iCount]->Text[iCounter]=NULL;
PopUpBoxList[iCount]->pSecondColumnString[iCounter]=NULL;
}
SetCurrentBox(iCount);
@@ -130,7 +130,7 @@ BOOLEAN CreatePopUpBox(INT32 *phBoxHandle, SGPRect Dimensions, SGPPoint Position
PopUpBoxList[iCount]->fUpdated = FALSE;
return TRUE;
return TRUE;
}
@@ -141,8 +141,8 @@ void SetBoxFlags( INT32 hBoxHandle, UINT32 uiFlags)
Assert( PopUpBoxList[ hBoxHandle ] );
PopUpBoxList[hBoxHandle]->uiFlags=uiFlags;
PopUpBoxList[hBoxHandle]->fUpdated = FALSE;
PopUpBoxList[hBoxHandle]->uiFlags=uiFlags;
PopUpBoxList[hBoxHandle]->fUpdated = FALSE;
return;
}
@@ -155,12 +155,12 @@ void SetMargins(INT32 hBoxHandle, UINT32 uiLeft, UINT32 uiTop, UINT32 uiBottom,
Assert( PopUpBoxList[ hBoxHandle ] );
PopUpBoxList[hBoxHandle]->uiLeftMargin=uiLeft;
PopUpBoxList[hBoxHandle]->uiRightMargin=uiRight;
PopUpBoxList[hBoxHandle]->uiTopMargin=uiTop;
PopUpBoxList[hBoxHandle]->uiBottomMargin=uiBottom;
PopUpBoxList[hBoxHandle]->uiLeftMargin=uiLeft;
PopUpBoxList[hBoxHandle]->uiRightMargin=uiRight;
PopUpBoxList[hBoxHandle]->uiTopMargin=uiTop;
PopUpBoxList[hBoxHandle]->uiBottomMargin=uiBottom;
PopUpBoxList[hBoxHandle]-> fUpdated = FALSE;
PopUpBoxList[hBoxHandle]->fUpdated = FALSE;
return;
}
@@ -188,8 +188,8 @@ void ShadeStringInBox( INT32 hBoxHandle, INT32 iLineNumber )
Assert( PopUpBoxList[ hBoxHandle ] );
if( PopUpBoxList[hBoxHandle]->Text[iLineNumber]!=NULL)
{
if( PopUpBoxList[hBoxHandle]->Text[iLineNumber]!=NULL)
{
// set current box
SetCurrentBox( hBoxHandle );
@@ -210,7 +210,7 @@ void UnShadeStringInBox( INT32 hBoxHandle, INT32 iLineNumber )
Assert( PopUpBoxList[ hBoxHandle ] );
if( PopUpBoxList[hBoxHandle]->Text[iLineNumber]!=NULL)
{
{
// set current box
SetCurrentBox( hBoxHandle );
@@ -231,8 +231,8 @@ void SecondaryShadeStringInBox( INT32 hBoxHandle, INT32 iLineNumber )
Assert( PopUpBoxList[ hBoxHandle ] );
if( PopUpBoxList[hBoxHandle]->Text[iLineNumber]!=NULL)
{
if( PopUpBoxList[hBoxHandle]->Text[iLineNumber]!=NULL)
{
// set current box
SetCurrentBox( hBoxHandle );
@@ -253,7 +253,7 @@ void UnSecondaryShadeStringInBox( INT32 hBoxHandle, INT32 iLineNumber )
Assert( PopUpBoxList[ hBoxHandle ] );
if( PopUpBoxList[hBoxHandle]->Text[iLineNumber]!=NULL)
{
{
// set current box
SetCurrentBox( hBoxHandle );
@@ -275,7 +275,7 @@ void SetBoxBuffer(INT32 hBoxHandle, UINT32 uiBuffer)
PopUpBoxList[hBoxHandle]->uiBuffer=uiBuffer;
PopUpBoxList[hBoxHandle]-> fUpdated = FALSE;
PopUpBoxList[hBoxHandle]->fUpdated = FALSE;
return;
}
@@ -291,9 +291,9 @@ void SetBoxPosition( INT32 hBoxHandle,SGPPoint Position )
PopUpBoxList[hBoxHandle]->Position.iX=Position.iX;
PopUpBoxList[hBoxHandle]->Position.iY=Position.iY;
PopUpBoxList[hBoxHandle]-> fUpdated = FALSE;
PopUpBoxList[hBoxHandle]->fUpdated = FALSE;
return;
return;
}
@@ -304,8 +304,8 @@ void GetBoxPosition( INT32 hBoxHandle, SGPPoint *Position )
Assert( PopUpBoxList[ hBoxHandle ] );
Position -> iX = PopUpBoxList[hBoxHandle]->Position.iX;
Position -> iY = PopUpBoxList[hBoxHandle]->Position.iY;
Position->iX = PopUpBoxList[hBoxHandle]->Position.iX;
Position->iY = PopUpBoxList[hBoxHandle]->Position.iY;
return;
}
@@ -322,7 +322,7 @@ void SetBoxSize(INT32 hBoxHandle,SGPRect Dimensions)
PopUpBoxList[hBoxHandle]->Dimensions.iRight=Dimensions.iRight;
PopUpBoxList[hBoxHandle]->Dimensions.iTop=Dimensions.iTop;
PopUpBoxList[hBoxHandle]-> fUpdated = FALSE;
PopUpBoxList[hBoxHandle]->fUpdated = FALSE;
return;
}
@@ -335,15 +335,15 @@ void GetBoxSize( INT32 hBoxHandle, SGPRect *Dimensions )
Assert( PopUpBoxList[ hBoxHandle ] );
Dimensions -> iLeft = PopUpBoxList[hBoxHandle]->Dimensions.iLeft;
Dimensions -> iBottom = PopUpBoxList[hBoxHandle]->Dimensions.iBottom;
Dimensions -> iRight = PopUpBoxList[hBoxHandle]->Dimensions.iRight;
Dimensions -> iTop = PopUpBoxList[hBoxHandle]->Dimensions.iTop;
Dimensions->iLeft = PopUpBoxList[hBoxHandle]->Dimensions.iLeft;
Dimensions->iBottom = PopUpBoxList[hBoxHandle]->Dimensions.iBottom;
Dimensions->iRight = PopUpBoxList[hBoxHandle]->Dimensions.iRight;
Dimensions->iTop = PopUpBoxList[hBoxHandle]->Dimensions.iTop;
return;
}
void SetBorderType(INT32 hBoxHandle, INT32 iBorderObjectIndex)
{
if ( ( hBoxHandle < 0 ) || ( hBoxHandle >= MAX_POPUP_BOX_COUNT ) )
@@ -408,8 +408,8 @@ void AddMonoString(UINT32 *hStringHandle, STR16 pString)
PopUpBoxList[guiCurrentBox]->Text[iCounter]->fSecondaryShadeFlag = FALSE;
*hStringHandle=iCounter;
PopUpBoxList[guiCurrentBox]-> fUpdated = FALSE;
PopUpBoxList[guiCurrentBox]->fUpdated = FALSE;
return;
}
@@ -438,25 +438,25 @@ void AddSecondColumnMonoString( UINT32 *hStringHandle, STR16 pString )
return;
}
pStringSt=(POPUPSTRING *)(MemAlloc(sizeof(POPUPSTRING)));
pStringSt=(POPUPSTRING *)(MemAlloc(sizeof(POPUPSTRING)));
if (pStringSt == NULL)
return;
pLocalString=(STR16)MemAlloc((wcslen(pString)+1)*sizeof(CHAR16));
pLocalString=(STR16)MemAlloc((wcslen(pString)+1)*sizeof(CHAR16));
if (pLocalString == NULL)
return;
wcscpy(pLocalString, pString);
wcscpy(pLocalString, pString);
RemoveCurrentBoxSecondaryText( iCounter );
PopUpBoxList[guiCurrentBox]->pSecondColumnString[iCounter]=pStringSt;
PopUpBoxList[guiCurrentBox]->pSecondColumnString[iCounter]->fColorFlag=FALSE;
PopUpBoxList[guiCurrentBox]->pSecondColumnString[iCounter]->pString=pLocalString;
PopUpBoxList[guiCurrentBox]->pSecondColumnString[iCounter]->fShadeFlag = FALSE;
PopUpBoxList[guiCurrentBox]->pSecondColumnString[iCounter]->fHighLightFlag = FALSE;
PopUpBoxList[guiCurrentBox]->pSecondColumnString[iCounter]->fColorFlag=FALSE;
PopUpBoxList[guiCurrentBox]->pSecondColumnString[iCounter]->pString=pLocalString;
PopUpBoxList[guiCurrentBox]->pSecondColumnString[iCounter]->fShadeFlag = FALSE;
PopUpBoxList[guiCurrentBox]->pSecondColumnString[iCounter]->fHighLightFlag = FALSE;
*hStringHandle=iCounter;
*hStringHandle=iCounter;
return;
}
@@ -503,7 +503,7 @@ void AddColorString(INT32 *hStringHandle, STR16 pString)
*hStringHandle=iCounter;
PopUpBoxList[guiCurrentBox]-> fUpdated = FALSE;
PopUpBoxList[guiCurrentBox]->fUpdated = FALSE;
return;
}
@@ -575,14 +575,14 @@ void SetBoxFont(INT32 hBoxHandle, UINT32 uiFont)
{
if ( PopUpBoxList[hBoxHandle]->Text[uiCounter] != NULL)
{
PopUpBoxList[hBoxHandle]->Text[uiCounter]->uiFont=uiFont;
PopUpBoxList[hBoxHandle]->Text[uiCounter]->uiFont=uiFont;
}
}
// set up the 2nd column font
SetBoxSecondColumnFont( hBoxHandle, uiFont );
PopUpBoxList[hBoxHandle]-> fUpdated = FALSE;
PopUpBoxList[hBoxHandle]->fUpdated = FALSE;
return;
}
@@ -614,13 +614,13 @@ void SetBoxSecondColumnFont(INT32 hBoxHandle, UINT32 uiFont)
for( iCounter = 0; iCounter < MAX_POPUP_BOX_STRING_COUNT; iCounter++ )
{
if( PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter] )
{
if( PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter] )
{
PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter]->uiFont=uiFont;
}
}
}
PopUpBoxList[hBoxHandle]-> fUpdated = FALSE;
PopUpBoxList[hBoxHandle]->fUpdated = FALSE;
return;
}
@@ -825,7 +825,7 @@ void SetBoxForeground(INT32 hBoxHandle, UINT8 ubColor)
{
if (PopUpBoxList[hBoxHandle]->Text[uiCounter]!=NULL)
{
PopUpBoxList[hBoxHandle]->Text[uiCounter]->ubForegroundColor=ubColor;
PopUpBoxList[hBoxHandle]->Text[uiCounter]->ubForegroundColor=ubColor;
}
}
return;
@@ -844,7 +844,7 @@ void SetBoxBackground(INT32 hBoxHandle, UINT8 ubColor)
{
if (PopUpBoxList[hBoxHandle]->Text[uiCounter]!=NULL)
{
PopUpBoxList[hBoxHandle]->Text[uiCounter]->ubBackgroundColor=ubColor;
PopUpBoxList[hBoxHandle]->Text[uiCounter]->ubBackgroundColor=ubColor;
}
}
return;
@@ -863,7 +863,7 @@ void SetBoxHighLight(INT32 hBoxHandle, UINT8 ubColor)
{
if (PopUpBoxList[hBoxHandle]->Text[uiCounter]!=NULL)
{
PopUpBoxList[hBoxHandle]->Text[uiCounter]->ubHighLight=ubColor;
PopUpBoxList[hBoxHandle]->Text[uiCounter]->ubHighLight=ubColor;
}
}
return;
@@ -882,7 +882,7 @@ void SetBoxShade(INT32 hBoxHandle, UINT8 ubColor)
{
if (PopUpBoxList[hBoxHandle]->Text[uiCounter]!=NULL)
{
PopUpBoxList[hBoxHandle]->Text[uiCounter]->ubShade=ubColor;
PopUpBoxList[hBoxHandle]->Text[uiCounter]->ubShade=ubColor;
}
}
return;
@@ -891,7 +891,7 @@ void SetBoxShade(INT32 hBoxHandle, UINT8 ubColor)
void SetBoxSecondColumnForeground(INT32 hBoxHandle, UINT8 ubColor)
{
UINT32 iCounter=0;
if ( ( hBoxHandle < 0 ) || ( hBoxHandle >= MAX_POPUP_BOX_COUNT ) )
return;
@@ -899,10 +899,10 @@ void SetBoxSecondColumnForeground(INT32 hBoxHandle, UINT8 ubColor)
for( iCounter = 0; iCounter < MAX_POPUP_BOX_STRING_COUNT; iCounter++ )
{
if( PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter] )
{
PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter]->ubForegroundColor=ubColor;
}
if( PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter] )
{
PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter]->ubForegroundColor=ubColor;
}
}
return;
@@ -919,10 +919,10 @@ void SetBoxSecondColumnBackground(INT32 hBoxHandle, UINT8 ubColor)
for( iCounter = 0; iCounter < MAX_POPUP_BOX_STRING_COUNT; iCounter++ )
{
if( PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter] )
{
PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter]->ubBackgroundColor=ubColor;
}
if( PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter] )
{
PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter]->ubBackgroundColor=ubColor;
}
}
return;
@@ -939,10 +939,10 @@ void SetBoxSecondColumnHighLight(INT32 hBoxHandle, UINT8 ubColor)
for( iCounter = 0; iCounter < MAX_POPUP_BOX_STRING_COUNT; iCounter++ )
{
if( PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter] )
{
if( PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter] )
{
PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter]->ubHighLight=ubColor;
}
}
}
return;
@@ -959,10 +959,10 @@ void SetBoxSecondColumnShade(INT32 hBoxHandle, UINT8 ubColor)
for( iCounter = 0; iCounter < MAX_POPUP_BOX_STRING_COUNT; iCounter++ )
{
if( PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter] )
{
if( PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter] )
{
PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter]->ubShade=ubColor;
}
}
}
return;
}
@@ -976,7 +976,7 @@ void HighLightLine(INT32 hStringHandle)
Assert( PopUpBoxList[guiCurrentBox] != NULL );
if(!PopUpBoxList[guiCurrentBox]->Text[hStringHandle])
return;
return;
PopUpBoxList[guiCurrentBox]->Text[hStringHandle]->fHighLightFlag=TRUE;
return;
}
@@ -989,7 +989,7 @@ BOOLEAN GetShadeFlag( INT32 hStringHandle )
Assert( PopUpBoxList[guiCurrentBox] != NULL );
if(!PopUpBoxList[guiCurrentBox]->Text[hStringHandle])
return( FALSE );
return( FALSE );
return( PopUpBoxList[guiCurrentBox]->Text[hStringHandle]->fShadeFlag);
}
@@ -1002,7 +1002,7 @@ BOOLEAN GetSecondaryShadeFlag( INT32 hStringHandle )
Assert( PopUpBoxList[guiCurrentBox] != NULL );
if(!PopUpBoxList[guiCurrentBox]->Text[hStringHandle])
return( FALSE );
return( FALSE );
return( PopUpBoxList[guiCurrentBox]->Text[hStringHandle]->fSecondaryShadeFlag );
}
@@ -1015,8 +1015,8 @@ void HighLightBoxLine( INT32 hBoxHandle, INT32 iLineNumber )
// highlight iLineNumber Line in box indexed by hBoxHandle
if( PopUpBoxList[hBoxHandle]->Text[iLineNumber]!=NULL)
{
if( PopUpBoxList[hBoxHandle]->Text[iLineNumber]!=NULL)
{
// set current box
SetCurrentBox( hBoxHandle );
@@ -1033,8 +1033,8 @@ BOOLEAN GetBoxShadeFlag( INT32 hBoxHandle, INT32 iLineNumber )
return(FALSE);
if( PopUpBoxList[hBoxHandle]->Text[iLineNumber]!=NULL)
{
return( PopUpBoxList[hBoxHandle]->Text[iLineNumber]->fShadeFlag );
{
return( PopUpBoxList[hBoxHandle]->Text[iLineNumber]->fShadeFlag );
}
@@ -1047,8 +1047,8 @@ BOOLEAN GetBoxSecondaryShadeFlag( INT32 hBoxHandle, INT32 iLineNumber )
return(FALSE);
if( PopUpBoxList[hBoxHandle]->Text[iLineNumber]!=NULL)
{
return( PopUpBoxList[hBoxHandle]->Text[iLineNumber]->fSecondaryShadeFlag );
{
return( PopUpBoxList[hBoxHandle]->Text[iLineNumber]->fSecondaryShadeFlag );
}
@@ -1063,7 +1063,7 @@ void UnHighLightLine(INT32 hStringHandle)
Assert( PopUpBoxList[guiCurrentBox] != NULL );
if(!PopUpBoxList[guiCurrentBox]->Text[hStringHandle])
return;
return;
PopUpBoxList[guiCurrentBox]->Text[hStringHandle]->fHighLightFlag=FALSE;
return;
}
@@ -1078,7 +1078,7 @@ void UnHighLightBox(INT32 hBoxHandle)
for(iCounter=0; iCounter <MAX_POPUP_BOX_STRING_COUNT;iCounter++)
{
if(PopUpBoxList[hBoxHandle]->Text[iCounter])
PopUpBoxList[hBoxHandle]->Text[iCounter]->fHighLightFlag=FALSE;
PopUpBoxList[hBoxHandle]->Text[iCounter]->fHighLightFlag=FALSE;
}
}
@@ -1090,7 +1090,7 @@ void UnHighLightSecondColumnLine(INT32 hStringHandle)
Assert( PopUpBoxList[guiCurrentBox] != NULL );
if(!PopUpBoxList[guiCurrentBox]->pSecondColumnString[hStringHandle])
return;
return;
PopUpBoxList[guiCurrentBox]->pSecondColumnString[hStringHandle]->fHighLightFlag=FALSE;
return;
@@ -1106,7 +1106,7 @@ void UnHighLightSecondColumnBox(INT32 hBoxHandle)
for(iCounter=0; iCounter <MAX_POPUP_BOX_STRING_COUNT;iCounter++)
{
if(PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter])
PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter]->fHighLightFlag=FALSE;
PopUpBoxList[hBoxHandle]->pSecondColumnString[iCounter]->fHighLightFlag=FALSE;
}
}
@@ -1132,8 +1132,8 @@ void RemoveOneCurrentBoxString(INT32 hStringHandle, BOOLEAN fFillGaps)
PopUpBoxList[guiCurrentBox]->pSecondColumnString[uiCounter]=PopUpBoxList[guiCurrentBox]->pSecondColumnString[uiCounter+1];
}
}
PopUpBoxList[guiCurrentBox]-> fUpdated = FALSE;
PopUpBoxList[guiCurrentBox]->fUpdated = FALSE;
}
@@ -1167,7 +1167,7 @@ void RemoveBox(INT32 hBoxHandle)
PopUpBoxList[hBoxHandle]=NULL;
if(hOldBoxHandle !=hBoxHandle)
SetCurrentBox(hOldBoxHandle);
SetCurrentBox(hOldBoxHandle);
return;
}
@@ -1211,7 +1211,7 @@ void SetCurrentBox(INT32 hBoxHandle)
if ( ( hBoxHandle < 0 ) || ( hBoxHandle >= MAX_POPUP_BOX_COUNT ) )
return;
guiCurrentBox = hBoxHandle;
guiCurrentBox = hBoxHandle;
}
@@ -1224,13 +1224,13 @@ void GetCurrentBox(INT32 *hBoxHandle)
void DisplayBoxes(UINT32 uiBuffer)
{
UINT32 uiCounter;
UINT32 uiCounter;
for( uiCounter=0; uiCounter < MAX_POPUP_BOX_COUNT; uiCounter++ )
{
DisplayOnePopupBox( uiCounter, uiBuffer );
}
return;
}
return;
}
@@ -1241,10 +1241,10 @@ void DisplayOnePopupBox( UINT32 uiIndex, UINT32 uiBuffer )
if ( PopUpBoxList[ uiIndex ] != NULL )
{
if( ( PopUpBoxList[ uiIndex ]->uiBuffer == uiBuffer) && ( PopUpBoxList[ uiIndex ]->fShowBox ) )
if( ( PopUpBoxList[ uiIndex ]->uiBuffer == uiBuffer) && ( PopUpBoxList[ uiIndex ]->fShowBox ) )
{
DrawBox( uiIndex );
DrawBoxText( uiIndex );
DrawBox( uiIndex );
DrawBoxText( uiIndex );
}
}
}
@@ -1267,18 +1267,18 @@ void ForceUpDateOfBox( UINT32 uiIndex )
BOOLEAN DrawBox(UINT32 uiCounter)
{
// will build pop up box in usTopX, usTopY with dimensions usWidth and usHeight
UINT32 uiNumTilesWide;
// will build pop up box in usTopX, usTopY with dimensions usWidth and usHeight
UINT32 uiNumTilesWide;
UINT32 uiNumTilesHigh;
UINT32 uiCount=0;
HVOBJECT hBoxHandle;
HVSURFACE hSrcVSurface;
UINT32 uiDestPitchBYTES;
HVOBJECT hBoxHandle;
HVSURFACE hSrcVSurface;
UINT32 uiDestPitchBYTES;
UINT32 uiSrcPitchBYTES;
UINT16 *pDestBuf;
UINT8 *pSrcBuf;
UINT16 *pDestBuf;
UINT8 *pSrcBuf;
SGPRect clip;
UINT16 usTopX, usTopY;
UINT16 usTopX, usTopY;
UINT16 usWidth, usHeight;
@@ -1290,12 +1290,12 @@ BOOLEAN DrawBox(UINT32 uiCounter)
// only update if we need to
if( PopUpBoxList[uiCounter]-> fUpdated == TRUE )
if( PopUpBoxList[uiCounter]->fUpdated == TRUE )
{
return( FALSE );
}
PopUpBoxList[uiCounter]-> fUpdated = TRUE;
PopUpBoxList[uiCounter]->fUpdated = TRUE;
if( PopUpBoxList[uiCounter]->uiFlags & POPUP_BOX_FLAG_RESIZE )
{
@@ -1314,7 +1314,7 @@ BOOLEAN DrawBox(UINT32 uiCounter)
}
// make sure it will fit on screen!
Assert( usTopX + usWidth <= SCREEN_WIDTH );
Assert( usTopX + usWidth <= SCREEN_WIDTH );
Assert( usTopY + usHeight <= SCREEN_HEIGHT );
// subtract 4 because the 2 2-pixel corners are handled separately
@@ -1322,58 +1322,58 @@ BOOLEAN DrawBox(UINT32 uiCounter)
uiNumTilesHigh=((usHeight-4)/BORDER_HEIGHT);
clip.iLeft=0;
clip.iRight=clip.iLeft+usWidth;
clip.iRight=clip.iLeft+usWidth;
clip.iTop=0;
clip.iBottom=clip.iTop+usHeight;
// blit in texture first, then borders
// blit in surface
pDestBuf = (UINT16*)LockVideoSurface(PopUpBoxList[uiCounter]->uiBuffer, &uiDestPitchBYTES);
CHECKF( GetVideoSurface( &hSrcVSurface, PopUpBoxList[uiCounter]->iBackGroundSurface) );
// blit in surface
pDestBuf = (UINT16*)LockVideoSurface(PopUpBoxList[uiCounter]->uiBuffer, &uiDestPitchBYTES);
CHECKF( GetVideoSurface( &hSrcVSurface, PopUpBoxList[uiCounter]->iBackGroundSurface) );
pSrcBuf = LockVideoSurface( PopUpBoxList[uiCounter]->iBackGroundSurface, &uiSrcPitchBYTES);
Blt8BPPDataSubTo16BPPBuffer( pDestBuf, uiDestPitchBYTES, hSrcVSurface, pSrcBuf,uiSrcPitchBYTES,usTopX,usTopY, &clip);
Blt8BPPDataSubTo16BPPBuffer( pDestBuf, uiDestPitchBYTES, hSrcVSurface, pSrcBuf,uiSrcPitchBYTES,usTopX,usTopY, &clip);
UnLockVideoSurface( PopUpBoxList[uiCounter]->iBackGroundSurface);
UnLockVideoSurface(PopUpBoxList[uiCounter]->uiBuffer);
UnLockVideoSurface(PopUpBoxList[uiCounter]->uiBuffer);
GetVideoObject(&hBoxHandle, PopUpBoxList[uiCounter]->iBorderObjectIndex);
// blit in 4 corners (they're 2x2 pixels)
// blit in 4 corners (they're 2x2 pixels)
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, TOP_LEFT_CORNER,usTopX,usTopY, VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, TOP_RIGHT_CORNER,usTopX+usWidth-2,usTopY, VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, TOP_RIGHT_CORNER,usTopX+usWidth-2,usTopY, VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, BOTTOM_RIGHT_CORNER,usTopX+usWidth-2,usTopY+usHeight-2, VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, BOTTOM_LEFT_CORNER,usTopX,usTopY+usHeight-2, VO_BLT_SRCTRANSPARENCY, NULL );
// blit in edges
// blit in edges
if (uiNumTilesWide > 0)
{
// full pieces
for (uiCount=0; uiCount <uiNumTilesWide; uiCount++)
for (uiCount=0; uiCount <uiNumTilesWide; uiCount++)
{
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, TOP_EDGE, usTopX+2+(uiCount*BORDER_WIDTH),usTopY, VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, BOTTOM_EDGE,usTopX+2+(uiCount*BORDER_WIDTH),usTopY+usHeight-2, VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, TOP_EDGE, usTopX+2+(uiCount*BORDER_WIDTH),usTopY, VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, BOTTOM_EDGE,usTopX+2+(uiCount*BORDER_WIDTH),usTopY+usHeight-2, VO_BLT_SRCTRANSPARENCY, NULL );
}
// partial pieces
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, TOP_EDGE, usTopX+usWidth-2-BORDER_WIDTH,usTopY, VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, TOP_EDGE, usTopX+usWidth-2-BORDER_WIDTH,usTopY, VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, BOTTOM_EDGE,usTopX+usWidth-2-BORDER_WIDTH,usTopY+usHeight-2, VO_BLT_SRCTRANSPARENCY, NULL );
}
if (uiNumTilesHigh > 0)
if (uiNumTilesHigh > 0)
{
// full pieces
for (uiCount=0; uiCount <uiNumTilesHigh; uiCount++)
for (uiCount=0; uiCount <uiNumTilesHigh; uiCount++)
{
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, SIDE_EDGE,usTopX, usTopY+2+(uiCount*BORDER_HEIGHT), VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, SIDE_EDGE,usTopX+usWidth-2,usTopY+2+(uiCount*BORDER_HEIGHT), VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, SIDE_EDGE,usTopX, usTopY+2+(uiCount*BORDER_HEIGHT), VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, SIDE_EDGE,usTopX+usWidth-2,usTopY+2+(uiCount*BORDER_HEIGHT), VO_BLT_SRCTRANSPARENCY, NULL );
}
// partial pieces
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, SIDE_EDGE,usTopX, usTopY+usHeight-2-BORDER_HEIGHT, VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, SIDE_EDGE,usTopX, usTopY+usHeight-2-BORDER_HEIGHT, VO_BLT_SRCTRANSPARENCY, NULL );
BltVideoObject(PopUpBoxList[uiCounter]->uiBuffer, hBoxHandle, SIDE_EDGE,usTopX+usWidth-2,usTopY+usHeight-2-BORDER_HEIGHT, VO_BLT_SRCTRANSPARENCY, NULL );
}
}
InvalidateRegion( usTopX, usTopY, usTopX + usWidth, usTopY + usHeight );
return TRUE;
}
BOOLEAN DrawBoxText(UINT32 uiCounter)
@@ -1382,7 +1382,7 @@ BOOLEAN DrawBoxText(UINT32 uiCounter)
INT16 uX, uY;
CHAR16 sString[100];
if ( ( uiCounter < 0 ) || ( uiCounter >= MAX_POPUP_BOX_COUNT ) )
return(FALSE);
@@ -1399,112 +1399,112 @@ BOOLEAN DrawBoxText(UINT32 uiCounter)
{
// there is text in this line?
if(PopUpBoxList[uiCounter]->Text[uiCount])
{
{
// set font
SetFont(PopUpBoxList[uiCounter]->Text[uiCount]->uiFont);
SetFont(PopUpBoxList[uiCounter]->Text[uiCount]->uiFont);
// are we highlighting?...shading?..or neither
if( ( PopUpBoxList[ uiCounter ] -> Text[ uiCount ] -> fHighLightFlag == FALSE )&&( PopUpBoxList[ uiCounter ] -> Text[ uiCount ] -> fShadeFlag == FALSE) &&( PopUpBoxList[ uiCounter ] -> Text[ uiCount ] -> fSecondaryShadeFlag == FALSE ) )
if( ( PopUpBoxList[ uiCounter ]->Text[ uiCount ]->fHighLightFlag == FALSE )&&( PopUpBoxList[ uiCounter ]->Text[ uiCount ]->fShadeFlag == FALSE) &&( PopUpBoxList[ uiCounter ]->Text[ uiCount ]->fSecondaryShadeFlag == FALSE ) )
{
// neither
SetFontForeground(PopUpBoxList[uiCounter]->Text[uiCount]->ubForegroundColor);
SetFontForeground(PopUpBoxList[uiCounter]->Text[uiCount]->ubForegroundColor);
}
else if( ( PopUpBoxList[ uiCounter ] -> Text[ uiCount ] -> fHighLightFlag == TRUE ) )
else if( ( PopUpBoxList[ uiCounter ]->Text[ uiCount ]->fHighLightFlag == TRUE ) )
{
// highlight
SetFontForeground(PopUpBoxList[uiCounter]->Text[uiCount]->ubHighLight);
SetFontForeground(PopUpBoxList[uiCounter]->Text[uiCount]->ubHighLight);
}
else if( ( PopUpBoxList[ uiCounter ] -> Text[ uiCount ] -> fSecondaryShadeFlag == TRUE ) )
else if( ( PopUpBoxList[ uiCounter ]->Text[ uiCount ]->fSecondaryShadeFlag == TRUE ) )
{
SetFontForeground(PopUpBoxList[uiCounter]->Text[uiCount]->ubSecondaryShade);
}
else
else
{
//shading
SetFontForeground(PopUpBoxList[uiCounter]->Text[uiCount]->ubShade);
}
// set background
SetFontBackground(PopUpBoxList[uiCounter]->Text[uiCount]->ubBackgroundColor);
SetFontBackground(PopUpBoxList[uiCounter]->Text[uiCount]->ubBackgroundColor);
// copy string
wcsncpy(sString, PopUpBoxList[uiCounter]->Text[uiCount]->pString, wcslen(PopUpBoxList[uiCounter]->Text[uiCount]->pString)+1);
wcsncpy(sString, PopUpBoxList[uiCounter]->Text[uiCount]->pString, wcslen(PopUpBoxList[uiCounter]->Text[uiCount]->pString)+1);
// cnetering?
if(PopUpBoxList[uiCounter]->uiFlags & POPUP_BOX_FLAG_CENTER_TEXT)
if(PopUpBoxList[uiCounter]->uiFlags & POPUP_BOX_FLAG_CENTER_TEXT)
{
FindFontCenterCoordinates(((INT16)(PopUpBoxList[uiCounter]->Position.iX+PopUpBoxList[uiCounter]->uiLeftMargin)),((INT16)(PopUpBoxList[uiCounter]->Position.iY+uiCount*GetFontHeight(PopUpBoxList[uiCounter]->Text[uiCount]->uiFont)+PopUpBoxList[uiCounter]->uiTopMargin+uiCount*PopUpBoxList[uiCounter]->uiLineSpace)),((INT16)(PopUpBoxList[uiCounter]->Dimensions.iRight-(PopUpBoxList[uiCounter]->uiRightMargin+PopUpBoxList[uiCounter]->uiLeftMargin+2))),((INT16)GetFontHeight(PopUpBoxList[uiCounter]->Text[uiCount]->uiFont)),(sString),((INT32)PopUpBoxList[uiCounter]->Text[uiCount]->uiFont) ,&uX, &uY);
}
else
{
uX=((INT16)(PopUpBoxList[uiCounter]->Position.iX+PopUpBoxList[uiCounter]->uiLeftMargin));
uY=((INT16)(PopUpBoxList[uiCounter]->Position.iY+uiCount*GetFontHeight(PopUpBoxList[uiCounter]->Text[uiCount]->uiFont)+PopUpBoxList[uiCounter]->uiTopMargin+uiCount*PopUpBoxList[uiCounter]->uiLineSpace));
FindFontCenterCoordinates(((INT16)(PopUpBoxList[uiCounter]->Position.iX+PopUpBoxList[uiCounter]->uiLeftMargin)),((INT16)(PopUpBoxList[uiCounter]->Position.iY+uiCount*GetFontHeight(PopUpBoxList[uiCounter]->Text[uiCount]->uiFont)+PopUpBoxList[uiCounter]->uiTopMargin+uiCount*PopUpBoxList[uiCounter]->uiLineSpace)),((INT16)(PopUpBoxList[uiCounter]->Dimensions.iRight-(PopUpBoxList[uiCounter]->uiRightMargin+PopUpBoxList[uiCounter]->uiLeftMargin+2))),((INT16)GetFontHeight(PopUpBoxList[uiCounter]->Text[uiCount]->uiFont)),(sString),((INT32)PopUpBoxList[uiCounter]->Text[uiCount]->uiFont) ,&uX, &uY);
}
else
{
uX=((INT16)(PopUpBoxList[uiCounter]->Position.iX+PopUpBoxList[uiCounter]->uiLeftMargin));
uY=((INT16)(PopUpBoxList[uiCounter]->Position.iY+uiCount*GetFontHeight(PopUpBoxList[uiCounter]->Text[uiCount]->uiFont)+PopUpBoxList[uiCounter]->uiTopMargin+uiCount*PopUpBoxList[uiCounter]->uiLineSpace));
}
// print
//gprintfdirty(uX,uY,PopUpBoxList[uiCounter]->Text[uiCount]->pString );
mprintf(uX,uY,PopUpBoxList[uiCounter]->Text[uiCount]->pString);
//gprintfdirty(uX,uY,PopUpBoxList[uiCounter]->Text[uiCount]->pString );
mprintf(uX,uY,PopUpBoxList[uiCounter]->Text[uiCount]->pString);
}
// there is secondary text in this line?
if(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount])
{
{
// set font
SetFont(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->uiFont);
SetFont(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->uiFont);
// are we highlighting?...shading?..or neither
if( ( PopUpBoxList[ uiCounter ] -> pSecondColumnString[ uiCount ] -> fHighLightFlag == FALSE )&&( PopUpBoxList[ uiCounter ] -> pSecondColumnString[ uiCount ] -> fShadeFlag == FALSE) )
if( ( PopUpBoxList[ uiCounter ]->pSecondColumnString[ uiCount ]->fHighLightFlag == FALSE )&&( PopUpBoxList[ uiCounter ]->pSecondColumnString[ uiCount ]->fShadeFlag == FALSE) )
{
// neither
SetFontForeground(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->ubForegroundColor);
SetFontForeground(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->ubForegroundColor);
}
else if( ( PopUpBoxList[ uiCounter ] -> pSecondColumnString[ uiCount ] -> fHighLightFlag == TRUE ) )
else if( ( PopUpBoxList[ uiCounter ]->pSecondColumnString[ uiCount ]->fHighLightFlag == TRUE ) )
{
// highlight
SetFontForeground(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->ubHighLight);
SetFontForeground(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->ubHighLight);
}
else
else
{
//shading
SetFontForeground(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->ubShade);
}
// set background
SetFontBackground(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->ubBackgroundColor);
SetFontBackground(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->ubBackgroundColor);
// copy string
wcsncpy(sString, PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->pString, wcslen(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->pString)+1);
wcsncpy(sString, PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->pString, wcslen(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->pString)+1);
// cnetering?
if(PopUpBoxList[uiCounter]->uiFlags & POPUP_BOX_FLAG_CENTER_TEXT)
if(PopUpBoxList[uiCounter]->uiFlags & POPUP_BOX_FLAG_CENTER_TEXT)
{
FindFontCenterCoordinates(((INT16)(PopUpBoxList[uiCounter]->Position.iX+PopUpBoxList[uiCounter]->uiLeftMargin)),((INT16)(PopUpBoxList[uiCounter]->Position.iY+uiCount*GetFontHeight(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->uiFont)+PopUpBoxList[uiCounter]->uiTopMargin+uiCount*PopUpBoxList[uiCounter]->uiLineSpace)),((INT16)(PopUpBoxList[uiCounter]->Dimensions.iRight-(PopUpBoxList[uiCounter]->uiRightMargin+PopUpBoxList[uiCounter]->uiLeftMargin+2))),((INT16)GetFontHeight(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->uiFont)),(sString),((INT32)PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->uiFont) ,&uX, &uY);
}
else
{
uX=((INT16)(PopUpBoxList[uiCounter]->Position.iX+PopUpBoxList[uiCounter]->uiLeftMargin + PopUpBoxList[uiCounter]->uiSecondColumnCurrentOffset ) );
uY=((INT16)(PopUpBoxList[uiCounter]->Position.iY+uiCount*GetFontHeight(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->uiFont)+PopUpBoxList[uiCounter]->uiTopMargin+uiCount*PopUpBoxList[uiCounter]->uiLineSpace));
FindFontCenterCoordinates(((INT16)(PopUpBoxList[uiCounter]->Position.iX+PopUpBoxList[uiCounter]->uiLeftMargin)),((INT16)(PopUpBoxList[uiCounter]->Position.iY+uiCount*GetFontHeight(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->uiFont)+PopUpBoxList[uiCounter]->uiTopMargin+uiCount*PopUpBoxList[uiCounter]->uiLineSpace)),((INT16)(PopUpBoxList[uiCounter]->Dimensions.iRight-(PopUpBoxList[uiCounter]->uiRightMargin+PopUpBoxList[uiCounter]->uiLeftMargin+2))),((INT16)GetFontHeight(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->uiFont)),(sString),((INT32)PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->uiFont) ,&uX, &uY);
}
else
{
uX=((INT16)(PopUpBoxList[uiCounter]->Position.iX+PopUpBoxList[uiCounter]->uiLeftMargin + PopUpBoxList[uiCounter]->uiSecondColumnCurrentOffset ) );
uY=((INT16)(PopUpBoxList[uiCounter]->Position.iY+uiCount*GetFontHeight(PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->uiFont)+PopUpBoxList[uiCounter]->uiTopMargin+uiCount*PopUpBoxList[uiCounter]->uiLineSpace));
}
// print
//gprintfdirty(uX,uY,PopUpBoxList[uiCounter]->Text[uiCount]->pString );
mprintf(uX,uY,PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->pString);
}
//gprintfdirty(uX,uY,PopUpBoxList[uiCounter]->Text[uiCount]->pString );
mprintf(uX,uY,PopUpBoxList[uiCounter]->pSecondColumnString[uiCount]->pString);
}
}
if( PopUpBoxList[uiCounter]->uiBuffer != guiSAVEBUFFER )
if( PopUpBoxList[uiCounter]->uiBuffer != guiSAVEBUFFER )
{
InvalidateRegion( PopUpBoxList[uiCounter]->Position.iX+PopUpBoxList[uiCounter]->uiLeftMargin-1, PopUpBoxList[uiCounter]->Position.iY+PopUpBoxList[uiCounter]->uiTopMargin, PopUpBoxList[uiCounter]->Position.iX+PopUpBoxList[uiCounter]->Dimensions.iRight-PopUpBoxList[uiCounter]->uiRightMargin,PopUpBoxList[uiCounter]->Position.iY+PopUpBoxList[uiCounter]->Dimensions.iBottom-PopUpBoxList[uiCounter]->uiBottomMargin );
}
SetFontDestBuffer(FRAME_BUFFER, 0,0,SCREEN_WIDTH, SCREEN_HEIGHT,FALSE);
SetFontDestBuffer(FRAME_BUFFER, 0,0,SCREEN_WIDTH, SCREEN_HEIGHT,FALSE);
return TRUE;
}
@@ -1528,7 +1528,7 @@ void ResizeBoxToText(INT32 hBoxHandle)
ResizeBoxForSecondStrings( hBoxHandle );
iHeight=PopUpBoxList[hBoxHandle]->uiTopMargin+PopUpBoxList[hBoxHandle]->uiBottomMargin;
for ( iCurrString = 0; iCurrString < MAX_POPUP_BOX_STRING_COUNT; iCurrString++ )
{
if ( PopUpBoxList[hBoxHandle]->Text[iCurrString] != NULL)
@@ -1536,14 +1536,14 @@ void ResizeBoxToText(INT32 hBoxHandle)
if( PopUpBoxList[hBoxHandle]->pSecondColumnString[iCurrString] != NULL )
{
iSecondColumnLength = StringPixLength( PopUpBoxList[hBoxHandle]->pSecondColumnString[iCurrString]->pString,PopUpBoxList[ hBoxHandle]->pSecondColumnString[ iCurrString ]->uiFont );
if( PopUpBoxList[hBoxHandle] -> uiSecondColumnCurrentOffset + iSecondColumnLength + PopUpBoxList[hBoxHandle]->uiLeftMargin+PopUpBoxList[hBoxHandle]->uiRightMargin > ( ( UINT32 ) iWidth ) )
if( PopUpBoxList[hBoxHandle]->uiSecondColumnCurrentOffset + iSecondColumnLength + PopUpBoxList[hBoxHandle]->uiLeftMargin+PopUpBoxList[hBoxHandle]->uiRightMargin > ( ( UINT32 ) iWidth ) )
{
iWidth = PopUpBoxList[hBoxHandle] -> uiSecondColumnCurrentOffset + iSecondColumnLength + PopUpBoxList[hBoxHandle]->uiLeftMargin+PopUpBoxList[hBoxHandle]->uiRightMargin;
iWidth = PopUpBoxList[hBoxHandle]->uiSecondColumnCurrentOffset + iSecondColumnLength + PopUpBoxList[hBoxHandle]->uiLeftMargin+PopUpBoxList[hBoxHandle]->uiRightMargin;
}
}
if( ( StringPixLength(PopUpBoxList[hBoxHandle]->Text[iCurrString]->pString,PopUpBoxList[hBoxHandle]->Text[iCurrString]->uiFont ) + PopUpBoxList[hBoxHandle]->uiLeftMargin+PopUpBoxList[hBoxHandle]->uiRightMargin ) > ( (UINT32) iWidth ) )
iWidth=StringPixLength(PopUpBoxList[hBoxHandle]->Text[iCurrString]->pString,PopUpBoxList[hBoxHandle]->Text[iCurrString]->uiFont ) + PopUpBoxList[hBoxHandle]->uiLeftMargin+PopUpBoxList[hBoxHandle]->uiRightMargin;
iWidth=StringPixLength(PopUpBoxList[hBoxHandle]->Text[iCurrString]->pString,PopUpBoxList[hBoxHandle]->Text[iCurrString]->uiFont ) + PopUpBoxList[hBoxHandle]->uiLeftMargin+PopUpBoxList[hBoxHandle]->uiRightMargin;
//vertical
iHeight+=GetFontHeight(PopUpBoxList[hBoxHandle]->Text[iCurrString]->uiFont)+PopUpBoxList[hBoxHandle]->uiLineSpace;
@@ -1553,9 +1553,9 @@ void ResizeBoxToText(INT32 hBoxHandle)
// doesn't support gaps in text array...
break;
}
}
}
PopUpBoxList[hBoxHandle]->Dimensions.iBottom=iHeight;
PopUpBoxList[hBoxHandle]->Dimensions.iRight=iWidth;
PopUpBoxList[hBoxHandle]->Dimensions.iRight=iWidth;
}
@@ -1569,7 +1569,7 @@ BOOLEAN IsBoxShown( UINT32 uiHandle )
return ( FALSE );
}
return( PopUpBoxList[ uiHandle ] -> fShowBox );
return( PopUpBoxList[ uiHandle ]->fShowBox );
}
+3 -3
View File
@@ -33,13 +33,13 @@ typedef struct popupstring POPUPSTRING;
typedef POPUPSTRING* POPUPSTRINGPTR;
struct popupbox{
SGPRect Dimensions;
SGPRect Dimensions;
SGPPoint Position;
UINT32 uiLeftMargin;
UINT32 uiRightMargin;
UINT32 uiBottomMargin;
UINT32 uiTopMargin;
UINT32 uiLineSpace;
UINT32 uiLineSpace;
INT32 iBorderObjectIndex;
INT32 iBackGroundSurface;
UINT32 uiFlags;
@@ -75,7 +75,7 @@ void SetBoxPosition(INT32 hBoxHandle,SGPPoint Position);
void GetBoxPosition( INT32 hBoxHandle, SGPPoint *Position );
UINT32 GetNumberOfLinesOfTextInBox( INT32 hBoxHandle );
void SetBoxSize( INT32 hBoxHandle, SGPRect Dimensions );
void GetBoxSize( INT32 hBoxHandle, SGPRect *Dimensions );
void GetBoxSize( INT32 hBoxHandle, SGPRect *Dimensions );
void SetBoxFlags( INT32 hBoxHandle, UINT32 uiFlags);
void SetBorderType(INT32 hBoxHandle,INT32 BorderObjectIndex);
void SetBackGroundSurface(INT32 hBoxHandle, INT32 BackGroundSurfaceIndex);
+3 -3
View File
@@ -29,7 +29,7 @@ BOOLEAN QuantizeImage( UINT8 *pDest, UINT8 *pSrc, INT16 sWidth, INT16 sHeight, S
sNumColors = q.GetColorCount();
memset( pPalette, 0, sizeof( SGPPaletteEntry ) * 256 );
memset( pPalette, 0, sizeof( SGPPaletteEntry ) * 256 );
q.GetColorTable( (RGBQUAD*)pPalette );
@@ -81,7 +81,7 @@ void MapPalette( UINT8 *pDest, UINT8 *pSrc, INT16 sWidth, INT16 sHeight, INT16 s
{
dLowestDist = dCubeDist;
bBest = cnt;
}
}
}
// Now we have the lowest value
@@ -93,4 +93,4 @@ void MapPalette( UINT8 *pDest, UINT8 *pSrc, INT16 sWidth, INT16 sHeight, INT16 s
}
}
}
}
+134 -134
View File
@@ -10,199 +10,199 @@
CQuantizer::CQuantizer (UINT nMaxColors, UINT nColorBits)
{
m_pTree = NULL;
m_nLeafCount = 0;
for (int i=0; i<=(int) nColorBits; i++)
m_pReducibleNodes[i] = NULL;
m_nMaxColors = nMaxColors;
m_nColorBits = nColorBits;
m_pTree = NULL;
m_nLeafCount = 0;
for (int i=0; i<=(int) nColorBits; i++)
m_pReducibleNodes[i] = NULL;
m_nMaxColors = nMaxColors;
m_nColorBits = nColorBits;
}
CQuantizer::~CQuantizer ()
{
if (m_pTree != NULL)
DeleteTree (&m_pTree);
if (m_pTree != NULL)
DeleteTree (&m_pTree);
}
BOOL CQuantizer::ProcessImage (BYTE *pData, int iWidth, int iHeight )
{
BYTE* pbBits;
BYTE r, g, b;
int i, j;
BYTE* pbBits;
BYTE r, g, b;
int i, j;
pbBits = (BYTE*)pData;
for (i=0; i<iHeight; i++) {
for (j=0; j<iWidth; j++) {
b = *pbBits++;
g = *pbBits++;
r = *pbBits++;
AddColor (&m_pTree, r, g, b, m_nColorBits, 0, &m_nLeafCount,
m_pReducibleNodes);
while (m_nLeafCount > m_nMaxColors)
ReduceTree (m_nColorBits, &m_nLeafCount, m_pReducibleNodes);
}
pbBits = (BYTE*)pData;
for (i=0; i<iHeight; i++) {
for (j=0; j<iWidth; j++) {
b = *pbBits++;
g = *pbBits++;
r = *pbBits++;
AddColor (&m_pTree, r, g, b, m_nColorBits, 0, &m_nLeafCount,
m_pReducibleNodes);
while (m_nLeafCount > m_nMaxColors)
ReduceTree (m_nColorBits, &m_nLeafCount, m_pReducibleNodes);
}
//Padding
//pbBits ++;
}
return TRUE;
//pbBits ++;
}
return TRUE;
}
int CQuantizer::GetLeftShiftCount (DWORD dwVal)
{
int nCount = 0;
for (int i=0; i<sizeof (DWORD) * 8; i++) {
if (dwVal & 1)
nCount++;
dwVal >>= 1;
}
return (8 - nCount);
int nCount = 0;
for (int i=0; i<sizeof (DWORD) * 8; i++) {
if (dwVal & 1)
nCount++;
dwVal >>= 1;
}
return (8 - nCount);
}
int CQuantizer::GetRightShiftCount (DWORD dwVal)
{
for (int i=0; i<sizeof (DWORD) * 8; i++) {
if (dwVal & 1)
return i;
dwVal >>= 1;
}
return -1;
for (int i=0; i<sizeof (DWORD) * 8; i++) {
if (dwVal & 1)
return i;
dwVal >>= 1;
}
return -1;
}
void CQuantizer::AddColor (NODE** ppNode, BYTE r, BYTE g, BYTE b,
UINT nColorBits, UINT nLevel, UINT* pLeafCount, NODE** pReducibleNodes)
UINT nColorBits, UINT nLevel, UINT* pLeafCount, NODE** pReducibleNodes)
{
static BYTE mask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
static BYTE mask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
//
// If the node doesn't exist, create it.
//
if (*ppNode == NULL)
*ppNode = CreateNode (nLevel, nColorBits, pLeafCount,
pReducibleNodes);
//
// If the node doesn't exist, create it.
//
if (*ppNode == NULL)
*ppNode = CreateNode (nLevel, nColorBits, pLeafCount,
pReducibleNodes);
//
// Update color information if it's a leaf node.
//
if ((*ppNode)->bIsLeaf) {
(*ppNode)->nPixelCount++;
(*ppNode)->nRedSum += r;
(*ppNode)->nGreenSum += g;
(*ppNode)->nBlueSum += b;
}
//
// Update color information if it's a leaf node.
//
if ((*ppNode)->bIsLeaf) {
(*ppNode)->nPixelCount++;
(*ppNode)->nRedSum += r;
(*ppNode)->nGreenSum += g;
(*ppNode)->nBlueSum += b;
}
//
// Recurse a level deeper if the node is not a leaf.
//
else {
int shift = 7 - nLevel;
int nIndex = (((r & mask[nLevel]) >> shift) << 2) |
(((g & mask[nLevel]) >> shift) << 1) |
((b & mask[nLevel]) >> shift);
AddColor (&((*ppNode)->pChild[nIndex]), r, g, b, nColorBits,
nLevel + 1, pLeafCount, pReducibleNodes);
}
//
// Recurse a level deeper if the node is not a leaf.
//
else {
int shift = 7 - nLevel;
int nIndex = (((r & mask[nLevel]) >> shift) << 2) |
(((g & mask[nLevel]) >> shift) << 1) |
((b & mask[nLevel]) >> shift);
AddColor (&((*ppNode)->pChild[nIndex]), r, g, b, nColorBits,
nLevel + 1, pLeafCount, pReducibleNodes);
}
}
NODE* CQuantizer::CreateNode (UINT nLevel, UINT nColorBits, UINT* pLeafCount,
NODE** pReducibleNodes)
NODE** pReducibleNodes)
{
NODE* pNode;
NODE* pNode;
if ((pNode = (NODE*) HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (NODE))) == NULL)
return NULL;
if ((pNode = (NODE*) HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (NODE))) == NULL)
return NULL;
pNode->bIsLeaf = (nLevel == nColorBits) ? TRUE : FALSE;
if (pNode->bIsLeaf)
(*pLeafCount)++;
else {
pNode->pNext = pReducibleNodes[nLevel];
pReducibleNodes[nLevel] = pNode;
}
return pNode;
pNode->bIsLeaf = (nLevel == nColorBits) ? TRUE : FALSE;
if (pNode->bIsLeaf)
(*pLeafCount)++;
else {
pNode->pNext = pReducibleNodes[nLevel];
pReducibleNodes[nLevel] = pNode;
}
return pNode;
}
void CQuantizer::ReduceTree (UINT nColorBits, UINT* pLeafCount,
NODE** pReducibleNodes)
NODE** pReducibleNodes)
{
//
// Find the deepest level containing at least one reducible node.
//
//
// Find the deepest level containing at least one reducible node.
//
int i = 0;
for (i=nColorBits - 1; (i>0) && (pReducibleNodes[i] == NULL); i--);
for (i=nColorBits - 1; (i>0) && (pReducibleNodes[i] == NULL); i--);
//
// Reduce the node most recently added to the list at level i.
//
//
// Reduce the node most recently added to the list at level i.
//
NODE* pNode = pReducibleNodes[i];
pReducibleNodes[i] = pNode->pNext;
NODE* pNode = pReducibleNodes[i];
pReducibleNodes[i] = pNode->pNext;
UINT nRedSum = 0;
UINT nGreenSum = 0;
UINT nBlueSum = 0;
UINT nChildren = 0;
UINT nRedSum = 0;
UINT nGreenSum = 0;
UINT nBlueSum = 0;
UINT nChildren = 0;
for (i=0; i<8; i++) {
if (pNode->pChild[i] != NULL) {
nRedSum += pNode->pChild[i]->nRedSum;
nGreenSum += pNode->pChild[i]->nGreenSum;
nBlueSum += pNode->pChild[i]->nBlueSum;
pNode->nPixelCount += pNode->pChild[i]->nPixelCount;
HeapFree (GetProcessHeap (), 0, pNode->pChild[i]);
pNode->pChild[i] = NULL;
nChildren++;
}
}
for (i=0; i<8; i++) {
if (pNode->pChild[i] != NULL) {
nRedSum += pNode->pChild[i]->nRedSum;
nGreenSum += pNode->pChild[i]->nGreenSum;
nBlueSum += pNode->pChild[i]->nBlueSum;
pNode->nPixelCount += pNode->pChild[i]->nPixelCount;
HeapFree (GetProcessHeap (), 0, pNode->pChild[i]);
pNode->pChild[i] = NULL;
nChildren++;
}
}
pNode->bIsLeaf = TRUE;
pNode->nRedSum = nRedSum;
pNode->nGreenSum = nGreenSum;
pNode->nBlueSum = nBlueSum;
*pLeafCount -= (nChildren - 1);
pNode->bIsLeaf = TRUE;
pNode->nRedSum = nRedSum;
pNode->nGreenSum = nGreenSum;
pNode->nBlueSum = nBlueSum;
*pLeafCount -= (nChildren - 1);
}
void CQuantizer::DeleteTree (NODE** ppNode)
{
for (int i=0; i<8; i++) {
if ((*ppNode)->pChild[i] != NULL)
DeleteTree (&((*ppNode)->pChild[i]));
}
HeapFree (GetProcessHeap (), 0, *ppNode);
*ppNode = NULL;
for (int i=0; i<8; i++) {
if ((*ppNode)->pChild[i] != NULL)
DeleteTree (&((*ppNode)->pChild[i]));
}
HeapFree (GetProcessHeap (), 0, *ppNode);
*ppNode = NULL;
}
void CQuantizer::GetPaletteColors (NODE* pTree, RGBQUAD* prgb, UINT* pIndex)
{
if (pTree->bIsLeaf) {
prgb[*pIndex].rgbRed =
(BYTE) ((pTree->nRedSum) / (pTree->nPixelCount));
prgb[*pIndex].rgbGreen =
(BYTE) ((pTree->nGreenSum) / (pTree->nPixelCount));
prgb[*pIndex].rgbBlue =
(BYTE) ((pTree->nBlueSum) / (pTree->nPixelCount));
prgb[*pIndex].rgbReserved = 0;
(*pIndex)++;
}
else {
for (int i=0; i<8; i++) {
if (pTree->pChild[i] != NULL)
GetPaletteColors (pTree->pChild[i], prgb, pIndex);
}
}
if (pTree->bIsLeaf) {
prgb[*pIndex].rgbRed =
(BYTE) ((pTree->nRedSum) / (pTree->nPixelCount));
prgb[*pIndex].rgbGreen =
(BYTE) ((pTree->nGreenSum) / (pTree->nPixelCount));
prgb[*pIndex].rgbBlue =
(BYTE) ((pTree->nBlueSum) / (pTree->nPixelCount));
prgb[*pIndex].rgbReserved = 0;
(*pIndex)++;
}
else {
for (int i=0; i<8; i++) {
if (pTree->pChild[i] != NULL)
GetPaletteColors (pTree->pChild[i], prgb, pIndex);
}
}
}
UINT CQuantizer::GetColorCount ()
{
return m_nLeafCount;
return m_nLeafCount;
}
void CQuantizer::GetColorTable (RGBQUAD* prgb)
{
UINT nIndex = 0;
GetPaletteColors (m_pTree, prgb, &nIndex);
UINT nIndex = 0;
GetPaletteColors (m_pTree, prgb, &nIndex);
}
+27 -27
View File
@@ -2,42 +2,42 @@
#define __QUANTIZE_H_
typedef struct _NODE {
BOOL bIsLeaf; // TRUE if node has no children
UINT nPixelCount; // Number of pixels represented by this leaf
UINT nRedSum; // Sum of red components
UINT nGreenSum; // Sum of green components
UINT nBlueSum; // Sum of blue components
struct _NODE* pChild[8]; // Pointers to child nodes
struct _NODE* pNext; // Pointer to next reducible node
BOOL bIsLeaf; // TRUE if node has no children
UINT nPixelCount; // Number of pixels represented by this leaf
UINT nRedSum; // Sum of red components
UINT nGreenSum; // Sum of green components
UINT nBlueSum; // Sum of blue components
struct _NODE* pChild[8]; // Pointers to child nodes
struct _NODE* pNext; // Pointer to next reducible node
} NODE;
class CQuantizer
{
protected:
NODE* m_pTree;
UINT m_nLeafCount;
NODE* m_pReducibleNodes[9];
UINT m_nMaxColors;
UINT m_nColorBits;
NODE* m_pTree;
UINT m_nLeafCount;
NODE* m_pReducibleNodes[9];
UINT m_nMaxColors;
UINT m_nColorBits;
public:
CQuantizer (UINT nMaxColors, UINT nColorBits);
virtual ~CQuantizer ();
BOOL ProcessImage (BYTE *pData, int iWidth, int iHeight );
UINT GetColorCount ();
void GetColorTable (RGBQUAD* prgb);
CQuantizer (UINT nMaxColors, UINT nColorBits);
virtual ~CQuantizer ();
BOOL ProcessImage (BYTE *pData, int iWidth, int iHeight );
UINT GetColorCount ();
void GetColorTable (RGBQUAD* prgb);
protected:
int GetLeftShiftCount (DWORD dwVal);
int GetRightShiftCount (DWORD dwVal);
void AddColor (NODE** ppNode, BYTE r, BYTE g, BYTE b, UINT nColorBits,
UINT nLevel, UINT* pLeafCount, NODE** pReducibleNodes);
NODE* CreateNode (UINT nLevel, UINT nColorBits, UINT* pLeafCount,
NODE** pReducibleNodes);
void ReduceTree (UINT nColorBits, UINT* pLeafCount,
NODE** pReducibleNodes);
void DeleteTree (NODE** ppNode);
void GetPaletteColors (NODE* pTree, RGBQUAD* prgb, UINT* pIndex);
int GetLeftShiftCount (DWORD dwVal);
int GetRightShiftCount (DWORD dwVal);
void AddColor (NODE** ppNode, BYTE r, BYTE g, BYTE b, UINT nColorBits,
UINT nLevel, UINT* pLeafCount, NODE** pReducibleNodes);
NODE* CreateNode (UINT nLevel, UINT nColorBits, UINT* pLeafCount,
NODE** pReducibleNodes);
void ReduceTree (UINT nColorBits, UINT* pLeafCount,
NODE** pReducibleNodes);
void DeleteTree (NODE** ppNode);
void GetPaletteColors (NODE* pTree, RGBQUAD* prgb, UINT* pIndex);
};
#endif
+41 -39
View File
@@ -31,11 +31,11 @@ BOOLEAN ConvertToETRLE( UINT8 ** ppDest, UINT32 * puiDestLen, UINT8 ** ppSubImag
#define CONVERT_ETRLE_FLIC_NAME 0x0800
#define CONVERT_TO_8_BIT 0x1000
#define CONVERT_TO_16_BIT 0x2000
// NB 18-bit is actually 24 bit but with only 6 bits used in each byte. I implemented
// NB 18-bit is actually 24 bit but with only 6 bits used in each byte. I implemented
// it to see how well such images would compress with ZLIB.
#define CONVERT_TO_18_BIT 0x4000
// Defines for inserting red/green/blue values into a 16-bit pixel.
// Defines for inserting red/green/blue values into a 16-bit pixel.
// MASK is the mask to use to get the proper bits out of a byte (part of a 24-bit pixel)
// use SHIFT_RIGHT to move the masked bits to the lowest bits of the byte
// use SHIFT_LEFT to put the bits in their proper place in the 16-bit pixel
@@ -78,7 +78,7 @@ void ConvertRGBDistribution555To565( UINT16 * p16BPPData, UINT32 uiNumberOfPixel
{
UINT16 * pPixel;
UINT32 uiLoop;
SplitUINT32 Pixel;
pPixel = p16BPPData;
@@ -99,7 +99,7 @@ void ConvertRGBDistribution555To565( UINT16 * p16BPPData, UINT32 uiNumberOfPixel
}
}
void WriteSTIFile( INT8 *pData, SGPPaletteEntry *pPalette, INT16 sWidth, INT16 sHeight, STR cOutputName, UINT32 fFlags, UINT32 uiAppDataSize )
void WriteSTIFile( INT8 *pData, SGPPaletteEntry *pPalette, INT16 sWidth, INT16 sHeight, STR cOutputName, UINT32 fFlags, UINT32 uiAppDataSize )
{
FILE * pOutput;
@@ -120,10 +120,10 @@ void WriteSTIFile( INT8 *pData, SGPPaletteEntry *pPalette, INT16 sWidth, INT16 s
UINT32 uiSubImageBufferSize=0;
//UINT16 usLoop;
memset( &Header, 0, STCI_HEADER_SIZE );
memset( &Image, 0, sizeof( image_type ));
uiOriginalSize = sWidth * sHeight * (8 / 8);
@@ -169,7 +169,7 @@ void WriteSTIFile( INT8 *pData, SGPPaletteEntry *pPalette, INT16 sWidth, INT16 s
{
return;
}
// write header
// write header
fwrite( &Header, STCI_HEADER_SIZE, 1, pOutput );
// write palette and subimage structs, if any
if (Header.fFlags & STCI_INDEXED)
@@ -261,7 +261,6 @@ BOOLEAN ConvertToETRLE( UINT8 ** ppDest, UINT32 * puiDestLen, UINT8 ** ppSubImag
BOOLEAN fNextExists;
STCISubImage * pCurrSubImage;
STCISubImage TempSubImage;
UINT32 uiCompressedSize = 0;
UINT32 uiSubImageCompressedSize;
UINT32 uiSpaceLeft;
@@ -270,7 +269,7 @@ BOOLEAN ConvertToETRLE( UINT8 ** ppDest, UINT32 * puiDestLen, UINT8 ** ppSubImag
*ppDest = (UINT8 *) MemAlloc( uiSpaceLeft );
CHECKF( *ppDest );
*puiDestLen = uiSpaceLeft;
pOutputNext = *ppDest;
if (fFlags & CONVERT_ETRLE_COMPRESS_SINGLE)
@@ -297,7 +296,7 @@ BOOLEAN ConvertToETRLE( UINT8 ** ppDest, UINT32 * puiDestLen, UINT8 ** ppSubImag
if (!(DetermineSubImageUsedSize( p8BPPBuffer, usWidth, usHeight, pCurrSubImage )))
{
MemFree( *ppDest );
return( FALSE );
return( FALSE );
}
}
uiSubImageCompressedSize = ETRLECompressSubImage( pOutputNext, uiSpaceLeft, p8BPPBuffer, usWidth, usHeight, pCurrSubImage );
@@ -324,7 +323,7 @@ BOOLEAN ConvertToETRLE( UINT8 ** ppDest, UINT32 * puiDestLen, UINT8 ** ppSubImag
}
*ppSubImageBuffer = NULL;
*pusNumberOfSubImages = 0;
while (fContinue)
{
// allocate more memory for SubImage structures, and set the current pointer to the last one
@@ -339,9 +338,9 @@ BOOLEAN ConvertToETRLE( UINT8 ** ppDest, UINT32 * puiDestLen, UINT8 ** ppSubImag
*ppSubImageBuffer = pTemp;
}
pCurrSubImage = (STCISubImage *) (*ppSubImageBuffer + (*pusNumberOfSubImages) * STCI_SUBIMAGE_SIZE);
pCurrSubImage->sOffsetX = sCurrX;
pCurrSubImage->sOffsetY = sCurrY;
pCurrSubImage->sOffsetY = sCurrY;
// determine the subimage's full size
if (!DetermineSubImageSize( p8BPPBuffer, usWidth, usHeight, pCurrSubImage ))
{
@@ -352,7 +351,7 @@ BOOLEAN ConvertToETRLE( UINT8 ** ppDest, UINT32 * puiDestLen, UINT8 ** ppSubImag
{
printf( "\tWarning: no walls (subimage delimiters) found.\n" );
}
memcpy( &TempSubImage, pCurrSubImage, STCI_SUBIMAGE_SIZE );
if (DetermineSubImageUsedSize( p8BPPBuffer, usWidth, usHeight, &TempSubImage))
{
@@ -368,7 +367,7 @@ BOOLEAN ConvertToETRLE( UINT8 ** ppDest, UINT32 * puiDestLen, UINT8 ** ppSubImag
// image is transparent; we will store it if there is another subimage
// to the right of it on the same line
// find the next subimage
fNextExists = GoToNextSubImage( &sNextX, &sNextY, p8BPPBuffer, usWidth, usHeight, sCurrX, sCurrY );
fNextExists = GoToNextSubImage( &sNextX, &sNextY, p8BPPBuffer, usWidth, usHeight, sCurrX, sCurrY );
if (fNextExists && sNextY == sCurrY )
{
fStore = TRUE;
@@ -397,7 +396,7 @@ BOOLEAN ConvertToETRLE( UINT8 ** ppDest, UINT32 * puiDestLen, UINT8 ** ppSubImag
pCurrSubImage->uiDataOffset = (*puiDestLen - uiSpaceLeft);
pCurrSubImage->uiDataLength = uiSubImageCompressedSize;
// this is a cheap hack; the sOffsetX and sOffsetY values have been used
// to store the location of the subimage within the whole image. Now
// to store the location of the subimage within the whole image. Now
// we want the offset within the subimage, so, we subtract the coordatines
// for the upper-left corner of the subimage.
pCurrSubImage->sOffsetX -= sCurrX;
@@ -454,14 +453,15 @@ UINT32 ETRLECompressSubImage( UINT8 * pDest, UINT32 uiDestLen, UINT8 * p8BPPBuff
}
UINT32 ETRLECompress( UINT8 * pDest, UINT32 uiDestLen, UINT8 * pSource, UINT32 uiSourceLen )
{ // Compress a buffer (a scanline) into ETRLE format, which is a series of runs.
// Each run starts with a byte whose high bit is 1 if the run is compressed, 0 otherwise.
{
// Compress a buffer (a scanline) into ETRLE format, which is a series of runs.
// Each run starts with a byte whose high bit is 1 if the run is compressed, 0 otherwise.
// The lower seven bits of that byte indicate the length of the run
// ETRLECompress returns the number of bytes used by the compressed buffer, or 0 if an error
// occurred
// uiSourceLoc keeps track of our current position in the
// uiSourceLoc keeps track of our current position in the
// source
UINT32 uiSourceLoc = 0;
// uiCurrentSourceLoc is used to look ahead in the source to
@@ -469,21 +469,21 @@ UINT32 ETRLECompress( UINT8 * pDest, UINT32 uiDestLen, UINT8 * pSource, UINT32 u
UINT32 uiCurrentSourceLoc = 0;
UINT32 uiDestLoc = 0;
UINT8 ubLength = 0;
while (uiSourceLoc < uiSourceLen && uiDestLoc < uiDestLen)
{
if (pSource[uiSourceLoc] == TCI)
{ // transparent run - determine its length
do
{
{
uiCurrentSourceLoc++;
ubLength++;
}
while ((uiCurrentSourceLoc < uiSourceLen) && pSource[uiCurrentSourceLoc] == TCI && (ubLength < COMPRESS_RUN_LIMIT));
// output run-byte
pDest[uiDestLoc] = ubLength | COMPRESS_TRANSPARENT;
// update location
uiSourceLoc += ubLength;
uiDestLoc += 1;
@@ -500,7 +500,7 @@ UINT32 ETRLECompress( UINT8 * pDest, UINT32 uiDestLen, UINT8 * pSource, UINT32 u
{
// output run-byte
pDest[uiDestLoc++] = ubLength | COMPRESS_NON_TRANSPARENT;
// output run (and update location)
memcpy( pDest + uiDestLoc, pSource + uiSourceLoc, ubLength );
uiSourceLoc += ubLength;
@@ -509,7 +509,7 @@ UINT32 ETRLECompress( UINT8 * pDest, UINT32 uiDestLen, UINT8 * pSource, UINT32 u
else
{ // not enough room in dest buffer to copy the run!
return( 0 );
}
}
}
uiCurrentSourceLoc = uiSourceLoc;
ubLength = 0;
@@ -518,7 +518,7 @@ UINT32 ETRLECompress( UINT8 * pDest, UINT32 uiDestLen, UINT8 * pSource, UINT32 u
{
return( 0 );
}
else
else
{
// end with a run of 0 length (which might as well be non-transparent,
// giving a 0-byte
@@ -537,7 +537,7 @@ BOOLEAN DetermineOffset( UINT32 * puiOffset, UINT16 usWidth, UINT16 usHeight, IN
if (*puiOffset >= (UINT32) usWidth * (UINT32) usHeight)
{
return( FALSE );
}
}
return( TRUE );
}
@@ -559,7 +559,7 @@ BOOLEAN GoPastWall( INT16 * psNewX, INT16 * psNewY, UINT16 usWidth, UINT16 usHei
return( FALSE );
}
}
}
}
*psNewX = sCurrX;
*psNewY = sCurrY;
@@ -567,14 +567,15 @@ BOOLEAN GoPastWall( INT16 * psNewX, INT16 * psNewY, UINT16 usWidth, UINT16 usHei
}
BOOLEAN GoToNextSubImage( INT16 * psNewX, INT16 * psNewY, UINT8 * p8BPPBuffer, UINT16 usWidth, UINT16 usHeight, INT16 sOrigX, INT16 sOrigY )
{ // return the coordinates of the next subimage in the image
{
// return the coordinates of the next subimage in the image
// (either to the right, or the first of the next row down
INT16 sCurrX = sOrigX;
INT16 sCurrY = sOrigY;
UINT32 uiOffset;
UINT8 * pCurrent;
BOOLEAN fFound = TRUE;
CHECKF( DetermineOffset( &uiOffset, usWidth, usHeight, sCurrX, sCurrY ) )
pCurrent = p8BPPBuffer + uiOffset;
@@ -582,13 +583,13 @@ BOOLEAN GoToNextSubImage( INT16 * psNewX, INT16 * psNewY, UINT8 * p8BPPBuffer, U
{
return( GoPastWall( psNewX, psNewY, usWidth, usHeight, pCurrent, sCurrX, sCurrY ) );
}
else
else
{
// The current pixel is not a wall. We scan right past all non-wall data to skip to
// The current pixel is not a wall. We scan right past all non-wall data to skip to
// the right-hand end of the subimage, then right past all wall data to skip a vertical
// wall, and should find ourselves at another subimage.
// If we hit the right edge of the image, we back up to our start point, go DOWN to
// If we hit the right edge of the image, we back up to our start point, go DOWN to
// the bottom of the image to the horizontal wall, and then recurse to go along it
// to the right place on the next scanline
@@ -601,7 +602,7 @@ BOOLEAN GoToNextSubImage( INT16 * psNewX, INT16 * psNewY, UINT8 * p8BPPBuffer, U
fFound = FALSE;
break;
}
}
}
if (sCurrX < usWidth)
{
// skip all wall data to the right, starting at the new current position
@@ -617,9 +618,9 @@ BOOLEAN GoToNextSubImage( INT16 * psNewX, INT16 * psNewY, UINT8 * p8BPPBuffer, U
}
}
if (fFound)
{
{
*psNewX = sCurrX;
*psNewY = sCurrY;
*psNewY = sCurrY;
return( TRUE );
}
else
@@ -627,7 +628,7 @@ BOOLEAN GoToNextSubImage( INT16 * psNewX, INT16 * psNewY, UINT8 * p8BPPBuffer, U
// go back to the beginning of the subimage and scan down
sCurrX = sOrigX;
pCurrent = p8BPPBuffer + uiOffset;
// skip all non-wall data below, starting at the current position
while (*pCurrent != WI)
{
@@ -655,7 +656,7 @@ BOOLEAN DetermineSubImageSize( UINT8 * p8BPPBuffer, UINT16 usWidth, UINT16 usHei
{
return( FALSE );
}
// determine width
pCurrent = p8BPPBuffer + uiOffset;
do
@@ -726,7 +727,7 @@ BOOLEAN DetermineSubImageUsedSize( UINT8 * p8BPPBuffer, UINT16 usWidth, UINT16 u
pSubImage->sOffsetX = usNewX;
pSubImage->sOffsetY = usNewY;
pSubImage->usHeight = usNewHeight;
pSubImage->usWidth = usNewWidth;
pSubImage->usWidth = usNewWidth;
return( TRUE );
}
@@ -829,3 +830,4 @@ UINT8 * CheckForDataInRowOrColumn( UINT8 * pPixel, UINT16 usIncrement, UINT16 us
return( NULL );
}
+1 -1
View File
@@ -5,7 +5,7 @@
#define CONVERT_ETRLE_COMPRESS 0x0020
#define CONVERT_TO_8_BIT 0x1000
void WriteSTIFile( INT8 *pData, SGPPaletteEntry *pPalette, INT16 sWidth, INT16 sHeight, STR cOutputName, UINT32 fFlags, UINT32 uiAppDataSize );
void WriteSTIFile( INT8 *pData, SGPPaletteEntry *pPalette, INT16 sWidth, INT16 sHeight, STR cOutputName, UINT32 fFlags, UINT32 uiAppDataSize );
#endif
+33 -35
View File
@@ -43,7 +43,7 @@ typedef struct TAG_SLIDER
UINT16 usBackGroundColor;
MOUSE_REGION ScrollAreaMouseRegion;
MOUSE_REGION ScrollAreaMouseRegion;
UINT32 uiSliderBoxImage;
UINT16 usCurrentSliderBoxPosition;
@@ -115,8 +115,8 @@ void CalculateNewSliderIncrement( UINT32 uiSliderID, UINT16 usPosX );
BOOLEAN InitSlider()
{
VOBJECT_DESC VObjectDesc;
VOBJECT_DESC VObjectDesc;
// load Slider Box Graphic graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\SliderBox.sti", VObjectDesc.ImageFile);
@@ -155,9 +155,6 @@ INT32 AddSlider( UINT8 ubStyle, UINT16 usCursor, UINT16 usPosX, UINT16 usPosY, U
{
SLIDER *pTemp = NULL;
SLIDER *pNewSlider = NULL;
//INT32 iNewID=0;
//UINT32 cnt=0;
//UINT16 usIncrementWidth=0;
AssertMsg( gfSliderInited, "Trying to Add a Slider Bar when the Slider System was never inited");
@@ -196,7 +193,7 @@ INT32 AddSlider( UINT8 ubStyle, UINT16 usCursor, UINT16 usPosX, UINT16 usPosY, U
//
// Create the mouse regions for each increment in the slider
//
//add the region
usPosX = pNewSlider->usPosX;
usPosY = pNewSlider->usPosY;
@@ -214,10 +211,10 @@ INT32 AddSlider( UINT8 ubStyle, UINT16 usCursor, UINT16 usPosX, UINT16 usPosY, U
MSYS_DefineRegion( &pNewSlider->ScrollAreaMouseRegion, (UINT16)(usPosX-pNewSlider->usWidth/2), usPosY, (UINT16)(usPosX+pNewSlider->usWidth/2), (UINT16)(pNewSlider->usPosY+pNewSlider->usHeight), sPriority,
usCursor, SelectedSliderMovementCallBack, SelectedSliderButtonCallBack );
usCursor, SelectedSliderMovementCallBack, SelectedSliderButtonCallBack );
MSYS_SetRegionUserData( &pNewSlider->ScrollAreaMouseRegion, 1, pNewSlider->uiSliderID );
break;
case SLIDER_DEFAULT_STYLE:
default:
@@ -226,7 +223,7 @@ INT32 AddSlider( UINT8 ubStyle, UINT16 usCursor, UINT16 usPosX, UINT16 usPosY, U
pNewSlider->usHeight = DEFUALT_SLIDER_SIZE;
MSYS_DefineRegion( &pNewSlider->ScrollAreaMouseRegion, usPosX, (UINT16)(usPosY-DEFUALT_SLIDER_SIZE), (UINT16)(pNewSlider->usPosX+pNewSlider->usWidth), (UINT16)(usPosY+DEFUALT_SLIDER_SIZE), sPriority,
usCursor, SelectedSliderMovementCallBack, SelectedSliderButtonCallBack );
usCursor, SelectedSliderMovementCallBack, SelectedSliderButtonCallBack );
MSYS_SetRegionUserData( &pNewSlider->ScrollAreaMouseRegion, 1, pNewSlider->uiSliderID );
break;
}
@@ -234,7 +231,7 @@ INT32 AddSlider( UINT8 ubStyle, UINT16 usCursor, UINT16 usPosX, UINT16 usPosY, U
//
// Load the graphic image for the slider box
//
//
//add the slider into the list
pTemp = pSliderHead;
@@ -252,7 +249,7 @@ INT32 AddSlider( UINT8 ubStyle, UINT16 usCursor, UINT16 usPosX, UINT16 usPosY, U
{
pTemp = pTemp->pNext;
}
pTemp->pNext = pNewSlider;
pNewSlider->pPrev = pTemp;
pNewSlider->pNext = NULL;
@@ -278,8 +275,8 @@ void RenderAllSliderBars()
else
usPosY = gusMouseYPos - gpCurrentSlider->usPosY;
//if the mouse
CalculateNewSliderIncrement( gpCurrentSlider->uiSliderID, usPosY );
//if the mouse
CalculateNewSliderIncrement( gpCurrentSlider->uiSliderID, usPosY );
}
else
{
@@ -305,10 +302,10 @@ void RenderSelectedSliderBar( SLIDER *pSlider )
if( pSlider->uiFlags & SLIDER_VERTICAL )
{
}
}
else
{
//display the background ( the bar )
//display the background ( the bar )
OptDisplayLine( (UINT16)(pSlider->usPosX+1), (UINT16)(pSlider->usPosY-1), (UINT16)(pSlider->usPosX + pSlider->usWidth-1), (UINT16)(pSlider->usPosY-1), pSlider->usBackGroundColor );
OptDisplayLine( pSlider->usPosX, pSlider->usPosY, (UINT16)(pSlider->usPosX + pSlider->usWidth), pSlider->usPosY, pSlider->usBackGroundColor );
OptDisplayLine( (UINT16)(pSlider->usPosX+1), (UINT16)(pSlider->usPosY+1), (UINT16)(pSlider->usPosX + pSlider->usWidth-1), (UINT16)(pSlider->usPosY+1), pSlider->usBackGroundColor );
@@ -322,7 +319,7 @@ void RenderSelectedSliderBar( SLIDER *pSlider )
void RenderSliderBox( SLIDER *pSlider )
{
HVOBJECT hPixHandle;
HVOBJECT hPixHandle;
SGPRect SrcRect;
SGPRect DestRect;
@@ -340,7 +337,7 @@ void RenderSliderBox( SLIDER *pSlider )
DestRect.iRight = DestRect.iLeft + pSlider->ubSliderWidth;
DestRect.iBottom = DestRect.iTop + pSlider->ubSliderHeight;
//If it is not the first time to render the slider
if( !( pSlider->LastRect.iLeft == 0 && pSlider->LastRect.iRight == 0 ) )
{
@@ -480,7 +477,7 @@ void SelectedSliderMovementCallBack(MOUSE_REGION * pRegion, INT32 reason )
if( pSlider->uiFlags & SLIDER_VERTICAL )
{
CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeYPos );
}
}
else
{
CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeXPos );
@@ -505,7 +502,7 @@ void SelectedSliderMovementCallBack(MOUSE_REGION * pRegion, INT32 reason )
if( pSlider->uiFlags & SLIDER_VERTICAL )
{
CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeYPos );
}
}
else
{
CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeXPos );
@@ -531,19 +528,19 @@ void SelectedSliderMovementCallBack(MOUSE_REGION * pRegion, INT32 reason )
if( pSlider->uiFlags & SLIDER_VERTICAL )
{
CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeYPos );
}
}
else
{
CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeXPos );
}
}
}
}
}
void SelectedSliderButtonCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
{
UINT32 uiSelectedSlider;
SLIDER *pSlider=NULL;
@@ -573,16 +570,16 @@ void SelectedSliderButtonCallBack(MOUSE_REGION * pRegion, INT32 iReason )
if( pSlider->uiFlags & SLIDER_VERTICAL )
{
CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeYPos );
}
}
else
{
CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeXPos );
}
}
}
else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{
uiSelectedSlider = MSYS_GetRegionUserData( pRegion, 1 );
pSlider = GetSliderFromID( uiSelectedSlider );
if( pSlider == NULL )
return;
@@ -597,7 +594,7 @@ void SelectedSliderButtonCallBack(MOUSE_REGION * pRegion, INT32 iReason )
if( pSlider->uiFlags & SLIDER_VERTICAL )
{
CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeYPos );
}
}
else
{
CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeXPos );
@@ -606,7 +603,7 @@ void SelectedSliderButtonCallBack(MOUSE_REGION * pRegion, INT32 iReason )
else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
}
}
}
@@ -633,7 +630,7 @@ void CalculateNewSliderIncrement( UINT32 uiSliderID, UINT16 usPos )
if( usPos <= (UINT16)(pSlider->usHeight * (FLOAT).01 ) )
fFirstSpot = TRUE;
//pSlider->usNumberOfIncrements
if( fFirstSpot )
dNewIncrement = 0;
@@ -675,14 +672,14 @@ void CalculateNewSliderIncrement( UINT32 uiSliderID, UINT16 usPos )
void OptDisplayLine( UINT16 usStartX, UINT16 usStartY, UINT16 EndX, UINT16 EndY, INT16 iColor )
{
UINT32 uiDestPitchBYTES;
UINT8 *pDestBuf;
UINT32 uiDestPitchBYTES;
UINT8 *pDestBuf;
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
// draw the line
// draw the line
LineDraw(FALSE, usStartX, usStartY, EndX, EndY, iColor, pDestBuf);
// unlock frame buffer
@@ -752,8 +749,8 @@ SLIDER *GetSliderFromID( UINT32 uiSliderID )
// if we couldnt find the right slider
if( pTemp == NULL )
return( NULL );
return( pTemp );
return( pTemp );
}
@@ -776,3 +773,4 @@ void SetSliderValue( UINT32 uiSliderID, UINT32 uiNewValue )
CalculateNewSliderBoxPosition( pSlider );
}
+247 -246
View File
@@ -13,7 +13,7 @@
#include "math.h"
#endif
#define SOUND_FAR_VOLUME_MOD 25
#define SOUND_FAR_VOLUME_MOD 25
/*
UINT32 LOWVOLUME START_LOWVOLUME;
@@ -103,7 +103,7 @@ char szSoundEffects[MAX_SAMPLES][255];// =
// "SOUNDS\\BULLET IMPACT 02.WAV",
//
// "STSOUNDS\\BLAH.WAV", // CREATURE ATTACK
//
//
// "SOUNDS\\STEP INTO WATER.WAV",
// "SOUNDS\\SPLASH FROM SHALLOW TO DEEP.WAV",
//
@@ -142,14 +142,14 @@ char szSoundEffects[MAX_SAMPLES][255];// =
// "SOUNDS\\STONE IMPACT 01.WAV",
// "SOUNDS\\WATER IMPACT 01.WAV",
// "SOUNDS\\VEG IMPACT 01.WAV",
// "SOUNDS\\METAL HIT 01.WAV", // S_METAL_HIT1
// "SOUNDS\\METAL HIT 01.WAV",
// "SOUNDS\\METAL HIT 01.WAV",
// "SOUNDS\\METAL HIT 01.WAV", // S_METAL_HIT1
// "SOUNDS\\METAL HIT 01.WAV",
// "SOUNDS\\METAL HIT 01.WAV",
//
// "SOUNDS\\SLAP_IMPACT.WAV",
//
// // FIREARM RELOAD
// "SOUNDS\\WEAPONS\\REVOLVER RELOAD.WAV", // REVOLVER
// "SOUNDS\\WEAPONS\\REVOLVER RELOAD.WAV", // REVOLVER
// "SOUNDS\\WEAPONS\\PISTOL RELOAD.WAV", // PISTOL
// "SOUNDS\\WEAPONS\\SMG RELOAD.WAV", // SMG
// "SOUNDS\\WEAPONS\\RIFLE RELOAD.WAV", // RIFLE
@@ -157,7 +157,7 @@ char szSoundEffects[MAX_SAMPLES][255];// =
// "SOUNDS\\WEAPONS\\LMG RELOAD.WAV", // LMG
//
// // FIREARM LOCKNLOAD
// "SOUNDS\\WEAPONS\\REVOLVER LNL.WAV", // REVOLVER
// "SOUNDS\\WEAPONS\\REVOLVER LNL.WAV", // REVOLVER
// "SOUNDS\\WEAPONS\\PISTOL LNL.WAV", // PISTOL
// "SOUNDS\\WEAPONS\\SMG LNL.WAV", // SMG
// "SOUNDS\\WEAPONS\\RIFLE LNL.WAV", // RIFLE
@@ -168,7 +168,7 @@ char szSoundEffects[MAX_SAMPLES][255];// =
// "SOUNDS\\WEAPONS\\SMALL ROCKET LAUNCHER.WAV", // SMALL ROCKET LUANCHER
// "SOUNDS\\WEAPONS\\MORTAR FIRE 01.WAV", // GRENADE LAUNCHER
// "SOUNDS\\WEAPONS\\MORTAR FIRE 01.WAV", // UNDERSLUNG GRENADE LAUNCHER
// "SOUNDS\\WEAPONS\\ROCKET LAUNCHER.WAV",
// "SOUNDS\\WEAPONS\\ROCKET LAUNCHER.WAV",
// "SOUNDS\\WEAPONS\\MORTAR FIRE 01.WAV",
//
// // FIREARMS
@@ -263,7 +263,7 @@ char szSoundEffects[MAX_SAMPLES][255];// =
// "SOUNDS\\ARMPIT.WAV",
// "SOUNDS\\CRACKING BACK.WAV",
//
// "SOUNDS\\WEAPONS\\Auto Resolve Composite 02 (8-22).wav",// The FF sound in autoresolve interface
// "SOUNDS\\WEAPONS\\Auto Resolve Composite 02 (8-22).wav",// The FF sound in autoresolve interface
//
// "SOUNDS\\Email Alert 01.wav",
// "SOUNDS\\Entering Text 02.wav",
@@ -315,10 +315,10 @@ char szSoundEffects[MAX_SAMPLES][255];// =
// "SOUNDS\\remote activate.WAV",
// "SOUNDS\\wirecutters.WAV",
// "SOUNDS\\drink from canteen.WAV",
// "SOUNDS\\bloodcat attack.wav",
// "SOUNDS\\bloodcat loud roar.wav",
// "SOUNDS\\robot greeting.wav",
// "SOUNDS\\robot death.wav",
// "SOUNDS\\bloodcat attack.wav",
// "SOUNDS\\bloodcat loud roar.wav",
// "SOUNDS\\robot greeting.wav",
// "SOUNDS\\robot death.wav",
// "SOUNDS\\gas grenade explode.WAV",
// "SOUNDS\\air escaping.WAV",
// "SOUNDS\\drawer open.WAV",
@@ -328,53 +328,53 @@ char szSoundEffects[MAX_SAMPLES][255];// =
// "SOUNDS\\wooden box open.WAV",
// "SOUNDS\\wooden box close.WAV",
// "SOUNDS\\robot stop moving.WAV",
// "SOUNDS\\water movement 01.wav",
// "SOUNDS\\water movement 02.wav",
// "SOUNDS\\water movement 03.wav",
// "SOUNDS\\water movement 04.wav",
// "SOUNDS\\PRONE TO CROUCH.WAV",
// "SOUNDS\\CROUCH TO PRONE.WAV",
// "SOUNDS\\CROUCH TO STAND.WAV",
// "SOUNDS\\STAND TO CROUCH.WAV",
// "SOUNDS\\picking something up.WAV",
// "SOUNDS\\cow falling.wav",
// "SOUNDS\\bloodcat_growl_01.wav",
// "SOUNDS\\bloodcat_growl_02.wav",
// "SOUNDS\\bloodcat_growl_03.wav",
// "SOUNDS\\bloodcat_growl_04.wav",
// "SOUNDS\\spit ricochet.wav",
// "SOUNDS\\water movement 01.wav",
// "SOUNDS\\water movement 02.wav",
// "SOUNDS\\water movement 03.wav",
// "SOUNDS\\water movement 04.wav",
// "SOUNDS\\PRONE TO CROUCH.WAV",
// "SOUNDS\\CROUCH TO PRONE.WAV",
// "SOUNDS\\CROUCH TO STAND.WAV",
// "SOUNDS\\STAND TO CROUCH.WAV",
// "SOUNDS\\picking something up.WAV",
// "SOUNDS\\cow falling.wav",
// "SOUNDS\\bloodcat_growl_01.wav",
// "SOUNDS\\bloodcat_growl_02.wav",
// "SOUNDS\\bloodcat_growl_03.wav",
// "SOUNDS\\bloodcat_growl_04.wav",
// "SOUNDS\\spit ricochet.wav",
// "SOUNDS\\ADULT crippled.WAV",
// "SOUNDS\\death disintegration.wav",
// "SOUNDS\\Queen Ambience.wav",
// "SOUNDS\\Alien Impact.wav",
// "SOUNDS\\crow pecking flesh 01.wav",
// "SOUNDS\\crow fly.wav",
// "SOUNDS\\slap 02.wav",
// "SOUNDS\\setting up mortar.wav",
// "SOUNDS\\mortar whistle.wav",
// "SOUNDS\\load mortar.wav",
// "SOUNDS\\tank turret a.wav",
// "SOUNDS\\tank turret b.wav",
// "SOUNDS\\cow falling b.wav",
// "SOUNDS\\stab into flesh.wav",
// "SOUNDS\\explosion 10.wav",
// "SOUNDS\\explosion 12.wav",
// "SOUNDS\\death disintegration.wav",
// "SOUNDS\\Queen Ambience.wav",
// "SOUNDS\\Alien Impact.wav",
// "SOUNDS\\crow pecking flesh 01.wav",
// "SOUNDS\\crow fly.wav",
// "SOUNDS\\slap 02.wav",
// "SOUNDS\\setting up mortar.wav",
// "SOUNDS\\mortar whistle.wav",
// "SOUNDS\\load mortar.wav",
// "SOUNDS\\tank turret a.wav",
// "SOUNDS\\tank turret b.wav",
// "SOUNDS\\cow falling b.wav",
// "SOUNDS\\stab into flesh.wav",
// "SOUNDS\\explosion 10.wav",
// "SOUNDS\\explosion 12.wav",
// "SOUNDS\\drink from canteen male.WAV",
// "SOUNDS\\x ray activated.WAV",
// "SOUNDS\\catch object.wav",
// "SOUNDS\\fence open.wav",
// "SOUNDS\\catch object.wav",
// "SOUNDS\\fence open.wav",
////MADD MARKER
////New Guns
// "SOUNDS\\WEAPONS\\50CAL.WAV",
// "SOUNDS\\WEAPONS\\VALSILENT.WAV"
//// "SOUNDS\\BreakLight.wav",
//// "SOUNDS\\BreakLight.wav",
//};
char szAmbientEffects[NUM_AMBIENTS][255] =
{
"SOUNDS\\storm1.wav",
"SOUNDS\\storm2.wav",
"SOUNDS\\storm1.wav",
"SOUNDS\\storm2.wav",
"SOUNDS\\rain_loop_22k.wav",
"SOUNDS\\bird1-22k.wav",
"SOUNDS\\bird3-22k.wav",
@@ -408,7 +408,7 @@ UINT8 AmbientVols[NUM_AMBIENTS]={
SOUNDPARMS gDelayedSoundParms;
UINT32 guiDelayedSoundNum;
UINT32 guiDelayedSoundNum;
void DelayedSoundTimerCallback( void );
@@ -437,7 +437,7 @@ BOOLEAN ShutdownJA2Sound( )
//}
return( TRUE );
}
}
UINT32 PlayJA2Sample( UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
{
@@ -448,10 +448,10 @@ UINT32 PlayJA2Sample( UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoo
memset(&spParms, 0xff, sizeof(SOUNDPARMS));
spParms.uiSpeed = usRate;
if ( strstr( szSoundEffects[usNum], "WEAPONS" ) == NULL )
{
spParms.uiVolume = CalculateSoundEffectsVolume( ubVolume );
spParms.uiVolume = CalculateSoundEffectsVolume( ubVolume );
}
else
{
@@ -471,7 +471,7 @@ UINT32 PlayJA2Sample( UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoo
UINT32 PlayJA2StreamingSample( UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
{
SOUNDPARMS spParms;
SOUNDPARMS spParms;
memset(&spParms, 0xff, sizeof(SOUNDPARMS));
@@ -505,7 +505,7 @@ UINT32 PlayJA2SampleFromFile( STR8 szFileName, UINT32 usRate, UINT32 ubVolume, U
{
spParms.uiVolume = (UINT32)( ( ubVolume / (FLOAT) HIGHVOLUME ) * guiSoundEffectsVolume +.5 ) * (1 + gGameExternalOptions.guiWeaponSoundEffectsVolume / 100);
}
spParms.uiLoop = ubLoops;
spParms.uiPan = uiPan;
spParms.uiPriority=GROUP_PLAYER;
@@ -520,7 +520,7 @@ UINT32 PlayJA2StreamingSampleFromFile( STR8 szFileName, UINT32 usRate, UINT32 ub
// does the same thing as PlayJA2Sound, but one only has to pass the filename, not the index of the sound array
SOUNDPARMS spParms;
SOUNDPARMS spParms;
memset(&spParms, 0xff, sizeof(SOUNDPARMS));
@@ -529,7 +529,7 @@ UINT32 PlayJA2StreamingSampleFromFile( STR8 szFileName, UINT32 usRate, UINT32 ub
spParms.uiLoop = ubLoops;
spParms.uiPan = uiPan;
spParms.uiPriority=GROUP_PLAYER;
spParms.EOSCallback=EndsCallback;
spParms.EOSCallback=EndsCallback;
return( SoundPlayStreamedFile(szFileName, &spParms) );
}
@@ -569,13 +569,13 @@ UINT32 PlaySoldierJA2Sample( UINT16 usID, UINT32 usNum, UINT32 usRate, UINT32 ub
{
if( !( gTacticalStatus.uiFlags & LOADING_SAVED_GAME ) )
{
// CHECK IF GUY IS ON SCREEN BEFORE PLAYING!
if ( ( MercPtrs[ usID ]->bVisible != -1 ) || !fCheck )
{
return( PlayJA2Sample( usNum, usRate, CalculateSoundEffectsVolume( ubVolume ), ubLoops, uiPan ) );
}
}
{
// CHECK IF GUY IS ON SCREEN BEFORE PLAYING!
if ( ( MercPtrs[ usID ]->bVisible != -1 ) || !fCheck )
{
return( PlayJA2Sample( usNum, usRate, CalculateSoundEffectsVolume( ubVolume ), ubLoops, uiPan ) );
}
}
return( 0 );
}
@@ -587,7 +587,7 @@ UINT32 PlaySoldierJA2Sample( UINT16 usID, UINT32 usNum, UINT32 usRate, UINT32 ub
void SetSpeechVolume( UINT32 uiNewVolume )
{
guiSpeechVolume = __min( uiNewVolume, 127);
guiSpeechVolume = __min( uiNewVolume, 127);
}
@@ -600,7 +600,7 @@ UINT32 GetSpeechVolume( )
void SetSoundEffectsVolume( UINT32 uiNewVolume )
{
guiSoundEffectsVolume = __min( uiNewVolume, 127);
guiSoundEffectsVolume = __min( uiNewVolume, 127);
}
@@ -632,26 +632,26 @@ int x,dif,absDif;
dif = ScreenMiddleX - x;
if ( (absDif=abs(dif)) > 32)
{
// OK, NOT the middle.
{
// OK, NOT the middle.
// Is it outside the screen?
if (absDif > HalfWindowWidth)
{
// yes, outside...
if (dif > 0)
return(25);
else
return(102);
}
else // inside screen
if (dif > 0)
return(LEFTSIDE);
else
return(RIGHTSIDE);
}
// Is it outside the screen?
if (absDif > HalfWindowWidth)
{
// yes, outside...
if (dif > 0)
return(25);
else
return(102);
}
else // inside screen
if (dif > 0)
return(LEFTSIDE);
else
return(RIGHTSIDE);
}
else // hardly any difference, so sound should be played from middle
return(MIDDLE);
return(MIDDLE);
}
#endif
@@ -664,10 +664,10 @@ INT32 SoundDir( INT16 sGridNo )
INT16 sMiddleX;
INT16 sDif, sAbsDif;
if ( sGridNo == NOWHERE )
{
return( MIDDLEPAN );
}
if ( sGridNo == NOWHERE )
{
return( MIDDLEPAN );
}
// OK, get screen position of gridno.....
ConvertGridNoToXY( sGridNo, &sWorldX, &sWorldY );
@@ -681,21 +681,21 @@ INT32 SoundDir( INT16 sGridNo )
sDif = sMiddleX - sScreenX;
if ( ( sAbsDif = (INT16) abs( sDif ) ) > 64 )
{
{
// OK, NOT the middle.
// Is it outside the screen?
if ( sAbsDif > ( ( gsBottomRightWorldX - gsTopLeftWorldX ) / 2 ) )
{
{
// yes, outside...
if ( sDif > 0 )
{
return( FARLEFT );
//return( 1 );
}
else
return( FARRIGHT );
//return( 126 );
}
else
return( FARRIGHT );
//return( 126 );
}
else // inside screen
{
if ( sDif > 0)
@@ -703,9 +703,9 @@ INT32 SoundDir( INT16 sGridNo )
else
return( RIGHTSIDE );
}
}
}
else // hardly any difference, so sound should be played from middle
return(MIDDLE);
return(MIDDLE);
}
@@ -717,10 +717,10 @@ INT32 SoundVolume( INT8 bInitialVolume, INT16 sGridNo )
INT16 sDifX, sAbsDifX;
INT16 sDifY, sAbsDifY;
if ( sGridNo == NOWHERE )
{
return( bInitialVolume );
}
if ( sGridNo == NOWHERE )
{
return( bInitialVolume );
}
// OK, get screen position of gridno.....
ConvertGridNoToXY( sGridNo, &sWorldX, &sWorldY );
@@ -738,16 +738,16 @@ INT32 SoundVolume( INT8 bInitialVolume, INT16 sGridNo )
sAbsDifX = (INT16) abs( sDifX );
sAbsDifY = (INT16) abs( sDifY );
if ( sAbsDifX > 64 || sAbsDifY > 64 )
{
if ( sAbsDifX > 64 || sAbsDifY > 64 )
{
// OK, NOT the middle.
// Is it outside the screen?
if ( sAbsDifX > ( ( gsBottomRightWorldX - gsTopLeftWorldX ) / 2 ) ||
sAbsDifY > ( ( gsBottomRightWorldY - gsTopLeftWorldY ) / 2 ) )
{
if ( sAbsDifX > ( ( gsBottomRightWorldX - gsTopLeftWorldX ) / 2 ) ||
sAbsDifY > ( ( gsBottomRightWorldY - gsTopLeftWorldY ) / 2 ) )
{
return( __max( LOWVOLUME, ( bInitialVolume - SOUND_FAR_VOLUME_MOD ) ) );
}
}
}
}
return( bInitialVolume );
}
@@ -791,13 +791,13 @@ void DelayedSoundTimerCallback( void )
typedef struct
{
UINT32 uiFlags;
INT16 sGridNo;
INT32 iSoundSampleID;
INT32 iSoundToPlay;
UINT32 uiData;
BOOLEAN fAllocated;
BOOLEAN fInActive;
UINT32 uiFlags;
INT16 sGridNo;
INT32 iSoundSampleID;
INT32 iSoundToPlay;
UINT32 uiData;
BOOLEAN fAllocated;
BOOLEAN fInActive;
} POSITIONSND;
@@ -805,7 +805,7 @@ typedef struct
// GLOBAL FOR SMOKE LISTING
POSITIONSND gPositionSndData[ NUM_POSITION_SOUND_EFFECT_SLOTS ];
UINT32 guiNumPositionSnds = 0;
BOOLEAN gfPositionSoundsActive = FALSE;
BOOLEAN gfPositionSoundsActive = FALSE;
INT32 GetFreePositionSnd( void );
@@ -857,114 +857,114 @@ INT32 NewPositionSnd( INT16 sGridNo, UINT32 uiFlags, UINT32 uiData, UINT32 iSoun
pPositionSnd = &gPositionSndData[ iPositionSndIndex ];
// Default to inactive
// Default to inactive
if ( gfPositionSoundsActive )
{
pPositionSnd->fInActive = FALSE;
}
else
{
pPositionSnd->fInActive = TRUE;
}
pPositionSnd->sGridNo = sGridNo;
pPositionSnd->uiData = uiData;
pPositionSnd->uiFlags = uiFlags;
pPositionSnd->fAllocated = TRUE;
pPositionSnd->iSoundToPlay = iSoundToPlay;
if ( gfPositionSoundsActive )
{
pPositionSnd->fInActive = FALSE;
}
else
{
pPositionSnd->fInActive = TRUE;
}
pPositionSnd->iSoundSampleID = NO_SAMPLE;
pPositionSnd->sGridNo = sGridNo;
pPositionSnd->uiData = uiData;
pPositionSnd->uiFlags = uiFlags;
pPositionSnd->fAllocated = TRUE;
pPositionSnd->iSoundToPlay = iSoundToPlay;
return( iPositionSndIndex );
pPositionSnd->iSoundSampleID = NO_SAMPLE;
return( iPositionSndIndex );
}
void DeletePositionSnd( INT32 iPositionSndIndex )
{
POSITIONSND *pPositionSnd;
pPositionSnd = &gPositionSndData[ iPositionSndIndex ];
pPositionSnd = &gPositionSndData[ iPositionSndIndex ];
if ( pPositionSnd->fAllocated )
{
// Turn inactive first...
pPositionSnd->fInActive = TRUE;
if ( pPositionSnd->fAllocated )
{
// Turn inactive first...
pPositionSnd->fInActive = TRUE;
// End sound...
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
{
SoundStop( pPositionSnd->iSoundSampleID );
}
// End sound...
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
{
SoundStop( pPositionSnd->iSoundSampleID );
}
pPositionSnd->fAllocated = FALSE;
pPositionSnd->fAllocated = FALSE;
RecountPositionSnds( );
}
RecountPositionSnds( );
}
}
void SetPositionSndGridNo( INT32 iPositionSndIndex, INT16 sGridNo )
{
POSITIONSND *pPositionSnd;
pPositionSnd = &gPositionSndData[ iPositionSndIndex ];
pPositionSnd = &gPositionSndData[ iPositionSndIndex ];
if ( pPositionSnd->fAllocated )
{
pPositionSnd->sGridNo = sGridNo;
if ( pPositionSnd->fAllocated )
{
pPositionSnd->sGridNo = sGridNo;
SetPositionSndsVolumeAndPanning( );
}
SetPositionSndsVolumeAndPanning( );
}
}
void SetPositionSndsActive( )
{
UINT32 cnt;
UINT32 cnt;
POSITIONSND *pPositionSnd;
gfPositionSoundsActive = TRUE;
gfPositionSoundsActive = TRUE;
for ( cnt = 0; cnt < guiNumPositionSnds; cnt++ )
{
pPositionSnd = &gPositionSndData[ cnt ];
for ( cnt = 0; cnt < guiNumPositionSnds; cnt++ )
{
pPositionSnd = &gPositionSndData[ cnt ];
if ( pPositionSnd->fAllocated )
{
if ( pPositionSnd->fInActive )
{
pPositionSnd->fInActive = FALSE;
if ( pPositionSnd->fAllocated )
{
if ( pPositionSnd->fInActive )
{
pPositionSnd->fInActive = FALSE;
// Begin sound effect
// Volume 0
pPositionSnd->iSoundSampleID = PlayJA2Sample( pPositionSnd->iSoundToPlay, RATE_11025, 0, 0, MIDDLEPAN );
}
}
}
// Begin sound effect
// Volume 0
pPositionSnd->iSoundSampleID = PlayJA2Sample( pPositionSnd->iSoundToPlay, RATE_11025, 0, 0, MIDDLEPAN );
}
}
}
}
void SetPositionSndsInActive( )
{
UINT32 cnt;
UINT32 cnt;
POSITIONSND *pPositionSnd;
gfPositionSoundsActive = FALSE;
gfPositionSoundsActive = FALSE;
for ( cnt = 0; cnt < guiNumPositionSnds; cnt++ )
{
pPositionSnd = &gPositionSndData[ cnt ];
for ( cnt = 0; cnt < guiNumPositionSnds; cnt++ )
{
pPositionSnd = &gPositionSndData[ cnt ];
if ( pPositionSnd->fAllocated )
{
pPositionSnd->fInActive = TRUE;
if ( pPositionSnd->fAllocated )
{
pPositionSnd->fInActive = TRUE;
// End sound...
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
{
SoundStop( pPositionSnd->iSoundSampleID );
pPositionSnd->iSoundSampleID = NO_SAMPLE;
}
}
}
// End sound...
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
{
SoundStop( pPositionSnd->iSoundSampleID );
pPositionSnd->iSoundSampleID = NO_SAMPLE;
}
}
}
}
// == Lesh slightly changed this function ============
@@ -975,10 +975,10 @@ UINT8 PositionSoundDir( INT16 sGridNo )
INT16 sMiddleX;
INT16 sDif, sAbsDif;
if ( sGridNo == NOWHERE )
{
return( MIDDLEPAN );
}
if ( sGridNo == NOWHERE )
{
return( MIDDLEPAN );
}
// OK, get screen position of gridno.....
ConvertGridNoToXY( sGridNo, &sWorldX, &sWorldY );
@@ -992,23 +992,23 @@ UINT8 PositionSoundDir( INT16 sGridNo )
sDif = sMiddleX - sScreenX;
if ( ( sAbsDif = (INT16) abs( sDif ) ) > 64 )
{
{
// OK, NOT the middle.
// Is it outside the screen?
if ( sAbsDif > ( ( gsBottomRightWorldX - gsTopLeftWorldX ) / 2 ) )
{
{
// yes, outside...
if ( sDif > 0 )
{
return( FARLEFT );
//return( 1 );
}
else
return( FARRIGHT );
//return( 126 );
else
return( FARRIGHT );
//return( 126 );
}
}
else // inside screen
{
if ( sDif > 0)
@@ -1016,9 +1016,9 @@ UINT8 PositionSoundDir( INT16 sGridNo )
else
return( RIGHTSIDE );
}
}
}
else // hardly any difference, so sound should be played from middle
return(MIDDLE);
return(MIDDLE);
}
@@ -1029,13 +1029,13 @@ INT8 PositionSoundVolume( INT8 bInitialVolume, INT16 sGridNo )
INT16 sMiddleX, sMiddleY;
INT16 sDifX, sAbsDifX;
INT16 sDifY, sAbsDifY;
INT16 sMaxDistX, sMaxDistY;
double sMaxSoundDist, sSoundDist;
INT16 sMaxDistX, sMaxDistY;
double sMaxSoundDist, sSoundDist;
if ( sGridNo == NOWHERE )
{
return( bInitialVolume );
}
if ( sGridNo == NOWHERE )
{
return( bInitialVolume );
}
// OK, get screen position of gridno.....
ConvertGridNoToXY( sGridNo, &sWorldX, &sWorldY );
@@ -1053,60 +1053,60 @@ INT8 PositionSoundVolume( INT8 bInitialVolume, INT16 sGridNo )
sAbsDifX = (INT16) abs( sDifX );
sAbsDifY = (INT16) abs( sDifY );
sMaxDistX = (INT16)( ( gsBottomRightWorldX - gsTopLeftWorldX ) * 1.5 );
sMaxDistY = (INT16)( ( gsBottomRightWorldY - gsTopLeftWorldY ) * 1.5 );
sMaxDistX = (INT16)( ( gsBottomRightWorldX - gsTopLeftWorldX ) * 1.5 );
sMaxDistY = (INT16)( ( gsBottomRightWorldY - gsTopLeftWorldY ) * 1.5 );
sMaxSoundDist = sqrt( (double) ( sMaxDistX * sMaxDistX ) + ( sMaxDistY * sMaxDistY ) );
sSoundDist = sqrt( (double)( sAbsDifX * sAbsDifX ) + ( sAbsDifY * sAbsDifY ) );
sMaxSoundDist = sqrt( (double) ( sMaxDistX * sMaxDistX ) + ( sMaxDistY * sMaxDistY ) );
sSoundDist = sqrt( (double)( sAbsDifX * sAbsDifX ) + ( sAbsDifY * sAbsDifY ) );
if ( sSoundDist == 0 )
{
return( bInitialVolume );
}
if ( sSoundDist == 0 )
{
return( bInitialVolume );
}
if ( sSoundDist > sMaxSoundDist )
{
sSoundDist = sMaxSoundDist;
}
if ( sSoundDist > sMaxSoundDist )
{
sSoundDist = sMaxSoundDist;
}
// Scale
return( (INT8)( bInitialVolume * ( ( sMaxSoundDist - sSoundDist ) / sMaxSoundDist ) ) );
// Scale
return( (INT8)( bInitialVolume * ( ( sMaxSoundDist - sSoundDist ) / sMaxSoundDist ) ) );
}
void SetPositionSndsVolumeAndPanning( )
{
UINT32 cnt;
UINT32 cnt;
POSITIONSND *pPositionSnd;
INT8 bVolume;
UINT8 ubPan;
SOLDIERTYPE *pSoldier;
INT8 bVolume;
UINT8 ubPan;
SOLDIERTYPE *pSoldier;
for ( cnt = 0; cnt < guiNumPositionSnds; cnt++ )
{
pPositionSnd = &gPositionSndData[ cnt ];
for ( cnt = 0; cnt < guiNumPositionSnds; cnt++ )
{
pPositionSnd = &gPositionSndData[ cnt ];
if ( pPositionSnd->fAllocated )
{
if ( !pPositionSnd->fInActive )
{
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
{
bVolume = PositionSoundVolume( 15, pPositionSnd->sGridNo );
if ( pPositionSnd->fAllocated )
{
if ( !pPositionSnd->fInActive )
{
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
{
bVolume = PositionSoundVolume( 15, pPositionSnd->sGridNo );
if ( pPositionSnd->uiFlags & POSITION_SOUND_FROM_SOLDIER )
{
pSoldier = (SOLDIERTYPE*)pPositionSnd->uiData;
if ( pPositionSnd->uiFlags & POSITION_SOUND_FROM_SOLDIER )
{
pSoldier = (SOLDIERTYPE*)pPositionSnd->uiData;
if ( pSoldier->bVisible == -1 )
{
// Limit volume,,,
if ( bVolume > 10 )
{
bVolume = 10;
}
}
}
if ( pSoldier->bVisible == -1 )
{
// Limit volume,,,
if ( bVolume > 10 )
{
bVolume = 10;
}
}
}
//if the sound is from a stationay object
if( pPositionSnd->uiFlags & POSITION_SOUND_STATIONATY_OBJECT )
@@ -1118,14 +1118,15 @@ void SetPositionSndsVolumeAndPanning( )
}
}
SoundSetVolume( pPositionSnd->iSoundSampleID, bVolume );
SoundSetVolume( pPositionSnd->iSoundSampleID, bVolume );
ubPan = PositionSoundDir( pPositionSnd->sGridNo );
SoundSetPan( pPositionSnd->iSoundSampleID, ubPan );
}
}
}
}
}
}
}
}
}
+58 -58
View File
@@ -1,17 +1,17 @@
/*
* ChangeLog:
* 11.12.2005 Lesh changed balance settings
* 11.12.2005 Lesh changed balance settings
*/
#ifndef SOUND_CONTROL_H
#define SOUND_CONTROL_H
// == Lesh modifications ======
#define FARLEFT 0
#define LEFTSIDE 96
#define MIDDLE 128
#define FARLEFT 0
#define LEFTSIDE 96
#define MIDDLE 128
#define MIDDLEPAN 128
#define RIGHTSIDE 160
#define FARRIGHT 255
#define RIGHTSIDE 160
#define FARRIGHT 255
// == Lesh modifications ends =
#define LOWVOLUME 25
@@ -175,8 +175,8 @@ enum SoundDefines
S_MORTAR_SHOT,
S_GLOCK17,
S_GLOCK18,
S_BERETTA92,
S_BERETTA93,
S_BERETTA92,
S_BERETTA93,
S_SWSPECIAL,
S_BARRACUDA,
S_DESERTEAGLE,
@@ -212,7 +212,7 @@ enum SoundDefines
S_THROWKNIFE,
S_TANK_CANNON,
S_BURSTTYPE1,
S_AUTOMAG,
S_AUTOMAG,
S_SILENCER_1,
S_SILENCER_2,
@@ -315,64 +315,64 @@ enum SoundDefines
SWIM_2,
KEY_FAILURE,
TARGET_OUT_OF_RANGE,
OPEN_STATUE,
USE_STATUE_REMOTE,
USE_WIRE_CUTTERS,
DRINK_CANTEEN_FEMALE,
BLOODCAT_ATTACK,
BLOODCAT_ROAR,
ROBOT_GREETING,
ROBOT_DEATH,
GAS_EXPLODE_1,
AIR_ESCAPING_1,
OPEN_STATUE,
USE_STATUE_REMOTE,
USE_WIRE_CUTTERS,
DRINK_CANTEEN_FEMALE,
BLOODCAT_ATTACK,
BLOODCAT_ROAR,
ROBOT_GREETING,
ROBOT_DEATH,
GAS_EXPLODE_1,
AIR_ESCAPING_1,
OPEN_DRAWER,
CLOSE_DRAWER,
OPEN_LOCKER,
CLOSE_LOCKER,
OPEN_WOODEN_BOX,
CLOSE_WOODEN_BOX,
ROBOT_STOP,
OPEN_DRAWER,
CLOSE_DRAWER,
OPEN_LOCKER,
CLOSE_LOCKER,
OPEN_WOODEN_BOX,
CLOSE_WOODEN_BOX,
ROBOT_STOP,
WATER_WALK1_IN,
WATER_WALK1_OUT,
WATER_WALK2_IN,
WATER_WALK2_OUT,
PRONE_UP_SOUND,
PRONE_DOWN_SOUND,
KNEEL_UP_SOUND,
KNEEL_DOWN_SOUND,
PICKING_SOMETHING_UP,
PRONE_UP_SOUND,
PRONE_DOWN_SOUND,
KNEEL_UP_SOUND,
KNEEL_DOWN_SOUND,
PICKING_SOMETHING_UP,
COW_FALL,
COW_FALL,
BLOODCAT_GROWL_1,
BLOODCAT_GROWL_2,
BLOODCAT_GROWL_3,
BLOODCAT_GROWL_4,
CREATURE_GAS_NOISE,
CREATURE_FALL_PART_2,
CREATURE_DISSOLVE_1,
QUEEN_AMBIENT_NOISE,
CREATURE_FALL,
CROW_PECKING_AT_FLESH,
CROW_FLYING_AWAY,
SLAP_2,
MORTAR_START,
MORTAR_WHISTLE,
MORTAR_LOAD,
BLOODCAT_GROWL_1,
BLOODCAT_GROWL_2,
BLOODCAT_GROWL_3,
BLOODCAT_GROWL_4,
CREATURE_GAS_NOISE,
CREATURE_FALL_PART_2,
CREATURE_DISSOLVE_1,
QUEEN_AMBIENT_NOISE,
CREATURE_FALL,
CROW_PECKING_AT_FLESH,
CROW_FLYING_AWAY,
SLAP_2,
MORTAR_START,
MORTAR_WHISTLE,
MORTAR_LOAD,
TURRET_MOVE,
TURRET_STOP,
COW_FALL_2,
KNIFE_IMPACT,
EXPLOSION_ALT_BLAST_1,
EXPLOSION_BLAST_2,
DRINK_CANTEEN_MALE,
USE_X_RAY_MACHINE,
CATCH_OBJECT,
FENCE_OPEN,
TURRET_MOVE,
TURRET_STOP,
COW_FALL_2,
KNIFE_IMPACT,
EXPLOSION_ALT_BLAST_1,
EXPLOSION_BLAST_2,
DRINK_CANTEEN_MALE,
USE_X_RAY_MACHINE,
CATCH_OBJECT,
FENCE_OPEN,
//MADD MARKER
S_BARRETT,
@@ -448,7 +448,7 @@ INT32 SoundVolume( INT8 bInitialVolume, INT16 sGridNo );
void PlayDelayedJA2Sample( UINT32 uiDelay, UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan );
#define POSITION_SOUND_FROM_SOLDIER 0x00000001
#define POSITION_SOUND_FROM_SOLDIER 0x00000001
#define POSITION_SOUND_STATIONATY_OBJECT 0x00000002
INT32 NewPositionSnd( INT16 sGridNo, UINT32 uiFlags, UINT32 uiData, UINT32 iSoundToPlay );
+102 -102
View File
@@ -73,7 +73,7 @@ typedef struct TEXTINPUTNODE{
struct TEXTINPUTNODE *next, *prev;
}TEXTINPUTNODE;
//Stack list containing the head nodes of each level. Only the top level is the active level.
//Stack list containing the head nodes of each level. Only the top level is the active level.
typedef struct STACKTEXTINPUTNODE
{
TEXTINPUTNODE *head;
@@ -92,7 +92,7 @@ void ExecuteCopyCommand();
void ExecuteCutCommand();
void ExecutePasteCommand();
//Internal list vars. active always points to the currently edited field.
//Internal list vars. active always points to the currently edited field.
TEXTINPUTNODE *gpTextInputHead = NULL, *gpTextInputTail = NULL, *gpActive = NULL;
//Saving current mode
@@ -116,7 +116,7 @@ void PushTextInputLevel()
}
//After the currently text input mode is removed, we then restore the previous one
//automatically. Assert failure in this function will expose cases where you are trigger
//automatically. Assert failure in this function will expose cases where you are trigger
//happy with killing non-existant text input modes.
void PopTextInputLevel()
{
@@ -144,12 +144,12 @@ UINT8 gubEndHilite = 0;
//allow the user to cut, copy, and paste just like windows.
CHAR16 gszClipboardString[256];
//Simply initiates that you wish to begin inputting text. This should only apply to screen
//initializations that contain fields that edit text. It also verifies and clears any existing
//fields. Your input loop must contain the function HandleTextInput and processed if the gfTextInputMode
//flag is set else process your regular input handler. Note that this doesn't mean you are necessarily typing,
//just that there are text fields in your screen and may be inactive. The TAB key cycles through your text fields,
//and special fields can be defined which will call a void functionName( UINT16 usFieldNum )
//Simply initiates that you wish to begin inputting text. This should only apply to screen
//initializations that contain fields that edit text. It also verifies and clears any existing
//fields. Your input loop must contain the function HandleTextInput and processed if the gfTextInputMode
//flag is set else process your regular input handler. Note that this doesn't mean you are necessarily typing,
//just that there are text fields in your screen and may be inactive. The TAB key cycles through your text fields,
//and special fields can be defined which will call a void functionName( UINT16 usFieldNum )
void InitTextInputMode()
{
if( gpTextInputHead )
@@ -170,18 +170,18 @@ void InitTextInputMode()
pColors->usCursorColor = 0;
}
//A hybrid version of InitTextInput() which uses a specific scheme. JA2's editor uses scheme 1, so
//A hybrid version of InitTextInput() which uses a specific scheme. JA2's editor uses scheme 1, so
//feel free to add new schemes.
void InitTextInputModeWithScheme( UINT8 ubSchemeID )
{
InitTextInputMode();
switch( ubSchemeID )
{
case DEFAULT_SCHEME: //yellow boxes with black text, with bluish bevelling
case DEFAULT_SCHEME: //yellow boxes with black text, with bluish bevelling
SetTextInputFont( (UINT16)FONT12POINT1 );
Set16BPPTextFieldColor( Get16BPPColor(FROMRGB(250, 240, 188) ) );
SetBevelColors( Get16BPPColor(FROMRGB(136, 138, 135)), Get16BPPColor(FROMRGB(24, 61, 81)) );
SetTextInputRegularColors( FONT_BLACK, FONT_BLACK );
SetTextInputRegularColors( FONT_BLACK, FONT_BLACK );
SetTextInputHilitedColors( FONT_GRAY2, FONT_GRAY2, FONT_METALGRAY );
break;
}
@@ -225,8 +225,8 @@ void KillTextInputMode()
gpActive = NULL;
}
//Kills all levels of text input modes. When you init a second consecutive text input mode, without
//first removing them, the existing mode will be preserved. This function removes all of them in one
//Kills all levels of text input modes. When you init a second consecutive text input mode, without
//first removing them, the existing mode will be preserved. This function removes all of them in one
//call, though doing so "may" reflect poor coding style, though I haven't thought about any really
//just uses for it :(
void KillAllTextInputModes()
@@ -235,18 +235,18 @@ void KillAllTextInputModes()
KillTextInputMode();
}
//After calling InitTextInputMode, you want to define one or more text input fields. The order
//of calls to this function dictate the TAB order from traversing from one field to the next. This
//After calling InitTextInputMode, you want to define one or more text input fields. The order
//of calls to this function dictate the TAB order from traversing from one field to the next. This
//function adds mouse regions and processes them for you, as well as deleting them when you are done.
void AddTextInputField( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT8 bPriority,
STR16 szInitText, UINT8 ubMaxChars, UINT16 usInputType )
void AddTextInputField( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT8 bPriority,
STR16 szInitText, UINT8 ubMaxChars, UINT16 usInputType )
{
TEXTINPUTNODE *pNode;
pNode = (TEXTINPUTNODE*)MemAlloc(sizeof(TEXTINPUTNODE));
Assert(pNode);
memset( pNode, 0, sizeof( TEXTINPUTNODE ) );
pNode->next = NULL;
if( !gpTextInputHead ) //first entry, so we start with text input.
if( !gpTextInputHead ) //first entry, so we start with text input.
{
gfEditingText = TRUE;
gpTextInputHead = gpTextInputTail = pNode;
@@ -263,7 +263,7 @@ void AddTextInputField( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, IN
}
//Setup the information for the node
pNode->usInputType = usInputType; //setup the filter type
//All 24hourclock inputtypes have 6 characters. 01:23 (null terminated)
//All 24hourclock inputtypes have 6 characters. 01:23 (null terminated)
if( usInputType == INPUTTYPE_EXCLUSIVE_24HOURCLOCK )
ubMaxChars = 6;
//Allocate and copy the string.
@@ -271,7 +271,7 @@ void AddTextInputField( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, IN
Assert( pNode->szString );
if( szInitText )
{
pNode->ubStrLen = (UINT8)wcslen( szInitText );
pNode->ubStrLen = (UINT8)wcslen( szInitText );
Assert( pNode->ubStrLen <= ubMaxChars );
swprintf( pNode->szString, szInitText );
}
@@ -294,16 +294,16 @@ void AddTextInputField( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, IN
pNode->fEnabled = TRUE;
//Setup the region.
MSYS_DefineRegion( &pNode->region, sLeft, sTop, (INT16)(sLeft+sWidth), (INT16)(sTop+sHeight), bPriority,
gusTextInputCursor, MouseMovedInTextRegionCallback, MouseClickedInTextRegionCallback );
gusTextInputCursor, MouseMovedInTextRegionCallback, MouseClickedInTextRegionCallback );
MSYS_SetRegionUserData( &pNode->region, 0, pNode->ubID );
}
//This allows you to insert special processing functions and modes that can't be determined here. An example
//would be a file dialog where there would be a file list. This file list would be accessed using the Win95
//convention by pressing TAB. In there, your key presses would be handled differently and by adding a userinput
//field, you can make this hook into your function to accomplish this. In a filedialog, alpha characters
//would be used to jump to the file starting with that letter, and setting the field in the text input
//field. Pressing TAB again would place you back in the text input field. All of that stuff would be handled
//This allows you to insert special processing functions and modes that can't be determined here. An example
//would be a file dialog where there would be a file list. This file list would be accessed using the Win95
//convention by pressing TAB. In there, your key presses would be handled differently and by adding a userinput
//field, you can make this hook into your function to accomplish this. In a filedialog, alpha characters
//would be used to jump to the file starting with that letter, and setting the field in the text input
//field. Pressing TAB again would place you back in the text input field. All of that stuff would be handled
//externally, except for the TAB keys.
void AddUserInputField( INPUT_CALLBACK userFunction )
{
@@ -311,7 +311,7 @@ void AddUserInputField( INPUT_CALLBACK userFunction )
pNode = (TEXTINPUTNODE*)MemAlloc(sizeof(TEXTINPUTNODE));
Assert(pNode);
pNode->next = NULL;
if( !gpTextInputHead ) //first entry, so we don't start with text input.
if( !gpTextInputHead ) //first entry, so we don't start with text input.
{
gfEditingText = FALSE;
gpTextInputHead = gpTextInputTail = pNode;
@@ -334,7 +334,7 @@ void AddUserInputField( INPUT_CALLBACK userFunction )
pNode->InputCallback = userFunction;
}
//Removes the specified field from the existing fields. If it doesn't exist, then there will be an
//Removes the specified field from the existing fields. If it doesn't exist, then there will be an
//assertion failure.
void RemoveTextInputField( UINT8 ubField )
{
@@ -370,10 +370,10 @@ void RemoveTextInputField( UINT8 ubField )
}
curr = curr->next;
}
AssertMsg( 0, "Attempt to remove a text input field that doesn't exist. Check your IDs." );
AssertMsg( 0, "Attempt to remove a text input field that doesn't exist. Check your IDs." );
}
//Returns the gpActive field ID number. It'll return -1 if no field is active.
//Returns the gpActive field ID number. It'll return -1 if no field is active.
INT16 GetActiveFieldID()
{
if( gpActive )
@@ -381,13 +381,13 @@ INT16 GetActiveFieldID()
return -1;
}
//This is a useful call made from an external user input field. Using the previous file dialog example, this
//This is a useful call made from an external user input field. Using the previous file dialog example, this
//call would be made when the user selected a different filename in the list via clicking or scrolling with
//the arrows, or even using alpha chars to jump to the appropriate filename.
void SetInputFieldStringWith16BitString( UINT8 ubField, const STR16 szNewText )
{
TEXTINPUTNODE *curr;
curr = gpTextInputHead;
curr = gpTextInputHead;
while( curr )
{
if( curr->ubID == ubField )
@@ -416,7 +416,7 @@ void SetInputFieldStringWith16BitString( UINT8 ubField, const STR16 szNewText )
void SetInputFieldStringWith8BitString( UINT8 ubField, const STR8 szNewText )
{
TEXTINPUTNODE *curr;
curr = gpTextInputHead;
curr = gpTextInputHead;
while( curr )
{
if( curr->ubID == ubField )
@@ -446,7 +446,7 @@ void SetInputFieldStringWith8BitString( UINT8 ubField, const STR8 szNewText )
void Get8BitStringFromField( UINT8 ubField, STR8 szString )
{
TEXTINPUTNODE *curr;
curr = gpTextInputHead;
curr = gpTextInputHead;
while( curr )
{
if( curr->ubID == ubField )
@@ -462,7 +462,7 @@ void Get8BitStringFromField( UINT8 ubField, STR8 szString )
void Get16BitStringFromField( UINT8 ubField, STR16 szString )
{
TEXTINPUTNODE *curr;
curr = gpTextInputHead;
curr = gpTextInputHead;
while( curr )
{
if( curr->ubID == ubField )
@@ -476,7 +476,7 @@ void Get16BitStringFromField( UINT8 ubField, STR16 szString )
}
//Converts the field's string into a number, then returns that number
//returns -1 if blank or invalid. Only works for positive numbers.
//returns -1 if blank or invalid. Only works for positive numbers.
INT32 GetNumericStrictValueFromField( UINT8 ubField )
{
STR16 ptr;
@@ -486,7 +486,7 @@ INT32 GetNumericStrictValueFromField( UINT8 ubField )
//Blank string, so return -1
if( str[0] == '\0' )
return -1;
//Convert the string to a number. Don't trust other functions. This will
//Convert the string to a number. Don't trust other functions. This will
//ensure that nonnumeric values automatically return -1.
total = 0;
ptr = str;
@@ -494,7 +494,7 @@ INT32 GetNumericStrictValueFromField( UINT8 ubField )
{
if( *ptr >= '0' && *ptr <= '9' ) //...make sure it is numeric...
{ //Multiply prev total by 10 and add converted char digit value.
total = total * 10 + (*ptr - '0');
total = total * 10 + (*ptr - '0');
}
else //...else the string is invalid.
return -1;
@@ -503,7 +503,7 @@ INT32 GetNumericStrictValueFromField( UINT8 ubField )
return total; //if we made it this far, then we have a valid number.
}
//Converts a number to a numeric strict value. If the number is negative, the
//Converts a number to a numeric strict value. If the number is negative, the
//field will be blank.
void SetInputFieldStringWithNumericStrictValue( UINT8 ubField, INT32 iNumber )
{
@@ -517,7 +517,7 @@ void SetInputFieldStringWithNumericStrictValue( UINT8 ubField, INT32 iNumber )
AssertMsg( 0, String( "Attempting to illegally set text into user field %d", curr->ubID ) );
if( iNumber < 0 ) //negative number converts to blank string
swprintf( curr->szString, L"" );
else
else
{
INT32 iMax = (INT32)pow( 10.0, curr->ubMaxChars );
if( iNumber > iMax ) //set string to max value based on number of chars.
@@ -527,7 +527,7 @@ void SetInputFieldStringWithNumericStrictValue( UINT8 ubField, INT32 iNumber )
}
curr->ubStrLen = (UINT8)wcslen( curr->szString );
return;
}
}
curr = curr->next;
}
}
@@ -651,9 +651,9 @@ void SelectPrevField()
}
}
//These allow you to customize the general color scheme of your text input boxes. I am assuming that
//under no circumstances would a user want a different color for each field. It follows the Win95 convention
//that all text input boxes are exactly the same color scheme. However, these colors can be set at anytime,
//These allow you to customize the general color scheme of your text input boxes. I am assuming that
//under no circumstances would a user want a different color for each field. It follows the Win95 convention
//that all text input boxes are exactly the same color scheme. However, these colors can be set at anytime,
//but will effect all of the colors.
void SetTextInputFont( UINT16 usFont )
{
@@ -698,14 +698,14 @@ void SetCursorColor( UINT16 usCursorColor )
pColors->usCursorColor = usCursorColor;
}
//All CTRL and ALT keys combinations, F1-F12 keys, ENTER and ESC are ignored allowing
//processing to be done with your own input handler. Otherwise, the keyboard event
//All CTRL and ALT keys combinations, F1-F12 keys, ENTER and ESC are ignored allowing
//processing to be done with your own input handler. Otherwise, the keyboard event
//is absorbed by this input handler, if used in the appropriate manner.
//This call must be added at the beginning of your input handler in this format:
//while( DequeueEvent(&Event) )
//{
// if( !HandleTextInput( &Event ) && (your conditions...ex: Event.usEvent == KEY_DOWN ) )
// {
// if( !HandleTextInput( &Event ) && (your conditions...ex: Event.usEvent == KEY_DOWN ) )
// {
// switch( Event.usParam )
// {
// //Normal key cases here.
@@ -719,11 +719,11 @@ BOOLEAN HandleTextInput( InputAtom *Event )
//not in text input mode
gfNoScroll = FALSE;
if( !gfTextInputMode )
return FALSE;
if( !gfTextInputMode )
return FALSE;
//currently in a user field, so return unless TAB or SHIFT_TAB are pressed.
if( !gfEditingText && Event->usParam != TAB && Event->usParam != SHIFT_TAB )
return FALSE;
if( !gfEditingText && Event->usParam != TAB && Event->usParam != SHIFT_TAB )
return FALSE;
//unless we are psycho typers, we only want to process these key events.
if( Event->usEvent != KEY_DOWN && Event->usEvent != KEY_REPEAT )
return FALSE;
@@ -739,7 +739,7 @@ BOOLEAN HandleTextInput( InputAtom *Event )
//For any number of reasons, these ALT and CTRL combination key presses
//will be processed externally
#if 0
if( Event->usKeyState & CTRL_DOWN )
if( Event->usKeyState & CTRL_DOWN )
{
if( Event->usParam == 'c' || Event->usParam == 'C' )
{
@@ -761,8 +761,8 @@ BOOLEAN HandleTextInput( InputAtom *Event )
if( Event->usKeyState & ALT_DOWN || Event->usKeyState & CTRL_DOWN && Event->usParam != DEL )
return FALSE;
//F1-F12 regardless of state are processed externally as well.
if( Event->usParam >= F1 && Event->usParam <= F12 ||
Event->usParam >= SHIFT_F1 && Event->usParam <= SHIFT_F12 )
if( Event->usParam >= F1 && Event->usParam <= F12 ||
Event->usParam >= SHIFT_F1 && Event->usParam <= SHIFT_F12 )
{
return FALSE;
}
@@ -785,7 +785,7 @@ BOOLEAN HandleTextInput( InputAtom *Event )
SelectPrevField();
break;
case LEFTARROW:
//Move the cursor to the left one position. If there is selected text,
//Move the cursor to the left one position. If there is selected text,
//the cursor moves to the left of the block, and clears the block.
gfNoScroll = TRUE;
if( gfHiliteMode )
@@ -798,7 +798,7 @@ BOOLEAN HandleTextInput( InputAtom *Event )
gubCursorPos--;
break;
case RIGHTARROW:
//Move the cursor to the right one position. If there is selected text,
//Move the cursor to the right one position. If there is selected text,
//the block is cleared.
gfNoScroll = TRUE;
if( gfHiliteMode )
@@ -821,7 +821,7 @@ BOOLEAN HandleTextInput( InputAtom *Event )
gubCursorPos = 0;
break;
case SHIFT_LEFTARROW:
//Initiates or continues hilighting to the left one position. If the cursor
//Initiates or continues hilighting to the left one position. If the cursor
//is at the left end of the block, then the block decreases one position.
gfNoScroll = TRUE;
if( !gfHiliteMode )
@@ -834,7 +834,7 @@ BOOLEAN HandleTextInput( InputAtom *Event )
gubEndHilite = gubCursorPos;
break;
case SHIFT_RIGHTARROW:
//Initiates or continues hilighting to the right one position. If the cursor
//Initiates or continues hilighting to the right one position. If the cursor
//is at the right end of the block, then the block decreases one position.
gfNoScroll = TRUE;
if( !gfHiliteMode )
@@ -858,7 +858,7 @@ BOOLEAN HandleTextInput( InputAtom *Event )
gubEndHilite = gubCursorPos;
break;
case SHIFT_HOME:
//From the location of the anchored cursor for hilighting, the cursor goes to
//From the location of the anchored cursor for hilighting, the cursor goes to
//the beginning of the text, selecting all text from the anchor to the beginning
//of the text.
if( !gfHiliteMode )
@@ -871,7 +871,7 @@ BOOLEAN HandleTextInput( InputAtom *Event )
break;
case DEL:
//CTRL+DEL will delete the entire text field, regardless of hilighting.
//DEL will either delete the selected text, or the character to the right
//DEL will either delete the selected text, or the character to the right
//of the cursor if applicable.
PlayJA2Sample( ENTERING_TEXT, RATE_11025, BTNVOLUME, 1, MIDDLEPAN );
if( Event->usKeyState & CTRL_DOWN )
@@ -899,7 +899,7 @@ BOOLEAN HandleTextInput( InputAtom *Event )
RemoveChar( --gubCursorPos );
}
break;
default: //check for typing keys
default: //check for typing keys
if( gfHiliteMode )
DeleteHilitedText();
if( gpActive->usInputType >= INPUTTYPE_EXCLUSIVE_BASEVALUE )
@@ -927,7 +927,7 @@ BOOLEAN HandleTextInput( InputAtom *Event )
AddChar( key );
return TRUE;
}
//Handle alphas
//Handle alphas
if( type & INPUTTYPE_ALPHA )
{
if( key >= 'A' && key <= 'Z' )
@@ -949,10 +949,10 @@ BOOLEAN HandleTextInput( InputAtom *Event )
if( type & INPUTTYPE_SPECIAL )
{
//More can be added, but not all of the fonts support these
if( key >= 0x21 && key <= 0x2f || // ! " # $ % & ' ( ) * + , - . /
key >= 0x3a && key <= 0x40 || // : ; < = > ? @
if( key >= 0x21 && key <= 0x2f || // ! " # $ % & ' ( ) * + , - . /
key >= 0x3a && key <= 0x40 || // : ; < = > ? @
key >= 0x5b && key <= 0x5f || // [ \ ] ^ _
key >= 0x7b && key <= 0x7d ) // { | }
key >= 0x7b && key <= 0x7d ) // { | }
{
AddChar( key );
return TRUE;
@@ -969,7 +969,7 @@ void HandleExclusiveInput( UINT32 uiKey )
switch( gpActive->usInputType )
{
case INPUTTYPE_EXCLUSIVE_DOSFILENAME: //dos file names
if( uiKey >= 'A' && uiKey <= 'Z' ||
if( uiKey >= 'A' && uiKey <= 'Z' ||
uiKey >= 'a' && uiKey <= 'z' ||
uiKey >= '0' && uiKey <= '9' ||
uiKey == '_' || uiKey == '.' )
@@ -981,11 +981,11 @@ void HandleExclusiveInput( UINT32 uiKey )
AddChar( uiKey );
}
break;
case INPUTTYPE_EXCLUSIVE_COORDINATE: //coordinates such as a9, z78, etc.
case INPUTTYPE_EXCLUSIVE_COORDINATE: //coordinates such as a9, z78, etc.
if( !gubCursorPos ) //first char is an lower case alpha
{
if( uiKey >= 'a' && uiKey <= 'z' )
AddChar( uiKey );
AddChar( uiKey );
else if( uiKey >= 'A' && uiKey <= 'Z' )
AddChar( uiKey + 32 ); //convert to lowercase
}
@@ -1022,7 +1022,7 @@ void HandleExclusiveInput( UINT32 uiKey )
{
AddChar( ':' );
AddChar( uiKey );
}
}
}
else if( gubCursorPos == 3 )
{
@@ -1042,7 +1042,7 @@ void AddChar( UINT32 uiKey )
{
PlayJA2Sample( ENTERING_TEXT, RATE_11025, BTNVOLUME, 1, MIDDLEPAN );
if( gpActive->ubStrLen >= gpActive->ubMaxChars )
{ //max length reached. Just replace the last character with new one.
{ //max length reached. Just replace the last character with new one.
gpActive->ubStrLen = gpActive->ubMaxChars;
gpActive->szString[ gpActive->ubStrLen-1 ] = (UINT16)uiKey;
gpActive->szString[ gpActive->ubStrLen ] = '\0';
@@ -1108,7 +1108,7 @@ void RemoveChar( UINT8 ubArrayIndex )
fDeleting = TRUE;
}
//if we deleted a char, then decrement the strlen.
if( fDeleting )
if( fDeleting )
gpActive->ubStrLen--;
}
@@ -1118,7 +1118,7 @@ void MouseMovedInTextRegionCallback(MOUSE_REGION *reg, INT32 reason)
TEXTINPUTNODE *curr;
if( gfLeftButtonState )
{
if( reason & MSYS_CALLBACK_REASON_MOVE ||
if( reason & MSYS_CALLBACK_REASON_MOVE ||
reason & MSYS_CALLBACK_REASON_LOST_MOUSE ||
reason & MSYS_CALLBACK_REASON_GAIN_MOUSE )
{
@@ -1130,7 +1130,7 @@ void MouseMovedInTextRegionCallback(MOUSE_REGION *reg, INT32 reason)
RenderInactiveTextFieldNode( gpActive );
curr = gpTextInputHead;
while( curr )
{
{
if( curr->ubID == ubNewID )
{
gpActive = curr;
@@ -1141,7 +1141,7 @@ void MouseMovedInTextRegionCallback(MOUSE_REGION *reg, INT32 reason)
}
if( reason & MSYS_CALLBACK_REASON_LOST_MOUSE )
{
if( gusMouseYPos < reg->RegionTopLeftY )
if( gusMouseYPos < reg->RegionTopLeftY )
{
gubEndHilite = 0;
gfHiliteMode = TRUE;
@@ -1187,7 +1187,7 @@ void MouseClickedInTextRegionCallback(MOUSE_REGION *reg, INT32 reason)
RenderInactiveTextFieldNode( gpActive );
curr = gpTextInputHead;
while( curr )
{
{
if( curr->ubID == ubNewID )
{
gpActive = curr;
@@ -1209,10 +1209,10 @@ void MouseClickedInTextRegionCallback(MOUSE_REGION *reg, INT32 reason)
iCurrCharPos = iNextCharPos;
iNextCharPos = StringPixLengthArg( pColors->usFont, gubCursorPos + 1, gpActive->szString );
}
gubStartHilite = gubCursorPos; //This value is the anchor
gubStartHilite = gubCursorPos; //This value is the anchor
gubEndHilite = gubCursorPos; //The end will move with the cursor as long as it's down.
gfHiliteMode = FALSE;
}
}
@@ -1221,9 +1221,9 @@ void RenderBackgroundField( TEXTINPUTNODE *pNode )
UINT16 usColor;
if( pColors->fBevelling )
{
ColorFillVideoSurfaceArea(FRAME_BUFFER, pNode->region.RegionTopLeftX, pNode->region.RegionTopLeftY,
ColorFillVideoSurfaceArea(FRAME_BUFFER, pNode->region.RegionTopLeftX, pNode->region.RegionTopLeftY,
pNode->region.RegionBottomRightX, pNode->region.RegionBottomRightY, pColors->usDarkerColor );
ColorFillVideoSurfaceArea(FRAME_BUFFER, pNode->region.RegionTopLeftX+1, pNode->region.RegionTopLeftY+1,
ColorFillVideoSurfaceArea(FRAME_BUFFER, pNode->region.RegionTopLeftX+1, pNode->region.RegionTopLeftY+1,
pNode->region.RegionBottomRightX, pNode->region.RegionBottomRightY, pColors->usBrighterColor );
}
if( !pNode->fEnabled && !pColors->fUseDisabledAutoShade )
@@ -1231,10 +1231,10 @@ void RenderBackgroundField( TEXTINPUTNODE *pNode )
else
usColor = pColors->usTextFieldColor;
ColorFillVideoSurfaceArea(FRAME_BUFFER, pNode->region.RegionTopLeftX+1, pNode->region.RegionTopLeftY+1,
ColorFillVideoSurfaceArea(FRAME_BUFFER, pNode->region.RegionTopLeftX+1, pNode->region.RegionTopLeftY+1,
pNode->region.RegionBottomRightX-1, pNode->region.RegionBottomRightY-1, usColor );
InvalidateRegion( pNode->region.RegionTopLeftX, pNode->region.RegionTopLeftY,
InvalidateRegion( pNode->region.RegionTopLeftX, pNode->region.RegionTopLeftY,
pNode->region.RegionBottomRightX, pNode->region.RegionBottomRightY );
}
@@ -1307,10 +1307,10 @@ void RenderActiveTextField()
uiCursorXPos = StringPixLengthArg( pColors->usFont, gubCursorPos, str ) + 2;
if( GetJA2Clock()%1000 < 500 )
{ //draw the blinking ibeam cursor during the on blink period.
ColorFillVideoSurfaceArea(FRAME_BUFFER,
gpActive->region.RegionTopLeftX + uiCursorXPos,
gpActive->region.RegionTopLeftY + usOffset,
gpActive->region.RegionTopLeftX + uiCursorXPos + 1,
ColorFillVideoSurfaceArea(FRAME_BUFFER,
gpActive->region.RegionTopLeftX + uiCursorXPos,
gpActive->region.RegionTopLeftY + usOffset,
gpActive->region.RegionTopLeftX + uiCursorXPos + 1,
gpActive->region.RegionTopLeftY + usOffset + GetFontHeight( pColors->usFont ), pColors->usCursorColor );
}
}
@@ -1418,7 +1418,7 @@ void RenderAllTextFields()
void EnableTextField( UINT8 ubID )
{
TEXTINPUTNODE *curr;
curr = gpTextInputHead;
curr = gpTextInputHead;
while( curr )
{
if( curr->ubID == ubID )
@@ -1440,7 +1440,7 @@ void EnableTextField( UINT8 ubID )
void DisableTextField( UINT8 ubID )
{
TEXTINPUTNODE *curr;
curr = gpTextInputHead;
curr = gpTextInputHead;
while( curr )
{
if( curr->ubID == ubID )
@@ -1462,7 +1462,7 @@ void DisableTextField( UINT8 ubID )
void EnableTextFields( UINT8 ubFirstID, UINT8 ubLastID )
{
TEXTINPUTNODE *curr;
curr = gpTextInputHead;
curr = gpTextInputHead;
while( curr )
{
if( curr->ubID >= ubFirstID && curr->ubID <= ubLastID )
@@ -1482,7 +1482,7 @@ void EnableTextFields( UINT8 ubFirstID, UINT8 ubLastID )
void DisableTextFields( UINT8 ubFirstID, UINT8 ubLastID )
{
TEXTINPUTNODE *curr;
curr = gpTextInputHead;
curr = gpTextInputHead;
while( curr )
{
if( curr->ubID >= ubFirstID && curr->ubID <= ubLastID )
@@ -1502,7 +1502,7 @@ void DisableTextFields( UINT8 ubFirstID, UINT8 ubLastID )
void EnableAllTextFields()
{
TEXTINPUTNODE *curr;
curr = gpTextInputHead;
curr = gpTextInputHead;
while( curr )
{
if( !curr->fEnabled )
@@ -1519,7 +1519,7 @@ void EnableAllTextFields()
void DisableAllTextFields()
{
TEXTINPUTNODE *curr;
curr = gpTextInputHead;
curr = gpTextInputHead;
while( curr )
{
if( curr->fEnabled )
@@ -1596,10 +1596,10 @@ void ExecutePasteCommand()
if( !gpActive || !szClipboard )
return;
DeleteHilitedText();
ubCount = 0;
while( szClipboard[ ubCount ] )
{
{
AddChar( szClipboard[ ubCount ] );
ubCount++;
}
@@ -1612,7 +1612,7 @@ void ExecuteCutCommand()
}
//Saves the current text input mode, then removes it and activates the previous text input mode,
//if applicable. The second function restores the settings. Doesn't currently support nested
//if applicable. The second function restores the settings. Doesn't currently support nested
//calls.
void SaveAndRemoveCurrentTextInputMode()
{
@@ -1636,7 +1636,7 @@ void RestoreSavedTextInputMode()
{
if( !pSavedHead )
AssertMsg( 0, "Attempting to restore saved text input stack head, when one doesn't exist.");
gpTextInputHead = pSavedHead;
gpTextInputHead = pSavedHead;
pColors = pSavedColors;
pSavedHead = NULL;
pSavedColors = NULL;
@@ -1644,7 +1644,7 @@ void RestoreSavedTextInputMode()
UINT16 GetTextInputCursor()
{
return gusTextInputCursor;
return gusTextInputCursor;
}
void SetTextInputCursor( UINT16 usNewCursor )
@@ -1694,9 +1694,9 @@ UINT16 GetExclusive24HourTimeValueFromField( UINT8 ubField )
if( curr->szString[0] == '2' && curr->szString[1] >= '0' && //20-23
curr->szString[1] <='3' ||
curr->szString[0] >= '0' && curr->szString[0] <= '1' && // 00-19
curr->szString[1] >= '0' && curr->szString[1] <= '9' )
curr->szString[1] >= '0' && curr->szString[1] <= '9' )
{ //Next, validate the colon, and the minutes 00-59
if( curr->szString[2] == ':' && curr->szString[5] == 0 && // :
if( curr->szString[2] == ':' && curr->szString[5] == 0 && // :
curr->szString[3] >= '0' && curr->szString[3] <= '5' && // 0-5
curr->szString[4] >= '0' && curr->szString[4] <= '9' ) // 0-9
{
@@ -1721,7 +1721,7 @@ UINT16 GetExclusive24HourTimeValueFromField( UINT8 ubField )
void SetExclusive24HourTimeValue( UINT8 ubField, UINT16 usTime )
{
TEXTINPUTNODE *curr;
//First make sure the time is a valid time. If not, then use 23:59
//First make sure the time is a valid time. If not, then use 23:59
if( usTime == 0xffff )
{
SetInputFieldStringWith16BitString( ubField, L"" );
+45 -45
View File
@@ -3,33 +3,33 @@
#include "input.h"
//AUTHOR: Kris Morness
//AUTHOR: Kris Morness
//Intended for inclusion with SGP.
//NEW CHANGES: January 16, 1998
//I have added the ability to stack the text input modes. So, if you have a particular
//NEW CHANGES: January 16, 1998
//I have added the ability to stack the text input modes. So, if you have a particular
//screen that has fields, then somehow, hit a key to go into another mode with text input,
//it will automatically disable the current fields, as you go on to define new ones. Previously,
//you would have to make sure the mode was removed before initializing a new one. There were
//it will automatically disable the current fields, as you go on to define new ones. Previously,
//you would have to make sure the mode was removed before initializing a new one. There were
//potential side effects of crashes, and unpredictable results, as the new fields would cook the
//existing ones.
//NOTE: You may have to modify you code now, so that you don't accidentally kill a text input mode
//when you don't one to begin with. (like removing an already deleted button). Also, remember that
//NOTE: You may have to modify you code now, so that you don't accidentally kill a text input mode
//when you don't one to begin with. (like removing an already deleted button). Also, remember that
//this works like a stack system and you can't flip through existing defined text input modes at will.
//NOTES ON LIMITATIONS:
// -max number of fields 255 (per level)
// -max num of chars in field 255
// -max num of chars in field 255
//These are the definitions for the input types. I didn't like the input filter idea,
//and the lack of freedom it gives you. This method is much simpler to use.
//NOTE: Uppercase/lowercase filters ensures that all input is either all uppercase or lowercase
//NOTE: Feel free to expand this to your needs, though you also need to support it in the filter
// section.
//These are the definitions for the input types. I didn't like the input filter idea,
//and the lack of freedom it gives you. This method is much simpler to use.
//NOTE: Uppercase/lowercase filters ensures that all input is either all uppercase or lowercase
//NOTE: Feel free to expand this to your needs, though you also need to support it in the filter
// section.
#define INPUTTYPE_NUMERICSTRICT 0x0001 //0-9 only, no minus signs.
#define INPUTTYPE_ALPHA 0x0002 //a-z A-Z
#define INPUTTYPE_SPACES 0x0004 //allows spaces in input
#define INPUTTYPE_SPECIAL 0x0008 // !@#$%^&*()_+`|\[]{};':"<>,./? (spaces not included)
#define INPUTTYPE_SPECIAL 0x0008 // !@#$%^&*()_+`|\[]{};':"<>,./? (spaces not included)
#define INPUTTYPE_UPPERCASE 0x0010 //converts all lowercase to uppercase
#define INPUTTYPE_LOWERCASE 0x0020 //converts all uppercase to lowercase
#define INPUTTYPE_FIRSTPOSMINUS 0x0002 //allows '-' at beginning of field only
@@ -39,12 +39,12 @@
#define INPUTTYPE_ASCII (INPUTTYPE_ALPHANUMERIC | INPUTTYPE_SPECIALCHARS)
//DON'T GO ABOVE INPUTTYPE_EXCLUSIVE_BASEVALUE FOR INPUTTYPE MASKED VALUES LISTED ABOVE!!!
#define INPUTTYPE_EXCLUSIVE_BASEVALUE 0x1000 //increase this value if necessary
#define INPUTTYPE_EXCLUSIVE_BASEVALUE 0x1000 //increase this value if necessary
//Exclusive handlers
//The dosfilename inputtype is a perfect example of what is a exclusive handler.
//In this method, the input accepts only alphas and an underscore as the first character,
//then alphanumerics afterwards. For further support, chances are you'll want to treat it
//then alphanumerics afterwards. For further support, chances are you'll want to treat it
//as an exclusive handler, and you'll have to process it in the filter input function.
enum
{
@@ -54,15 +54,15 @@ enum
//INPUTTYPE_EXCLUSIVE_NEWNEWNEW, etc...
};
//Simply initiates that you wish to begin inputting text. This should only apply to screen
//initializations that contain fields that edit text. It also verifies and clears any existing
//fields. Your input loop must contain the function HandleTextInput and processed if the gfTextInputMode
//flag is set else process your regular input handler. Note that this doesn't mean you are necessarily typing,
//just that there are text fields in your screen and may be inactive. The TAB key cycles through your text fields,
//Simply initiates that you wish to begin inputting text. This should only apply to screen
//initializations that contain fields that edit text. It also verifies and clears any existing
//fields. Your input loop must contain the function HandleTextInput and processed if the gfTextInputMode
//flag is set else process your regular input handler. Note that this doesn't mean you are necessarily typing,
//just that there are text fields in your screen and may be inactive. The TAB key cycles through your text fields,
//and special fields can be defined which will call a void functionName( UINT16 usFieldNum )
void InitTextInputMode();
//A hybrid version of InitTextInput() which uses a specific scheme. JA2's editor uses scheme 1, so
//A hybrid version of InitTextInput() which uses a specific scheme. JA2's editor uses scheme 1, so
//feel free to add new color/font schemes.
enum{
DEFAULT_SCHEME
@@ -71,14 +71,14 @@ void InitTextInputModeWithScheme( UINT8 ubSchemeID );
//Clears any existing fields, and ends text input mode.
void KillTextInputMode();
//Kills all levels of text input modes. When you init a second consecutive text input mode, without
//first removing them, the existing mode will be preserved. This function removes all of them in one
//Kills all levels of text input modes. When you init a second consecutive text input mode, without
//first removing them, the existing mode will be preserved. This function removes all of them in one
//call, though doing so "may" reflect poor coding style, though I haven't thought about any really
//just uses for it :(
void KillAllTextInputModes();
//Saves the current text input mode, then removes it and activates the previous text input mode,
//if applicable. The second function restores the settings. Doesn't currently support nested
//if applicable. The second function restores the settings. Doesn't currently support nested
//calls.
void SaveAndRemoveCurrentTextInputMode();
void RestoreSavedTextInputMode();
@@ -86,31 +86,31 @@ void RestoreSavedTextInputMode();
void SetTextInputCursor( UINT16 usNewCursor );
UINT16 GetTextInputCursor();
//After calling InitTextInputMode, you want to define one or more text input fields. The order
//of calls to this function dictate the TAB order from traversing from one field to the next. This
//After calling InitTextInputMode, you want to define one or more text input fields. The order
//of calls to this function dictate the TAB order from traversing from one field to the next. This
//function adds mouse regions and processes them for you, as well as deleting them when you are done.
void AddTextInputField( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT8 bPriority,
STR16 szInitText, UINT8 ubMaxChars, UINT16 usInputType );
STR16 szInitText, UINT8 ubMaxChars, UINT16 usInputType );
//This allows you to insert special processing functions and modes that can't be determined here. An example
//would be a file dialog where there would be a file list. This file list would be accessed using the Win95
//convention by pressing TAB. In there, your key presses would be handled differently and by adding a userinput
//field, you can make this hook into your function to accomplish this. In a filedialog, alpha characters
//This allows you to insert special processing functions and modes that can't be determined here. An example
//would be a file dialog where there would be a file list. This file list would be accessed using the Win95
//convention by pressing TAB. In there, your key presses would be handled differently and by adding a userinput
//field, you can make this hook into your function to accomplish this. In a filedialog, alpha characters
//would be used to jump to the file starting with that letter, and setting the field in the text input
//field. Pressing TAB again would place you back in the text input field. All of that stuff would be handled
//field. Pressing TAB again would place you back in the text input field. All of that stuff would be handled
//externally, except for the TAB keys.
typedef void (*INPUT_CALLBACK)(UINT8,BOOLEAN);
void AddUserInputField( INPUT_CALLBACK userFunction );
//INPUT_CALLBACK explanation:
//The function must use this signature: void FunctionName( UINT8 ubFieldID, BOOLEAN fEntering );
//The function must use this signature: void FunctionName( UINT8 ubFieldID, BOOLEAN fEntering );
//ubFieldID contains the fieldID of that field
//fEntering is true if you are entering the user field, false if exiting.
//Removes the specified field from the existing fields. If it doesn't exist, then there will be an
//Removes the specified field from the existing fields. If it doesn't exist, then there will be an
//assertion failure.
void RemoveTextInputField( UINT8 ubField );
//This is a useful call made from an external user input field. Using the previous file dialog example, this
//This is a useful call made from an external user input field. Using the previous file dialog example, this
//call would be made when the user selected a different filename in the list via clicking or scrolling with
//the arrows, or even using alpha chars to jump to the appropriate filename.
void SetInputFieldStringWith16BitString( UINT8 ubField, const STR16 szNewText );
@@ -126,10 +126,10 @@ UINT16 GetExclusive24HourTimeValueFromField( UINT8 ubField );
void SetExclusive24HourTimeValue( UINT8 ubField, UINT16 usTime );
//Converts the field's string into a number, then returns that number
//returns -1 if blank or invalid. Only works for positive numbers.
//returns -1 if blank or invalid. Only works for positive numbers.
INT32 GetNumericStrictValueFromField( UINT8 ubField );
//Converts a number to a numeric strict value. If the number is negative, the
//Converts a number to a numeric strict value. If the number is negative, the
//field will be blank.
void SetInputFieldStringWithNumericStrictValue( UINT8 ubField, INT32 iNumber );
@@ -138,12 +138,12 @@ void SetActiveField( UINT8 ubField );
void SelectNextField();
void SelectPrevField();
//Returns the active field ID number. It'll return -1 if no field is active.
//Returns the active field ID number. It'll return -1 if no field is active.
INT16 GetActiveFieldID();
//These allow you to customize the general color scheme of your text input boxes. I am assuming that
//under no circumstances would a user want a different color for each field. It follows the Win95 convention
//that all text input boxes are exactly the same color scheme. However, these colors can be set at anytime,
//These allow you to customize the general color scheme of your text input boxes. I am assuming that
//under no circumstances would a user want a different color for each field. It follows the Win95 convention
//that all text input boxes are exactly the same color scheme. However, these colors can be set at anytime,
//but will effect all of the colors.
void SetTextInputFont( UINT16 usFont );
void Set16BPPTextFieldColor( UINT16 usTextFieldColor );
@@ -155,13 +155,13 @@ void SetBevelColors( UINT16 usBrighterColor, UINT16 usDarkerColor );
void SetCursorColor( UINT16 usCursorColor );
//All CTRL and ALT keys combinations, F1-F12 keys, ENTER and ESC are ignored allowing
//processing to be done with your own input handler. Otherwise, the keyboard event
//processing to be done with your own input handler. Otherwise, the keyboard event
//is absorbed by this input handler, if used in the appropriate manner.
//This call must be added at the beginning of your input handler in this format:
//while( DequeueEvent(&Event) )
//{
// if( !HandleTextInput( &Event ) && (your conditions...ex: Event.usEvent == KEY_DOWN ) )
// {
// if( !HandleTextInput( &Event ) && (your conditions...ex: Event.usEvent == KEY_DOWN ) )
// {
// switch( Event.usParam )
// {
// //Normal key cases here.
+88 -87
View File
@@ -20,7 +20,7 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
j++;
if ( j<(int)strlen(Item[ubIndex].szLongItemName ))
{
pNameString[i] = Item[ubIndex].szLongItemName [j];
pNameString[i] = Item[ubIndex].szLongItemName [j];
#ifdef GERMAN
// We have a german special character
@@ -30,39 +30,39 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
switch (Item[ubIndex].szLongItemName [j + 1])
{
// ü
case -68:
case -68:
pNameString[i] = 252;
// Skip next character, because "umlaute" have 2 chars
j++;
break;
// Ü
case -100:
case -100:
pNameString[i] = 220;
j++;
break;
// ä
case -92:
pNameString[i] = 228;
case -92:
pNameString[i] = 228;
j++;
break;
// Ä
case -124:
pNameString[i] = 196;
case -124:
pNameString[i] = 196;
j++;
break;
// ö
case -74:
pNameString[i] = 246;
case -74:
pNameString[i] = 246;
j++;
break;
// Ö
case -106:
pNameString[i] = 214;
case -106:
pNameString[i] = 214;
j++;
break;
// ß
case -97:
pNameString[i] = 223;
case -97:
pNameString[i] = 223;
j++;
break;
}
@@ -100,7 +100,7 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
{
// This character determines the special character
switch ( (unsigned char)Item[ubIndex].szLongItemName [j + 1] )
{
{
//capital letters
case 129: pNameString[ i ] = 197; j++; break; //U+0401 d0 81 CYRILLIC CAPITAL LETTER IO
@@ -134,7 +134,7 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
case 171: pNameString[ i ] = 219; j++; break;
case 172: pNameString[ i ] = 220; j++; break;
case 173: pNameString[ i ] = 221; j++; break;
case 174: pNameString[ i ] = 222; j++; break;
case 174: pNameString[ i ] = 222; j++; break;
case 175: pNameString[ i ] = 223; j++; break; //U+042F d0 af CYRILLIC CAPITAL LETTER YA
//small letters
@@ -152,7 +152,7 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
case 187: pNameString[ i ] = 235; j++; break;
case 188: pNameString[ i ] = 236; j++; break;
case 189: pNameString[ i ] = 237; j++; break;
case 190: pNameString[ i ] = 238; j++; break;
case 190: pNameString[ i ] = 238; j++; break;
case 191: pNameString[ i ] = 239; j++; break; //U+043F d0 bf CYRILLIC SMALL LETTER PE
}
}
@@ -161,7 +161,7 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
{
// This character determines the special character
switch ( (unsigned char)Item[ubIndex].szLongItemName [j + 1] )
{
{
case 128: pNameString[ i ] = 240; j++; break; //U+0440 p d1 80 CYRILLIC SMALL LETTER ER
case 129: pNameString[ i ] = 241; j++; break;
case 130: pNameString[ i ] = 242; j++; break;
@@ -205,7 +205,7 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
j++;
if ( j<(int)strlen(Item[ubIndex].szItemDesc ))
{
pInfoString[i] = Item[ubIndex].szItemDesc [j];
pInfoString[i] = Item[ubIndex].szItemDesc [j];
#ifdef GERMAN
// We have a german special character
@@ -215,39 +215,39 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
switch (Item[ubIndex].szItemDesc [j + 1])
{
// ü
case -68:
case -68:
pInfoString[i] = 252;
// Skip next character, because "umlaute" have 2 chars
j++;
break;
// Ü
case -100:
case -100:
pInfoString[i] = 220;
j++;
break;
// ä
case -92:
pInfoString[i] = 228;
case -92:
pInfoString[i] = 228;
j++;
break;
// Ä
case -124:
pInfoString[i] = 196;
case -124:
pInfoString[i] = 196;
j++;
break;
// ö
case -74:
pInfoString[i] = 246;
case -74:
pInfoString[i] = 246;
j++;
break;
// Ö
case -106:
pInfoString[i] = 214;
case -106:
pInfoString[i] = 214;
j++;
break;
// ß
case -97:
pInfoString[i] = 223;
case -97:
pInfoString[i] = 223;
j++;
break;
}
@@ -286,7 +286,7 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
{
// This character determines the special character
switch ( (unsigned char)Item[ubIndex].szItemDesc [j + 1] )
{
{
//capital letters
case 129: pInfoString[ i ] = 197; j++; break; //U+0401 d0 81 CYRILLIC CAPITAL LETTER IO
@@ -320,7 +320,7 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
case 171: pInfoString[ i ] = 219; j++; break;
case 172: pInfoString[ i ] = 220; j++; break;
case 173: pInfoString[ i ] = 221; j++; break;
case 174: pInfoString[ i ] = 222; j++; break;
case 174: pInfoString[ i ] = 222; j++; break;
case 175: pInfoString[ i ] = 223; j++; break; //U+042F d0 af CYRILLIC CAPITAL LETTER YA
//small letters
@@ -338,7 +338,7 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
case 187: pInfoString[ i ] = 235; j++; break;
case 188: pInfoString[ i ] = 236; j++; break;
case 189: pInfoString[ i ] = 237; j++; break;
case 190: pInfoString[ i ] = 238; j++; break;
case 190: pInfoString[ i ] = 238; j++; break;
case 191: pInfoString[ i ] = 239; j++; break; //U+043F d0 bf CYRILLIC SMALL LETTER PE
}
}
@@ -347,7 +347,7 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
{
// This character determines the special character
switch ( (unsigned char)Item[ubIndex].szItemDesc [j + 1] )
{
{
case 128: pInfoString[ i ] = 240; j++; break; //U+0440 p d1 80 CYRILLIC SMALL LETTER ER
case 129: pInfoString[ i ] = 241; j++; break;
case 130: pInfoString[ i ] = 242; j++; break;
@@ -368,12 +368,12 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
case 145: pInfoString[ i ] = 229; j++; break; //U+0451 d1 91 CYRILLIC SMALL LETTER IO
}
}
//if ( ((unsigned char)Item[ubIndex].szItemDesc [j] == 211) ) //d3
//{
// // This character determines the special character
// switch ( (unsigned char)Item[ubIndex].szItemDesc [j + 1] )
// {
// {
// case 162: pInfoString[ i ] = 20; j++; break;//U+04E2 d3a2 CYRILLIC CAPITAL LETTER I WITH MACRON
// case 163: pInfoString[ i ] = 20; j++; break;//U+04E3 d3a3 CYRILLIC SMALL LETTER I WITH MACRON
// }
@@ -406,7 +406,7 @@ BOOLEAN LoadBRName(UINT16 ubIndex, STR16 pNameString )
j++;
if ( j<(int)strlen(Item[ubIndex].szBRName))
{
pNameString[i] = Item[ubIndex].szBRName [j];
pNameString[i] = Item[ubIndex].szBRName [j];
#ifdef GERMAN
// We have a german special character
@@ -416,39 +416,39 @@ BOOLEAN LoadBRName(UINT16 ubIndex, STR16 pNameString )
switch (Item[ubIndex].szBRName [j + 1])
{
// ü
case -68:
case -68:
pNameString[i] = 252;
// Skip next character, because "umlaute" have 2 chars
j++;
break;
// Ü
case -100:
case -100:
pNameString[i] = 220;
j++;
break;
// ä
case -92:
pNameString[i] = 228;
case -92:
pNameString[i] = 228;
j++;
break;
// Ä
case -124:
pNameString[i] = 196;
case -124:
pNameString[i] = 196;
j++;
break;
// ö
case -74:
pNameString[i] = 246;
case -74:
pNameString[i] = 246;
j++;
break;
// Ö
case -106:
pNameString[i] = 214;
case -106:
pNameString[i] = 214;
j++;
break;
// ß
case -97:
pNameString[i] = 223;
case -97:
pNameString[i] = 223;
j++;
break;
}
@@ -486,7 +486,7 @@ BOOLEAN LoadBRName(UINT16 ubIndex, STR16 pNameString )
{
// This character determines the special character
switch ( (unsigned char)Item[ubIndex].szBRName [j + 1] )
{
{
//capital letters
case 129: pNameString[ i ] = 197; j++; break; //U+0401 d0 81 CYRILLIC CAPITAL LETTER IO
@@ -520,7 +520,7 @@ BOOLEAN LoadBRName(UINT16 ubIndex, STR16 pNameString )
case 171: pNameString[ i ] = 219; j++; break;
case 172: pNameString[ i ] = 220; j++; break;
case 173: pNameString[ i ] = 221; j++; break;
case 174: pNameString[ i ] = 222; j++; break;
case 174: pNameString[ i ] = 222; j++; break;
case 175: pNameString[ i ] = 223; j++; break; //U+042F d0 af CYRILLIC CAPITAL LETTER YA
//small letters
@@ -538,7 +538,7 @@ BOOLEAN LoadBRName(UINT16 ubIndex, STR16 pNameString )
case 187: pNameString[ i ] = 235; j++; break;
case 188: pNameString[ i ] = 236; j++; break;
case 189: pNameString[ i ] = 237; j++; break;
case 190: pNameString[ i ] = 238; j++; break;
case 190: pNameString[ i ] = 238; j++; break;
case 191: pNameString[ i ] = 239; j++; break; //U+043F d0 bf CYRILLIC SMALL LETTER PE
}
}
@@ -547,7 +547,7 @@ BOOLEAN LoadBRName(UINT16 ubIndex, STR16 pNameString )
{
// This character determines the special character
switch ( (unsigned char)Item[ubIndex].szBRName [j + 1] )
{
{
case 128: pNameString[ i ] = 240; j++; break; //U+0440 p d1 80 CYRILLIC SMALL LETTER ER
case 129: pNameString[ i ] = 241; j++; break;
case 130: pNameString[ i ] = 242; j++; break;
@@ -595,7 +595,7 @@ BOOLEAN LoadBRDesc(UINT16 ubIndex, STR16 pDescString )
j++;
if ( j<(int)strlen(Item[ubIndex].szBRDesc))
{
pDescString[i] = Item[ubIndex].szBRDesc [j];
pDescString[i] = Item[ubIndex].szBRDesc [j];
// WANNE: German specific characters
#ifdef GERMAN
@@ -606,39 +606,39 @@ BOOLEAN LoadBRDesc(UINT16 ubIndex, STR16 pDescString )
switch (Item[ubIndex].szBRDesc [j + 1])
{
// ü
case -68:
case -68:
pDescString[i] = 252;
// Skip next character, because "umlaute" have 2 chars
j++;
break;
// Ü
case -100:
case -100:
pDescString[i] = 220;
j++;
break;
// ä
case -92:
pDescString[i] = 228;
case -92:
pDescString[i] = 228;
j++;
break;
// Ä
case -124:
pDescString[i] = 196;
case -124:
pDescString[i] = 196;
j++;
break;
// ö
case -74:
pDescString[i] = 246;
case -74:
pDescString[i] = 246;
j++;
break;
// Ö
case -106:
pDescString[i] = 214;
case -106:
pDescString[i] = 214;
j++;
break;
// ß
case -97:
pDescString[i] = 223;
case -97:
pDescString[i] = 223;
j++;
break;
}
@@ -676,7 +676,7 @@ BOOLEAN LoadBRDesc(UINT16 ubIndex, STR16 pDescString )
{
// This character determines the special character
switch ( (unsigned char)Item[ubIndex].szBRDesc [j + 1] )
{
{
//capital letters
case 129: pDescString[ i ] = 197; j++; break; //U+0401 d0 81 CYRILLIC CAPITAL LETTER IO
@@ -710,7 +710,7 @@ BOOLEAN LoadBRDesc(UINT16 ubIndex, STR16 pDescString )
case 171: pDescString[ i ] = 219; j++; break;
case 172: pDescString[ i ] = 220; j++; break;
case 173: pDescString[ i ] = 221; j++; break;
case 174: pDescString[ i ] = 222; j++; break;
case 174: pDescString[ i ] = 222; j++; break;
case 175: pDescString[ i ] = 223; j++; break; //U+042F d0 af CYRILLIC CAPITAL LETTER YA
//small letters
@@ -728,7 +728,7 @@ BOOLEAN LoadBRDesc(UINT16 ubIndex, STR16 pDescString )
case 187: pDescString[ i ] = 235; j++; break;
case 188: pDescString[ i ] = 236; j++; break;
case 189: pDescString[ i ] = 237; j++; break;
case 190: pDescString[ i ] = 238; j++; break;
case 190: pDescString[ i ] = 238; j++; break;
case 191: pDescString[ i ] = 239; j++; break; //U+043F d0 bf CYRILLIC SMALL LETTER PE
}
}
@@ -737,7 +737,7 @@ BOOLEAN LoadBRDesc(UINT16 ubIndex, STR16 pDescString )
{
// This character determines the special character
switch ( (unsigned char)Item[ubIndex].szBRDesc [j + 1] )
{
{
case 128: pDescString[ i ] = 240; j++; break; //U+0440 p d1 80 CYRILLIC SMALL LETTER ER
case 129: pDescString[ i ] = 241; j++; break;
case 130: pDescString[ i ] = 242; j++; break;
@@ -784,7 +784,7 @@ BOOLEAN LoadShortNameItemInfo(UINT16 ubIndex, STR16 pNameString )
for (int i=0;i<80;i++)
{
j++;
if ( i<(int)wcslen(Item[ubIndex].szItemName))
{
pNameString[i] = Item[ubIndex].szItemName [j];
@@ -798,39 +798,39 @@ BOOLEAN LoadShortNameItemInfo(UINT16 ubIndex, STR16 pNameString )
switch (Item[ubIndex].szItemName [j + 1])
{
// ü
case -68:
case -68:
pNameString[i] = 252;
// Skip next character, because "umlaute" have 2 chars
j++;
break;
// Ü
case -100:
case -100:
pNameString[i] = 220;
j++;
break;
// ä
case -92:
pNameString[i] = 228;
case -92:
pNameString[i] = 228;
j++;
break;
// Ä
case -124:
pNameString[i] = 196;
case -124:
pNameString[i] = 196;
j++;
break;
// ö
case -74:
pNameString[i] = 246;
case -74:
pNameString[i] = 246;
j++;
break;
// Ö
case -106:
pNameString[i] = 214;
case -106:
pNameString[i] = 214;
j++;
break;
// ß
case -97:
pNameString[i] = 223;
case -97:
pNameString[i] = 223;
j++;
break;
}
@@ -870,7 +870,7 @@ BOOLEAN LoadShortNameItemInfo(UINT16 ubIndex, STR16 pNameString )
{
// This character determines the special character
switch ( (unsigned char)Item[ubIndex].szItemName [j + 1] )
{
{
//capital letters
case 129: pNameString[ i ] = 197; j++; break; //U+0401 d0 81 CYRILLIC CAPITAL LETTER IO
@@ -904,7 +904,7 @@ BOOLEAN LoadShortNameItemInfo(UINT16 ubIndex, STR16 pNameString )
case 171: pNameString[ i ] = 219; j++; break;
case 172: pNameString[ i ] = 220; j++; break;
case 173: pNameString[ i ] = 221; j++; break;
case 174: pNameString[ i ] = 222; j++; break;
case 174: pNameString[ i ] = 222; j++; break;
case 175: pNameString[ i ] = 223; j++; break; //U+042F d0 af CYRILLIC CAPITAL LETTER YA
//small letters
@@ -922,7 +922,7 @@ BOOLEAN LoadShortNameItemInfo(UINT16 ubIndex, STR16 pNameString )
case 187: pNameString[ i ] = 235; j++; break;
case 188: pNameString[ i ] = 236; j++; break;
case 189: pNameString[ i ] = 237; j++; break;
case 190: pNameString[ i ] = 238; j++; break;
case 190: pNameString[ i ] = 238; j++; break;
case 191: pNameString[ i ] = 239; j++; break; //U+043F d0 bf CYRILLIC SMALL LETTER PE
}
}
@@ -931,7 +931,7 @@ BOOLEAN LoadShortNameItemInfo(UINT16 ubIndex, STR16 pNameString )
{
// This character determines the special character
switch ( (unsigned char)Item[ubIndex].szItemName [j + 1] )
{
{
case 128: pNameString[ i ] = 240; j++; break; //U+0440 p d1 80 CYRILLIC SMALL LETTER ER
case 129: pNameString[ i ] = 241; j++; break;
case 130: pNameString[ i ] = 242; j++; break;
@@ -1021,3 +1021,4 @@ FLOAT GetWeightBasedOnMetricOption( UINT32 uiObjectWeight )
}
+30 -9
View File
@@ -325,7 +325,7 @@ enum
STR_SURRENDER,
STR_REFUSE_FIRSTAID,
STR_REFUSE_FIRSTAID_FOR_CREATURE,
STR_HOW_TO_USE_SKYRIDDER,
STR_HOW_TO_USE_SKYRIDDER,
STR_RELOAD_ONLY_ONE_GUN,
STR_BLOODCATS_TURN,
STR_AUTOFIRE,
@@ -547,9 +547,10 @@ enum
LOCK_HAS_BEEN_HIT,
LOCK_HAS_BEEN_DESTROYED,
DOOR_IS_BUSY,
VEHICLE_VITAL_STATS_POPUPTEXT,
NO_LOS_TO_TALK_TARGET,
VEHICLE_VITAL_STATS_POPUPTEXT,
NO_LOS_TO_TALK_TARGET,
ATTACHMENT_REMOVED,
VEHICLE_CAN_NOT_BE_ADDED,
};
enum{
@@ -820,6 +821,7 @@ enum
// Used
BOBBYR_FILTER_USED_GUNS,
BOBBYR_FILTER_USED_ARMOR,
BOBBYR_FILTER_USED_LBEGEAR,
BOBBYR_FILTER_USED_MISC,
// Armour
BOBBYR_FILTER_ARMOUR_HELM,
@@ -835,6 +837,7 @@ enum
BOBBYR_FILTER_MISC_MEDKIT,
BOBBYR_FILTER_MISC_KIT,
BOBBYR_FILTER_MISC_FACE,
BOBBYR_FILTER_MISC_LBEGEAR,
BOBBYR_FILTER_MISC_MISC,
};
@@ -1112,11 +1115,11 @@ extern STR16 zMarksMapScreenText[];
//Weapon Name and Description size
#define ITEMSTRINGFILENAME "BINARYDATA\\ITEMDESC.EDT"
#define SIZE_ITEM_NAME 160
#define SIZE_SHORT_ITEM_NAME 160
#define SIZE_ITEM_INFO 480
#define SIZE_ITEM_PROS 160
#define SIZE_ITEM_CONS 160
#define SIZE_ITEM_NAME 160
#define SIZE_SHORT_ITEM_NAME 160
#define SIZE_ITEM_INFO 480
#define SIZE_ITEM_PROS 160
#define SIZE_ITEM_CONS 160
BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString );
extern void LoadAllExternalText( void );
@@ -1325,6 +1328,8 @@ enum
SLG_BR_GREAT_TEXT,
SLG_BR_EXCELLENT_TEXT,
SLG_BR_AWESOME_TEXT,
SLG_INV_RES_ERROR,
};
extern STR16 zSaveLoadText[];
@@ -1406,6 +1411,10 @@ enum
GIO_BR_GREAT_TEXT,
GIO_BR_EXCELLENT_TEXT,
GIO_BR_AWESOME_TEXT,
GIO_INV_TEXT,
GIO_INV_OLD_TEXT,
GIO_INV_NEW_TEXT,
};
extern STR16 gzGIOScreenText[];
@@ -1547,4 +1556,16 @@ enum
MSG113_ARRIVINGREROUTED,
};
#endif
//CHRISL: NewInv messages
extern STR16 NewInvMessage[];
enum
{
NIV_CAN_NOT_PICKUP,
NIV_NO_DROP,
NIV_NO_PACK,
NIV_ZIPPER_COMBAT,
NIV_ZIPPER_NO_MOVE,
};
#endif
+52 -52
View File
@@ -1,6 +1,6 @@
#ifdef PRECOMPILEDHEADERS
#include "Utils All.h"
#include "interface control.h"
#include "interface control.h"
#else
#include <windows.h>
#include <mmsystem.h>
@@ -29,7 +29,7 @@ UINT32 guiBaseJA2NoPauseClock = 0;
BOOLEAN gfPauseClock = FALSE;
INT32 giTimerIntervals[ NUMTIMERS ] =
{
{
5, // Tactical Overhead
20, // NEXTSCROLL
200, // Start Scroll
@@ -93,7 +93,7 @@ extern INT32 giCommonGlowBaseTime;
extern INT32 giFlashAssignBaseTime;
extern INT32 giFlashContractBaseTime;
extern UINT32 guiFlashCursorBaseTime;
extern INT32 giPotCharPathBaseTime;
extern INT32 giPotCharPathBaseTime;
UINT32 InitializeJA2TimerCallback( UINT32 uiDelay, LPTIMECALLBACK TimerProc, UINT32 uiUser );
@@ -136,40 +136,40 @@ void CALLBACK TimeProc( UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2
#ifndef BOUNDS_CHECKER
// If mapscreen...
if( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN )
{
// IN Mapscreen, loop through player's team.....
for ( gCNT = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; gCNT <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; gCNT++ )
{
gPSOLDIER = MercPtrs[ gCNT ];
UPDATETIMECOUNTER( gPSOLDIER->PortraitFlashCounter );
UPDATETIMECOUNTER( gPSOLDIER->PanelAnimateCounter );
}
}
else
{
// Set update flags for soldiers
////////////////////////////
for ( gCNT = 0; gCNT < guiNumMercSlots; gCNT++ )
{
gPSOLDIER = MercSlots[ gCNT ];
// If mapscreen...
if( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN )
{
// IN Mapscreen, loop through player's team.....
for ( gCNT = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; gCNT <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; gCNT++ )
{
gPSOLDIER = MercPtrs[ gCNT ];
UPDATETIMECOUNTER( gPSOLDIER->timeCounters.PortraitFlashCounter );
UPDATETIMECOUNTER( gPSOLDIER->timeCounters.PanelAnimateCounter );
}
}
else
{
// Set update flags for soldiers
////////////////////////////
for ( gCNT = 0; gCNT < guiNumMercSlots; gCNT++ )
{
gPSOLDIER = MercSlots[ gCNT ];
if ( gPSOLDIER != NULL )
{
UPDATETIMECOUNTER( gPSOLDIER->UpdateCounter );
UPDATETIMECOUNTER( gPSOLDIER->DamageCounter );
UPDATETIMECOUNTER( gPSOLDIER->ReloadCounter );
UPDATETIMECOUNTER( gPSOLDIER->FlashSelCounter );
UPDATETIMECOUNTER( gPSOLDIER->BlinkSelCounter );
UPDATETIMECOUNTER( gPSOLDIER->PortraitFlashCounter );
UPDATETIMECOUNTER( gPSOLDIER->AICounter );
UPDATETIMECOUNTER( gPSOLDIER->FadeCounter );
UPDATETIMECOUNTER( gPSOLDIER->NextTileCounter );
UPDATETIMECOUNTER( gPSOLDIER->PanelAnimateCounter );
}
}
}
if ( gPSOLDIER != NULL )
{
UPDATETIMECOUNTER( gPSOLDIER->timeCounters.UpdateCounter );
UPDATETIMECOUNTER( gPSOLDIER->timeCounters.DamageCounter );
UPDATETIMECOUNTER( gPSOLDIER->timeCounters.ReloadCounter );
UPDATETIMECOUNTER( gPSOLDIER->timeCounters.FlashSelCounter );
UPDATETIMECOUNTER( gPSOLDIER->timeCounters.BlinkSelCounter );
UPDATETIMECOUNTER( gPSOLDIER->timeCounters.PortraitFlashCounter );
UPDATETIMECOUNTER( gPSOLDIER->timeCounters.AICounter );
UPDATETIMECOUNTER( gPSOLDIER->timeCounters.FadeCounter );
UPDATETIMECOUNTER( gPSOLDIER->timeCounters.NextTileCounter );
UPDATETIMECOUNTER( gPSOLDIER->timeCounters.PanelAnimateCounter );
}
}
}
#endif
}
@@ -203,28 +203,28 @@ BOOLEAN InitializeJA2Clock(void)
if ( mmResult != TIMERR_NOERROR )
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not get timer properties");
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not get timer properties");
}
// Set timer at lowest resolution. Could use middle of lowest/highest, we'll see how this performs first
gTimerID = timeSetEvent( BASETIMESLICE, BASETIMESLICE, TimeProc, (DWORD)0, TIME_PERIODIC );
if ( !gTimerID )
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not create timer callback");
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not create timer callback");
}
#endif
return TRUE;
return TRUE;
}
void ShutdownJA2Clock(void)
void ShutdownJA2Clock(void)
{
// Make sure we kill the timer
// Make sure we kill the timer
#ifdef CALLBACKTIMER
timeKillEvent( gTimerID );
timeKillEvent( gTimerID );
#endif
@@ -242,18 +242,18 @@ UINT32 InitializeJA2TimerCallback( UINT32 uiDelay, LPTIMECALLBACK TimerProc, UIN
if ( mmResult != TIMERR_NOERROR )
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not get timer properties");
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not get timer properties");
}
// Set timer at lowest resolution. Could use middle of lowest/highest, we'll see how this performs first
TimerID = timeSetEvent( (UINT)uiDelay, (UINT)uiDelay, TimerProc, (DWORD)uiUser, TIME_PERIODIC );
if ( !TimerID )
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not create timer callback");
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not create timer callback");
}
return ( (UINT32)TimerID );
return ( (UINT32)TimerID );
}
@@ -271,7 +271,7 @@ UINT32 InitializeJA2TimerID( UINT32 uiDelay, UINT32 uiCallbackID, UINT32 uiUser
return( InitializeJA2TimerCallback( uiDelay, FlashItem, uiUser ) );
break;
}
// invalid callback id
@@ -316,7 +316,7 @@ void CheckCustomizableTimer( void )
if ( TIMECOUNTERDONE( giTimerCustomizable, 0 ) )
{
// set the callback to a temp variable so we can reset the global variable
// before calling the callback, so that if the callback sets up another
// before calling the callback, so that if the callback sets up another
// instance of the timer, we don't reset it afterwards
CUSTOMIZABLE_TIMER_CALLBACK pTempCallback;
@@ -337,8 +337,8 @@ void ResetJA2ClockGlobalTimers( void )
guiCompressionStringBaseTime = uiCurrentTime;
giFlashHighlightedItemBaseTime = uiCurrentTime;
giCompatibleItemBaseTime = uiCurrentTime;
giAnimateRouteBaseTime = uiCurrentTime;
giPotHeliPathBaseTime = uiCurrentTime;
giAnimateRouteBaseTime = uiCurrentTime;
giPotHeliPathBaseTime = uiCurrentTime;
giClickHeliIconBaseTime = uiCurrentTime;
giExitToTactBaseTime = uiCurrentTime;
guiSectorLocatorBaseTime = uiCurrentTime;
@@ -347,5 +347,5 @@ void ResetJA2ClockGlobalTimers( void )
giFlashAssignBaseTime = uiCurrentTime;
giFlashContractBaseTime = uiCurrentTime;
guiFlashCursorBaseTime = uiCurrentTime;
giPotCharPathBaseTime = uiCurrentTime;
giPotCharPathBaseTime = uiCurrentTime;
}
+17 -17
View File
@@ -29,7 +29,7 @@ enum
PATHFINDCOUNTER, // PATH FIND COUNTER
CURSORCOUNTER, // ANIMATED CURSOR
RMOUSECLICK_DELAY_COUNTER, // RIGHT BUTTON CLICK DELAY
LMOUSECLICK_DELAY_COUNTER, // LEFT BUTTON CLICK DELAY
LMOUSECLICK_DELAY_COUNTER, // LEFT BUTTON CLICK DELAY
SLIDETEXT, // DAMAGE DISPLAY
TARGETREFINE, // TARGET REFINE
CURSORFLASH, // Cursor/AP flash
@@ -66,14 +66,14 @@ extern INT32 giTimerTeamTurnUpdate;
// Functions
BOOLEAN InitializeJA2Clock( void );
void ShutdownJA2Clock( void );
void ShutdownJA2Clock( void );
#define GetJA2Clock() guiBaseJA2Clock
UINT32 GetPauseJA2Clock( );
UINT32 InitializeJA2TimerID( UINT32 uiDelay, UINT32 uiCallbackID, UINT32 uiUser );
void RemoveJA2TimerCallback( UINT32 uiTimer );
void RemoveJA2TimerCallback( UINT32 uiTimer );
void PauseTime( BOOLEAN fPaused );
@@ -85,35 +85,35 @@ extern UINT32 guiBaseJA2Clock;
extern CUSTOMIZABLE_TIMER_CALLBACK gpCustomizableTimerCallback;
// MACROS
// CHeck if new counter < 0 | set to 0 | Decrement
// CHeck if new counter < 0 | set to 0 | Decrement
#ifdef CALLBACKTIMER
#define UPDATECOUNTER( c ) ( ( giTimerCounters[ c ] - BASETIMESLICE ) < 0 ) ? ( giTimerCounters[ c ] = 0 ) : ( giTimerCounters[ c ] -= BASETIMESLICE )
#define RESETCOUNTER( c ) ( giTimerCounters[ c ] = giTimerIntervals[ c ] )
#define COUNTERDONE( c ) ( giTimerCounters[ c ] == 0 ) ? TRUE : FALSE
#define UPDATECOUNTER( c ) ( ( giTimerCounters[ c ] - BASETIMESLICE ) < 0 ) ? ( giTimerCounters[ c ] = 0 ) : ( giTimerCounters[ c ] -= BASETIMESLICE )
#define RESETCOUNTER( c ) ( giTimerCounters[ c ] = giTimerIntervals[ c ] )
#define COUNTERDONE( c ) ( giTimerCounters[ c ] == 0 ) ? TRUE : FALSE
#define UPDATETIMECOUNTER( c ) ( ( c - BASETIMESLICE ) < 0 ) ? ( c = 0 ) : ( c -= BASETIMESLICE )
#define UPDATETIMECOUNTER( c ) ( ( c - BASETIMESLICE ) < 0 ) ? ( c = 0 ) : ( c -= BASETIMESLICE )
#define RESETTIMECOUNTER( c, d ) ( c = d )
#ifdef BOUNDS_CHECKER
#define TIMECOUNTERDONE( c, d ) ( TRUE )
#define TIMECOUNTERDONE( c, d ) ( TRUE )
#else
#define TIMECOUNTERDONE( c, d ) ( c == 0 ) ? TRUE : FALSE
#define TIMECOUNTERDONE( c, d ) ( c == 0 ) ? TRUE : FALSE
#endif
#define SYNCTIMECOUNTER( )
#define ZEROTIMECOUNTER( c ) ( c = 0 )
#define ZEROTIMECOUNTER( c ) ( c = 0 )
#else
#define UPDATECOUNTER( c )
#define RESETCOUNTER( c ) ( giTimerCounters[ c ] = giClockTimer )
#define COUNTERDONE( c ) ( ( ( giClockTimer = GetJA2Clock() ) - giTimerCounters[ c ] ) > giTimerIntervals[ c ] ) ? TRUE : FALSE
#define UPDATECOUNTER( c )
#define RESETCOUNTER( c ) ( giTimerCounters[ c ] = giClockTimer )
#define COUNTERDONE( c ) ( ( ( giClockTimer = GetJA2Clock() ) - giTimerCounters[ c ] ) > giTimerIntervals[ c ] ) ? TRUE : FALSE
#define UPDATETIMECOUNTER( c )
#define RESETTIMECOUNTER( c, d ) ( c = giClockTimer )
#define TIMECOUNTERDONE( c, d ) ( giClockTimer - c > d ) ? TRUE : FALSE
#define UPDATETIMECOUNTER( c )
#define RESETTIMECOUNTER( c, d ) ( c = giClockTimer )
#define TIMECOUNTERDONE( c, d ) ( giClockTimer - c > d ) ? TRUE : FALSE
#define SYNCTIMECOUNTER( ) ( giClockTimer = GetJA2Clock() )
#endif
+112 -112
View File
@@ -24,76 +24,76 @@ extern BOOLEAN GetCDromDriveLetter( STR8 pString );
BOOLEAN PerformTimeLimitedCheck();
// WANNE: Given a string, replaces all instances of "oldpiece" with "newpiece"
/*
/*
*
* Modified this routine to eliminate recursion and to avoid infinite
* expansion of string when newpiece contains oldpiece. --Byron
*/
//STR8 Replace(STR8 string, STR8 oldpiece, STR8 newpiece)
//{
// int str_index, newstr_index, oldpiece_index, end,
* expansion of string when newpiece contains oldpiece. --Byron
*/
//STR8 Replace(STR8 string, STR8 oldpiece, STR8 newpiece)
//{
// int str_index, newstr_index, oldpiece_index, end,
//
// new_len, old_len, cpy_len;
// STR8 c;
// static char newstring[MAXLINE];
// new_len, old_len, cpy_len;
// STR8 c;
// static char newstring[MAXLINE];
//
// if ((c = strstr(string, oldpiece)) == NULL)
// if ((c = strstr(string, oldpiece)) == NULL)
//
// return string;
// return string;
//
// new_len = strlen(newpiece);
// old_len = strlen(oldpiece);
// end = strlen(string) - old_len;
// oldpiece_index = c - string;
// new_len = strlen(newpiece);
// old_len = strlen(oldpiece);
// end = strlen(string) - old_len;
// oldpiece_index = c - string;
//
//
// newstr_index = 0;
// str_index = 0;
// while(str_index <= end && c != NULL)
// {
// newstr_index = 0;
// str_index = 0;
// while(str_index <= end && c != NULL)
// {
//
// //Copy characters from the left of matched pattern occurence
// cpy_len = oldpiece_index-str_index;
// strncpy(newstring+newstr_index, string+str_index, cpy_len);
// newstr_index += cpy_len;
// str_index += cpy_len;
// //Copy characters from the left of matched pattern occurence
// cpy_len = oldpiece_index-str_index;
// strncpy(newstring+newstr_index, string+str_index, cpy_len);
// newstr_index += cpy_len;
// str_index += cpy_len;
//
// //Copy replacement characters instead of matched pattern
// strcpy(newstring+newstr_index, newpiece);
// newstr_index += new_len;
// str_index += old_len;
// //Copy replacement characters instead of matched pattern
// strcpy(newstring+newstr_index, newpiece);
// newstr_index += new_len;
// str_index += old_len;
//
// //Check for another pattern match
// if((c = strstr(string+str_index, oldpiece)) != NULL)
// oldpiece_index = c - string;
// //Check for another pattern match
// if((c = strstr(string+str_index, oldpiece)) != NULL)
// oldpiece_index = c - string;
//
//
// }
// // Copy remaining characters from the right of last matched pattern
// strcpy(newstring+newstr_index, string+str_index);
// }
// // Copy remaining characters from the right of last matched pattern
// strcpy(newstring+newstr_index, string+str_index);
//
// return newstring;
//}
// return newstring;
//}
// WANNE: Replaces german specific characters
// WANNE: Replaces german specific characters
//STR8 ReplaceGermanSpecialCharacters(STR8 text)
//{
// // ä
// text = Replace(text, "ä", "ä");
// // Ä
// text = Replace(text, "Ä", "Ä");
// // ö
// text = Replace(text, "ö", "ö");
// // Ö
// text = Replace(text, "Ö", "Ö");
// // ü
// text = Replace(text, "ü", "ü");
// // Ü
// text = Replace(text, "Ü", "Ü");
// // ß
// text = Replace(text, "ß", "ß");
// // ä
// text = Replace(text, "ä", "ä");
// // Ä
// text = Replace(text, "Ä", "Ä");
// // ö
// text = Replace(text, "ö", "ö");
// // Ö
// text = Replace(text, "Ö", "Ö");
// // ü
// text = Replace(text, "ü", "ü");
// // Ü
// text = Replace(text, "Ü", "Ü");
// // ß
// text = Replace(text, "ß", "ß");
//
// return text;
// return text;
//}
@@ -111,7 +111,7 @@ CHAR8 Drive[128], Dir[128], Name[128], Ext[128];
else
{
_splitpath(pFilename, Drive, Dir, Name, Ext);
strcat(Name, "_8");
strcpy(pDestination, Drive);
@@ -125,9 +125,9 @@ CHAR8 Drive[128], Dir[128], Name[128], Ext[128];
BOOLEAN CreateSGPPaletteFromCOLFile( SGPPaletteEntry *pPalette, SGPFILENAME ColFile )
{
HWFILE hFileHandle;
BYTE bColHeader[ 8 ];
UINT32 cnt;
HWFILE hFileHandle;
BYTE bColHeader[ 8 ];
UINT32 cnt;
//See if files exists, if not, return error
if ( !FileExists( ColFile ) )
@@ -138,7 +138,7 @@ BOOLEAN CreateSGPPaletteFromCOLFile( SGPPaletteEntry *pPalette, SGPFILENAME ColF
}
// Open and read in the file
if ( ( hFileHandle = FileOpen( ColFile, FILE_ACCESS_READ, FALSE)) == 0)
if ( ( hFileHandle = FileOpen( ColFile, FILE_ACCESS_READ, FALSE)) == 0)
{
// Return FALSE w/ debug
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Cannot open COL file");
@@ -146,14 +146,14 @@ BOOLEAN CreateSGPPaletteFromCOLFile( SGPPaletteEntry *pPalette, SGPFILENAME ColF
}
// Skip header
FileRead( hFileHandle, bColHeader, sizeof( bColHeader ) , NULL);
FileRead( hFileHandle, bColHeader, sizeof( bColHeader ) , NULL);
// Read in a palette entry at a time
for ( cnt = 0; cnt < 256; cnt++ )
{
FileRead( hFileHandle, &pPalette[ cnt ].peRed, sizeof( UINT8 ) , NULL);
FileRead( hFileHandle, &pPalette[ cnt ].peGreen, sizeof( UINT8 ) , NULL);
FileRead( hFileHandle, &pPalette[ cnt ].peBlue, sizeof( UINT8 ) , NULL);
FileRead( hFileHandle, &pPalette[ cnt ].peRed, sizeof( UINT8 ) , NULL);
FileRead( hFileHandle, &pPalette[ cnt ].peGreen, sizeof( UINT8 ) , NULL);
FileRead( hFileHandle, &pPalette[ cnt ].peBlue, sizeof( UINT8 ) , NULL);
}
// Close file
@@ -167,7 +167,7 @@ BOOLEAN DisplayPaletteRep( PaletteRepID aPalRep, UINT8 ubXPos, UINT8 ubYPos, UIN
UINT16 us16BPPColor;
UINT32 cnt1;
UINT8 ubSize, ubType;
INT16 sTLX, sTLY, sBRX, sBRY;
INT16 sTLX, sTLY, sBRX, sBRY;
UINT8 ubPaletteRep;
// Create 16BPP Palette
@@ -197,7 +197,7 @@ BOOLEAN DisplayPaletteRep( PaletteRepID aPalRep, UINT8 ubXPos, UINT8 ubYPos, UIN
}
BOOLEAN WrapString( STR16 pStr, STR16 pStr2, UINT16 usWidth, INT32 uiFont )
BOOLEAN WrapString( STR16 pStr, STR16 pStr2, UINT16 usWidth, INT32 uiFont )
{
UINT32 Cur, uiLet, uiNewLet, uiHyphenLet;
STR16 curletter;
@@ -205,7 +205,7 @@ BOOLEAN WrapString( STR16 pStr, STR16 pStr2, UINT16 usWidth, INT32 uiFont )
BOOLEAN fLineSplit = FALSE;
HVOBJECT hFont;
// CHECK FOR WRAP
// CHECK FOR WRAP
Cur=0;
uiLet = 0;
curletter = pStr;
@@ -229,12 +229,12 @@ BOOLEAN WrapString( STR16 pStr, STR16 pStr2, UINT16 usWidth, INT32 uiFont )
{
if ( (*curletter) == 32 )
{
// Split Line!
fLineSplit = TRUE;
// Split Line!
fLineSplit = TRUE;
pStr[ uiNewLet ] = (INT16)'\0';
pStr[ uiNewLet ] = (INT16)'\0';
wcscpy( pStr2, &(pStr[ uiNewLet + 1 ]) );
wcscpy( pStr2, &(pStr[ uiNewLet + 1 ]) );
}
if ( fLineSplit )
@@ -242,14 +242,14 @@ BOOLEAN WrapString( STR16 pStr, STR16 pStr2, UINT16 usWidth, INT32 uiFont )
uiNewLet--;
curletter--;
}
if( !fLineSplit)
{
//We completed the check for a space, but failed, so use the hyphen method.
swprintf( pStr2, L"-%s", &(pStr[uiHyphenLet]) );
pStr[uiHyphenLet] = (INT16)'/0';
fLineSplit = TRUE; //hyphen method
fLineSplit = TRUE; //hyphen method
break;
}
}
@@ -298,7 +298,7 @@ BOOLEAN IfWin95(void)
void HandleLimitedNumExecutions( )
{
// Get system directory
HWFILE hFileHandle;
HWFILE hFileHandle;
CHAR8 ubSysDir[ 512 ];
INT8 bNumRuns;
@@ -328,7 +328,7 @@ void HandleLimitedNumExecutions( )
SET_ERROR( "Error 1054: Cannot execute - contact Sir-Tech Software." );
return;
}
}
else
{
@@ -355,9 +355,9 @@ void HandleLimitedNumExecutions( )
SGPFILENAME gCheckFilenames[] =
{
"DATA\\INTRO.SLF",
"DATA\\LOADSCREENS.SLF",
"DATA\\MAPS.SLF",
"DATA\\INTRO.SLF",
"DATA\\LOADSCREENS.SLF",
"DATA\\MAPS.SLF",
"DATA\\NPC_SPEECH.SLF",
"DATA\\SPEECH.SLF",
};
@@ -365,14 +365,14 @@ SGPFILENAME gCheckFilenames[] =
UINT32 gCheckFileMinSizes[] =
{
68000000,
36000000,
87000000,
187000000,
236000000
68000000,
36000000,
87000000,
187000000,
236000000
};
#if defined( JA2TESTVERSION ) || defined( _DEBUG )
#if defined( JA2TESTVERSION ) || defined( _DEBUG )
#define NOCDCHECK
#endif
@@ -400,46 +400,46 @@ BOOLEAN HandleJA2CDCheck( )
BOOLEAN fFailed = FALSE;
CHAR8 zCdLocation[ SGPFILENAME_LEN ];
CHAR8 zCdFile[ SGPFILENAME_LEN ];
INT32 cnt;
INT32 cnt;
HWFILE hFile;
// Check for a file on CD....
if( GetCDromDriveLetter( zCdLocation ) )
{
for ( cnt = 0; cnt < 5; cnt++ )
{
// OK, build filename
sprintf( zCdFile, "%s%s", zCdLocation, gCheckFilenames[ cnt ] );
for ( cnt = 0; cnt < 5; cnt++ )
{
// OK, build filename
sprintf( zCdFile, "%s%s", zCdLocation, gCheckFilenames[ cnt ] );
hFile = FileOpen( zCdFile, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
// Check if it exists...
if ( !hFile )
{
fFailed = TRUE;
// Check if it exists...
if ( !hFile )
{
fFailed = TRUE;
FileClose( hFile );
break;
}
break;
}
// Check min size
// Check min size
//#ifndef GERMAN
// if ( FileGetSize( hFile ) < gCheckFileMinSizes[ cnt ] )
// {
// fFailed = TRUE;
// if ( FileGetSize( hFile ) < gCheckFileMinSizes[ cnt ] )
// {
// fFailed = TRUE;
// FileClose( hFile );
// break;
// }
// break;
// }
//#endif
FileClose( hFile );
}
}
else
{
fFailed = TRUE;
}
}
else
{
fFailed = TRUE;
}
if ( fFailed )
{
CHAR8 zErrorMessage[256];
@@ -452,8 +452,8 @@ BOOLEAN HandleJA2CDCheck( )
}
}
return( TRUE );
return( TRUE );
#endif
}
@@ -482,7 +482,7 @@ BOOLEAN HandleJA2CDCheckTwo( )
fFailed = FALSE;
}
}
if ( fFailed )
{
CHAR8 zErrorMessage[256];
@@ -519,7 +519,7 @@ BOOLEAN PerformTimeLimitedCheck()
if( sSystemTime.wYear > 1999 || sSystemTime.wMonth > 7 )
{
//spit out an error message
MessageBox( NULL, "This time limited version of Jagged Alliance 2 has expired.", "Ja2 Error!", MB_OK );
MessageBox( NULL, "This time limited version of Jagged Alliance 2 has expired.", "Ja2 Error!", MB_OK );
return( FALSE );
}
@@ -531,11 +531,11 @@ BOOLEAN DoJA2FilesExistsOnDrive( CHAR8 *zCdLocation )
{
BOOLEAN fFailed = FALSE;
CHAR8 zCdFile[ SGPFILENAME_LEN ];
INT32 cnt;
INT32 cnt;
HWFILE hFile;
for ( cnt = 0; cnt < 4; cnt++ )
{
for ( cnt = 0; cnt < 4; cnt++ )
{
// OK, build filename
sprintf( zCdFile, "%s%s", zCdLocation, gCheckFilenames[ cnt ] );
@@ -546,7 +546,7 @@ BOOLEAN DoJA2FilesExistsOnDrive( CHAR8 *zCdLocation )
{
fFailed = TRUE;
FileClose( hFile );
break;
break;
}
FileClose( hFile );
}
+4 -4
View File
@@ -8,14 +8,14 @@
#define GETPIXELDEPTH( ) ( gbPixelDepth )
// WANNE: Maximum number of characters in german description (German xml files)
#define MAXLINE 200
#define MAXLINE 200
BOOLEAN CreateSGPPaletteFromCOLFile( SGPPaletteEntry *pPalette, SGPFILENAME ColFile );
BOOLEAN DisplayPaletteRep( PaletteRepID aPalRep, UINT8 ubXPos, UINT8 ubYPos, UINT32 uiDestSurface );
void FilenameForBPP(STR pFilename, STR pDestination);
BOOLEAN WrapString( STR16 pStr, STR16 pStr2, UINT16 usWidth, INT32 uiFont );
BOOLEAN WrapString( STR16 pStr, STR16 pStr2, UINT16 usWidth, INT32 uiFont );
BOOLEAN IfWinNT(void);
BOOLEAN IfWin95(void);
@@ -38,7 +38,7 @@ template<class Integer>
inline Integer idiv(Integer a, Integer b)
{
return a > 0 ? b > 0 ? (a + b/2) / b : (a - b/2) / b :
b > 0 ? (a - b/2) / b : (a + b/2) / b ;
b > 0 ? (a - b/2) / b : (a + b/2) / b ;
}
#endif
#endif
+106 -4
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Version="8.00"
Name="Utils_2005Express"
ProjectGUID="{262A5F80-0B99-4E8E-A6C7-74CB1FD0A67C}"
RootNamespace="Utils_2005Express"
@@ -39,7 +39,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;&#x0D;&#x0A;"
AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
@@ -103,7 +103,6 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
RuntimeTypeInfo="false"
@@ -139,6 +138,69 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="MapEditor|Win32"
OutputDirectory="MapEditor"
IntermediateDirectory="MapEditor"
ConfigurationType="4"
InheritedPropertySheets="..\ja2_2005Express.vsprops;..\ja2_2005ExpressEditor.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
DisableSpecificWarnings="4100"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
@@ -148,18 +210,38 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\_Ja25DutchText.h"
>
</File>
<File
RelativePath=".\_Ja25EnglishText.h"
>
</File>
<File
RelativePath=".\_Ja25FrenchText.h"
>
</File>
<File
RelativePath=".\_Ja25GermanText.h"
>
</File>
<File
RelativePath=".\_Ja25ItalianText.h"
>
</File>
<File
RelativePath=".\_Ja25PolishText.h"
>
</File>
<File
RelativePath=".\_Ja25RussianText.h"
>
</File>
<File
RelativePath=".\_Ja25TaiwaneseText.h"
>
</File>
<File
RelativePath=".\Animated ProgressBar.h"
>
@@ -302,18 +384,38 @@
RelativePath=".\_ItalianText.cpp"
>
</File>
<File
RelativePath=".\_Ja25DutchText.cpp"
>
</File>
<File
RelativePath=".\_Ja25EnglishText.cpp"
>
</File>
<File
RelativePath=".\_Ja25FrenchText.cpp"
>
</File>
<File
RelativePath=".\_Ja25GermanText.cpp"
>
</File>
<File
RelativePath=".\_Ja25ItalianText.cpp"
>
</File>
<File
RelativePath=".\_Ja25PolishText.cpp"
>
</File>
<File
RelativePath=".\_Ja25RussianText.cpp"
>
</File>
<File
RelativePath=".\_Ja25TaiwaneseText.cpp"
>
</File>
<File
RelativePath=".\_PolishText.cpp"
>
+371 -374
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -9,7 +9,7 @@
// Defines for coded text For use with IanDisplayWrappedString()
#define TEXT_SPACE 32
#define TEXT_SPACE 32
#define TEXT_CODE_NEWLINE 177
#define TEXT_CODE_BOLD 178
#define TEXT_CODE_CENTER 179
@@ -25,10 +25,10 @@ UINT16 IanDisplayWrappedString(UINT16 usPosX, UINT16 usPosY, UINT16 usWidth, UIN
#define TEXT_SHADOWED 0x00000008
#define INVALIDATE_TEXT 0x00000010
#define DONT_DISPLAY_TEXT 0x00000020 //Wont display the text. Used if you just want to get how many lines will be displayed
#define DONT_DISPLAY_TEXT 0x00000020 //Wont display the text. Used if you just want to get how many lines will be displayed
#define IAN_WRAP_NO_SHADOW 32
#define IAN_WRAP_NO_SHADOW 32
@@ -48,14 +48,14 @@ UINT16 DisplayWrappedString(UINT16 usPosX, UINT16 usPosY, UINT16 usWidth, UINT8
UINT16 DeleteWrappedString(WRAPPED_STRING *pWrappedString);
void CleanOutControlCodesFromString(STR16 pSourceString, STR16 pDestString);
INT16 IanDisplayWrappedStringToPages(UINT16 usPosX, UINT16 usPosY, UINT16 usWidth, UINT16 usPageHeight, UINT16 usTotalHeight, UINT16 usPageNumber,UINT8 ubGap,
UINT32 uiFont, UINT8 ubColor, STR16 pString,
UINT8 ubBackGroundColor, BOOLEAN fDirty, UINT32 uiFlags, BOOLEAN *fOnLastPageFlag);
UINT32 uiFont, UINT8 ubColor, STR16 pString,
UINT8 ubBackGroundColor, BOOLEAN fDirty, UINT32 uiFlags, BOOLEAN *fOnLastPageFlag);
BOOLEAN DrawTextToScreen(STR16 pStr, UINT16 LocX, UINT16 LocY, UINT16 usWidth, UINT32 ulFont, UINT8 ubColor, UINT8 ubBackGroundColor, BOOLEAN fDirty, UINT32 FLAGS);
UINT16 IanWrappedStringHeight(UINT16 usPosX, UINT16 usPosY, UINT16 usWidth, UINT8 ubGap,
UINT32 uiFont, UINT8 ubColor, STR16 pString,
UINT8 ubBackGroundColor, BOOLEAN fDirty, UINT32 uiFlags);
UINT32 uiFont, UINT8 ubColor, STR16 pString,
UINT8 ubBackGroundColor, BOOLEAN fDirty, UINT32 uiFlags);
BOOLEAN WillThisStringGetCutOff( INT32 iCurrentYPosition, INT32 iBottomOfPage, INT32 iWrapWidth, UINT32 uiFont, STR16 pString, INT32 iGap, INT32 iPage );
BOOLEAN WillThisStringGetCutOff( INT32 iCurrentYPosition, INT32 iBottomOfPage, INT32 iWrapWidth, UINT32 uiFont, STR16 pString, INT32 iGap, INT32 iPage );
BOOLEAN IsThisStringBeforeTheCurrentPage( INT32 iTotalYPosition, INT32 iPageSize, INT32 iCurrentPage ,INT32 iWrapWidth, UINT32 uiFont, STR16 pString, INT32 iGap );
INT32 GetNewTotalYPositionOfThisString( INT32 iTotalYPosition, INT32 iPageSize, INT32 iCurrentPage ,INT32 iWrapWidth, UINT32 uiFont, STR16 pString, INT32 iGap );
RecordPtr GetFirstRecordOnThisPage( RecordPtr RecordList, UINT32 uiFont, UINT16 usWidth, UINT8 ubGap, INT32 iPage, INT32 iPageSize );
+31 -1
View File
@@ -103,6 +103,7 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "ubGraphicNum") == 0 ||
strcmp(name, "ubWeight") == 0 ||
strcmp(name, "ubPerPocket") == 0 ||
strcmp(name, "ItemSize") == 0 ||
strcmp(name, "usPrice") == 0 ||
strcmp(name, "ubCoolness") == 0 ||
strcmp(name, "bReliability") == 0 ||
@@ -162,6 +163,7 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "DayVisionRangeBonus") == 0 ||
strcmp(name, "CaveVisionRangeBonus") == 0 ||
strcmp(name, "BrightLightVisionRangeBonus") == 0 ||
strcmp(name, "ItemSizeBonus") == 0 ||
strcmp(name, "LeatherJacket") == 0 ||
strcmp(name, "NeedsBatteries") == 0 ||
strcmp(name, "Batteries") == 0 ||
@@ -185,6 +187,7 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "Flare") == 0 ||
strcmp(name, "MetalDetector") == 0 ||
strcmp(name, "FingerPrintID") == 0 ||
strcmp(name, "AmmoCrate") == 0 ||
strcmp(name, "Cannon") == 0 ||
strcmp(name, "RocketRifle") == 0 ||
strcmp(name, "MedicalKit") == 0 ||
@@ -209,6 +212,7 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "SnowCamoBonus") == 0 ||
strcmp(name, "StealthBonus") == 0 ||
strcmp(name, "SciFi") == 0 ||
strcmp(name, "NewInv") == 0 ||
strcmp(name, "fFlags") == 0 ))
{
@@ -242,7 +246,9 @@ static void XMLCALL
itemEndElementHandle(void *userData, const XML_Char *name)
{
itemParseData * pData = (itemParseData *)userData;
#if 0
char temp;
#endif
if(pData->currentDepth <= pData->maxReadDepth) //we're at the end of an element that we've been reading
{
@@ -457,6 +463,11 @@ itemEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curItem.ubPerPocket = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "ItemSize") == 0)
{
pData->curElement = ELEMENT;
pData->curItem.ItemSize = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "usPrice") == 0)
{
pData->curElement = ELEMENT;
@@ -749,6 +760,11 @@ itemEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curItem.scifi = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "NewInv") == 0)
{
pData->curElement = ELEMENT;
pData->curItem.newinv = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "HideMuzzleFlash") == 0)
{
pData->curElement = ELEMENT;
@@ -874,6 +890,11 @@ itemEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curItem.brightlightvisionrangebonus = (INT16) atol(pData->szCharData);
}
if(strcmp(name, "ItemSizeBonus") == 0)
{
pData->curElement = ELEMENT;
pData->curItem.itemsizebonus = (INT16) atol(pData->szCharData);
}
else if(strcmp(name, "LeatherJacket") == 0)
{
pData->curElement = ELEMENT;
@@ -964,6 +985,11 @@ itemEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curItem.fingerprintid = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "AmmoCrate") == 0)
{
pData->curElement = ELEMENT;
pData->curItem.ammocrate = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "Rock") == 0)
{
pData->curElement = ELEMENT;
@@ -1398,6 +1424,7 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t<ubGraphicNum>%d</ubGraphicNum>\r\n", Item[cnt].ubGraphicNum);
FilePrintf(hFile,"\t\t<ubWeight>%d</ubWeight>\r\n", Item[cnt].ubWeight);
FilePrintf(hFile,"\t\t<ubPerPocket>%d</ubPerPocket>\r\n", Item[cnt].ubPerPocket);
FilePrintf(hFile,"\t\t<ItemSize>%d</ItemSize>\r\n", Item[cnt].ItemSize);
FilePrintf(hFile,"\t\t<usPrice>%d</usPrice>\r\n", Item[cnt].usPrice);
FilePrintf(hFile,"\t\t<ubCoolness>%d</ubCoolness>\r\n", Item[cnt].ubCoolness);
FilePrintf(hFile,"\t\t<bReliability>%d</bReliability>\r\n", Item[cnt].bReliability);
@@ -1432,6 +1459,7 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t<Attachment>%d</Attachment>\r\n", Item[cnt].attachment );
FilePrintf(hFile,"\t\t<BigGunList>%d</BigGunList>\r\n", Item[cnt].biggunlist );
FilePrintf(hFile,"\t\t<SciFi>%d</SciFi>\r\n", Item[cnt].scifi );
FilePrintf(hFile,"\t\t<NewInv>%d</NewInv>\r\n", Item[cnt].newinv );
FilePrintf(hFile,"\t\t<NotInEditor>%d</NotInEditor>\r\n", Item[cnt].notineditor );
FilePrintf(hFile,"\t\t<DefaultUndroppable>%d</DefaultUndroppable>\r\n", Item[cnt].defaultundroppable );
FilePrintf(hFile,"\t\t<Unaerodynamic>%d</Unaerodynamic>\r\n", Item[cnt].unaerodynamic );
@@ -1508,6 +1536,7 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t<DayVisionRangeBonus>%d</DayVisionRangeBonus>\r\n", Item[cnt].dayvisionrangebonus );
FilePrintf(hFile,"\t\t<CaveVisionRangeBonus>%d</CaveVisionRangeBonus>\r\n", Item[cnt].cavevisionrangebonus );
FilePrintf(hFile,"\t\t<BrightLightVisionRangeBonus>%d</BrightLightVisionRangeBonus>\r\n", Item[cnt].brightlightvisionrangebonus );
FilePrintf(hFile,"\t\t<ItemSizeBonus>%d</ItemSizeBonus>\r\n", Item[cnt].itemsizebonus );
FilePrintf(hFile,"\t\t<PercentTunnelVision>%d</PercentTunnelVision>\r\n", Item[cnt].percenttunnelvision );
FilePrintf(hFile,"\t\t<ThermalOptics>%d</ThermalOptics>\r\n", Item[cnt].thermaloptics );
FilePrintf(hFile,"\t\t<GasMask>%d</GasMask>\r\n", Item[cnt].gasmask );
@@ -1533,6 +1562,7 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t<ContainsLiquid>%d</ContainsLiquid>\r\n", Item[cnt].containsliquid );
FilePrintf(hFile,"\t\t<MetalDetector>%d</MetalDetector>\r\n", Item[cnt].metaldetector );
FilePrintf(hFile,"\t\t<FingerPrintID>%d</FingerPrintID>\r\n", Item[cnt].fingerprintid );
FilePrintf(hFile,"\t\t<AmmoCrate>%d</AmmoCrate>\r\n", Item[cnt].ammocrate );
FilePrintf(hFile,"\t</ITEM>\r\n");
}
@@ -1541,4 +1571,4 @@ BOOLEAN WriteItemStats()
FileClose( hFile );
return( TRUE );
}
}
+13 -13
View File
@@ -47,15 +47,15 @@ struct
PARSE_STAGE curElement;
CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
UINT32 maxArraySize;
UINT32 curIndex;
UINT32 curIndex;
UINT32 currentDepth;
UINT32 maxReadDepth;
}
typedef stringParseData;
static void XMLCALL
static void XMLCALL
stringStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
{
stringParseData * pData = (stringParseData *)userData;
@@ -88,9 +88,9 @@ stringCharacterDataHandle(void *userData, const XML_Char *str, int len)
{
stringParseData * pData = (stringParseData *)userData;
if( (pData->currentDepth <= pData->maxReadDepth) &&
if( (pData->currentDepth <= pData->maxReadDepth) &&
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
){
){
strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
}
}
@@ -133,7 +133,7 @@ BOOLEAN ReadInStringArray()
UINT32 uiFSize;
CHAR8 * lpcBuffer;
XML_Parser parser = XML_ParserCreate(NULL);
stringParseData pData;
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("Loading %s",AMMOCALIBERSTRINGSFILENAME ) );
@@ -142,7 +142,7 @@ BOOLEAN ReadInStringArray()
hFile = FileOpen( AMMOCALIBERSTRINGSFILENAME, FILE_ACCESS_READ, FALSE );
if ( !hFile )
return( FALSE );
uiFSize = FileGetSize(hFile);
lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
@@ -157,19 +157,19 @@ BOOLEAN ReadInStringArray()
FileClose( hFile );
XML_SetElementHandler(parser, stringStartElementHandle, stringEndElementHandle);
XML_SetCharacterDataHandler(parser, stringCharacterDataHandle);
memset(&pData,0,sizeof(pData));
pData.maxArraySize = MAXITEMS;
pData.maxArraySize = MAXITEMS;
pData.curIndex = 0xffffffff;
XML_SetUserData(parser, &pData);
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
{
CHAR8 errorBuf[511];
@@ -196,7 +196,7 @@ BOOLEAN WriteStringArray()
hFile = FileOpen( "TABLEDATA\\AmmoCaliberStrings out.xml", FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE );
if ( !hFile )
return( FALSE );
{
UINT32 cnt;
@@ -211,7 +211,7 @@ BOOLEAN WriteStringArray()
{
UINT32 uiCharLoc = wcscspn(szRemainder,L"&<>\'\"\0");
CHAR16 invChar = szRemainder[uiCharLoc];
if(uiCharLoc)
{
szRemainder[uiCharLoc] = '\0';
+28 -8
View File
@@ -767,7 +767,7 @@ STR16 gzMercSkillText[] =
L"Dief",
L"Vechtkunsten",
L"Mesworp",
L"Raak op dak! Bonus",
L"Sniper",
L"Camouflaged",
L"Camouflage (Urban)",
L"Camouflage (Desert)",
@@ -1081,7 +1081,7 @@ STR16 sKeyDescriptionStrings[2] =
//The headers used to describe various weapon statistics.
INT16 gWeaponStatsDesc[][ 14 ] =
CHAR16 gWeaponStatsDesc[][ 14 ] =
{
L"Gewicht (%s):",
L"Status:",
@@ -1102,7 +1102,7 @@ INT16 gWeaponStatsDesc[][ 14 ] =
//The headers used for the merc's money.
INT16 gMoneyStatsDesc[][ 13 ] =
CHAR16 gMoneyStatsDesc[][ 13 ] =
{
L"Bedrag",
L"Restbedrag:", //this is the overall balance
@@ -1140,12 +1140,12 @@ STR16 gzMoneyAmounts[6] =
};
// short words meaning "Advantages" for "Pros" and "Disadvantages" for "Cons."
INT16 gzProsLabel[10] =
CHAR16 gzProsLabel[10] =
{
L"Voor:",
};
INT16 gzConsLabel[10] =
CHAR16 gzConsLabel[10] =
{
L"Tegen:",
};
@@ -1408,6 +1408,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Gezondheid: %d/%d\nBrandstof: %d/%d", //L"Health: %d/%d\nFuel: %d/%d",
L"%s kan %s niet zien.", // Cannot see person trying to talk to
L"Attachment removed",
L"Kan niet een ander voertuig bereiken aangezien u reeds 2 hebt",
};
//Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface.
@@ -1618,6 +1619,7 @@ STR16 pMapInventoryErrorString[] =
L"Tijdens gevechten moet je items handmatig oppakken.",
L"Tijdens gevechten moet je items handmatig neerleggen.",
L"%s is niet in de sector om dat item neer te leggen.",
L"Tijdens gevecht, kunt u met een munitiekrat herladen niet.",
};
STR16 pMapInventoryStrings[] =
@@ -2843,6 +2845,7 @@ STR16 BobbyRFilter[] =
// Used
L"Guns",
L"Armor",
L"LBE Gear",
L"Misc",
// Armour
@@ -2860,6 +2863,7 @@ STR16 BobbyRFilter[] =
L"Med. Kits",
L"Kits",
L"Face Items",
L"LBE Gear",
L"Misc.",
};
@@ -3384,6 +3388,8 @@ STR16 zSaveLoadText[] =
L"Great Selection",
L"Excellent Selection",
L"Awesome Selection",
L"New Inventory does not work in 640x480 screen size. Please resize and try again.",
};
@@ -3602,6 +3608,9 @@ STR16 gzGIOScreenText[] =
L"Excellent",
L"Awesome",
L"INSANE",
L"Inventory System",
L"Old",
L"New",
};
STR16 pDeliveryLocationStrings[] =
@@ -3994,6 +4003,8 @@ STR16 sRepairsDoneString[] =
L"%s is klaar met reparatie van ieders wapens en bepantering",
L"%s is klaar met reparatie van ieders uitrusting",
L"%s is klaar met reparatie van ieders vervoerde items",
L"%s is klaar met reparatie van ieders vervoerde items",
L"%s is klaar met reparatie van ieders vervoerde items",
};
/*STR16 zGioDifConfirmText[]=
@@ -4243,10 +4254,19 @@ STR16 New113MERCMercMailTexts[] =
// INFO: Do not replace the ± characters. They indicate the <B2> (-> Newline) from the edt files
STR16 MissingIMPSkillsDescriptions[] =
{
// Rooftop sniping
L"Rooftop Sniping: Not even ants are on the save side. Each target is mercilessly tracked down! ± ",
// Sniper
L"Sniper: De ogen van een havik, u kunnen de vleugels van een vlieg bij honderd werven ontspruiten! ± ",
// Camouflage
L"Camouflage: Besides you even bushes look synthetic! ± ",
L"Camouflage: Naast u ringt synthetische zelfs blik! ± ",
};
STR16 NewInvMessage[] =
{
L"Kan op dit moment niet bestelwagenrugzak",
L"Geen plaats om rugzak te zetten",
L"Gevonden niet rugzak",
L"De ritssluiting werkt slechts in gevecht",
L"Kan niet me bewegen terwijl actieve rugzakritssluiting",
};
#endif //DUTCH
+26 -6
View File
@@ -2,13 +2,13 @@
#include "Utils All.h"
#else
#include "Language Defines.h"
#if defined( ENGLISH ) || defined( TAIWANESE )
#if defined( ENGLISH )
#include "text.h"
#include "Fileman.h"
#endif
#endif
#if defined( ENGLISH ) || defined( TAIWANESE )
#if defined( ENGLISH )
/*
@@ -765,7 +765,7 @@ STR16 gzMercSkillText[] =
L"Thief",
L"Martial Arts",
L"Knifing",
L"Rooftop Sniping", //JA25: modified
L"Sniper",
L"Camouflage", //JA25: modified
L"Camouflage (Urban)",
L"Camouflage (Desert)",
@@ -1408,6 +1408,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Health: %d/%d\nFuel: %d/%d",
L"%s cannot see %s.", // Cannot see person trying to talk to
L"Attachment removed",
L"Can not gain another vehicle as you already have 2",
};
//Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface.
@@ -1618,6 +1619,7 @@ STR16 pMapInventoryErrorString[] =
L"During combat, you'll have to pick up items manually.",
L"During combat, you'll have to drop items manually.",
L"%s isn't in the sector to drop that item.",
L"During combat, you can't reload with an ammo crate.",
};
STR16 pMapInventoryStrings[] =
@@ -2844,6 +2846,7 @@ STR16 BobbyRFilter[] =
// Used
L"Guns",
L"Armor",
L"LBE Gear",
L"Misc",
// Armour
@@ -2861,6 +2864,7 @@ STR16 BobbyRFilter[] =
L"Med. Kits",
L"Kits",
L"Face Items",
L"LBE Gear",
L"Misc.",
};
@@ -3385,6 +3389,8 @@ STR16 zSaveLoadText[] =
L"Great Selection",
L"Excellent Selection",
L"Awesome Selection",
L"New Inventory does not work in 640x480 screen size. Please resize and try again.",
};
@@ -3605,6 +3611,9 @@ STR16 gzGIOScreenText[] =
L"Great",
L"Excellent",
L"Awesome",
L"Inventory System",
L"Old",
L"New",
};
STR16 pDeliveryLocationStrings[] =
@@ -3997,6 +4006,8 @@ STR16 sRepairsDoneString[] =
L"%s finished repairing everyone's guns & armor",
L"%s finished repairing everyone's equipped items",
L"%s finished repairing everyone's carried items",
L"%s finished repairing everyone's carried items",
L"%s finished repairing everyone's carried items",
};
STR16 zGioDifConfirmText[]=
@@ -4238,10 +4249,19 @@ STR16 New113MERCMercMailTexts[] =
// INFO: Do not replace the ± characters. They indicate the <B2> (-> Newline) from the edt files
STR16 MissingIMPSkillsDescriptions[] =
{
// Rooftop sniping
L"Rooftop Sniping: Not even ants are on the save side. Each target is mercilessly tracked down! ± ",
// Sniper
L"Sniper: Eyes of a hawk, you can shoot the wings from a fly at a hundred yards! ± ",
// Camouflage
L"Camouflage: Besides you even bushes look synthetic! ± ",
};
#endif //ENGLISH
STR16 NewInvMessage[] =
{
L"Cannot pickup backpack at this time",
L"No place to put backpack",
L"Backpack not found",
L"Zipper only works in combat",
L"Can not move while backpack zipper active",
};
#endif //ENGLISH
+28 -8
View File
@@ -757,7 +757,7 @@ STR16 gzMercSkillText[] =
L"Voleur",
L"Arts martiaux",
L"Couteau",
L"Bonus toucher (sur le toit)",
L"Tireur isolé",
L"Camouflage",
L"Camouflage (Urban)",
L"Camouflage (Desert)",
@@ -1071,7 +1071,7 @@ STR16 sKeyDescriptionStrings[2] =
//The headers used to describe various weapon statistics.
INT16 gWeaponStatsDesc[][ 14 ] =
CHAR16 gWeaponStatsDesc[][ 14 ] =
{
L"Poids (%s):",
L"Etat :",
@@ -1092,7 +1092,7 @@ INT16 gWeaponStatsDesc[][ 14 ] =
//The headers used for the merc's money.
INT16 gMoneyStatsDesc[][ 13 ] =
CHAR16 gMoneyStatsDesc[][ 13 ] =
{
L"Montant",
L"Restant :", //this is the overall balance
@@ -1130,12 +1130,12 @@ STR16 gzMoneyAmounts[6] =
};
// short words meaning "Advantages" for "Pros" and "Disadvantages" for "Cons."
INT16 gzProsLabel[10] =
CHAR16 gzProsLabel[10] =
{
L"Plus :",
};
INT16 gzConsLabel[10] =
CHAR16 gzConsLabel[10] =
{
L"Moins :",
};
@@ -1398,6 +1398,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Etat : %d/%d\nCarburant : %d/%d",
L"%s ne peut pas voir %s.", // Cannot see person trying to talk to
L"Attachment removed",
L"Ne peut pas gagner un autre véhicule car vous avez déjà 2",
};
//Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface.
@@ -1608,6 +1609,7 @@ STR16 pMapInventoryErrorString[] =
L"En combat, vous devez prendre les objets vous-même.",
L"En combat, vous devez abandonner les objets vous-même.",
L"%s n'est pas dans le bon secteur.",
L"Pendant le combat, vous ne pouvez pas recharger avec une caisse de munitions.",
};
STR16 pMapInventoryStrings[] =
@@ -2832,6 +2834,7 @@ STR16 BobbyRFilter[] =
// Used
L"Guns",
L"Armor",
L"LBE Gear",
L"Misc",
// Armour
@@ -2849,6 +2852,7 @@ STR16 BobbyRFilter[] =
L"Med. Kits",
L"Kits",
L"Face Items",
L"LBE Gear",
L"Misc.",
};
@@ -3373,6 +3377,8 @@ STR16 zSaveLoadText[] =
L"Meilleur Selection",
L"Excellent Selection",
L"Superb Selection",
L"New Inventory does not work in 640x480 screen size. Please resize and try again.",
};
@@ -3592,6 +3598,9 @@ STR16 gzGIOScreenText[] =
L"Meilleur",
L"Excellent",
L"Superb",
L"Inventory System",
L"Old",
L"New",
};
STR16 pDeliveryLocationStrings[] =
@@ -3984,6 +3993,8 @@ STR16 sRepairsDoneString[] =
L"%s a terminé la réparation des armes & armures",
L"%s a terminé la réparation des objets portés",
L"%s a terminé la réparation des objets transportés",
L"%s a terminé la réparation des objets transportés",
L"%s a terminé la réparation des objets transportés",
};
STR16 zGioDifConfirmText[]=
@@ -4225,10 +4236,19 @@ STR16 New113MERCMercMailTexts[] =
// INFO: Do not replace the ± characters. They indicate the <B2> (-> Newline) from the edt files
STR16 MissingIMPSkillsDescriptions[] =
{
// Rooftop sniping
L"Rooftop Sniping: Not even ants are on the save side. Each target is mercilessly tracked down! ± ",
// Sniper
L"Tireur isolé : Des yeux d'un faucon, vous pouvez tirer les ailes d'une mouche à cent yards! ± ",
// Camouflage
L"Camouflage: Besides you even bushes look synthetic! ± ",
L"Camouflage : Sans compter que vous même les buissons semblent synthétiques! ± ",
};
STR16 NewInvMessage[] =
{
L"Ne peut pas le baluchon de collecte actuellement",
L"Aucun endroit pour mettre le baluchon",
L"Baluchon non trouvé",
L"La tirette fonctionne seulement dans le combat",
L"Ne peut pas se déplacer alors que la tirette de baluchon active",
};
#endif //FRENCH
+24 -4
View File
@@ -739,7 +739,7 @@ STR16 gzMercSkillText[] =
L"Dieb",
L"Kampfsport",
L"Messer",
L"Dach-Treffer-Bonus",
L"Scharfschütze",
L"Getarnt",
L"Getarnt (Stadt)",
L"Getarnt (Wüste)",
@@ -1370,6 +1370,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Gesundh.: %d/%d\nTank: %d/%d",
L"%s kann %s nicht sehen.", // Cannot see person trying to talk to
L"Attachment removed",
L"Sie können kein weiteres Fahrzeug mehr verwenden, da Sie bereits 2 haben",
};
//Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface.
@@ -1569,6 +1570,7 @@ STR16 pMapInventoryErrorString[] =
L"Während einer Schlacht müssen Sie Gegenstände manuell nehmen.",
L"Während einer Schlacht müssen Sie Gegenstände manuell fallenlassen.",
L"%s ist nicht im Sektor und kann Gegenstand nicht fallen lassen.",
L"Während des Kampfes können Sie die Munitionskiste nicht zum Nachladen verwenden.",
};
STR16 pMapInventoryStrings[] =
@@ -2702,6 +2704,7 @@ STR16 BobbyRFilter[] =
// Used
L"Feuerwfn.",
L"Rüstungen",
L"LBE Ausr.",
L"Sonstiges",
// Armour
@@ -2719,6 +2722,7 @@ STR16 BobbyRFilter[] =
L"Verbandsk.",
L"Taschen",
L"Gesicht G.",
L"LBE Ausr.",
L"Sonstiges",
};
@@ -3187,6 +3191,8 @@ STR16 zSaveLoadText[] =
L"Große Auswahl",
L"Ausgezeichnete Auswahl",
L"Fantastische Auswahl",
L"Neuer Warenbestand arbeitet nicht im 640x480 Bildumfang. Bitte bestimmen Sie die Größe neu und versuchen Sie wieder.",
};
//MapScreen
@@ -3406,6 +3412,9 @@ STR16 gzGIOScreenText[] =
L"Groß",
L"Ausgezeichnet",
L"Fantastisch",
L"Inventar System",
L"Alt",
L"Neu",
};
STR16 pDeliveryLocationStrings[] =
@@ -3796,6 +3805,8 @@ STR16 sRepairsDoneString[] =
L"%s hat die Waffen und Rüstungen aller Teammitglieder repariert",
L"%s hat die aktivierten Gegenstände aller Teammitglieder repariert",
L"%s hat die mitgeführten Gegenstände aller Teammitglieder repariert",
L"%s hat die mitgeführten Gegenstände aller Teammitglieder repariert",
L"%s hat die mitgeführten Gegenstände aller Teammitglieder repariert",
};
STR16 zGioDifConfirmText[]=
@@ -4030,10 +4041,19 @@ STR16 New113MERCMercMailTexts[] =
// INFO: Do not replace the ± characters. They indicate the <B2> (-> Newline) from the edt files
STR16 MissingIMPSkillsDescriptions[] =
{
// Rooftop sniping
L"Dach-Treffer Bonus: Vor Ihnen sind nicht einmal Ameisen sicher. Jedes anvisierte Ziel wird gnadenlos zur Strecke gebracht! ± ",
// Sniper
L"Scharfschütze: Sie haben Augen wie ein Falke. Dadurch können sie sogar auf die Flügel einer Fliege aus hunderten von Metern schießen! ± ",
// Camouflage
L"Getarnt: Neben Ihnen sehen selbst Sträucher künstlich aus! ± ",
L"Tarnung: Neben Ihnen schauen sogar Büsche synthetisch aus! ± ",
};
STR16 NewInvMessage[] =
{
L"Rucksack kann zur Zeit nicht aufgehoben werden",
L"Kein Platz zum Ablegen des Rucksacks",
L"Rucksack nicht gefunden",
L"Reißverschluss funktioniert nur im Kampf",
L"Bewegung nicht möglich, während Reißverschluss des Rucksacks offen ist",
};
#endif //GERMAN
+28 -8
View File
@@ -750,7 +750,7 @@ STR16 gzMercSkillText[] =
L"Furtività",
L"Arti marziali",
L"Coltelli",
L"Bonus per altezza",
L"Sniper",
L"Camuffato",
L"Camuffato (Urban)",
L"Camuffato (Desert)",
@@ -1064,7 +1064,7 @@ STR16 sKeyDescriptionStrings[2] =
//The headers used to describe various weapon statistics.
INT16 gWeaponStatsDesc[][ 14 ] =
CHAR16 gWeaponStatsDesc[][ 14 ] =
{
L"Peso (%s):",
L"Stato:",
@@ -1085,7 +1085,7 @@ INT16 gWeaponStatsDesc[][ 14 ] =
//The headers used for the merc's money.
INT16 gMoneyStatsDesc[][ 13 ] =
CHAR16 gMoneyStatsDesc[][ 13 ] =
{
L"Ammontare",
L"Rimanenti:", //this is the overall balance
@@ -1123,12 +1123,12 @@ STR16 gzMoneyAmounts[6] =
};
// short words meaning "Advantages" for "Pros" and "Disadvantages" for "Cons."
INT16 gzProsLabel[10] =
CHAR16 gzProsLabel[10] =
{
L"Vant.:",
};
INT16 gzConsLabel[10] =
CHAR16 gzConsLabel[10] =
{
L"Svant.:",
};
@@ -1392,6 +1392,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Salute: %d/%d\nCarburante: %d/%d",
L"%s non riesce a vedere %s.", // Cannot see person trying to talk to
L"Attachment removed",
L"Non può guadagnare un altro veicolo poichè già avete 2",
};
//Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface.
@@ -1602,6 +1603,7 @@ STR16 pMapInventoryErrorString[] =
L"Durante il combattimento, dovrete raccogliere gli oggetti manualmente.",
L"Durante il combattimento, dovrete rilasciare gli oggetti manualmente.",
L"%s non si trova nel settore per rilasciare quell'oggetto.",
L"Durante il combattimento, non potete ricaricare con una cassa del ammo.",
};
STR16 pMapInventoryStrings[] =
@@ -2826,6 +2828,7 @@ STR16 BobbyRFilter[] =
// Used
L"Guns",
L"Armor",
L"LBE Gear",
L"Misc",
// Armour
@@ -2843,6 +2846,7 @@ STR16 BobbyRFilter[] =
L"Med. Kits",
L"Kits",
L"Face Items",
L"LBE Gear",
L"Misc.",
};
@@ -3365,6 +3369,8 @@ STR16 zSaveLoadText[] =
L"Great Selection",
L"Excellent Selection",
L"Awesome Selection",
L"New Inventory does not work in 640x480 screen size. Please resize and try again.",
};
@@ -3583,6 +3589,9 @@ STR16 gzGIOScreenText[] =
L"Excellent",
L"Awesome",
L"INSANE",
L"Inventory System",
L"Old",
L"New",
};
STR16 pDeliveryLocationStrings[] =
@@ -3975,6 +3984,8 @@ STR16 sRepairsDoneString[] =
L"%s ha finito di riparare le armi e i giubbotti antiproiettile di tutti",
L"%s ha finito di riparare gli oggetti dell'equipaggiamento di tutti",
L"%s ha finito di riparare gli oggetti trasportati di tutti",
L"%s ha finito di riparare gli oggetti trasportati di tutti",
L"%s ha finito di riparare gli oggetti trasportati di tutti",
};
STR16 zGioDifConfirmText[]=
@@ -4222,10 +4233,19 @@ STR16 New113MERCMercMailTexts[] =
// INFO: Do not replace the ± characters. They indicate the <B2> (-> Newline) from the edt files
STR16 MissingIMPSkillsDescriptions[] =
{
// Rooftop sniping
L"Rooftop Sniping: Not even ants are on the save side. Each target is mercilessly tracked down! ± ",
// Sniper
L"Sniper: Occhi di un hawk, potete sparare le ale da un mosca ad cento yarde! ± ",
// Camouflage
L"Camouflage: Besides you even bushes look synthetic! ± ",
L"Camuffamento: Oltre voi persino i cespugli sembrano sintetici! ± ",
};
STR16 NewInvMessage[] =
{
L"Non può il fagotto della raccolta attualmente",
L"Nessun posto per mettere fagotto",
L"Fagotto non trovato",
L"La chiusura lampo funziona soltanto nel combattimento",
L"Non può muoversi mentre la chiusura lampo del fagotto attiva",
};
#endif //ITALIAN
+71
View File
@@ -0,0 +1,71 @@
#ifdef PRECOMPILEDHEADERS
#include "Utils All.h"
#include "_Ja25Dutchtext.h"
#else
#include "Language Defines.h"
#ifdef DUTCH
#include "text.h"
#include "Fileman.h"
#endif
#endif
#ifdef DUTCH
// VERY TRUNCATED FILE COPIED FROM JA2.5 FOR ITS FEATURES FOR JA2 GOLD
STR16 zNewTacticalMessages[]=
{
L"Range to target: %d tiles, Brightness: %d/%d",
L"Attaching the transmitter to your laptop computer.",
L"You cannot afford to hire %s",
L"For a limited time, the above fee covers the cost of the entire mission and includes the equipment listed below.",
L"Hire %s now and take advantage of our unprecedented 'one fee covers all' pricing. Also included in this unbelievable offer is the mercenary's personal equipment at no charge.",
L"Fee",
L"There is someone else in the sector...",
L"Gun Range: %d tiles, Chance to hit: %d percent",
L"Display Cover",
L"Line of Sight",
L"New Recruits cannot arrive there.",
L"Since your laptop has no transmitter, you won't be able to hire new team members. Perhaps this would be a good time to load a saved game or start over!",
L"%s hears the sound of crumpling metal coming from underneath Jerry's body. It sounds disturbingly like your laptop antenna being crushed.", //the %s is the name of a merc. @@@ Modified
L"After scanning the note left behind by Deputy Commander Morris, %s senses an oppurtinity. The note contains the coordinates for launching missiles against different towns in Arulco. It also gives the coodinates of the origin - the missile facility.",
L"Noticing the control panel, %s figures the numbers can be reveresed, so that the missile might destroy this very facility. %s needs to find an escape route. The elevator appears to offer the fastest solution...",
L"This is an IRON MAN game and you cannot save when enemies are around.", // @@@ new text
L"(Cannot save during combat)", //@@@@ new text
L"The current campaign name is greater than 30 characters.", // @@@ new text
L"The current campaign cannot be found.", // @@@ new text
L"Campaign: Default ( %S )", // @@@ new text
L"Campaign: %S", // @@@ new text
L"You have selected the campaign %S. This campaign is a player-modified version of the original Unfinished Business campaign. Are you sure you wish to play the %S campaign?", // @@@ new text
L"In order to use the editor, please select a campaign other than the default.", ///@@new
};
//these strings match up with the defines in IMP Skill trait.cpp
STR16 gzIMPSkillTraitsText[]=
{
L"Lock picking",
L"Hand to hand combat",
L"Electronics",
L"Night operations",
L"Throwing",
L"Teaching",
L"Heavy Weapons",
L"Auto Weapons",
L"Stealth",
L"Ambidextrous",
L"Knifing",
L"Sniper",
L"Camouflage",
L"Martial Arts",
L"None",
L"I.M.P. Specialties",
};
//@@@: New string as of March 3, 2000.
STR16 gzIronManModeWarningText[]=
{
L"You have chosen IRON MAN mode. This setting makes the game considerably more challenging as you will not be able to save your game when in a sector occupied by enemies. This setting will affect the entire course of the game. Are you sure want to play in IRON MAN mode?",
};
#endif
+43
View File
@@ -0,0 +1,43 @@
#ifndef _JA25ENGLISHTEXT__H_
#define _JA25ENGLISHTEXT__H_
enum
{
TCTL_MSG__RANGE_TO_TARGET,
TCTL_MSG__ATTACH_TRANSMITTER_TO_LAPTOP,
TACT_MSG__CANNOT_AFFORD_MERC,
TACT_MSG__AIMMEMBER_FEE_TEXT,
TACT_MSG__AIMMEMBER_ONE_TIME_FEE,
TACT_MSG__FEE,
TACT_MSG__SOMEONE_ELSE_IN_SECTOR,
TCTL_MSG__GUN_RANGE_AND_CTH,
TCTL_MSG__DISPLAY_COVER,
TCTL_MSG__LOS,
TCTL_MSG__INVALID_DROPOFF_SECTOR,
TCTL_MSG__PLAYER_LOST_SHOULD_RESTART,
TCTL_MSG__JERRY_BREAKIN_LAPTOP_ANTENA,
TCTL_MSG__END_GAME_POPUP_TXT_1,
TCTL_MSG__END_GAME_POPUP_TXT_2,
TCTL_MSG__IRON_MAN_CANT_SAVE_NOW,
TCTL_MSG__CANNOT_SAVE_DURING_COMBAT,
TCTL_MSG__CAMPAIGN_NAME_TOO_LARGE,
TCTL_MSG__CAMPAIGN_DOESN_T_EXIST,
TCTL_MSG__DEFAULT_CAMPAIGN_LABEL,
TCTL_MSG__CAMPAIGN_LABEL,
TCTL_MSG__NEW_CAMPAIGN_CONFIRM,
TCTL_MSG__CANT_EDIT_DEFAULT,
};
extern STR16 zNewTacticalMessages[];
extern STR16 gzIMPSkillTraitsText[];
enum
{
IMM__IRON_MAN_MODE_WARNING_TEXT,
};
extern STR16 gzIronManModeWarningText[];
#endif
+1 -1
View File
@@ -54,7 +54,7 @@ STR16 gzIMPSkillTraitsText[]=
L"Stealth",
L"Ambidextrous",
L"Knifing",
L"Rooftop Sniping",
L"Sniper",
L"Camouflage",
L"Martial Arts",
+1
View File
@@ -12,6 +12,7 @@ enum
TACT_MSG__FEE,
TACT_MSG__SOMEONE_ELSE_IN_SECTOR,
TCTL_MSG__GUN_RANGE_AND_CTH,
//TCTL_MSG__RANGE_TO_TARGET_AND_GUN_RANGE, // WANNE: Not used
TCTL_MSG__DISPLAY_COVER,
TCTL_MSG__LOS,
TCTL_MSG__INVALID_DROPOFF_SECTOR,
+71
View File
@@ -0,0 +1,71 @@
#ifdef PRECOMPILEDHEADERS
#include "Utils All.h"
#include "_Ja25Frenchtext.h"
#else
#include "Language Defines.h"
#ifdef FRENCH
#include "text.h"
#include "Fileman.h"
#endif
#endif
#ifdef FRENCH
// VERY TRUNCATED FILE COPIED FROM JA2.5 FOR ITS FEATURES FOR JA2 GOLD
STR16 zNewTacticalMessages[]=
{
L"Range to target: %d tiles, Brightness: %d/%d",
L"Attaching the transmitter to your laptop computer.",
L"You cannot afford to hire %s",
L"For a limited time, the above fee covers the cost of the entire mission and includes the equipment listed below.",
L"Hire %s now and take advantage of our unprecedented 'one fee covers all' pricing. Also included in this unbelievable offer is the mercenary's personal equipment at no charge.",
L"Fee",
L"There is someone else in the sector...",
L"Gun Range: %d tiles, Chance to hit: %d percent",
L"Display Cover",
L"Line of Sight",
L"New Recruits cannot arrive there.",
L"Since your laptop has no transmitter, you won't be able to hire new team members. Perhaps this would be a good time to load a saved game or start over!",
L"%s hears the sound of crumpling metal coming from underneath Jerry's body. It sounds disturbingly like your laptop antenna being crushed.", //the %s is the name of a merc. @@@ Modified
L"After scanning the note left behind by Deputy Commander Morris, %s senses an oppurtinity. The note contains the coordinates for launching missiles against different towns in Arulco. It also gives the coodinates of the origin - the missile facility.",
L"Noticing the control panel, %s figures the numbers can be reveresed, so that the missile might destroy this very facility. %s needs to find an escape route. The elevator appears to offer the fastest solution...",
L"This is an IRON MAN game and you cannot save when enemies are around.", // @@@ new text
L"(Cannot save during combat)", //@@@@ new text
L"The current campaign name is greater than 30 characters.", // @@@ new text
L"The current campaign cannot be found.", // @@@ new text
L"Campaign: Default ( %S )", // @@@ new text
L"Campaign: %S", // @@@ new text
L"You have selected the campaign %S. This campaign is a player-modified version of the original Unfinished Business campaign. Are you sure you wish to play the %S campaign?", // @@@ new text
L"In order to use the editor, please select a campaign other than the default.", ///@@new
};
//these strings match up with the defines in IMP Skill trait.cpp
STR16 gzIMPSkillTraitsText[]=
{
L"Lock picking",
L"Hand to hand combat",
L"Electronics",
L"Night operations",
L"Throwing",
L"Teaching",
L"Heavy Weapons",
L"Auto Weapons",
L"Stealth",
L"Ambidextrous",
L"Knifing",
L"Sniper",
L"Camouflage",
L"Martial Arts",
L"None",
L"I.M.P. Specialties",
};
//@@@: New string as of March 3, 2000.
STR16 gzIronManModeWarningText[]=
{
L"You have chosen IRON MAN mode. This setting makes the game considerably more challenging as you will not be able to save your game when in a sector occupied by enemies. This setting will affect the entire course of the game. Are you sure want to play in IRON MAN mode?",
};
#endif
+43
View File
@@ -0,0 +1,43 @@
#ifndef _JA25ENGLISHTEXT__H_
#define _JA25ENGLISHTEXT__H_
enum
{
TCTL_MSG__RANGE_TO_TARGET,
TCTL_MSG__ATTACH_TRANSMITTER_TO_LAPTOP,
TACT_MSG__CANNOT_AFFORD_MERC,
TACT_MSG__AIMMEMBER_FEE_TEXT,
TACT_MSG__AIMMEMBER_ONE_TIME_FEE,
TACT_MSG__FEE,
TACT_MSG__SOMEONE_ELSE_IN_SECTOR,
TCTL_MSG__GUN_RANGE_AND_CTH,
TCTL_MSG__DISPLAY_COVER,
TCTL_MSG__LOS,
TCTL_MSG__INVALID_DROPOFF_SECTOR,
TCTL_MSG__PLAYER_LOST_SHOULD_RESTART,
TCTL_MSG__JERRY_BREAKIN_LAPTOP_ANTENA,
TCTL_MSG__END_GAME_POPUP_TXT_1,
TCTL_MSG__END_GAME_POPUP_TXT_2,
TCTL_MSG__IRON_MAN_CANT_SAVE_NOW,
TCTL_MSG__CANNOT_SAVE_DURING_COMBAT,
TCTL_MSG__CAMPAIGN_NAME_TOO_LARGE,
TCTL_MSG__CAMPAIGN_DOESN_T_EXIST,
TCTL_MSG__DEFAULT_CAMPAIGN_LABEL,
TCTL_MSG__CAMPAIGN_LABEL,
TCTL_MSG__NEW_CAMPAIGN_CONFIRM,
TCTL_MSG__CANT_EDIT_DEFAULT,
};
extern STR16 zNewTacticalMessages[];
extern STR16 gzIMPSkillTraitsText[];
enum
{
IMM__IRON_MAN_MODE_WARNING_TEXT,
};
extern STR16 gzIronManModeWarningText[];
#endif
+1 -1
View File
@@ -1,6 +1,6 @@
#ifdef PRECOMPILEDHEADERS
#include "Utils All.h"
#include "_Ja25EnglishText.h"
#include "_Ja25GermanText.h"
#else
#include "Language Defines.h"
#include "text.h"
+1
View File
@@ -31,6 +31,7 @@ enum
};
extern STR16 zNewTacticalMessages[];
extern STR16 gzIMPSkillTraitsText[];
enum
{
+71
View File
@@ -0,0 +1,71 @@
#ifdef PRECOMPILEDHEADERS
#include "Utils All.h"
#include "_Ja25Italiantext.h"
#else
#include "Language Defines.h"
#ifdef ITALIAN
#include "text.h"
#include "Fileman.h"
#endif
#endif
#ifdef ITALIAN
// VERY TRUNCATED FILE COPIED FROM JA2.5 FOR ITS FEATURES FOR JA2 GOLD
STR16 zNewTacticalMessages[]=
{
L"Range to target: %d tiles, Brightness: %d/%d",
L"Attaching the transmitter to your laptop computer.",
L"You cannot afford to hire %s",
L"For a limited time, the above fee covers the cost of the entire mission and includes the equipment listed below.",
L"Hire %s now and take advantage of our unprecedented 'one fee covers all' pricing. Also included in this unbelievable offer is the mercenary's personal equipment at no charge.",
L"Fee",
L"There is someone else in the sector...",
L"Gun Range: %d tiles, Chance to hit: %d percent",
L"Display Cover",
L"Line of Sight",
L"New Recruits cannot arrive there.",
L"Since your laptop has no transmitter, you won't be able to hire new team members. Perhaps this would be a good time to load a saved game or start over!",
L"%s hears the sound of crumpling metal coming from underneath Jerry's body. It sounds disturbingly like your laptop antenna being crushed.", //the %s is the name of a merc. @@@ Modified
L"After scanning the note left behind by Deputy Commander Morris, %s senses an oppurtinity. The note contains the coordinates for launching missiles against different towns in Arulco. It also gives the coodinates of the origin - the missile facility.",
L"Noticing the control panel, %s figures the numbers can be reveresed, so that the missile might destroy this very facility. %s needs to find an escape route. The elevator appears to offer the fastest solution...",
L"This is an IRON MAN game and you cannot save when enemies are around.", // @@@ new text
L"(Cannot save during combat)", //@@@@ new text
L"The current campaign name is greater than 30 characters.", // @@@ new text
L"The current campaign cannot be found.", // @@@ new text
L"Campaign: Default ( %S )", // @@@ new text
L"Campaign: %S", // @@@ new text
L"You have selected the campaign %S. This campaign is a player-modified version of the original Unfinished Business campaign. Are you sure you wish to play the %S campaign?", // @@@ new text
L"In order to use the editor, please select a campaign other than the default.", ///@@new
};
//these strings match up with the defines in IMP Skill trait.cpp
STR16 gzIMPSkillTraitsText[]=
{
L"Lock picking",
L"Hand to hand combat",
L"Electronics",
L"Night operations",
L"Throwing",
L"Teaching",
L"Heavy Weapons",
L"Auto Weapons",
L"Stealth",
L"Ambidextrous",
L"Knifing",
L"Sniper",
L"Camouflage",
L"Martial Arts",
L"None",
L"I.M.P. Specialties",
};
//@@@: New string as of March 3, 2000.
STR16 gzIronManModeWarningText[]=
{
L"You have chosen IRON MAN mode. This setting makes the game considerably more challenging as you will not be able to save your game when in a sector occupied by enemies. This setting will affect the entire course of the game. Are you sure want to play in IRON MAN mode?",
};
#endif
+43
View File
@@ -0,0 +1,43 @@
#ifndef _JA25ENGLISHTEXT__H_
#define _JA25ENGLISHTEXT__H_
enum
{
TCTL_MSG__RANGE_TO_TARGET,
TCTL_MSG__ATTACH_TRANSMITTER_TO_LAPTOP,
TACT_MSG__CANNOT_AFFORD_MERC,
TACT_MSG__AIMMEMBER_FEE_TEXT,
TACT_MSG__AIMMEMBER_ONE_TIME_FEE,
TACT_MSG__FEE,
TACT_MSG__SOMEONE_ELSE_IN_SECTOR,
TCTL_MSG__GUN_RANGE_AND_CTH,
TCTL_MSG__DISPLAY_COVER,
TCTL_MSG__LOS,
TCTL_MSG__INVALID_DROPOFF_SECTOR,
TCTL_MSG__PLAYER_LOST_SHOULD_RESTART,
TCTL_MSG__JERRY_BREAKIN_LAPTOP_ANTENA,
TCTL_MSG__END_GAME_POPUP_TXT_1,
TCTL_MSG__END_GAME_POPUP_TXT_2,
TCTL_MSG__IRON_MAN_CANT_SAVE_NOW,
TCTL_MSG__CANNOT_SAVE_DURING_COMBAT,
TCTL_MSG__CAMPAIGN_NAME_TOO_LARGE,
TCTL_MSG__CAMPAIGN_DOESN_T_EXIST,
TCTL_MSG__DEFAULT_CAMPAIGN_LABEL,
TCTL_MSG__CAMPAIGN_LABEL,
TCTL_MSG__NEW_CAMPAIGN_CONFIRM,
TCTL_MSG__CANT_EDIT_DEFAULT,
};
extern STR16 zNewTacticalMessages[];
extern STR16 gzIMPSkillTraitsText[];
enum
{
IMM__IRON_MAN_MODE_WARNING_TEXT,
};
extern STR16 gzIronManModeWarningText[];
#endif
+71
View File
@@ -0,0 +1,71 @@
#ifdef PRECOMPILEDHEADERS
#include "Utils All.h"
#include "_Ja25Polishtext.h"
#else
#include "Language Defines.h"
#ifdef POLISH
#include "text.h"
#include "Fileman.h"
#endif
#endif
#ifdef POLISH
// VERY TRUNCATED FILE COPIED FROM JA2.5 FOR ITS FEATURES FOR JA2 GOLD
STR16 zNewTacticalMessages[]=
{
L"Range to target: %d tiles, Brightness: %d/%d",
L"Attaching the transmitter to your laptop computer.",
L"You cannot afford to hire %s",
L"For a limited time, the above fee covers the cost of the entire mission and includes the equipment listed below.",
L"Hire %s now and take advantage of our unprecedented 'one fee covers all' pricing. Also included in this unbelievable offer is the mercenary's personal equipment at no charge.",
L"Fee",
L"There is someone else in the sector...",
L"Gun Range: %d tiles, Chance to hit: %d percent",
L"Display Cover",
L"Line of Sight",
L"New Recruits cannot arrive there.",
L"Since your laptop has no transmitter, you won't be able to hire new team members. Perhaps this would be a good time to load a saved game or start over!",
L"%s hears the sound of crumpling metal coming from underneath Jerry's body. It sounds disturbingly like your laptop antenna being crushed.", //the %s is the name of a merc. @@@ Modified
L"After scanning the note left behind by Deputy Commander Morris, %s senses an oppurtinity. The note contains the coordinates for launching missiles against different towns in Arulco. It also gives the coodinates of the origin - the missile facility.",
L"Noticing the control panel, %s figures the numbers can be reveresed, so that the missile might destroy this very facility. %s needs to find an escape route. The elevator appears to offer the fastest solution...",
L"This is an IRON MAN game and you cannot save when enemies are around.", // @@@ new text
L"(Cannot save during combat)", //@@@@ new text
L"The current campaign name is greater than 30 characters.", // @@@ new text
L"The current campaign cannot be found.", // @@@ new text
L"Campaign: Default ( %S )", // @@@ new text
L"Campaign: %S", // @@@ new text
L"You have selected the campaign %S. This campaign is a player-modified version of the original Unfinished Business campaign. Are you sure you wish to play the %S campaign?", // @@@ new text
L"In order to use the editor, please select a campaign other than the default.", ///@@new
};
//these strings match up with the defines in IMP Skill trait.cpp
STR16 gzIMPSkillTraitsText[]=
{
L"Lock picking",
L"Hand to hand combat",
L"Electronics",
L"Night operations",
L"Throwing",
L"Teaching",
L"Heavy Weapons",
L"Auto Weapons",
L"Stealth",
L"Ambidextrous",
L"Knifing",
L"Sniper",
L"Camouflage",
L"Martial Arts",
L"None",
L"I.M.P. Specialties",
};
//@@@: New string as of March 3, 2000.
STR16 gzIronManModeWarningText[]=
{
L"You have chosen IRON MAN mode. This setting makes the game considerably more challenging as you will not be able to save your game when in a sector occupied by enemies. This setting will affect the entire course of the game. Are you sure want to play in IRON MAN mode?",
};
#endif
+43
View File
@@ -0,0 +1,43 @@
#ifndef _JA25ENGLISHTEXT__H_
#define _JA25ENGLISHTEXT__H_
enum
{
TCTL_MSG__RANGE_TO_TARGET,
TCTL_MSG__ATTACH_TRANSMITTER_TO_LAPTOP,
TACT_MSG__CANNOT_AFFORD_MERC,
TACT_MSG__AIMMEMBER_FEE_TEXT,
TACT_MSG__AIMMEMBER_ONE_TIME_FEE,
TACT_MSG__FEE,
TACT_MSG__SOMEONE_ELSE_IN_SECTOR,
TCTL_MSG__GUN_RANGE_AND_CTH,
TCTL_MSG__DISPLAY_COVER,
TCTL_MSG__LOS,
TCTL_MSG__INVALID_DROPOFF_SECTOR,
TCTL_MSG__PLAYER_LOST_SHOULD_RESTART,
TCTL_MSG__JERRY_BREAKIN_LAPTOP_ANTENA,
TCTL_MSG__END_GAME_POPUP_TXT_1,
TCTL_MSG__END_GAME_POPUP_TXT_2,
TCTL_MSG__IRON_MAN_CANT_SAVE_NOW,
TCTL_MSG__CANNOT_SAVE_DURING_COMBAT,
TCTL_MSG__CAMPAIGN_NAME_TOO_LARGE,
TCTL_MSG__CAMPAIGN_DOESN_T_EXIST,
TCTL_MSG__DEFAULT_CAMPAIGN_LABEL,
TCTL_MSG__CAMPAIGN_LABEL,
TCTL_MSG__NEW_CAMPAIGN_CONFIRM,
TCTL_MSG__CANT_EDIT_DEFAULT,
};
extern STR16 zNewTacticalMessages[];
extern STR16 gzIMPSkillTraitsText[];
enum
{
IMM__IRON_MAN_MODE_WARNING_TEXT,
};
extern STR16 gzIronManModeWarningText[];
#endif
+71
View File
@@ -0,0 +1,71 @@
#ifdef PRECOMPILEDHEADERS
#include "Utils All.h"
#include "_Ja25Taiwanesetext.h"
#else
#include "Language Defines.h"
#ifdef TAIWANESE
#include "text.h"
#include "Fileman.h"
#endif
#endif
#ifdef TAIWANESE
// VERY TRUNCATED FILE COPIED FROM JA2.5 FOR ITS FEATURES FOR JA2 GOLD
STR16 zNewTacticalMessages[]=
{
L"Range to target: %d tiles, Brightness: %d/%d",
L"Attaching the transmitter to your laptop computer.",
L"You cannot afford to hire %s",
L"For a limited time, the above fee covers the cost of the entire mission and includes the equipment listed below.",
L"Hire %s now and take advantage of our unprecedented 'one fee covers all' pricing. Also included in this unbelievable offer is the mercenary's personal equipment at no charge.",
L"Fee",
L"There is someone else in the sector...",
L"Gun Range: %d tiles, Chance to hit: %d percent",
L"Display Cover",
L"Line of Sight",
L"New Recruits cannot arrive there.",
L"Since your laptop has no transmitter, you won't be able to hire new team members. Perhaps this would be a good time to load a saved game or start over!",
L"%s hears the sound of crumpling metal coming from underneath Jerry's body. It sounds disturbingly like your laptop antenna being crushed.", //the %s is the name of a merc. @@@ Modified
L"After scanning the note left behind by Deputy Commander Morris, %s senses an oppurtinity. The note contains the coordinates for launching missiles against different towns in Arulco. It also gives the coodinates of the origin - the missile facility.",
L"Noticing the control panel, %s figures the numbers can be reveresed, so that the missile might destroy this very facility. %s needs to find an escape route. The elevator appears to offer the fastest solution...",
L"This is an IRON MAN game and you cannot save when enemies are around.", // @@@ new text
L"(Cannot save during combat)", //@@@@ new text
L"The current campaign name is greater than 30 characters.", // @@@ new text
L"The current campaign cannot be found.", // @@@ new text
L"Campaign: Default ( %S )", // @@@ new text
L"Campaign: %S", // @@@ new text
L"You have selected the campaign %S. This campaign is a player-modified version of the original Unfinished Business campaign. Are you sure you wish to play the %S campaign?", // @@@ new text
L"In order to use the editor, please select a campaign other than the default.", ///@@new
};
//these strings match up with the defines in IMP Skill trait.cpp
STR16 gzIMPSkillTraitsText[]=
{
L"Lock picking",
L"Hand to hand combat",
L"Electronics",
L"Night operations",
L"Throwing",
L"Teaching",
L"Heavy Weapons",
L"Auto Weapons",
L"Stealth",
L"Ambidextrous",
L"Knifing",
L"Sniper",
L"Camouflage",
L"Martial Arts",
L"None",
L"I.M.P. Specialties",
};
//@@@: New string as of March 3, 2000.
STR16 gzIronManModeWarningText[]=
{
L"You have chosen IRON MAN mode. This setting makes the game considerably more challenging as you will not be able to save your game when in a sector occupied by enemies. This setting will affect the entire course of the game. Are you sure want to play in IRON MAN mode?",
};
#endif
+43
View File
@@ -0,0 +1,43 @@
#ifndef _JA25ENGLISHTEXT__H_
#define _JA25ENGLISHTEXT__H_
enum
{
TCTL_MSG__RANGE_TO_TARGET,
TCTL_MSG__ATTACH_TRANSMITTER_TO_LAPTOP,
TACT_MSG__CANNOT_AFFORD_MERC,
TACT_MSG__AIMMEMBER_FEE_TEXT,
TACT_MSG__AIMMEMBER_ONE_TIME_FEE,
TACT_MSG__FEE,
TACT_MSG__SOMEONE_ELSE_IN_SECTOR,
TCTL_MSG__GUN_RANGE_AND_CTH,
TCTL_MSG__DISPLAY_COVER,
TCTL_MSG__LOS,
TCTL_MSG__INVALID_DROPOFF_SECTOR,
TCTL_MSG__PLAYER_LOST_SHOULD_RESTART,
TCTL_MSG__JERRY_BREAKIN_LAPTOP_ANTENA,
TCTL_MSG__END_GAME_POPUP_TXT_1,
TCTL_MSG__END_GAME_POPUP_TXT_2,
TCTL_MSG__IRON_MAN_CANT_SAVE_NOW,
TCTL_MSG__CANNOT_SAVE_DURING_COMBAT,
TCTL_MSG__CAMPAIGN_NAME_TOO_LARGE,
TCTL_MSG__CAMPAIGN_DOESN_T_EXIST,
TCTL_MSG__DEFAULT_CAMPAIGN_LABEL,
TCTL_MSG__CAMPAIGN_LABEL,
TCTL_MSG__NEW_CAMPAIGN_CONFIRM,
TCTL_MSG__CANT_EDIT_DEFAULT,
};
extern STR16 zNewTacticalMessages[];
extern STR16 gzIMPSkillTraitsText[];
enum
{
IMM__IRON_MAN_MODE_WARNING_TEXT,
};
extern STR16 gzIronManModeWarningText[];
#endif
+31 -7
View File
@@ -751,7 +751,7 @@ STR16 gzMercSkillText[] =
L"Kradzie¿e",
L"Sztuki walki",
L"Broñ bia³a",
L"Snajper",
L"Sniper",
L"Kamufla¿",
L"Kamufla¿ (Urban)",
L"Kamufla¿ (Desert)",
@@ -1065,7 +1065,7 @@ STR16 sKeyDescriptionStrings[2] =
//The headers used to describe various weapon statistics.
INT16 gWeaponStatsDesc[][ 14 ] =
CHAR16 gWeaponStatsDesc[][ 14 ] =
{
L"Waga (%s):", // change kg to another weight unit if your standard is not kilograms, and TELL SIR-TECH!
L"Stan:",
@@ -1086,7 +1086,7 @@ INT16 gWeaponStatsDesc[][ 14 ] =
//The headers used for the merc's money.
INT16 gMoneyStatsDesc[][ 13 ] =
CHAR16 gMoneyStatsDesc[][ 13 ] =
{
L"Kwota",
L"Pozosta³o:", //this is the overall balance
@@ -1124,12 +1124,12 @@ STR16 gzMoneyAmounts[6] =
};
// short words meaning "Advantages" for "Pros" and "Disadvantages" for "Cons."
INT16 gzProsLabel[10] =
CHAR16 gzProsLabel[10] =
{
L"Zalety:",
};
INT16 gzConsLabel[10] =
CHAR16 gzConsLabel[10] =
{
L"Wady:",
};
@@ -1392,6 +1392,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Stan: %d/%d\nPaliwo: %d/%d",
L"%s nie widzi - %s.", // Cannot see person trying to talk to
L"Attachment removed",
L"Can not gain another vehicle as you already have 2",
};
//Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface.
@@ -1602,6 +1603,7 @@ STR16 pMapInventoryErrorString[] =
L"Podczas walki nie mo¿na korzystaæ z tego panelu.",
L"Podczas walki nie mo¿na korzystaæ z tego panelu.",
L"%s nie mo¿e tu zostawiæ tego przedmiotu, gdy¿ nie jest w tym sektorze.",
L"During combat, you can't reload with an ammo crate.",
};
STR16 pMapInventoryStrings[] =
@@ -2825,6 +2827,7 @@ STR16 BobbyRFilter[] =
// Used
L"Guns",
L"Armor",
L"LBE Gear",
L"Misc",
// Armour
@@ -2842,6 +2845,7 @@ STR16 BobbyRFilter[] =
L"Med. Kits",
L"Kits",
L"Face Items",
L"LBE Gear",
L"Misc.",
};
@@ -3366,6 +3370,7 @@ STR16 zSaveLoadText[] =
L"Excellent Selection",
L"Awesome Selection",
L"New Inventory does not work in 640x480 screen size. Please resize and try again.",
};
@@ -3584,6 +3589,9 @@ STR16 gzGIOScreenText[] =
L"Great",
L"Excellent",
L"Awesome",
L"Inventory System",
L"Old",
L"New",
};
STR16 pDeliveryLocationStrings[] =
@@ -3976,6 +3984,8 @@ STR16 sRepairsDoneString[] =
L"%s skoñczy³(a) naprawiaæ broñ i ochraniacze wszystkich cz³onków oddzia³u",
L"%s skoñczy³(a) naprawiaæ wyposa¿enie wszystkich cz³onków oddzia³u",
L"%s skoñczy³(a) naprawiaæ ekwipunek wszystkich cz³onków oddzia³u",
L"%s skoñczy³(a) naprawiaæ ekwipunek wszystkich cz³onków oddzia³u",
L"%s skoñczy³(a) naprawiaæ ekwipunek wszystkich cz³onków oddzia³u",
};
@@ -4133,6 +4143,11 @@ STR16 gzLateLocalizedString[] =
L"%s fires %d more round than intended!",
};
STR16 gzCWStrings[] =
{
L"Call reinforcements from adjacent sectors?",
};
// WANNE: Tooltips
STR16 gzTooltipStrings[] =
{
@@ -4214,10 +4229,19 @@ STR16 New113MERCMercMailTexts[] =
// INFO: Do not replace the ± characters. They indicate the <B2> (-> Newline) from the edt files
STR16 MissingIMPSkillsDescriptions[] =
{
// Rooftop sniping
L"Rooftop Sniping: Not even ants are on the save side. Each target is mercilessly tracked down! ± ",
// Sniper
L"Sniper: Eyes of a hawk, you can shoot the wings from a fly at a hundred yards! ± ",
// Camouflage
L"Camouflage: Besides you even bushes look synthetic! ± ",
};
STR16 NewInvMessage[] =
{
L"Cannot pickup backpack at this time",
L"No place to put backpack",
L"Backpack not found",
L"Zipper only works in combat",
L"Can not move while backpack zipper active",
};
#endif //POLISH
+24 -4
View File
@@ -763,7 +763,7 @@ STR16 gzMercSkillText[] =
L"Воровство",
L"Боевые искусства",
L"Холодное оружие",
L"Стрельба с крыш",
L"Снайпер",
L"Камуфляж",
L"Камуфляж (Город)",
L"Камуфляж (Пустыня)",
@@ -1404,6 +1404,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Состояние: %d/%d\nТопливо: %d/%d",
L"%s не видит %s.", // Cannot see person trying to talk to
L"Принадлежность отсоединена", //пр
L"Вы не можете содержать еще одну машину, довольствуйтесь уже имеющимися двумя.",
};
//Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface.
@@ -1614,6 +1615,7 @@ STR16 pMapInventoryErrorString[] =
L"Во время боя вам придется подбирать вещи вручную.", //*перефразировать, показывается когда пытаешься со стратегич карты в инвентаре сектора взять предмет
L"Во время боя вам придется выкладывать вещи вручную.",
L"%s вне этого сектора, и не может оставить предмет.",
L"Во время битвы вы не можете заряжать оружие патронами из короба.",
};
STR16 pMapInventoryStrings[] =
@@ -2417,7 +2419,7 @@ STR16 pWebPagesTitles[] =
STR16 pShowBookmarkString[] =
{
L"Подсказка",
L"Щелкните еще раз по кнопке \"Сайты\" для отображения меню сайтов.",
L"Щелкните еще раз по кнопке \"Сайты\" для отображения меню сайтов.",
};
STR16 pLaptopTitles[] =
@@ -2839,6 +2841,7 @@ STR16 BobbyRFilter[] =
// Used
L"Оружие",
L"Броня",
L"Разгр.с-мы",
L"Разное",
// Armour
@@ -2856,6 +2859,7 @@ STR16 BobbyRFilter[] =
L"Аптечки",
L"Наборы",
L"Головные",
L"Разгр.с-мы",
L"Разное",
};
@@ -3379,6 +3383,8 @@ STR16 zSaveLoadText[] =
L"Большой",
L"Огромный",
L"Все, включая эксклюзив",
L"Новый инвентарь, используемый в этом релизе, не работает при разрешении экрана 640х480. Измените разрешение и запустит игру заново.",
};
@@ -3598,6 +3604,9 @@ STR16 gzGIOScreenText[] =
L"Большой",
L"Огромный",
L"Все, включая эксклюзив",
L"Режим инвентаря",
L"Классический",
L"Новый вариант",
};
STR16 pDeliveryLocationStrings[] =
@@ -3990,6 +3999,8 @@ STR16 sRepairsDoneString[] =
L"%s: завершен ремонт всего оружия и брони.",
L"%s: завершен ремонт всей экипировки отряда.",
L"%s: завершен ремонт всех вещей, имеющихся у отряда.",
L"%s: завершен ремонт всех вещей, имеющихся у отряда.",
L"%s: завершен ремонт всех вещей, имеющихся у отряда.",
};
STR16 zGioDifConfirmText[]=
@@ -4231,10 +4242,19 @@ STR16 New113MERCMercMailTexts[] =
// INFO: Do not replace the ± characters. They indicate the <B2> (-> Newline) from the edt files
STR16 MissingIMPSkillsDescriptions[] =
{
// Rooftop sniping
L"Стрельба с крыш: Даже муравьи в опасности. Каджая цель безжалостно отслеживается! ± ",
// Sniper
L"Снайпер: У вас глаза ястреба. В свободное время вы развлекаетесь отстреливая крылышки у мух с расстояния 100 метров! ± ",
// Camouflage
L"Маскировка: На вашем фоне кусты выглядят синтетическими! ± ",
};
STR16 NewInvMessage[] =
{
L"В данный момент поднять рюкзак нельзя.",
L"Вы не можете одновременно носить 2 рюкзака.",
L"Вы потеряли свой рюкзак...",
L"Замок рюкзака работает лишь во время битвы.",
L"Вы не можете передвигаться с открытым рюкзаком.",
};
#endif //RUSSIAN
+374 -110
View File
@@ -11,7 +11,7 @@
#ifdef TAIWANESE
/*
******************************************************************************************************
** IMPORTANT TRANSLATION NOTES **
******************************************************************************************************
@@ -106,13 +106,24 @@ FAST HELP TEXT -- Explains how the syntax of fast help text works.
*/
UINT16 ItemNames[MAXITEMS][80] =
STR16 pCreditsJA2113[] =
{
L"@T,{;JA2 v1.13 Development Team",
L"@T,C144,R134,{;Coding",
L"@T,C144,R134,{;Graphics and Sounds",
L"@};(Various other mods!)",
L"@T,C144,R134,{;Items",
L"@T,C144,R134,{;Other Contributors",
L"@};(All other community members who contributed input and feedback!)",
};
CHAR16 ItemNames[MAXITEMS][80] =
{
L"",
};
UINT16 ShortItemNames[MAXITEMS][80] =
CHAR16 ShortItemNames[MAXITEMS][80] =
{
L"",
};
@@ -122,26 +133,28 @@ UINT16 ShortItemNames[MAXITEMS][80] =
// NATO is the North Atlantic Treaty Organization
// WP is Warsaw Pact
// cal is an abbreviation for calibre
UINT16 AmmoCaliber[][20] =
{
L"0",
L".38 cal",
L"9mm",
L".45 cal",
L".357 cal",
L"12 gauge",
L"CAWS",
L"5.45mm",
L"5.56mm",
L"7.62mm NATO",
L"7.62mm WP",
L"4.7mm",
L"5.7mm",
L"Monster",
L"Rocket",
L"", // dart
L"", // flame
};
CHAR16 AmmoCaliber[MAXITEMS][20];// =
//{
// L"0",
// L".38 cal",
// L"9mm",
// L".45 cal",
// L".357 cal",
// L"12 gauge",
// L"CAWS",
// L"5.45mm",
// L"5.56mm",
// L"7.62mm NATO",
// L"7.62mm WP",
// L"4.7mm",
// L"5.7mm",
// L"Monster",
// L"Rocket",
// L"", // dart
// L"", // flame
// L".50 cal", // barrett
// L"9mm Hvy", // Val silent
//};
// This BobbyRayAmmoCaliber is virtually the same as AmmoCaliber however the bobby version doesnt have as much room for the words.
//
@@ -150,41 +163,44 @@ UINT16 AmmoCaliber[][20] =
// NATO is the North Atlantic Treaty Organization
// WP is Warsaw Pact
// cal is an abbreviation for calibre
UINT16 BobbyRayAmmoCaliber[][20] =
{
L"0",
L".38 cal",
L"9mm",
L".45 cal",
L".357 cal",
L"12 gauge",
L"CAWS",
L"5.45mm",
L"5.56mm",
L"7.62mm N.",
L"7.62mm WP",
L"4.7mm",
L"5.7mm",
L"Monster",
L"Rocket",
L"", // dart
};
CHAR16 BobbyRayAmmoCaliber[MAXITEMS][20] ;//=
//{
// L"0",
// L".38 cal",
// L"9mm",
// L".45 cal",
// L".357 cal",
// L"12 gauge",
// L"CAWS",
// L"5.45mm",
// L"5.56mm",
// L"7.62mm N.",
// L"7.62mm WP",
// L"4.7mm",
// L"5.7mm",
// L"Monster",
// L"Rocket",
// L"dart", // dart
// L"", // flamethrower
// L".50 cal", // barrett
// L"9mm Hvy", // Val silent
//};
UINT16 WeaponType[][30] =
CHAR16 WeaponType[MAXITEMS][30] =
{
L"Other",
L"Pistol",
L"Machine pistol",
L"Submachine gun",
L"MP",
L"SMG",
L"Rifle",
L"Sniper rifle",
L"Assault rifle",
L"Light machine gun",
L"LMG",
L"Shotgun",
};
UINT16 TeamTurnString[][STRING_LENGTH] =
CHAR16 TeamTurnString[][STRING_LENGTH] =
{
L"Player's Turn", // player's turn
L"Opponents' Turn",
@@ -194,7 +210,7 @@ UINT16 TeamTurnString[][STRING_LENGTH] =
// planning turn
};
UINT16 Message[][STRING_LENGTH] =
CHAR16 Message[][STRING_LENGTH] =
{
L"",
@@ -269,7 +285,7 @@ UINT16 Message[][STRING_LENGTH] =
//You cannot use "item(s)" and your "other item" at the same time.
//Ex: You cannot use sun goggles and you gas mask at the same time.
L"You cannot use %s and your %s at the same time.",
L"You cannot use your %s and your %s at the same time.",
L"The item you have in your cursor can be attached to certain items by placing it in one of the four attachment slots.",
L"The item you have in your cursor can be attached to certain items by placing it in one of the four attachment slots. (However in this case, the item is not compatible.)",
@@ -280,7 +296,7 @@ UINT16 Message[][STRING_LENGTH] =
L"This attachment will be permanent. Go ahead with it?",
L"%s feels more energetic!",
L"%s slipped on some marbles!",
L"%s failed to grab the %s!",
L"%s failed to grab the %s from enemy's hand!",
L"%s has repaired the %s",
L"Interrupt for ",
L"Surrender?",
@@ -289,12 +305,19 @@ UINT16 Message[][STRING_LENGTH] =
L"To travel in Skyrider's chopper, you'll have to ASSIGN mercs to VEHICLE/HELICOPTER first.",
L"%s only had enough time to reload ONE gun",
L"Bloodcats' turn",
L"full auto",
L"no full auto",
L"accurate",
L"inaccurate",
L"no semi auto",
L"The enemy has no more items to steal!",
L"The enemy has no item in its hand!",
};
// the names of the towns in the game
STR16 pTownNames[] =
CHAR16 pTownNames[MAX_TOWNS][MAX_TOWN_NAME_LENGHT] =
{
L"",
L"Omerta",
@@ -527,6 +550,8 @@ STR16 pInvPanelTitleStrings[] =
L"Armor", // the armor rating of the merc
L"Weight", // the weight the merc is carrying
L"Camo", // the merc's camouflage rating
L"Camouflage:",
L"Protection:",
};
STR16 pShortAttributeStrings[] =
@@ -603,6 +628,36 @@ STR16 pAssignMenuStrings[] =
L"Cancel", // cancel this menu
};
//lal
STR16 pMilitiaControlMenuStrings[] =
{
L"Attack", // set militia to aggresive
L"Hold Position", // set militia to stationary
L"Retreat", // retreat militia
L"Come to me", // retreat militia
L"Get down", // retreat militia
L"Take cover",
L"All: Attack",
L"All: Hold Position",
L"All: Retreat",
L"All: Come to me",
L"All: Spread out",
L"All: Get down",
L"All: Take cover",
//L"All: Find items",
L"Cancel", // cancel this menu
};
//STR16 pTalkToAllMenuStrings[] =
//{
// L"Attack", // set militia to aggresive
// L"Hold Position", // set militia to stationary
// L"Retreat", // retreat militia
// L"Come to me", // retreat militia
// L"Get down", // retreat militia
// L"Cancel", // cancel this menu
//};
STR16 pRemoveMercStrings[] =
{
L"Remove Merc", // remove dead merc from current team
@@ -698,20 +753,23 @@ STR16 gzMercSkillText[] =
{
L"No Skill",
L"Lock picking",
L"Hand to hand",
L"Hand to hand combat", //JA25: modified
L"Electronics",
L"Night ops",
L"Night operations", //JA25: modified
L"Throwing",
L"Teaching",
L"Heavy Weapons",
L"Auto Weapons",
L"Stealthy",
L"Stealth",
L"Ambidextrous",
L"Thief",
L"Martial Arts",
L"Knifing",
L"On Roof Bonus to hit",
L"Camouflaged",
L"Sniper",
L"Camouflage", //JA25: modified
L"Camouflage (Urban)",
L"Camouflage (Desert)",
L"Camouflage (Snow)",
L"(Expert)",
};
@@ -1021,22 +1079,30 @@ STR16 sKeyDescriptionStrings[2] =
//The headers used to describe various weapon statistics.
INT16 gWeaponStatsDesc[][ 14 ] =
CHAR16 gWeaponStatsDesc[][ 14 ] =
{
L"Weight (%s):",
L"Status:",
L"Amount:", // Number of bullets left in a magazine
L"Amount:", // Number of bullets left in a magazine
L"Rng:", // Range
L"Dam:", // Damage
L"AP:", // abbreviation for Action Points
L"",
L"=",
L"=",
//Lal: additional strings for tooltips
L"Accuracy:", //9
L"Range:", //10
L"Damage:", //11
L"Weight:", //12
L"Stun Damage:",//13
};
//The headers used for the merc's money.
INT16 gMoneyStatsDesc[][ 13 ] =
CHAR16 gMoneyStatsDesc[][ 13 ] =
{
L"Amount",
L"Remaining:", //this is the overall balance
@@ -1052,7 +1118,7 @@ INT16 gMoneyStatsDesc[][ 13 ] =
//The health of various creatures, enemies, characters in the game. The numbers following each are for comment
//only, but represent the precentage of points remaining.
UINT16 zHealthStr[][13] =
CHAR16 zHealthStr[][13] =
{
L"DYING", // >= 0
L"CRITICAL", // >= 15
@@ -1074,18 +1140,18 @@ STR16 gzMoneyAmounts[6] =
};
// short words meaning "Advantages" for "Pros" and "Disadvantages" for "Cons."
INT16 gzProsLabel[10] =
CHAR16 gzProsLabel[10] =
{
L"Pros:",
};
INT16 gzConsLabel[10] =
CHAR16 gzConsLabel[10] =
{
L"Cons:",
};
//Conversation options a player has when encountering an NPC
UINT16 zTalkMenuStrings[6][ SMALL_STRING_LENGTH ] =
CHAR16 zTalkMenuStrings[6][ SMALL_STRING_LENGTH ] =
{
L"Come Again?", //meaning "Repeat yourself"
L"Friendly", //approach in a friendly
@@ -1096,7 +1162,7 @@ UINT16 zTalkMenuStrings[6][ SMALL_STRING_LENGTH ] =
};
//Some NPCs buy, sell or repair items. These different options are available for those NPCs as well.
UINT16 zDealerStrings[4][ SMALL_STRING_LENGTH ]=
CHAR16 zDealerStrings[4][ SMALL_STRING_LENGTH ]=
{
L"Buy/Sell",
L"Buy",
@@ -1104,7 +1170,7 @@ UINT16 zDealerStrings[4][ SMALL_STRING_LENGTH ]=
L"Repair",
};
UINT16 zDialogActions[1][ SMALL_STRING_LENGTH ] =
CHAR16 zDialogActions[1][ SMALL_STRING_LENGTH ] =
{
L"Done",
};
@@ -1145,7 +1211,7 @@ STR16 zVehicleName[] =
//These are messages Used in the Tactical Screen
UINT16 TacticalStr[][ MED_STRING_LENGTH ] =
CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
{
L"Air Raid",
L"Apply first aid automatically?",
@@ -1255,7 +1321,7 @@ UINT16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Mute",
L"Stance Up (|P|g|U|p)",
L"Cursor Level (|T|a|b)",
L"Climb / Jump",
L"Climb / |Jump",
L"Stance Down (|P|g|D|n)",
L"Examine (|C|t|r|l)",
L"Previous Merc",
@@ -1330,7 +1396,7 @@ UINT16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Key Ring Panel",
L"You cannot do that with an EPC.",
L"Spare Krott?",
L"Out of weapon range",
L"Out of effective weapon range.",
L"Miner",
L"Vehicle can only travel between sectors",
L"Can't autobandage right now",
@@ -1340,7 +1406,9 @@ UINT16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Lock destroyed",
L"Somebody else is trying to use this door.",
L"Health: %d/%d\nFuel: %d/%d",
L"%s cannot see %s.", // Cannot see person trying to talk to
L"%s cannot see %s.", // Cannot see person trying to talk to
L"Attachment removed",
L"Can not gain another vehicle as you already have 2",
};
//Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface.
@@ -1551,6 +1619,7 @@ STR16 pMapInventoryErrorString[] =
L"During combat, you'll have to pick up items manually.",
L"During combat, you'll have to drop items manually.",
L"%s isn't in the sector to drop that item.",
L"During combat, you can't reload with an ammo crate.",
};
STR16 pMapInventoryStrings[] =
@@ -1678,7 +1747,7 @@ STR16 pSenderNameList[] =
L"Len",
L"Danny",
L"Magic",
L"Stephan",
L"Stephen",
L"Scully",
L"Malice",
L"Dr.Q",
@@ -1806,6 +1875,7 @@ STR16 pTransactionText[] =
L"Equip militia in %s", // initial cost to equip a town's militia
L"Purchased items from %s.", //is used for the Shop keeper interface. The dealers name will be appended to the end of the string.
L"%s deposited money.",
L"Sold Item(s) to the Locals",
};
STR16 pTransactionAlternateText[] =
@@ -1896,7 +1966,7 @@ STR16 pMapErrorString[] =
L"needs an escort to move. Place her on a squad with one.", // for a female
L"Merc hasn't yet arrived in Arulco!",
L"Looks like there's some contract negotiations to settle first.",
L"",
L"Cannot give a movement order. Air raid is going on.",
//11-15
L"Movement orders? There's a battle going on!",
L"You have been ambushed by bloodcats in sector %s!",
@@ -1910,13 +1980,13 @@ STR16 pMapErrorString[] =
L"%s could not join %s as it is already full",
L"%s could not join %s as it is too far away.",
//21-25
L"The mine in %s has been captured by Deidranna's forces!",
L"Deidranna's forces have just invaded the SAM site in %s",
L"Deidranna's forces have just invaded %s",
L"Deidranna's forces have just been spotted in %s.",
L"Deidranna's forces have just taken over %s.",
L"The mine in %s has been captured by enemy forces!",
L"Enemy forces have just invaded the SAM site in %s",
L"Enemy forces have just invaded %s",
L"Enemy forces have just been spotted in %s.",
L"Enemy forces have just taken over %s.",
//26-30
L"At least one of your mercs could not be put asleep.",
L"At least one of your mercs is not tired.",
L"At least one of your mercs could not be woken up.",
L"Militia will not appear until they have finished training.",
L"%s cannot be given movement orders at this time.",
@@ -2013,15 +2083,22 @@ STR16 pMercContractOverStrings[] =
// Text used on IMP Web Pages
// WDS: Allow flexible numbers of IMPs of each sex
// note: I only updated the English text to remove "three" below
STR16 pImpPopUpStrings[] =
{
L"Invalid Authorization Code",
L"You Are About To Restart The Entire Profiling Process. Are You Certain?",
L"Please Enter A Valid Full Name and Gender",
L"Invalid authorization code",
L"You are about to restart the entire profiling process. Are you certain?",
L"Please enter a valid full name and gender",
L"Preliminary analysis of your financial status shows that you cannot afford a profile analysis.",
L"Not A Valid Option At This Time.",
L"Not a valid option at this time.",
L"To complete an accurate profile, you must have room for at least one team member.",
L"Profile Already Completed.",
L"Profile already completed.",
L"Cannot load I.M.P. character from disk.",
L"You have already reached the maximum number of I.M.P. characters.",
L"You have already the maximum number of I.M.P characters with that gender on your team.",
L"You cannot afford the I.M.P character.",
L"The new I.M.P character has joined your team.",
};
@@ -2031,7 +2108,7 @@ STR16 pImpButtonText[] =
{
L"About Us", // about the IMP site
L"BEGIN", // begin profiling
L"Personality", // personality section
L"Skills", // personality section
L"Attributes", // personal stats/attributes section
L"Portrait", // the personal portrait selection
L"Voice %d", // the voice selection
@@ -2478,7 +2555,7 @@ STR16 pUpdatePanelButtons[] =
// Text which appears when everyone on your team is incapacitated and incapable of battle
UINT16 LargeTacticalStr[][ LARGE_STRING_LENGTH ] =
CHAR16 LargeTacticalStr[][ LARGE_STRING_LENGTH ] =
{
L"You have been defeated in this sector!",
L"The enemy, having no mercy for the team's soul, devours each and every one of you!",
@@ -2527,6 +2604,13 @@ STR16 MercAccountText[] =
L"Are you sure you want to authorize the payment of %s?", //the %s is a string that contains the dollar amount ( ex. "$150" )
};
// Merc Account Page buttons
STR16 MercAccountPageText[] =
{
// Text on the buttons on the bottom of the screen
L"Previous",
L"Next",
};
//For use at the M.E.R.C. web site. Text relating a MERC mercenary
@@ -2736,6 +2820,54 @@ STR16 BobbyROrderFormText[] =
L"Shipments",
};
STR16 BobbyRFilter[] =
{
// Guns
L"Heavy W.",
L"Pistol",
L"M. Pistol",
L"SMG",
L"Rifle",
L"SN Rifle",
L"AS Rifle",
L"MG",
L"Shotgun",
// Ammo
L"Pistol",
L"M. Pistol",
L"SMG",
L"Rifle",
L"SN Rifle",
L"AS Rifle",
L"MG",
L"Shotgun",
// Used
L"Guns",
L"Armor",
L"LBE Gear",
L"Misc",
// Armour
L"Helmets",
L"Vests",
L"Leggings",
L"Plates",
// Misc
L"Blades",
L"Th. Knives",
L"Punch. W.",
L"Grenades",
L"Bombs",
L"Med. Kits",
L"Kits",
L"Face Items",
L"LBE Gear",
L"Misc.",
};
// This text is used when on the various Bobby Ray Web site pages that sell items
@@ -3078,7 +3210,7 @@ STR16 AimScreenText[] =
L"A.I.M. and the A.I.M. logo are registered trademarks in most countries.",
L"So don't even think of trying to copy us.",
L"Copyright 1998-1999 A.I.M., Ltd. All rights reserved.",
L"Copyright 2005 A.I.M., Ltd. All rights reserved.", //1.13 modified to 2005
//Text for an advertisement that gets displayed on the AIM page
@@ -3213,25 +3345,25 @@ STR16 zSaveLoadText[] =
L"Loaded the game successfully",
L"ERROR loading the game!",
L"The game version in the saved game file is different then the current version. It is most likely safe to continue. Continue?",
L"The saved game files may be invalidated. Do you want them all deleted?",
L"The game version in the saved game file is different then the current version. It is most likely safe to continue. Continue?",
L"The saved game files may be invalidated. Do you want them all deleted?",
//Translators, the next two strings are for the same thing. The first one is for beta version releases and the second one
//is used for the final version. Please don't modify the "#ifdef JA2BETAVERSION" or the "#else" or the "#endif" as they are
//used by the compiler and will cause program errors if modified/removed. It's okay to translate the strings though.
#ifdef JA2BETAVERSION
L"Save version has changed. Please report if there any problems. Continue?",
L"Save version has changed. Please report if there any problems. Continue?",
#else
L"Attempting to load an older version save. Automatically update and load the save?",
L"Attempting to load an older version save. Automatically update and load the save?",
#endif
//Translators, the next two strings are for the same thing. The first one is for beta version releases and the second one
//is used for the final version. Please don't modify the "#ifdef JA2BETAVERSION" or the "#else" or the "#endif" as they are
//used by the compiler and will cause program errors if modified/removed. It's okay to translate the strings though.
#ifdef JA2BETAVERSION
L"Save version and game version have changed. Please report if there are any problems. Continue?",
L"Save version and game version have changed. Please report if there are any problems. Continue?",
#else
L"Attempting to load an older version save. Automatically update and load the save?",
L"Attempting to load an older version save. Automatically update and load the save?",
#endif
L"Are you sure you want to overwrite the saved game in slot #%d?",
@@ -3250,6 +3382,15 @@ STR16 zSaveLoadText[] =
L"Sci Fi style",
L"Difficulty",
L"Platinum Mode", //Placeholder English
L"Bobby Ray's",
L"Normal Selection",
L"Great Selection",
L"Excellent Selection",
L"Awesome Selection",
L"New Inventory does not work in 640x480 screen size. Please resize and try again.",
};
@@ -3285,6 +3426,7 @@ STR16 zMarksMapScreenText[] =
L"%s is full of militia.",
L"Merc has a finite contract.",
L"Merc's contract is not insured",
L"Map Overview", // 24
};
@@ -3344,6 +3486,21 @@ STR16 zOptionsToggleText[] =
L"Show Tree Tops",
L"Show Wireframes",
L"Show 3D Cursor",
L"Show Chance to Hit on cursor",
L"GL Burst uses Burst cursor",
L"Enemies Drop all Items",
L"High angle Grenade launching",
L"Restrict extra Aim Levels",
L"Space selects next Squad",
L"Show Item Shadow",
L"Show Weapon Ranges in Tiles",
L"Tracer effect for single shot",
L"Rain noises",
L"Allow crows",
L"Random I.M.P personality",
L"Auto save",
L"Silent Skyrider",
L"Low CPU usage",
};
//This is the help text associated with the above toggles.
@@ -3383,7 +3540,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, an additional \"safety\" click will be required for movement in Real-time.",
//Sleep/Wake notification
L"When ON, you will be notified when mercs on \"assignment\" go to sleep and resume work.",
L"When ON, you will be notified when mercs on \"assignment\" go to sleep and resume work.",
//Use the metric system
L"When ON, uses the metric system for measurements; otherwise it uses the Imperial system.",
@@ -3408,6 +3565,22 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, the movement cursor is shown in 3D. ( |Home )",
// Options for 1.13
L"When ON, the chance to hit is shown on the cursor.",
L"When ON, GL burst uses burst cursor.",
L"When ON, dead enemies drop all items.",
L"When ON, grenade launchers fire grenades at higher angles (|Q).",
L"When ON, aim levels beyond 4 are restricted to rifles and sniper rifles.",
L"When ON, |S|p|a|c|e selects next squad automatically.",
L"When ON, item shadows will be shown.",
L"When ON, weapon ranges will be shown in tiles.",
L"When ON, tracer effect will be shown for single shots.",
L"When ON, you will hear rain noises when it is raining.",
L"When ON, the crows are present in game.",
L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved after each players turn.",
L"When ON, Skyrider will not talk anymore.",
L"When ON, game will run with much lower CPU usage.",
};
@@ -3417,19 +3590,30 @@ STR16 gzGIOScreenText[] =
L"Game Style",
L"Realistic",
L"Sci Fi",
L"Gun Options",
L"Platinum",
L"Items",
L"Tons of Guns",
L"Normal",
L"Normal Guns",
L"Difficulty Level",
L"Novice",
L"Experienced",
L"Expert",
L"INSANE",
L"Ok",
L"Cancel",
L"Extra Difficulty",
L"Unlimited Time",
L"Timed Turns",
L"Save Anytime",
L"Iron Man",
L"Disabled for Demo",
L"Bobby Ray's Selection",
L"Normal",
L"Great",
L"Excellent",
L"Awesome",
L"Inventory System",
L"Old",
L"New",
};
STR16 pDeliveryLocationStrings[] =
@@ -3514,7 +3698,7 @@ STR16 pMessageStrings[] =
L"No description", //Save slots that don't have a description.
L"Game Saved.",
L"Game Saved.",
L"QuickSave", //The name of the quicksave file (filename, text reference)
L"QuickSave", //10 The name of the quicksave file (filename, text reference)
L"SaveGame", //The name of the normal savegame file, such as SaveGame01, SaveGame02, etc.
L"sav", //The 3 character dos extension (represents sav)
L"..\\SavedGames", //The name of the directory where games are saved.
@@ -3524,7 +3708,7 @@ STR16 pMessageStrings[] =
L"Demo", //Demo of JA2
L"Debug", //State of development of a project (JA2) that is a debug build
L"Release", //Release build for JA2
L"rpm", //Abbreviation for Rounds per minute -- the potential # of bullets fired in a minute.
L"rpm", //20 Abbreviation for Rounds per minute -- the potential # of bullets fired in a minute.
L"min", //Abbreviation for minute.
L"m", //One character abbreviation for meter (metric distance measurement unit).
L"rnds", //Abbreviation for rounds (# of bullets)
@@ -3534,7 +3718,7 @@ STR16 pMessageStrings[] =
L"USD", //Abbreviation to US dollars
L"n/a", //Lowercase acronym for not applicable.
L"Meanwhile", //Meanwhile
L"%s has arrived in sector %s%s", //Name/Squad has arrived in sector A9. Order must not change without notifying
L"%s has arrived in sector %s%s", //30 Name/Squad has arrived in sector A9. Order must not change without notifying
//SirTech
L"Version",
L"Empty Quick Save Slot",
@@ -3545,7 +3729,7 @@ STR16 pMessageStrings[] =
L"Hired %s from AIM",
L"%s has caught %s.", //'Merc name' has caught 'item' -- let SirTech know if name comes after item.
L"%s has taken the drug.", //'Merc name' has taken the drug
L"%s has no medical skill",//'Merc name' has no medical skill.
L"%s has no medical skill",//40 'Merc name' has no medical skill.
//CDRom errors (such as ejecting CD while attempting to read the CD)
L"The integrity of the game has been compromised.",
@@ -3567,7 +3751,7 @@ STR16 pMessageStrings[] =
L"No room to pass %s to %s.", //pass "item" to "merc". Same instructions as above.
//A list of attachments appear after the items. Ex: Kevlar vest ( Ceramic Plate 'Attached )'
L" Attached )",
L" attached]", // 50
//Cheat modes
L"Cheat level ONE reached",
@@ -3587,7 +3771,7 @@ STR16 pMessageStrings[] =
//These are used in the cheat modes for changing levels in the game. Going from a basement level to
//an upper level, etc.
L"Can't go up from this level...",
L"There are no lower levels...",
L"There are no lower levels...", // 60
L"Entering basement level %d...",
L"Leaving basement...",
@@ -3598,20 +3782,26 @@ STR16 pMessageStrings[] =
L"3D Cursor ON.",
L"Squad %d active.",
L"You cannot afford to pay for %s's daily salary of %s", //first %s is the mercs name, the seconds is a string containing the salary
L"Skip",
L"Skip", // 70
L"%s cannot leave alone.",
L"A save has been created called, SaveGame99.sav. If needed, rename it to SaveGame01 - SaveGame10 and then you will have access to it in the Load screen.",
L"%s drank some %s",
L"A package has arrived in Drassen.",
L"%s should arrive at the designated drop-off point (sector %s) on day %d, at approximately %s.", //first %s is mercs name, next is the sector location and name where they will be arriving in, lastely is the day an the time of arrival
L"History log updated.",
L"Grenade Bursts use Targeting Cursor (Spread fire enabled)",
L"Grenade Bursts use Trajectory Cursor (Spread fire disabled)",
L"Drop All Enabled",
L"Drop All Disabled",
L"Grenade Launchers fire at standard angles",
L"Grenade Launchers fire at higher angles",
#ifdef JA2BETAVERSION
L"Successfully Saved the Game into the End Turn Auto Save slot.",
#endif
};
UINT16 ItemPickupHelpPopup[][40] =
CHAR16 ItemPickupHelpPopup[][40] =
{
L"OK",
L"Scroll Up",
@@ -3816,6 +4006,16 @@ STR16 sRepairsDoneString[] =
L"%s finished repairing everyone's guns & armor",
L"%s finished repairing everyone's equipped items",
L"%s finished repairing everyone's carried items",
L"%s finished repairing everyone's carried items",
L"%s finished repairing everyone's carried items",
};
STR16 zGioDifConfirmText[]=
{
L"You have chosen NOVICE mode. This setting is appropriate for those new to Jagged Alliance, those new to strategy games in general, or those wishing shorter battles in the game. Your choice will affect things throughout the entire course of the game, so choose wisely. Are you sure you want to play in Novice mode?",
L"You have chosen EXPERIENCED mode. This setting is suitable for those already familiar with Jagged Alliance or similar games. Your choice will affect things throughout the entire course of the game, so choose wisely. Are you sure you want to play in Experienced mode?",
L"You have chosen EXPERT mode. We warned you. Don't blame us if you get shipped back in a body bag. Your choice will affect things throughout the entire course of the game, so choose wisely. Are you sure you want to play in Expert mode?",
L"You have chosen INSANE mode. WARNING: Don't blame us if you get shipped back in little pieces... Deidranna WILL kick your ass. Hard. Your choice will affect things throughout the entire course of the game, so choose wisely. Are you sure you want to play in INSANE mode?",
};
STR16 gzLateLocalizedString[] =
@@ -3891,9 +4091,9 @@ STR16 gzLateLocalizedString[] =
L"It is currently unsafe to compress time when mercs are in the creature infested mines.",
//29-31 singular versions
L"1 green militia has been promoted to an veteran militia.",
L"1 green militia has been promoted to a veteran militia.",
L"1 green militia has been promoted to a regular militia.",
L"1 regular militia has been promoted to an veteran militia.",
L"1 regular militia has been promoted to a veteran militia.",
//32-34
L"%s doesn't say anything.",
@@ -3945,7 +4145,7 @@ STR16 gzLateLocalizedString[] =
//55
L"Can't compress time while viewing sector inventory.",
L"The Jagged Alliance 2 PLAY CD was not found. Program will now exit.",
L"The Jagged Alliance 2 PLAY DISK was not found. Program will now exit.",
L"Items successfully combined.",
@@ -3953,9 +4153,64 @@ STR16 gzLateLocalizedString[] =
//Displayed with the version information when cheats are enabled.
L"Current/Max Progress: %d%%/%d%%",
//59
L"Escort John and Mary?",
// 60
L"Switch Activated.",
L"%s's armour attachment has been smashed!",
L"%s fires %d more rounds than intended!",
L"%s fires %d more round than intended!",
};
STR16 gzCWStrings[] =
{
L"Call reinforcements from adjacent sectors?",
};
// WANNE: Tooltips
STR16 gzTooltipStrings[] =
{
// Debug info
L"%s|Location: %d\n",
L"%s|Brightness: %d / %d\n",
L"%s|Range to |Target: %d\n",
L"%s|I|D: %d\n",
L"%s|Orders: %d\n",
L"%s|Attitude: %d\n",
L"%s|Current |A|Ps: %d\n",
L"%s|Current |Health: %d\n",
// Full info
L"%s|Helmet: %s\n",
L"%s|Vest: %s\n",
L"%s|Leggings: %s\n",
// Limited, Basic
L"|Armor: ",
L"Helmet ",
L"Vest ",
L"Leggings",
L"worn",
L"no Armor",
L"%s|N|V|G: %s\n",
L"no NVG",
L"%s|Gas |Mask: %s\n",
L"no Gas Mask",
L"%s|Head |Position |1: %s\n",
L"%s|Head |Position |2: %s\n",
L"\n(in Backpack) ",
L"%s|Weapon: %s ",
L"no Weapon",
L"Handgun",
L"SMG",
L"Rifle",
L"MG",
L"Shotgun",
L"Knife",
L"Heavy Weapon",
L"no Helmet",
L"no Vest",
L"no Leggings",
L"|Armor: %s\n",
};
STR16 New113Message[] =
@@ -3994,10 +4249,19 @@ STR16 New113MERCMercMailTexts[] =
// INFO: Do not replace the ± characters. They indicate the <B2> (-> Newline) from the edt files
STR16 MissingIMPSkillsDescriptions[] =
{
// Rooftop sniping
L"Rooftop Sniping: Not even ants are on the save side. Each target is mercilessly tracked down! ± ",
// Sniper
L"Sniper: Eyes of a hawk, you can shoot the wings from a fly at a hundred yards! ± ",
// Camouflage
L"Camouflage: Besides you even bushes look synthetic! ± ",
};
STR16 NewInvMessage[] =
{
L"Cannot pickup backpack at this time",
L"No place to put backpack",
L"Backpack not found",
L"Zipper only works in combat",
L"Can not move while backpack zipper active",
};
#endif //TAIWANESE
+224 -224
View File
@@ -19,11 +19,11 @@
typedef struct
{
BYTE *pbWaveData; // pointer into wave resource (for restore)
DWORD cbWaveSize; // size of wave data (for restore)
int iAlloc; // number of buffers.
int iCurrent; // current buffer
IDirectSoundBuffer* Buffers[1]; // list of buffers
BYTE *pbWaveData; // pointer into wave resource (for restore)
DWORD cbWaveSize; // size of wave data (for restore)
int iAlloc; // number of buffers.
int iCurrent; // current buffer
IDirectSoundBuffer* Buffers[1]; // list of buffers
} SNDOBJ, *HSNDOBJ;
@@ -40,30 +40,30 @@ static const char c_szWAV[] = "WAVE";
IDirectSoundBuffer *DSLoadSoundBuffer(IDirectSound *pDS, LPCTSTR lpName)
{
IDirectSoundBuffer *pDSB = NULL;
DSBUFFERDESC dsBD = {0};
BYTE *pbWaveData;
IDirectSoundBuffer *pDSB = NULL;
DSBUFFERDESC dsBD = {0};
BYTE *pbWaveData;
if (DSGetWaveResource(NULL, lpName, &dsBD.lpwfxFormat, &pbWaveData, &dsBD.dwBufferBytes))
{
dsBD.dwSize = sizeof(dsBD);
dsBD.dwFlags = DSBCAPS_STATIC | DSBCAPS_CTRLDEFAULT; // | DSBCAPS_GETCURRENTPOSITION2;
if (DSGetWaveResource(NULL, lpName, &dsBD.lpwfxFormat, &pbWaveData, &dsBD.dwBufferBytes))
{
dsBD.dwSize = sizeof(dsBD);
dsBD.dwFlags = DSBCAPS_STATIC | DSBCAPS_CTRLDEFAULT; // | DSBCAPS_GETCURRENTPOSITION2;
if (SUCCEEDED(IDirectSound_CreateSoundBuffer(pDS, &dsBD, &pDSB, NULL)))
{
if (!DSFillSoundBuffer(pDSB, pbWaveData, dsBD.dwBufferBytes))
{
IDirectSoundBuffer_Release(pDSB);
pDSB = NULL;
}
}
else
{
pDSB = NULL;
}
}
if (SUCCEEDED(IDirectSound_CreateSoundBuffer(pDS, &dsBD, &pDSB, NULL)))
{
if (!DSFillSoundBuffer(pDSB, pbWaveData, dsBD.dwBufferBytes))
{
IDirectSoundBuffer_Release(pDSB);
pDSB = NULL;
}
}
else
{
pDSB = NULL;
}
}
return pDSB;
return pDSB;
}
///////////////////////////////////////////////////////////////////////////////
@@ -74,20 +74,20 @@ IDirectSoundBuffer *DSLoadSoundBuffer(IDirectSound *pDS, LPCTSTR lpName)
BOOL DSReloadSoundBuffer(IDirectSoundBuffer *pDSB, LPCTSTR lpName)
{
BOOL result=FALSE;
BYTE *pbWaveData;
DWORD cbWaveSize;
BOOL result=FALSE;
BYTE *pbWaveData;
DWORD cbWaveSize;
if (DSGetWaveResource(NULL, lpName, NULL, &pbWaveData, &cbWaveSize))
{
if (SUCCEEDED(IDirectSoundBuffer_Restore(pDSB)) &&
DSFillSoundBuffer(pDSB, pbWaveData, cbWaveSize))
{
result = TRUE;
}
}
if (DSGetWaveResource(NULL, lpName, NULL, &pbWaveData, &cbWaveSize))
{
if (SUCCEEDED(IDirectSoundBuffer_Restore(pDSB)) &&
DSFillSoundBuffer(pDSB, pbWaveData, cbWaveSize))
{
result = TRUE;
}
}
return result;
return result;
}
///////////////////////////////////////////////////////////////////////////////
@@ -97,21 +97,21 @@ BOOL DSReloadSoundBuffer(IDirectSoundBuffer *pDSB, LPCTSTR lpName)
///////////////////////////////////////////////////////////////////////////////
BOOL DSGetWaveResource(HMODULE hModule, LPCTSTR lpName,
WAVEFORMATEX **ppWaveHeader, BYTE **ppbWaveData, DWORD *pcbWaveSize)
WAVEFORMATEX **ppWaveHeader, BYTE **ppbWaveData, DWORD *pcbWaveSize)
{
HRSRC hResInfo;
HGLOBAL hResData;
void *pvRes;
HRSRC hResInfo;
HGLOBAL hResData;
void *pvRes;
if (((hResInfo = FindResource(hModule, lpName, c_szWAV)) != NULL) &&
((hResData = LoadResource(hModule, hResInfo)) != NULL) &&
((pvRes = LockResource(hResData)) != NULL) &&
DSParseWaveResource(pvRes, ppWaveHeader, ppbWaveData, pcbWaveSize))
{
return TRUE;
}
if (((hResInfo = FindResource(hModule, lpName, c_szWAV)) != NULL) &&
((hResData = LoadResource(hModule, hResInfo)) != NULL) &&
((pvRes = LockResource(hResData)) != NULL) &&
DSParseWaveResource(pvRes, ppWaveHeader, ppbWaveData, pcbWaveSize))
{
return TRUE;
}
return FALSE;
return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
@@ -120,43 +120,43 @@ BOOL DSGetWaveResource(HMODULE hModule, LPCTSTR lpName,
SNDOBJ *SndObjCreate(IDirectSound *pDS, LPCTSTR lpName, int iConcurrent)
{
SNDOBJ *pSO = NULL;
LPWAVEFORMATEX pWaveHeader;
BYTE *pbData;
UINT cbData;
SNDOBJ *pSO = NULL;
LPWAVEFORMATEX pWaveHeader;
BYTE *pbData;
UINT cbData;
if (DSGetWaveResource(NULL, lpName, &pWaveHeader, &pbData, (DWORD *)&cbData))
{
if (iConcurrent < 1)
iConcurrent = 1;
if (DSGetWaveResource(NULL, lpName, &pWaveHeader, &pbData, (DWORD *)&cbData))
{
if (iConcurrent < 1)
iConcurrent = 1;
if ((pSO = (SNDOBJ *)LocalAlloc(LPTR, sizeof(SNDOBJ) +
(iConcurrent-1) * sizeof(IDirectSoundBuffer *))) != NULL)
{
int i;
if ((pSO = (SNDOBJ *)LocalAlloc(LPTR, sizeof(SNDOBJ) +
(iConcurrent-1) * sizeof(IDirectSoundBuffer *))) != NULL)
{
int i;
pSO->iAlloc = iConcurrent;
pSO->pbWaveData = pbData;
pSO->cbWaveSize = cbData;
pSO->Buffers[0] = DSLoadSoundBuffer(pDS, lpName);
pSO->iAlloc = iConcurrent;
pSO->pbWaveData = pbData;
pSO->cbWaveSize = cbData;
pSO->Buffers[0] = DSLoadSoundBuffer(pDS, lpName);
for (i=1; i<pSO->iAlloc; i++)
{
if (FAILED(IDirectSound_DuplicateSoundBuffer(pDS,
pSO->Buffers[0], &pSO->Buffers[i])))
{
pSO->Buffers[i] = DSLoadSoundBuffer(pDS, lpName);
if (!pSO->Buffers[i]) {
SndObjDestroy(pSO);
pSO = NULL;
break;
}
}
}
}
}
for (i=1; i<pSO->iAlloc; i++)
{
if (FAILED(IDirectSound_DuplicateSoundBuffer(pDS,
pSO->Buffers[0], &pSO->Buffers[i])))
{
pSO->Buffers[i] = DSLoadSoundBuffer(pDS, lpName);
if (!pSO->Buffers[i]) {
SndObjDestroy(pSO);
pSO = NULL;
break;
}
}
}
}
}
return pSO;
return pSO;
}
///////////////////////////////////////////////////////////////////////////////
@@ -164,20 +164,20 @@ SNDOBJ *SndObjCreate(IDirectSound *pDS, LPCTSTR lpName, int iConcurrent)
void SndObjDestroy(SNDOBJ *pSO)
{
if (pSO)
{
int i;
if (pSO)
{
int i;
for (i=0; i<pSO->iAlloc; i++)
{
if (pSO->Buffers[i])
{
IDirectSoundBuffer_Release(pSO->Buffers[i]);
pSO->Buffers[i] = NULL;
}
}
LocalFree((HANDLE)pSO);
}
for (i=0; i<pSO->iAlloc; i++)
{
if (pSO->Buffers[i])
{
IDirectSoundBuffer_Release(pSO->Buffers[i]);
pSO->Buffers[i] = NULL;
}
}
LocalFree((HANDLE)pSO);
}
}
///////////////////////////////////////////////////////////////////////////////
@@ -185,54 +185,54 @@ void SndObjDestroy(SNDOBJ *pSO)
IDirectSoundBuffer *SndObjGetFreeBuffer(SNDOBJ *pSO)
{
IDirectSoundBuffer *pDSB;
IDirectSoundBuffer *pDSB;
if (pSO == NULL)
return NULL;
if (pSO == NULL)
return NULL;
if (pDSB = pSO->Buffers[pSO->iCurrent])
{
HRESULT hres;
DWORD dwStatus;
if (pDSB = pSO->Buffers[pSO->iCurrent])
{
HRESULT hres;
DWORD dwStatus;
hres = IDirectSoundBuffer_GetStatus(pDSB, &dwStatus);
hres = IDirectSoundBuffer_GetStatus(pDSB, &dwStatus);
if (FAILED(hres))
dwStatus = 0;
if (FAILED(hres))
dwStatus = 0;
if ((dwStatus & DSBSTATUS_PLAYING) == DSBSTATUS_PLAYING)
{
if (pSO->iAlloc > 1)
{
if (++pSO->iCurrent >= pSO->iAlloc)
pSO->iCurrent = 0;
if ((dwStatus & DSBSTATUS_PLAYING) == DSBSTATUS_PLAYING)
{
if (pSO->iAlloc > 1)
{
if (++pSO->iCurrent >= pSO->iAlloc)
pSO->iCurrent = 0;
pDSB = pSO->Buffers[pSO->iCurrent];
hres = IDirectSoundBuffer_GetStatus(pDSB, &dwStatus);
pDSB = pSO->Buffers[pSO->iCurrent];
hres = IDirectSoundBuffer_GetStatus(pDSB, &dwStatus);
if (SUCCEEDED(hres) && (dwStatus & DSBSTATUS_PLAYING) == DSBSTATUS_PLAYING)
{
IDirectSoundBuffer_Stop(pDSB);
IDirectSoundBuffer_SetCurrentPosition(pDSB, 0);
}
}
else
{
pDSB = NULL;
}
}
if (SUCCEEDED(hres) && (dwStatus & DSBSTATUS_PLAYING) == DSBSTATUS_PLAYING)
{
IDirectSoundBuffer_Stop(pDSB);
IDirectSoundBuffer_SetCurrentPosition(pDSB, 0);
}
}
else
{
pDSB = NULL;
}
}
if (pDSB && (dwStatus & DSBSTATUS_BUFFERLOST))
{
if (FAILED(IDirectSoundBuffer_Restore(pDSB)) ||
!DSFillSoundBuffer(pDSB, pSO->pbWaveData, pSO->cbWaveSize))
{
pDSB = NULL;
}
}
}
if (pDSB && (dwStatus & DSBSTATUS_BUFFERLOST))
{
if (FAILED(IDirectSoundBuffer_Restore(pDSB)) ||
!DSFillSoundBuffer(pDSB, pSO->pbWaveData, pSO->cbWaveSize))
{
pDSB = NULL;
}
}
}
return pDSB;
return pDSB;
}
///////////////////////////////////////////////////////////////////////////////
@@ -240,20 +240,20 @@ IDirectSoundBuffer *SndObjGetFreeBuffer(SNDOBJ *pSO)
BOOL SndObjPlay(SNDOBJ *pSO, DWORD dwPlayFlags)
{
BOOL result = FALSE;
BOOL result = FALSE;
if (pSO == NULL)
return FALSE;
if (pSO == NULL)
return FALSE;
if ((!(dwPlayFlags & DSBPLAY_LOOPING) || (pSO->iAlloc == 1)))
{
IDirectSoundBuffer *pDSB = SndObjGetFreeBuffer(pSO);
if (pDSB != NULL) {
result = SUCCEEDED(IDirectSoundBuffer_Play(pDSB, 0, 0, dwPlayFlags));
}
}
if ((!(dwPlayFlags & DSBPLAY_LOOPING) || (pSO->iAlloc == 1)))
{
IDirectSoundBuffer *pDSB = SndObjGetFreeBuffer(pSO);
if (pDSB != NULL) {
result = SUCCEEDED(IDirectSoundBuffer_Play(pDSB, 0, 0, dwPlayFlags));
}
}
return result;
return result;
}
///////////////////////////////////////////////////////////////////////////////
@@ -261,18 +261,18 @@ BOOL SndObjPlay(SNDOBJ *pSO, DWORD dwPlayFlags)
BOOL SndObjStop(SNDOBJ *pSO)
{
int i;
int i;
if (pSO == NULL)
return FALSE;
if (pSO == NULL)
return FALSE;
for (i=0; i<pSO->iAlloc; i++)
{
IDirectSoundBuffer_Stop(pSO->Buffers[i]);
IDirectSoundBuffer_SetCurrentPosition(pSO->Buffers[i], 0);
}
for (i=0; i<pSO->iAlloc; i++)
{
IDirectSoundBuffer_Stop(pSO->Buffers[i]);
IDirectSoundBuffer_SetCurrentPosition(pSO->Buffers[i], 0);
}
return TRUE;
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
@@ -280,25 +280,25 @@ BOOL SndObjStop(SNDOBJ *pSO)
BOOL DSFillSoundBuffer(IDirectSoundBuffer *pDSB, BYTE *pbWaveData, DWORD cbWaveSize)
{
if (pDSB && pbWaveData && cbWaveSize)
{
LPVOID pMem1, pMem2;
DWORD dwSize1, dwSize2;
if (pDSB && pbWaveData && cbWaveSize)
{
LPVOID pMem1, pMem2;
DWORD dwSize1, dwSize2;
if (SUCCEEDED(IDirectSoundBuffer_Lock(pDSB, 0, cbWaveSize,
&pMem1, &dwSize1, &pMem2, &dwSize2, 0)))
{
CopyMemory(pMem1, pbWaveData, dwSize1);
if (SUCCEEDED(IDirectSoundBuffer_Lock(pDSB, 0, cbWaveSize,
&pMem1, &dwSize1, &pMem2, &dwSize2, 0)))
{
CopyMemory(pMem1, pbWaveData, dwSize1);
if ( 0 != dwSize2 )
CopyMemory(pMem2, pbWaveData+dwSize1, dwSize2);
if ( 0 != dwSize2 )
CopyMemory(pMem2, pbWaveData+dwSize1, dwSize2);
IDirectSoundBuffer_Unlock(pDSB, pMem1, dwSize1, pMem2, dwSize2);
return TRUE;
}
}
IDirectSoundBuffer_Unlock(pDSB, pMem1, dwSize1, pMem2, dwSize2);
return TRUE;
}
}
return FALSE;
return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
@@ -306,76 +306,76 @@ BOOL DSFillSoundBuffer(IDirectSoundBuffer *pDSB, BYTE *pbWaveData, DWORD cbWaveS
BOOL DSParseWaveResource(void *pvRes, WAVEFORMATEX **ppWaveHeader, BYTE **ppbWaveData,DWORD *pcbWaveSize)
{
DWORD *pdw;
DWORD *pdwEnd;
DWORD dwRiff;
DWORD dwType;
DWORD dwLength;
DWORD *pdw;
DWORD *pdwEnd;
DWORD dwRiff;
DWORD dwType;
DWORD dwLength;
if (ppWaveHeader)
*ppWaveHeader = NULL;
if (ppWaveHeader)
*ppWaveHeader = NULL;
if (ppbWaveData)
*ppbWaveData = NULL;
if (ppbWaveData)
*ppbWaveData = NULL;
if (pcbWaveSize)
*pcbWaveSize = 0;
if (pcbWaveSize)
*pcbWaveSize = 0;
pdw = (DWORD *)pvRes;
dwRiff = *pdw++;
dwLength = *pdw++;
dwType = *pdw++;
pdw = (DWORD *)pvRes;
dwRiff = *pdw++;
dwLength = *pdw++;
dwType = *pdw++;
if (dwRiff != mmioFOURCC('R', 'I', 'F', 'F'))
goto exit; // not even RIFF
if (dwRiff != mmioFOURCC('R', 'I', 'F', 'F'))
goto exit; // not even RIFF
if (dwType != mmioFOURCC('W', 'A', 'V', 'E'))
goto exit; // not a WAV
if (dwType != mmioFOURCC('W', 'A', 'V', 'E'))
goto exit; // not a WAV
pdwEnd = (DWORD *)((BYTE *)pdw + dwLength-4);
pdwEnd = (DWORD *)((BYTE *)pdw + dwLength-4);
while (pdw < pdwEnd)
{
dwType = *pdw++;
dwLength = *pdw++;
while (pdw < pdwEnd)
{
dwType = *pdw++;
dwLength = *pdw++;
switch (dwType)
{
case mmioFOURCC('f', 'm', 't', ' '):
if (ppWaveHeader && !*ppWaveHeader)
{
if (dwLength < sizeof(WAVEFORMAT))
goto exit; // not a WAV
switch (dwType)
{
case mmioFOURCC('f', 'm', 't', ' '):
if (ppWaveHeader && !*ppWaveHeader)
{
if (dwLength < sizeof(WAVEFORMAT))
goto exit; // not a WAV
*ppWaveHeader = (WAVEFORMATEX *)pdw;
*ppWaveHeader = (WAVEFORMATEX *)pdw;
if ((!ppbWaveData || *ppbWaveData) &&
(!pcbWaveSize || *pcbWaveSize))
{
return TRUE;
}
}
break;
if ((!ppbWaveData || *ppbWaveData) &&
(!pcbWaveSize || *pcbWaveSize))
{
return TRUE;
}
}
break;
case mmioFOURCC('d', 'a', 't', 'a'):
if ((ppbWaveData && !*ppbWaveData) ||
(pcbWaveSize && !*pcbWaveSize))
{
if (ppbWaveData)
*ppbWaveData = (LPBYTE)pdw;
case mmioFOURCC('d', 'a', 't', 'a'):
if ((ppbWaveData && !*ppbWaveData) ||
(pcbWaveSize && !*pcbWaveSize))
{
if (ppbWaveData)
*ppbWaveData = (LPBYTE)pdw;
if (pcbWaveSize)
*pcbWaveSize = dwLength;
if (pcbWaveSize)
*pcbWaveSize = dwLength;
if (!ppWaveHeader || *ppWaveHeader)
return TRUE;
}
break;
}
if (!ppWaveHeader || *ppWaveHeader)
return TRUE;
}
break;
}
pdw = (DWORD *)((BYTE *)pdw + ((dwLength+1)&~1));
}
pdw = (DWORD *)((BYTE *)pdw + ((dwLength+1)&~1));
}
exit:
return FALSE;
return FALSE;
}
+87 -87
View File
@@ -1,9 +1,9 @@
/*==========================================================================
*
* Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
* Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
*
* File: dsutil.cpp
* Content: Routines for dealing with sounds from resources
* File: dsutil.cpp
* Content: Routines for dealing with sounds from resources
*
*
***************************************************************************/
@@ -14,110 +14,110 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////
//
// DSLoadSoundBuffer Loads an IDirectSoundBuffer from a Win32 resource in
// the current application.
// DSLoadSoundBuffer Loads an IDirectSoundBuffer from a Win32 resource in
// the current application.
//
// Params:
// pDS -- Pointer to an IDirectSound that will be used to create
// the buffer.
// pDS -- Pointer to an IDirectSound that will be used to create
// the buffer.
//
// lpName -- Name of WAV resource to load the data from. Can be a
// resource id specified using the MAKEINTRESOURCE macro.
// lpName -- Name of WAV resource to load the data from. Can be a
// resource id specified using the MAKEINTRESOURCE macro.
//
// Returns an IDirectSoundBuffer containing the wave data or NULL on error.
//
// example:
// in the application's resource script (.RC file)
// Turtle WAV turtle.wav
// in the application's resource script (.RC file)
// Turtle WAV turtle.wav
//
// some code in the application:
// IDirectSoundBuffer *pDSB = DSLoadSoundBuffer(pDS, "Turtle");
// some code in the application:
// IDirectSoundBuffer *pDSB = DSLoadSoundBuffer(pDS, "Turtle");
//
// if (pDSB)
// {
// IDirectSoundBuffer_Play(pDSB, 0, 0, DSBPLAY_TOEND);
// /* ... */
// if (pDSB)
// {
// IDirectSoundBuffer_Play(pDSB, 0, 0, DSBPLAY_TOEND);
// /* ... */
//
///////////////////////////////////////////////////////////////////////////////
IDirectSoundBuffer *DSLoadSoundBuffer(IDirectSound *pDS, LPCTSTR lpName);
///////////////////////////////////////////////////////////////////////////////
//
// DSReloadSoundBuffer Reloads an IDirectSoundBuffer from a Win32 resource in
// the current application. normally used to handle
// a DSERR_BUFFERLOST error.
// DSReloadSoundBuffer Reloads an IDirectSoundBuffer from a Win32 resource in
// the current application. normally used to handle
// a DSERR_BUFFERLOST error.
// Params:
// pDSB -- Pointer to an IDirectSoundBuffer to be reloaded.
// pDSB -- Pointer to an IDirectSoundBuffer to be reloaded.
//
// lpName -- Name of WAV resource to load the data from. Can be a
// resource id specified using the MAKEINTRESOURCE macro.
// lpName -- Name of WAV resource to load the data from. Can be a
// resource id specified using the MAKEINTRESOURCE macro.
//
// Returns a BOOL indicating whether the buffer was successfully reloaded.
//
// example:
// in the application's resource script (.RC file)
// Turtle WAV turtle.wav
// in the application's resource script (.RC file)
// Turtle WAV turtle.wav
//
// some code in the application:
// TryAgain:
// HRESULT hres = IDirectSoundBuffer_Play(pDSB, 0, 0, DSBPLAY_TOEND);
// some code in the application:
// TryAgain:
// HRESULT hres = IDirectSoundBuffer_Play(pDSB, 0, 0, DSBPLAY_TOEND);
//
// if (FAILED(hres))
// {
// if ((hres == DSERR_BUFFERLOST) &&
// DSReloadSoundBuffer(pDSB, "Turtle"))
// {
// goto TryAgain;
// }
// /* deal with other errors... */
// }
// if (FAILED(hres))
// {
// if ((hres == DSERR_BUFFERLOST) &&
// DSReloadSoundBuffer(pDSB, "Turtle"))
// {
// goto TryAgain;
// }
// /* deal with other errors... */
// }
//
///////////////////////////////////////////////////////////////////////////////
BOOL DSReloadSoundBuffer(IDirectSoundBuffer *pDSB, LPCTSTR lpName);
///////////////////////////////////////////////////////////////////////////////
//
// DSGetWaveResource Finds a WAV resource in a Win32 module.
// DSGetWaveResource Finds a WAV resource in a Win32 module.
//
// Params:
// hModule -- Win32 module handle of module containing WAV resource.
// Pass NULL to indicate current application.
// hModule -- Win32 module handle of module containing WAV resource.
// Pass NULL to indicate current application.
//
// lpName -- Name of WAV resource to load the data from. Can be a
// resource id specified using the MAKEINTRESOURCE macro.
// lpName -- Name of WAV resource to load the data from. Can be a
// resource id specified using the MAKEINTRESOURCE macro.
//
// ppWaveHeader-- Optional pointer to WAVEFORMATEX * to receive a pointer to
// the WAVEFORMATEX header in the specified WAV resource.
// Pass NULL if not required.
// ppWaveHeader-- Optional pointer to WAVEFORMATEX * to receive a pointer to
// the WAVEFORMATEX header in the specified WAV resource.
// Pass NULL if not required.
//
// ppbWaveData -- Optional pointer to BYTE * to receive a pointer to the
// waveform data in the specified WAV resource. Pass NULL if
// not required.
// ppbWaveData -- Optional pointer to BYTE * to receive a pointer to the
// waveform data in the specified WAV resource. Pass NULL if
// not required.
//
// pdwWaveSize -- Optional pointer to DWORD to receive the size of the
// waveform data in the specified WAV resource. Pass NULL if
// not required.
// pdwWaveSize -- Optional pointer to DWORD to receive the size of the
// waveform data in the specified WAV resource. Pass NULL if
// not required.
//
// Returns a BOOL indicating whether a valid WAV resource was found.
//
///////////////////////////////////////////////////////////////////////////////
BOOL DSGetWaveResource(HMODULE hModule, LPCTSTR lpName,
WAVEFORMATEX **ppWaveHeader, BYTE **ppbWaveData, DWORD *pdwWaveSize);
WAVEFORMATEX **ppWaveHeader, BYTE **ppbWaveData, DWORD *pdwWaveSize);
///////////////////////////////////////////////////////////////////////////////
//
// HSNDOBJ Handle to a SNDOBJ object.
// HSNDOBJ Handle to a SNDOBJ object.
//
// SNDOBJs are implemented in dsutil as an example layer built on top
// of DirectSound.
// SNDOBJs are implemented in dsutil as an example layer built on top
// of DirectSound.
//
// A SNDOBJ is generally used to manage individual
// sounds which need to be played multiple times concurrently. A
// SNDOBJ represents a queue of IDirectSoundBuffer objects which
// all refer to the same buffer memory.
// A SNDOBJ is generally used to manage individual
// sounds which need to be played multiple times concurrently. A
// SNDOBJ represents a queue of IDirectSoundBuffer objects which
// all refer to the same buffer memory.
//
// A SNDOBJ also automatically reloads the sound resource when
// DirectSound returns a DSERR_BUFFERLOST
// A SNDOBJ also automatically reloads the sound resource when
// DirectSound returns a DSERR_BUFFERLOST
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _HSNDOBJ_DEFINED
@@ -126,77 +126,77 @@ DECLARE_HANDLE32(HSNDOBJ);
///////////////////////////////////////////////////////////////////////////////
//
// SndObjCreate Loads a SNDOBJ from a Win32 resource in
// the current application.
// SndObjCreate Loads a SNDOBJ from a Win32 resource in
// the current application.
//
// Params:
// pDS -- Pointer to an IDirectSound that will be used to create
// the SNDOBJ.
// pDS -- Pointer to an IDirectSound that will be used to create
// the SNDOBJ.
//
// lpName -- Name of WAV resource to load the data from. Can be a
// resource id specified using the MAKEINTRESOURCE macro.
// lpName -- Name of WAV resource to load the data from. Can be a
// resource id specified using the MAKEINTRESOURCE macro.
//
// iConcurrent -- Integer representing the number of concurrent playbacks of
// to plan for. Attempts to play more than this number will
// succeed but will restart the least recently played buffer
// even if it is not finished playing yet.
// iConcurrent -- Integer representing the number of concurrent playbacks of
// to plan for. Attempts to play more than this number will
// succeed but will restart the least recently played buffer
// even if it is not finished playing yet.
//
// Returns an HSNDOBJ or NULL on error.
//
// NOTES:
// SNDOBJs automatically restore and reload themselves as required.
// SNDOBJs automatically restore and reload themselves as required.
//
///////////////////////////////////////////////////////////////////////////////
HSNDOBJ SndObjCreate(IDirectSound *pDS, LPCTSTR lpName, int iConcurrent);
///////////////////////////////////////////////////////////////////////////////
//
// SndObjDestroy Frees a SNDOBJ and releases all of its buffers.
// SndObjDestroy Frees a SNDOBJ and releases all of its buffers.
//
// Params:
// hSO -- Handle to a SNDOBJ to free.
// hSO -- Handle to a SNDOBJ to free.
//
///////////////////////////////////////////////////////////////////////////////
void SndObjDestroy(HSNDOBJ hSO);
///////////////////////////////////////////////////////////////////////////////
//
// SndObjPlay Plays a buffer in a SNDOBJ.
// SndObjPlay Plays a buffer in a SNDOBJ.
//
// Params:
// hSO -- Handle to a SNDOBJ to play a buffer from.
// hSO -- Handle to a SNDOBJ to play a buffer from.
//
// dwPlayFlags -- Flags to pass to IDirectSoundBuffer::Play. It is not
// legal to play an SndObj which has more than one buffer
// with the DSBPLAY_LOOPING flag. Pass 0 to stop playback.
// dwPlayFlags -- Flags to pass to IDirectSoundBuffer::Play. It is not
// legal to play an SndObj which has more than one buffer
// with the DSBPLAY_LOOPING flag. Pass 0 to stop playback.
//
///////////////////////////////////////////////////////////////////////////////
BOOL SndObjPlay(HSNDOBJ hSO, DWORD dwPlayFlags);
///////////////////////////////////////////////////////////////////////////////
//
// SndObjStop Stops one or more buffers in a SNDOBJ.
// SndObjStop Stops one or more buffers in a SNDOBJ.
//
// Params:
// hSO -- Handle to a SNDOBJ to play a buffer from.
// hSO -- Handle to a SNDOBJ to play a buffer from.
//
///////////////////////////////////////////////////////////////////////////////
BOOL SndObjStop(HSNDOBJ hSO);
///////////////////////////////////////////////////////////////////////////////
//
// SndObjGetFreeBuffer returns one of the cloned buffers that is
// not currently playing
// SndObjGetFreeBuffer returns one of the cloned buffers that is
// not currently playing
//
// Params:
// hSO -- Handle to a SNDOBJ
// hSO -- Handle to a SNDOBJ
//
// NOTES:
// This function is provided so that callers can set things like pan etc
// before playing the buffer.
// This function is provided so that callers can set things like pan etc
// before playing the buffer.
//
// EXAMPLE:
// ...
// ...
//
///////////////////////////////////////////////////////////////////////////////
IDirectSoundBuffer *SndObjGetFreeBuffer(HSNDOBJ hSO);
+207 -215
View File
@@ -23,17 +23,18 @@
#include "Dialogue Control.h"
#include <stdio.h>
#include "Game Clock.h"
#include "GameSettings.h"
#endif
typedef struct
typedef struct
{
UINT32 uiFont;
UINT32 uiTimeOfLastUpdate;
UINT32 uiFlags;
UINT32 uiFont;
UINT32 uiTimeOfLastUpdate;
UINT32 uiFlags;
UINT32 uiPadding[ 3 ];
UINT16 usColor;
UINT16 usColor;
BOOLEAN fBeginningOfNewString;
} StringSaveStruct;
@@ -68,7 +69,7 @@ BOOLEAN fOkToBeepNewMessage = TRUE;
static ScrollStringStPtr gpDisplayList[ MAX_LINE_COUNT ];
static ScrollStringStPtr gMapScreenMessageList[ 256 ];
static ScrollStringStPtr pStringS=NULL;
extern ScrollStringStPtr pStringS=NULL;
// first time adding any message to the message dialogue system
BOOLEAN fFirstTimeInMessageSystem = TRUE;
@@ -93,7 +94,7 @@ extern BOOLEAN fDialogueBoxDueToLastMessage;
// prototypes
BOOLEAN CreateStringVideoOverlay( ScrollStringStPtr pStringSt, UINT16 usX, UINT16 usY );
void SetStringVideoOverlayPosition( ScrollStringStPtr pStringSt, UINT16 usX, UINT16 usY );
void SetStringVideoOverlayPosition( ScrollStringStPtr pStringSt, UINT16 usX, UINT16 usY );
void BlitString( VIDEO_OVERLAY *pBlitter );
void RemoveStringVideoOverlay( ScrollStringStPtr pStringSt );
@@ -109,7 +110,7 @@ ScrollStringStPtr AddString(STR16 string, UINT16 usColor, UINT32 uiFont, BOOLEAN
void SetString(ScrollStringStPtr pStringSt, STR16 String);
void SetStringPosition(ScrollStringStPtr pStringSt, UINT16 x, UINT16 y);
void SetStringColor(ScrollStringStPtr pStringSt, UINT16 color);
void SetStringColor(ScrollStringStPtr pStringSt, UINT16 color);
ScrollStringStPtr SetStringNext(ScrollStringStPtr pStringSt, ScrollStringStPtr pNext);
ScrollStringStPtr SetStringPrev(ScrollStringStPtr pStringSt, ScrollStringStPtr pPrev);
void AddStringToMapScreenMessageList( STR16 pString, UINT16 usColor, UINT32 uiFont, BOOLEAN fStartOfNewString, UINT8 ubPriority );
@@ -148,13 +149,13 @@ ScrollStringStPtr AddString(STR16 pString, UINT16 usColor, UINT32 uiFont, BOOLEA
// add a new string to the list of strings
ScrollStringStPtr pStringSt=NULL;
pStringSt= (ScrollStringStPtr)MemAlloc(sizeof(ScrollStringSt));
SetString(pStringSt, pString);
SetStringColor(pStringSt, usColor);
pStringSt->uiFont = uiFont;
pStringSt -> fBeginningOfNewString = fStartOfNewString;
pStringSt -> uiFlags = ubPriority;
pStringSt->fBeginningOfNewString = fStartOfNewString;
pStringSt->uiFlags = ubPriority;
SetStringNext(pStringSt, NULL);
SetStringPrev(pStringSt, NULL);
pStringSt->iVideoOverlay=-1;
@@ -190,7 +191,7 @@ void SetStringColor(ScrollStringStPtr pStringSt, UINT16 usColor)
ScrollStringStPtr GetNextString(ScrollStringStPtr pStringSt)
{
// returns pointer to next string line
if (pStringSt==NULL)
if (pStringSt==NULL)
return NULL;
else
return pStringSt->pNext;
@@ -210,14 +211,14 @@ ScrollStringStPtr GetPrevString(ScrollStringStPtr pStringSt)
ScrollStringStPtr SetStringNext(ScrollStringStPtr pStringSt, ScrollStringStPtr pNext)
{
pStringSt->pNext=pNext;
return pStringSt;
return pStringSt;
}
ScrollStringStPtr SetStringPrev(ScrollStringStPtr pStringSt, ScrollStringStPtr pPrev)
{
pStringSt->pPrev=pPrev;
return pStringSt;
return pStringSt;
}
@@ -229,16 +230,16 @@ BOOLEAN CreateStringVideoOverlay( ScrollStringStPtr pStringSt, UINT16 usX, UINT1
memset( &VideoOverlayDesc, 0, sizeof( VIDEO_OVERLAY_DESC ) );
// SET VIDEO OVERLAY
VideoOverlayDesc.sLeft = usX;
VideoOverlayDesc.sTop = usY;
VideoOverlayDesc.uiFontID = pStringSt->uiFont;
VideoOverlayDesc.ubFontBack = FONT_MCOLOR_BLACK ;
VideoOverlayDesc.ubFontFore = (unsigned char)pStringSt->usColor;
VideoOverlayDesc.sX = VideoOverlayDesc.sLeft;
VideoOverlayDesc.sY = VideoOverlayDesc.sTop;
VideoOverlayDesc.sLeft = usX;
VideoOverlayDesc.sTop = usY;
VideoOverlayDesc.uiFontID = pStringSt->uiFont;
VideoOverlayDesc.ubFontBack = FONT_MCOLOR_BLACK ;
VideoOverlayDesc.ubFontFore = (unsigned char)pStringSt->usColor;
VideoOverlayDesc.sX = VideoOverlayDesc.sLeft;
VideoOverlayDesc.sY = VideoOverlayDesc.sTop;
swprintf( VideoOverlayDesc.pzText, pStringSt->pString16 );
VideoOverlayDesc.BltCallback = BlitString;
pStringSt->iVideoOverlay = RegisterVideoOverlay( ( VOVERLAY_DIRTYBYTEXT ), &VideoOverlayDesc );
pStringSt->iVideoOverlay = RegisterVideoOverlay( ( VOVERLAY_DIRTYBYTEXT ), &VideoOverlayDesc );
if ( pStringSt->iVideoOverlay == -1 )
{
@@ -264,7 +265,7 @@ void RemoveStringVideoOverlay( ScrollStringStPtr pStringSt )
}
void SetStringVideoOverlayPosition( ScrollStringStPtr pStringSt, UINT16 usX, UINT16 usY )
void SetStringVideoOverlayPosition( ScrollStringStPtr pStringSt, UINT16 usX, UINT16 usY )
{
VIDEO_OVERLAY_DESC VideoOverlayDesc;
@@ -273,11 +274,11 @@ void SetStringVideoOverlayPosition( ScrollStringStPtr pStringSt, UINT16 usX, UI
// Donot update if not allocated!
if ( pStringSt->iVideoOverlay != -1 )
{
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_POSITION;
VideoOverlayDesc.sLeft = usX;
VideoOverlayDesc.sTop = usY;
VideoOverlayDesc.sX = VideoOverlayDesc.sLeft;
VideoOverlayDesc.sY = VideoOverlayDesc.sTop;
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_POSITION;
VideoOverlayDesc.sLeft = usX;
VideoOverlayDesc.sTop = usY;
VideoOverlayDesc.sX = VideoOverlayDesc.sLeft;
VideoOverlayDesc.sY = VideoOverlayDesc.sTop;
UpdateVideoOverlay( &VideoOverlayDesc, pStringSt->iVideoOverlay, FALSE );
}
}
@@ -285,12 +286,12 @@ void SetStringVideoOverlayPosition( ScrollStringStPtr pStringSt, UINT16 usX, UI
void BlitString( VIDEO_OVERLAY *pBlitter )
{
UINT8 *pDestBuf;
UINT8 *pDestBuf;
UINT32 uiDestPitchBYTES;
//gprintfdirty(pBlitter->sX,pBlitter->sY, pBlitter->zText);
//gprintfdirty(pBlitter->sX,pBlitter->sY, pBlitter->zText);
//RestoreExternBackgroundRect(pBlitter->sX,pBlitter->sY, pBlitter->sX+StringPixLength(pBlitter->zText,pBlitter->uiFontID ), pBlitter->sY+GetFontHeight(pBlitter->uiFontID ));
if( fScrollMessagesHidden == TRUE )
{
return;
@@ -305,7 +306,7 @@ void BlitString( VIDEO_OVERLAY *pBlitter )
SetFontShadow( DEFAULT_SHADOW );
mprintf_buffer_coded( pDestBuf, uiDestPitchBYTES, pBlitter->uiFontID, pBlitter->sX, pBlitter->sY, pBlitter->zText );
UnLockVideoSurface( pBlitter->uiDestBuff );
}
@@ -318,7 +319,7 @@ void EnableStringVideoOverlay( ScrollStringStPtr pStringSt, BOOLEAN fEnable )
if ( pStringSt->iVideoOverlay != -1 )
{
VideoOverlayDesc.fDisabled = !fEnable;
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_DISABLED;
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_DISABLED;
UpdateVideoOverlay( &VideoOverlayDesc, pStringSt->iVideoOverlay, FALSE );
}
}
@@ -329,22 +330,22 @@ void ClearDisplayedListOfTacticalStrings( void )
// this function will go through list of display strings and clear them all out
UINT32 cnt;
for ( cnt = 0; cnt < MAX_LINE_COUNT; cnt++ )
{
for ( cnt = 0; cnt < MAX_LINE_COUNT; cnt++ )
{
if ( gpDisplayList[ cnt ] != NULL )
{
// CHECK IF WE HAVE AGED
// Remove our sorry ass
RemoveStringVideoOverlay( gpDisplayList[ cnt ] );
MemFree( gpDisplayList[ cnt ]->pString16);
MemFree( gpDisplayList[ cnt ] );
// Free slot
gpDisplayList[ cnt ] = NULL;
gpDisplayList[ cnt ] = NULL;
}
}
}
return;
}
@@ -352,15 +353,15 @@ void ClearDisplayedListOfTacticalStrings( void )
void ScrollString( )
{
//ScrollStringStPtr pStringSt = pStringS;
UINT32 suiTimer=0;
UINT32 cnt;
INT32 iNumberOfNewStrings = 0; // the count of new strings, so we can update position by WIDTH_BETWEEN_NEW_STRINGS pixels in the y
INT32 iNumberOfNewStrings = 0; // the count of new strings, so we can update position by WIDTH_BETWEEN_NEW_STRINGS pixels in the y
INT32 iNumberOfMessagesOnQueue = 0;
INT32 iMaxAge = 0;
BOOLEAN fDitchLastMessage = FALSE;
INT16 iMsgYStart = SCREEN_HEIGHT - 150;
INT16 iMsgYStart = ((UsingNewInventorySystem() == false)) ? SCREEN_HEIGHT - 150 : SCREEN_HEIGHT - 210;
// UPDATE TIMER
suiTimer=GetJA2Clock();
@@ -386,7 +387,7 @@ void ScrollString( )
}
iNumberOfMessagesOnQueue = GetMessageQueueSize( );
iMaxAge = MAX_AGE;
iMaxAge = MAX_AGE;
if( ( iNumberOfMessagesOnQueue > 0 )&&( gpDisplayList[ MAX_LINE_COUNT - 1 ] != NULL) )
{
@@ -398,7 +399,7 @@ void ScrollString( )
}
if( ( iNumberOfMessagesOnQueue * 1000 ) >= iMaxAge )
{
iNumberOfMessagesOnQueue = ( iMaxAge / 1000 );
@@ -407,7 +408,7 @@ void ScrollString( )
{
iNumberOfMessagesOnQueue = 0;
}
//AGE
for ( cnt = 0; cnt < MAX_LINE_COUNT; cnt++ )
{
@@ -418,15 +419,15 @@ void ScrollString( )
gpDisplayList[ cnt ]->uiTimeOfLastUpdate = iMaxAge;
}
// CHECK IF WE HAVE AGED
if ( ( suiTimer - gpDisplayList[ cnt ]->uiTimeOfLastUpdate ) > ( UINT32 )( iMaxAge - ( 1000 * iNumberOfMessagesOnQueue ) ) )
if ( ( suiTimer - gpDisplayList[ cnt ]->uiTimeOfLastUpdate ) > ( UINT32 )( iMaxAge - ( 1000 * iNumberOfMessagesOnQueue ) ) )
{
// Remove our sorry ass
RemoveStringVideoOverlay( gpDisplayList[ cnt ] );
MemFree( gpDisplayList[ cnt ]->pString16);
MemFree( gpDisplayList[ cnt ] );
// Free slot
gpDisplayList[ cnt ] = NULL;
gpDisplayList[ cnt ] = NULL;
}
}
}
@@ -442,57 +443,57 @@ void ScrollString( )
if ( gpDisplayList[ MAX_LINE_COUNT - 1 ] == NULL )
{
// MOVE ALL UP!
// cpy, then move
for( cnt = MAX_LINE_COUNT - 1; cnt > 0; cnt-- )
{
gpDisplayList[ cnt ] = gpDisplayList[ cnt - 1 ];
}
// cpy, then move
for( cnt = MAX_LINE_COUNT - 1; cnt > 0; cnt-- )
{
gpDisplayList[ cnt ] = gpDisplayList[ cnt - 1 ];
}
// now add in the new string
cnt = 0;
gpDisplayList[ cnt ] = pStringS;
CreateStringVideoOverlay( pStringS, X_START, iMsgYStart );
if( pStringS -> fBeginningOfNewString == TRUE )
{
iNumberOfNewStrings++;
}
cnt = 0;
gpDisplayList[ cnt ] = pStringS;
CreateStringVideoOverlay( pStringS, X_START, iMsgYStart );
if( pStringS->fBeginningOfNewString == TRUE )
{
iNumberOfNewStrings++;
}
// set up age
pStringS->uiTimeOfLastUpdate = GetJA2Clock();
// now move
for ( cnt = 0; cnt <= MAX_LINE_COUNT - 1; cnt++ )
{
// set up age
pStringS->uiTimeOfLastUpdate = GetJA2Clock();
// now move
for ( cnt = 0; cnt <= MAX_LINE_COUNT - 1; cnt++ )
{
// Adjust position!
if ( gpDisplayList[ cnt ] != NULL )
if ( gpDisplayList[ cnt ] != NULL )
{
SetStringVideoOverlayPosition( gpDisplayList[ cnt ], X_START, (INT16)( ( iMsgYStart - ( ( cnt ) * GetFontHeight( SMALLFONT1 ) ) ) - ( INT16)( WIDTH_BETWEEN_NEW_STRINGS * ( iNumberOfNewStrings ) ) ) );
// start of new string, increment count of new strings, for spacing purposes
if( gpDisplayList[ cnt ] -> fBeginningOfNewString == TRUE )
if( gpDisplayList[ cnt ]->fBeginningOfNewString == TRUE )
{
iNumberOfNewStrings++;
}
}
}
}
}
// WE NOW HAVE A FREE SPACE, INSERT!
// Adjust head!
pStringS = pStringS->pNext;
if( pStringS )
{
pStringS->pPrev = NULL;
}
//check if new meesage we have not seen since mapscreen..if so, beep
// WE NOW HAVE A FREE SPACE, INSERT!
// Adjust head!
pStringS = pStringS->pNext;
if( pStringS )
{
pStringS->pPrev = NULL;
}
//check if new meesage we have not seen since mapscreen..if so, beep
if( ( fOkToBeepNewMessage == TRUE ) && ( gpDisplayList[ MAX_LINE_COUNT - 2 ] == NULL ) && ( ( guiCurrentScreen == GAME_SCREEN ) || ( guiCurrentScreen == MAP_SCREEN ) ) && ( gfFacePanelActive == FALSE ) )
{
PlayNewMessageSound( );
@@ -528,18 +529,18 @@ void HideMessagesDuringNPCDialogue( void )
VideoOverlayDesc.fDisabled = TRUE;
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_DISABLED;
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_DISABLED;
fScrollMessagesHidden = TRUE;
uiStartOfPauseTime = GetJA2Clock();
for ( cnt = 0; cnt < MAX_LINE_COUNT; cnt++ )
{
if ( gpDisplayList[ cnt ] != NULL )
{
RestoreExternBackgroundRectGivenID( gVideoOverlays[ gpDisplayList[ cnt ] -> iVideoOverlay ].uiBackground );
UpdateVideoOverlay( &VideoOverlayDesc, gpDisplayList[ cnt ] -> iVideoOverlay, FALSE );
RestoreExternBackgroundRectGivenID( gVideoOverlays[ gpDisplayList[ cnt ]->iVideoOverlay ].uiBackground );
UpdateVideoOverlay( &VideoOverlayDesc, gpDisplayList[ cnt ]->iVideoOverlay, FALSE );
}
}
@@ -557,15 +558,15 @@ void UnHideMessagesDuringNPCDialogue( void )
VideoOverlayDesc.fDisabled = FALSE;
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_DISABLED;
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_DISABLED;
fScrollMessagesHidden = FALSE;
for ( cnt = 0; cnt < MAX_LINE_COUNT; cnt++ )
{
if ( gpDisplayList[ cnt ] != NULL )
{
gpDisplayList[ cnt ]->uiTimeOfLastUpdate+= GetJA2Clock() - uiStartOfPauseTime;
UpdateVideoOverlay( &VideoOverlayDesc, gpDisplayList[ cnt ] -> iVideoOverlay, FALSE );
UpdateVideoOverlay( &VideoOverlayDesc, gpDisplayList[ cnt ]->iVideoOverlay, FALSE );
}
}
@@ -602,7 +603,7 @@ void ScreenMsg( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ...)
#ifndef _DEBUG
return;
#endif
}
}
if( ubPriority == MSG_BETAVERSION )
{
@@ -620,12 +621,12 @@ void ScreenMsg( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ...)
usColor = TESTVERSION_COLOR;
#ifndef JA2TESTVERSION
return;
return;
#endif
}
va_start(argptr, pStringA);
va_start(argptr, pStringA);
vswprintf(DestString, pStringA, argptr);
va_end(argptr);
@@ -677,7 +678,7 @@ void ClearWrappedStrings( WRAPPED_STRING *pStringWrapperHead )
pDeleteNode = pNode;
// set current node as next node
pNode = pNode -> pNextWrappedString;
pNode = pNode->pNextWrappedString;
//delete the string
MemFree( pDeleteNode->sString );
@@ -700,26 +701,19 @@ void ClearWrappedStrings( WRAPPED_STRING *pStringWrapperHead )
// new tactical and mapscreen message system
void TacticalScreenMsg( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
{
// this function sets up the string into several single line structures
// this function sets up the string into several single line structures
ScrollStringStPtr pStringSt;
UINT32 uiFont = TINYFONT1;
//UINT16 usPosition=0;
//UINT16 usCount=0;
//UINT16 usStringLength=0;
//UINT16 usCurrentSPosition=0;
//UINT16 usCurrentLookup=0;
//STR16pString;
//BOOLEAN fLastLine=FALSE;
va_list argptr;
va_list argptr;
CHAR16 DestString[512];//, DestStringA[ 512 ];
CHAR16 DestString[512];//, DestStringA[ 512 ];
//STR16pStringBuffer;
//BOOLEAN fMultiLine=FALSE;
ScrollStringStPtr pTempStringSt=NULL;
WRAPPED_STRING *pStringWrapper=NULL;
WRAPPED_STRING *pStringWrapperHead=NULL;
BOOLEAN fNewString = FALSE;
ScrollStringStPtr pTempStringSt=NULL;
WRAPPED_STRING *pStringWrapper=NULL;
WRAPPED_STRING *pStringWrapperHead=NULL;
BOOLEAN fNewString = FALSE;
UINT16 usLineWidthIfWordIsWiderThenWidth=0;
@@ -750,7 +744,7 @@ void TacticalScreenMsg( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
usColor = TESTVERSION_COLOR;
#ifndef JA2TESTVERSION
return;
return;
#endif
WriteMessageToFile( DestString );
@@ -767,12 +761,12 @@ void TacticalScreenMsg( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
// return;
}
pStringSt=pStringS;
while(GetNextString(pStringSt))
pStringSt=GetNextString(pStringSt);
pStringSt=GetNextString(pStringSt);
va_start(argptr, pStringA); // Set up variable argument pointer
va_start(argptr, pStringA); // Set up variable argument pointer
vswprintf(DestString, pStringA, argptr); // process gprintf string (get output str)
va_end(argptr);
@@ -801,76 +795,69 @@ void TacticalScreenMsg( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
pStringWrapperHead=LineWrap(uiFont, LINE_WIDTH, &usLineWidthIfWordIsWiderThenWidth, DestString);
pStringWrapper=pStringWrapperHead;
pStringWrapper=pStringWrapperHead;
if(!pStringWrapper)
return;
return;
fNewString = TRUE;
while(pStringWrapper->pNextWrappedString!=NULL)
{
if(!pStringSt)
{
pStringSt=AddString(pStringWrapper->sString, usColor, uiFont, fNewString, ubPriority );
if(!pStringSt)
{
pStringSt=AddString(pStringWrapper->sString, usColor, uiFont, fNewString, ubPriority );
fNewString = FALSE;
pStringSt->pNext=NULL;
pStringSt->pPrev=NULL;
pStringS=pStringSt;
}
else
{
pTempStringSt=AddString(pStringWrapper->sString, usColor, uiFont, fNewString, ubPriority);
fNewString = FALSE;
pTempStringSt->pPrev=pStringSt;
pStringSt->pNext=pTempStringSt;
pStringSt=pTempStringSt;
pTempStringSt->pNext=NULL;
}
pStringWrapper=pStringWrapper->pNextWrappedString;
pStringS=pStringSt;
}
pTempStringSt=AddString(pStringWrapper->sString, usColor, uiFont, fNewString, ubPriority );
else
{
pTempStringSt=AddString(pStringWrapper->sString, usColor, uiFont, fNewString, ubPriority);
fNewString = FALSE;
pTempStringSt->pPrev=pStringSt;
pStringSt->pNext=pTempStringSt;
pStringSt=pTempStringSt;
pTempStringSt->pNext=NULL;
}
pStringWrapper=pStringWrapper->pNextWrappedString;
}
pTempStringSt=AddString(pStringWrapper->sString, usColor, uiFont, fNewString, ubPriority );
if(pStringSt)
{
pStringSt->pNext=pTempStringSt;
pTempStringSt->pPrev=pStringSt;
pStringSt=pTempStringSt;
pStringSt->pNext=NULL;
pStringSt->pNext=pTempStringSt;
pTempStringSt->pPrev=pStringSt;
pStringSt=pTempStringSt;
pStringSt->pNext=NULL;
}
else
else
{
pStringSt=pTempStringSt;
pStringSt->pNext=NULL;
pStringSt->pPrev=NULL;
pStringS=pStringSt;
pStringS=pStringSt;
}
// clear up list of wrapped strings
ClearWrappedStrings( pStringWrapperHead );
//LeaveMutex(SCROLL_MESSAGE_MUTEX, __LINE__, __FILE__);
return;
}
}
void MapScreenMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
{
// this function sets up the string into several single line structures
// this function sets up the string into several single line structures
ScrollStringStPtr pStringSt;
UINT32 uiFont = MAP_SCREEN_MESSAGE_FONT;
//UINT16 usPosition=0;
//UINT16 usCount=0;
//UINT16 usStringLength=0;
//UINT16 usCurrentSPosition=0;
//UINT16 usCurrentLookup=0;
//STR16pString;
//BOOLEAN fLastLine=FALSE;
va_list argptr;
CHAR16 DestString[512], DestStringA[ 512 ];
va_list argptr;
CHAR16 DestString[512], DestStringA[ 512 ];
//STR16pStringBuffer;
//BOOLEAN fMultiLine=FALSE;
WRAPPED_STRING *pStringWrapper=NULL;
WRAPPED_STRING *pStringWrapperHead=NULL;
BOOLEAN fNewString = FALSE;
WRAPPED_STRING *pStringWrapper=NULL;
WRAPPED_STRING *pStringWrapperHead=NULL;
BOOLEAN fNewString = FALSE;
UINT16 usLineWidthIfWordIsWiderThenWidth;
if( fDisableJustForIan == TRUE )
@@ -906,14 +893,14 @@ void MapScreenMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
usColor = TESTVERSION_COLOR;
#ifndef JA2TESTVERSION
return;
return;
#endif
WriteMessageToFile( DestString );
}
// OK, check if we are ani imeediate feedback message, if so, do something else!
if ( ubPriority == MSG_UI_FEEDBACK )
{
va_start(argptr, pStringA); // Set up variable argument pointer
va_start(argptr, pStringA); // Set up variable argument pointer
vswprintf(DestString, pStringA, argptr); // process gprintf string (get output str)
va_end(argptr);
@@ -923,7 +910,7 @@ void MapScreenMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
if ( ubPriority == MSG_SKULL_UI_FEEDBACK )
{
va_start(argptr, pStringA); // Set up variable argument pointer
va_start(argptr, pStringA); // Set up variable argument pointer
vswprintf(DestString, pStringA, argptr); // process gprintf string (get output str)
va_end(argptr);
@@ -934,7 +921,7 @@ void MapScreenMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
// check if error
if ( ubPriority == MSG_ERROR )
{
va_start(argptr, pStringA); // Set up variable argument pointer
va_start(argptr, pStringA); // Set up variable argument pointer
vswprintf(DestString, pStringA, argptr); // process gprintf string (get output str)
va_end(argptr);
@@ -948,11 +935,11 @@ void MapScreenMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
// OK, check if we are an immediate MAP feedback message, if so, do something else!
if ( ( ubPriority == MSG_MAP_UI_POSITION_UPPER ) ||
( ubPriority == MSG_MAP_UI_POSITION_MIDDLE ) ||
( ubPriority == MSG_MAP_UI_POSITION_LOWER ) )
if ( ( ubPriority == MSG_MAP_UI_POSITION_UPPER ) ||
( ubPriority == MSG_MAP_UI_POSITION_MIDDLE ) ||
( ubPriority == MSG_MAP_UI_POSITION_LOWER ) )
{
va_start(argptr, pStringA); // Set up variable argument pointer
va_start(argptr, pStringA); // Set up variable argument pointer
vswprintf(DestString, pStringA, argptr); // process gprintf string (get output str)
va_end(argptr);
@@ -970,12 +957,12 @@ void MapScreenMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
// return;
}
pStringSt=pStringS;
while(GetNextString(pStringSt))
pStringSt=GetNextString(pStringSt);
pStringSt=GetNextString(pStringSt);
va_start(argptr, pStringA); // Set up variable argument pointer
va_start(argptr, pStringA); // Set up variable argument pointer
vswprintf(DestString, pStringA, argptr); // process gprintf string (get output str)
va_end(argptr);
@@ -1000,10 +987,10 @@ void MapScreenMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
}
pStringWrapperHead=LineWrap(uiFont, MAP_LINE_WIDTH, &usLineWidthIfWordIsWiderThenWidth, DestString);
pStringWrapper=pStringWrapperHead;
pStringWrapper=pStringWrapperHead;
if(!pStringWrapper)
return;
return;
fNewString = TRUE;
while(pStringWrapper->pNextWrappedString!=NULL)
@@ -1014,7 +1001,7 @@ void MapScreenMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
pStringWrapper=pStringWrapper->pNextWrappedString;
}
AddStringToMapScreenMessageList(pStringWrapper->sString, usColor, uiFont, fNewString, ubPriority );
AddStringToMapScreenMessageList(pStringWrapper->sString, usColor, uiFont, fNewString, ubPriority );
// clear up list of wrapped strings
@@ -1033,22 +1020,21 @@ void MapScreenMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
// add string to the map screen message list
void AddStringToMapScreenMessageList( STR16 pString, UINT16 usColor, UINT32 uiFont, BOOLEAN fStartOfNewString, UINT8 ubPriority )
{
//UINT8 ubSlotIndex = 0;
ScrollStringStPtr pStringSt = NULL;
ScrollStringStPtr pStringSt = NULL;
pStringSt = (ScrollStringStPtr) MemAlloc(sizeof(ScrollStringSt));
pStringSt = (ScrollStringStPtr) MemAlloc(sizeof(ScrollStringSt));
SetString(pStringSt, pString);
SetStringColor(pStringSt, usColor);
SetStringColor(pStringSt, usColor);
pStringSt->uiFont = uiFont;
pStringSt->fBeginningOfNewString = fStartOfNewString;
pStringSt->fBeginningOfNewString = fStartOfNewString;
pStringSt->uiFlags = ubPriority;
pStringSt->iVideoOverlay = -1;
pStringSt->iVideoOverlay = -1;
// next/previous are not used, it's strictly a wraparound queue
SetStringNext(pStringSt, NULL);
SetStringPrev(pStringSt, NULL);
SetStringNext(pStringSt, NULL);
SetStringPrev(pStringSt, NULL);
// Figure out which queue slot index we're going to use to store this
@@ -1063,7 +1049,7 @@ void AddStringToMapScreenMessageList( STR16 pString, UINT16 usColor, UINT32 uiFo
{
MemFree( gMapScreenMessageList[ gubEndOfMapScreenMessageList ]->pString16 );
MemFree( gMapScreenMessageList[ gubEndOfMapScreenMessageList ] );
}
}
// store the new message there
gMapScreenMessageList[ gubEndOfMapScreenMessageList ] = pStringSt;
@@ -1089,6 +1075,9 @@ void DisplayStringsInMapScreenMessageList( void )
//SetFontDestBuffer( FRAME_BUFFER, 17, 360 + 6, 407, 360 + 101, FALSE );
// CHRISL: Change both X paramters so they dynamically generate from right edge of screen
//SetFontDestBuffer( FRAME_BUFFER, (SCREEN_WIDTH - 509), (SCREEN_HEIGHT - 114), (SCREEN_WIDTH - 233), (SCREEN_HEIGHT - 114) + 101, FALSE );
// CHRISL: Use this setup if we want message box on the left side
SetFontDestBuffer( FRAME_BUFFER, 17, (SCREEN_HEIGHT - 114), 407, (SCREEN_HEIGHT - 114) + 101, FALSE );
SetFont( MAP_SCREEN_MESSAGE_FONT ); // no longer supports variable fonts
@@ -1120,6 +1109,9 @@ void DisplayStringsInMapScreenMessageList( void )
SetFontForeground( ( UINT8 )( gMapScreenMessageList[ ubCurrentStringIndex ]->usColor ) );
// print this line
// CHRISL: Change X parameter to dynamically generate from right edge of screen
//mprintf_coded( (SCREEN_WIDTH - 506), sY, gMapScreenMessageList[ ubCurrentStringIndex ]->pString16 );
// CHRISL: Use this line if we want to display from the left edge
mprintf_coded( 20, sY, gMapScreenMessageList[ ubCurrentStringIndex ]->pString16 );
sY = sY + usSpacing;
@@ -1140,11 +1132,11 @@ void EnableDisableScrollStringVideoOverlay( BOOLEAN fEnable )
for( bCounter = 0; bCounter < MAX_LINE_COUNT; bCounter++ )
{
// if valid, enable/disable
if( gpDisplayList[ bCounter ] != NULL )
{
EnableVideoOverlay( fEnable ,gpDisplayList[ bCounter ] -> iVideoOverlay );
EnableVideoOverlay( fEnable ,gpDisplayList[ bCounter ]->iVideoOverlay );
}
}
@@ -1162,7 +1154,7 @@ void PlayNewMessageSound( void )
{
// is sound playing?..don't play new one
if( SoundIsPlaying( uiSoundId ) == TRUE )
{
{
return;
}
}
@@ -1230,7 +1222,7 @@ BOOLEAN SaveMapScreenMessagesToSaveGameFile( HWFILE hFile )
return(FALSE);
}
// Create the saved string struct
// Create the saved string struct
StringSave.uiFont = gMapScreenMessageList[ uiCount ]->uiFont;
StringSave.usColor = gMapScreenMessageList[ uiCount ]->usColor;
StringSave.fBeginningOfNewString = gMapScreenMessageList[ uiCount ]->fBeginningOfNewString;
@@ -1322,7 +1314,7 @@ BOOLEAN LoadMapScreenMessagesFromSaveGameFile( HWFILE hFile )
// There is now message here, add one
ScrollStringSt *sScroll;
sScroll = (ScrollStringSt *) MemAlloc( sizeof( ScrollStringSt ) );
if( sScroll == NULL )
return( FALSE );
@@ -1350,7 +1342,7 @@ BOOLEAN LoadMapScreenMessagesFromSaveGameFile( HWFILE hFile )
return(FALSE);
}
// Create the saved string struct
// Create the saved string struct
gMapScreenMessageList[ uiCount ]->uiFont = StringSave.uiFont;
gMapScreenMessageList[ uiCount ]->usColor = StringSave.usColor;
gMapScreenMessageList[ uiCount ]->uiFlags = StringSave.uiFlags;
@@ -1378,7 +1370,7 @@ void HandleLastQuotePopUpTimer( void )
}
// check if timed out
if( GetJA2Clock() - guiDialogueLastQuoteTime > guiDialogueLastQuoteDelay )
if( GetJA2Clock() - guiDialogueLastQuoteTime > guiDialogueLastQuoteDelay )
{
// done clear up
ShutDownLastQuoteTacticalTextBox( );
@@ -1438,7 +1430,7 @@ void ClearTacticalMessageQueue( void )
{
pOtherStringSt = pStringSt;
pStringSt = pStringSt->pNext;
MemFree( pOtherStringSt-> pString16 );
MemFree( pOtherStringSt->pString16 );
MemFree( pOtherStringSt );
}
@@ -1452,14 +1444,14 @@ void WriteMessageToFile( STR16 pString )
#ifdef JA2BETAVERSION
FILE *fp;
fp = fopen( "DebugMessage.txt", "a" );
if( fp == NULL )
{
return;
return;
}
fprintf( fp, "%S\n", pString );
fclose( fp );
@@ -1548,7 +1540,7 @@ UINT8 GetFirstEmptySlotInTheMapScreenMessageList( void )
// find first empty slot in list
if( IsThereAnEmptySlotInTheMapScreenMessageList( ) == FALSE)
if( IsThereAnEmptySlotInTheMapScreenMessageList( ) == FALSE)
{
ubSlotId = gubEndOfMapScreenMessageList;
return( ubSlotId );
@@ -1573,7 +1565,7 @@ UINT8 GetFirstEmptySlotInTheMapScreenMessageList( void )
void SetCurrentMapScreenMessageString( UINT8 ubCurrentStringPosition )
{
// will attempt to set current string to this value, or the closest one
UINT8 ubCounter = 0;
UINT8 ubCounter = 0;
if( gMapScreenMessageList[ ubCurrentStringPosition ] == NULL )
{
@@ -1581,7 +1573,7 @@ void SetCurrentMapScreenMessageString( UINT8 ubCurrentStringPosition )
ubCounter = ubCurrentStringPosition;
ubCounter--;
while( ( gMapScreenMessageList[ ubCounter ] == NULL )&&( ubCounter != ubCurrentStringPosition ) )
while( ( gMapScreenMessageList[ ubCounter ] == NULL )&&( ubCounter != ubCurrentStringPosition ) )
{
if( ubCounter == 0 )
{
@@ -1623,9 +1615,9 @@ UINT8 GetTheRelativePositionOfCurrentMessage( void )
void MoveCurrentMessagePointerDownList( void )
{
// check to see if we can move 'down' to newer messages?
if( gMapScreenMessageList[ ( UINT8 )( gubCurrentMapMessageString + 1 ) ] != NULL )
if( gMapScreenMessageList[ ( UINT8 )( gubCurrentMapMessageString + 1 ) ] != NULL )
{
if( ( UINT8 ) ( gubCurrentMapMessageString + 1 ) != gubEndOfMapScreenMessageList )
if( ( UINT8 ) ( gubCurrentMapMessageString + 1 ) != gubEndOfMapScreenMessageList )
{
if( ( AreThereASetOfStringsAfterThisIndex( gubCurrentMapMessageString, MAX_MESSAGES_ON_MAP_BOTTOM ) == TRUE ) )
{
@@ -1639,7 +1631,7 @@ void MoveCurrentMessagePointerDownList( void )
void MoveCurrentMessagePointerUpList(void )
{
// check to see if we can move 'down' to newer messages?
if( gMapScreenMessageList[ ( UINT8 )( gubCurrentMapMessageString - 1 ) ] != NULL )
if( gMapScreenMessageList[ ( UINT8 )( gubCurrentMapMessageString - 1 ) ] != NULL )
{
if( ( UINT8 ) ( gubCurrentMapMessageString - 1 ) != gubEndOfMapScreenMessageList )
{
@@ -1665,7 +1657,7 @@ void ScrollToHereInMapScreenMessageList( UINT8 ubPosition )
ubRange += 9;
}
ubTestPosition = ( UINT8 )( gubEndOfMapScreenMessageList - ( UINT8 )( ubRange ) + ( ( ( UINT8 )( ubRange ) * ubPosition ) / 256 ) );
ubTestPosition = ( UINT8 )( gubEndOfMapScreenMessageList - ( UINT8 )( ubRange ) + ( ( ( UINT8 )( ubRange ) * ubPosition ) / 256 ) );
if( AreThereASetOfStringsAfterThisIndex( ubTestPosition, MAX_MESSAGES_ON_MAP_BOTTOM ) == TRUE )
{
@@ -1715,9 +1707,9 @@ UINT8 GetCurrentMessageValue( void )
{
// return the value of the current message in the list, relative to the start of the list
if( GetRangeOfMapScreenMessages( ) >= 255 )
if( GetRangeOfMapScreenMessages( ) >= 255 )
{
return( gubCurrentMapMessageString - gubStartOfMapScreenMessageList );
return( gubCurrentMapMessageString - gubStartOfMapScreenMessageList );
}
else
{
@@ -1729,7 +1721,7 @@ UINT8 GetCurrentMessageValue( void )
UINT8 GetCurrentTempMessageValue( void )
{
if( GetRangeOfMapScreenMessages( ) >= 255 )
if( GetRangeOfMapScreenMessages( ) >= 255 )
{
return( ubTempPosition - gubEndOfMapScreenMessageList );
}
@@ -1803,8 +1795,8 @@ void DisplayLastMessage( void )
// set counter to end of list
while( ( gMapScreenMessageList[ ( UINT8 )( ubCounter + 1 ) ] != NULL ) && ( ( UINT8 ) ( ubCounter + 1 ) != gubEndOfMapScreenMessageList ) )
{
while( ( gMapScreenMessageList[ ( UINT8 )( ubCounter + 1 ) ] != NULL ) && ( ( UINT8 ) ( ubCounter + 1 ) != gubEndOfMapScreenMessageList ) )
{
ubCounter++;
}
@@ -1827,12 +1819,12 @@ void DisplayLastMessage( void )
// check if message if dialogue
if( gMapScreenMessageList[ ubCounter ]->uiFlags == MSG_DIALOG )
{
if( gMapScreenMessageList[ ubCounter ]-> fBeginningOfNewString == TRUE )
if( gMapScreenMessageList[ ubCounter ]->fBeginningOfNewString == TRUE )
{
// yup
fNotDone = FALSE;
fFound = TRUE;
// now display message
continue;
}
@@ -1849,7 +1841,7 @@ void DisplayLastMessage( void )
{
if( gMapScreenMessageList[ ubCounter ] )
{
if( ( fSecondNewString ) && ( gMapScreenMessageList[ ubCounter ] -> fBeginningOfNewString ) )
if( ( fSecondNewString ) && ( gMapScreenMessageList[ ubCounter ]-> fBeginningOfNewString ) )
{
fNotDone = FALSE;
}
@@ -1859,7 +1851,7 @@ void DisplayLastMessage( void )
wcscat( sString, L" " );
}
if( ( gMapScreenMessageList[ ubCounter ] -> fBeginningOfNewString ) )
if( ( gMapScreenMessageList[ ubCounter ]-> fBeginningOfNewString ) )
{
fSecondNewString = TRUE;
}
@@ -1874,7 +1866,7 @@ void DisplayLastMessage( void )
ubCounter++;
}
// execute text box
ExecuteTacticalTextBoxForLastQuote( ( INT16 )( ( 640 - gusSubtitleBoxWidth ) / 2 ), sString );
ExecuteTacticalTextBoxForLastQuote( ( INT16 )( ( 640 - gusSubtitleBoxWidth ) / 2 ), sString );
}
return;
+18 -18
View File
@@ -10,30 +10,30 @@
struct stringstruct{
STR16 pString16;
INT32 iVideoOverlay;
UINT32 uiFont;
UINT16 usColor;
UINT32 uiFlags;
STR16 pString16;
INT32 iVideoOverlay;
UINT32 uiFont;
UINT16 usColor;
UINT32 uiFlags;
BOOLEAN fBeginningOfNewString;
UINT32 uiTimeOfLastUpdate;
UINT32 uiPadding[ 5 ];
struct stringstruct *pNext;
struct stringstruct *pPrev;
UINT32 uiTimeOfLastUpdate;
UINT32 uiPadding[ 5 ];
struct stringstruct *pNext;
struct stringstruct *pPrev;
};
#define MSG_INTERFACE 0
#define MSG_DIALOG 1
#define MSG_CHAT 2
#define MSG_DEBUG 3
#define MSG_DEBUG 3
#define MSG_UI_FEEDBACK 4
#define MSG_ERROR 5
#define MSG_BETAVERSION 6
#define MSG_TESTVERSION 7
#define MSG_MAP_UI_POSITION_MIDDLE 8
#define MSG_MAP_UI_POSITION_UPPER 9
#define MSG_MAP_UI_POSITION_LOWER 10
#define MSG_SKULL_UI_FEEDBACK 11
#define MSG_ERROR 5
#define MSG_BETAVERSION 6
#define MSG_TESTVERSION 7
#define MSG_MAP_UI_POSITION_MIDDLE 8
#define MSG_MAP_UI_POSITION_UPPER 9
#define MSG_MAP_UI_POSITION_LOWER 10
#define MSG_SKULL_UI_FEEDBACK 11
// These defines correlate to defines in font.h
@@ -43,7 +43,7 @@ struct stringstruct{
typedef struct stringstruct ScrollStringSt;
typedef ScrollStringSt *ScrollStringStPtr;
typedef ScrollStringSt *ScrollStringStPtr;
extern ScrollStringStPtr pStringS;