- added VS2005 compability fix from Space Viking

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@766 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2007-03-10 18:46:57 +00:00
parent 9971b56b0e
commit 3f37673034
110 changed files with 477 additions and 439 deletions
+12 -10
View File
@@ -1672,7 +1672,7 @@ INT32 CreateIconButton(INT16 Icon,INT16 IconIndex,INT16 GenImg,INT16 xloc,INT16
}
//Creates a generic button with text on it.
INT32 CreateTextButton(UINT16 *string, UINT32 uiFont, INT16 sForeColor, INT16 sShadowColor, INT16 GenImg, INT16 xloc, INT16 yloc, INT16 w, INT16 h, INT32 Type, INT16 Priority,GUI_CALLBACK MoveCallback, GUI_CALLBACK ClickCallback)
INT32 CreateTextButton(wchar_t *string, UINT32 uiFont, INT16 sForeColor, INT16 sShadowColor, INT16 GenImg, INT16 xloc, INT16 yloc, INT16 w, INT16 h, INT32 Type, INT16 Priority,GUI_CALLBACK MoveCallback, GUI_CALLBACK ClickCallback)
{
GUI_BUTTON *b;
INT32 ButtonNum;
@@ -1716,7 +1716,7 @@ INT32 CreateTextButton(UINT16 *string, UINT32 uiFont, INT16 sForeColor, INT16 sS
b->string = NULL;
if ( string && wcslen( string ) )
{
b->string = (UINT16*)MemAlloc( (wcslen(string)+1)*sizeof(UINT16) );
b->string = (wchar_t*)MemAlloc( (wcslen(string)+1)*sizeof(wchar_t) );
AssertMsg( b->string, "Out of memory error: Couldn't allocate string in CreateTextButton." );
wcscpy( b->string, string );
}
@@ -2123,6 +2123,8 @@ INT32 CreateSimpleButton( INT32 x, INT32 y, string3 filename, INT32 Type, INT16
return( ButNum );
}
template INT32 CreateIconAndTextButton<wchar_t const *>(INT32, wchar_t const *, UINT32, INT16, INT16, INT16, INT16, INT8, INT16, INT16, INT32, INT16, GUI_CALLBACK, GUI_CALLBACK);
template INT32 CreateIconAndTextButton<wchar_t *>(INT32, wchar_t *, UINT32, INT16, INT16, INT16, INT16, INT8, INT16, INT16, INT32, INT16, GUI_CALLBACK, GUI_CALLBACK);
template INT32 CreateIconAndTextButton<unsigned short const *>(INT32, unsigned short const *, UINT32, INT16, INT16, INT16, INT16, INT8, INT16, INT16, INT32, INT16, GUI_CALLBACK, GUI_CALLBACK);
template INT32 CreateIconAndTextButton<unsigned short *>(INT32, unsigned short *, UINT32, INT16, INT16, INT16, INT16, INT8, INT16, INT16, INT32, INT16, GUI_CALLBACK, GUI_CALLBACK);
template INT32 CreateIconAndTextButton<short *>(INT32, short *, UINT32, INT16, INT16, INT16, INT16, INT8, INT16, INT16, INT32, INT16, GUI_CALLBACK, GUI_CALLBACK);
@@ -2190,7 +2192,7 @@ INT32 CreateIconAndTextButton( INT32 Image, string2 string, UINT32 uiFont,
b->string = NULL;
if ( string )
{
b->string = (UINT16*)MemAlloc( (wcslen((wchar_t *)string)+1)*sizeof(UINT16) );
b->string = (wchar_t*)MemAlloc( (wcslen((wchar_t *)string)+1)*sizeof(wchar_t) );
AssertMsg( b->string, "Out of memory error: Couldn't allocate string in CreateIconAndTextButton." );
wcscpy( b->string, string );
}
@@ -2263,7 +2265,7 @@ INT32 CreateIconAndTextButton( INT32 Image, string2 string, UINT32 uiFont,
}
//New functions
void SpecifyButtonText( INT32 iButtonID, UINT16 * string )
void SpecifyButtonText( INT32 iButtonID, wchar_t * string )
{
GUI_BUTTON *b;
@@ -2280,7 +2282,7 @@ void SpecifyButtonText( INT32 iButtonID, UINT16 * string )
if( string && wcslen( string ) )
{
//allocate memory for the new string
b->string = (UINT16*)MemAlloc( (wcslen(string)+1)*sizeof(UINT16) );
b->string = (wchar_t*)MemAlloc( (wcslen(string)+1)*sizeof(wchar_t) );
Assert( b->string );
//copy the string to the button
wcscpy( b->string, string );
@@ -2360,7 +2362,7 @@ void SpecifyButtonTextJustification( INT32 iButtonID, INT8 bJustification )
b->uiFlags |= BUTTON_DIRTY ;
}
void SpecifyFullButtonTextAttributes( INT32 iButtonID, UINT16 *string, INT32 uiFont,
void SpecifyFullButtonTextAttributes( INT32 iButtonID, wchar_t *string, INT32 uiFont,
INT16 sForeColor, INT16 sShadowColor,
INT16 sForeColorDown, INT16 sShadowColorDown, INT8 bJustification )
{
@@ -2383,7 +2385,7 @@ void SpecifyFullButtonTextAttributes( INT32 iButtonID, UINT16 *string, INT32 uiF
b->uiFlags |= BUTTON_DIRTY ;
}
void SpecifyGeneralButtonTextAttributes( INT32 iButtonID, UINT16 *string, INT32 uiFont,
void SpecifyGeneralButtonTextAttributes( INT32 iButtonID, wchar_t *string, INT32 uiFont,
INT16 sForeColor, INT16 sShadowColor )
{
GUI_BUTTON *b;
@@ -2540,7 +2542,7 @@ void AllowDisabledButtonFastHelp( INT32 iButtonID, BOOLEAN fAllow )
//
// Set the text that will be displayed as the FastHelp
//
void SetButtonFastHelpText(INT32 iButton, UINT16 * Text)
void SetButtonFastHelpText(INT32 iButton, wchar_t * Text)
{
GUI_BUTTON *b;
if(iButton<0 || iButton>MAX_BUTTONS)
@@ -3947,7 +3949,7 @@ BOOLEAN SetDialogAttributes( CreateDlgInfo *pDlgInfo, INT32 iAttrib, ... )
{
va_list arg;
INT32 iFont,iFontOptions;
UINT16 *zString;
wchar_t *zString;
INT32 iX,iY,iW,iH;
INT32 iIndex;
HVOBJECT hVObj;
@@ -3998,7 +4000,7 @@ BOOLEAN SetDialogAttributes( CreateDlgInfo *pDlgInfo, INT32 iAttrib, ... )
iFont = va_arg( arg, INT32 );
pDlgInfo->iTextFont = iFont;
zString = (UINT16 *)va_arg( arg, UINT32 );
zString = (wchar_t *)va_arg( arg, UINT32 );
if ( pDlgInfo->zDlgText != NULL )
MemFree( pDlgInfo->zDlgText );
+7 -7
View File
@@ -116,7 +116,7 @@ typedef struct _GUI_BUTTON {
//Button disabled style
INT8 bDisabledStyle;
//For buttons with text
UINT16 *string; //the string
wchar_t *string; //the string
UINT16 usFont; //font for text
BOOLEAN fMultiColor; //font is a multi-color font
INT16 sForeColor; //text colors if there is text
@@ -184,7 +184,7 @@ INT16 FindFreeIconSlot(void);
INT32 GetNextButtonNumber(void);
// Now used by Wizardry -- DB
void SetButtonFastHelpText(INT32 iButton, UINT16 * Text);
void SetButtonFastHelpText(INT32 iButton, wchar_t * Text);
#ifdef _JA2_RENDER_DIRTY
void SetBtnHelpEndCallback( INT32 iButton, MOUSE_HELPTEXT_DONE_CALLBACK CallbackFxn );
@@ -265,7 +265,7 @@ INT32 CreateCheckBoxButton( INT16 x, INT16 y, string3 filename, INT16 Priority,
INT32 CreateIconButton(INT16 Icon,INT16 IconIndex,INT16 GenImg,INT16 xloc,INT16 yloc,INT16 w,INT16 h,INT32 Type,INT16 Priority,GUI_CALLBACK MoveCallback,GUI_CALLBACK ClickCallback);
INT32 CreateHotSpot(INT16 xloc, INT16 yloc, INT16 Width, INT16 Height,INT16 Priority,GUI_CALLBACK MoveCallback,GUI_CALLBACK ClickCallback);
INT32 CreateTextButton(UINT16 *string, UINT32 uiFont, INT16 sForeColor, INT16 sShadowColor, INT16 GenImg, INT16 xloc, INT16 yloc, INT16 w, INT16 h, INT32 Type, INT16 Priority,GUI_CALLBACK MoveCallback, GUI_CALLBACK ClickCallback);
INT32 CreateTextButton(wchar_t *string, UINT32 uiFont, INT16 sForeColor, INT16 sShadowColor, INT16 GenImg, INT16 xloc, INT16 yloc, INT16 w, INT16 h, INT32 Type, INT16 Priority,GUI_CALLBACK MoveCallback, GUI_CALLBACK ClickCallback);
template <typename string2>
INT32 CreateIconAndTextButton( INT32 Image, string2 string, UINT32 uiFont,
INT16 sForeColor, INT16 sShadowColor,
@@ -275,19 +275,19 @@ INT32 CreateIconAndTextButton( INT32 Image, string2 string, UINT32 uiFont,
GUI_CALLBACK MoveCallback,GUI_CALLBACK ClickCallback);
//New functions
void SpecifyButtonText( INT32 iButtonID, UINT16 * string );
void SpecifyButtonText( INT32 iButtonID, wchar_t * string );
void SpecifyButtonFont( INT32 iButtonID, UINT32 uiFont );
void SpecifyButtonMultiColorFont(INT32 iButtonID, BOOLEAN fMultiColor);
void SpecifyButtonUpTextColors( INT32 iButtonID, INT16 sForeColor, INT16 sShadowColor );
void SpecifyButtonDownTextColors( INT32 iButtonID, INT16 sForeColorDown, INT16 sShadowColorDown );
void SpecifyButtonHilitedTextColors( INT32 iButtonID, INT16 sForeColorHilited, INT16 sShadowColorHilited );
void SpecifyButtonTextJustification( INT32 iButtonID, INT8 bJustification );
void SpecifyGeneralButtonTextAttributes( INT32 iButtonID, UINT16 *string, INT32 uiFont,
void SpecifyGeneralButtonTextAttributes( INT32 iButtonID, wchar_t *string, INT32 uiFont,
INT16 sForeColor, INT16 sShadowColor );
void SpecifyFullButtonTextAttributes( INT32 iButtonID, UINT16 *string, INT32 uiFont,
void SpecifyFullButtonTextAttributes( INT32 iButtonID, wchar_t *string, INT32 uiFont,
INT16 sForeColor, INT16 sShadowColor,
INT16 sForeColorDown, INT16 sShadowColorDown, INT8 bJustification );
void SpecifyGeneralButtonTextAttributes( INT32 iButtonID, UINT16 *string, INT32 uiFont,
void SpecifyGeneralButtonTextAttributes( INT32 iButtonID, wchar_t *string, INT32 uiFont,
INT16 sForeColor, INT16 sShadowColor );
void SpecifyButtonTextOffsets( INT32 iButtonID, INT8 bTextXOffset, INT8 bTextYOffset, BOOLEAN fShiftText );
void SpecifyButtonTextSubOffsets( INT32 iButtonID, INT8 bTextXOffset, INT8 bTextYOffset, BOOLEAN fShiftText );
+16 -1
View File
@@ -17,6 +17,10 @@
// Because we're in a library, define SGP_DEBUG here - the client may not always
// use the code to write text, because the header switches on the define
#define SGP_DEBUG
//#undef _DEBUG
// WDS: Note: To compile with VS2005 in release mode you might have to not define SGP_DEBUG and
// undefine _DEBUG or you get linker errors.
#ifdef JA2_PRECOMPILED_HEADERS
@@ -70,8 +74,16 @@ UINT8 gubAssertString[128];
UINT8 gbTmpDebugString[8][MAX_MSG_LENGTH2];
UINT8 gubStringIndex = 0;
#ifdef __cplusplus
}
#endif
#ifdef SGP_DEBUG
#ifdef __cplusplus
extern "C" {
#endif
//**************************************************************************
//
// Defines
@@ -501,9 +513,9 @@ template void _FailMessage<unsigned char *, char const *>(unsigned char *, unsig
template <typename type1, typename type2>
void _FailMessage( type1 pString, UINT32 uiLineNum, type2 pSourceFile )
{
MSG Message;
UINT8 ubOutputString[512];
#ifndef _NO_DEBUG_TXT
MSG Message;
FILE *DebugFile;
#endif
BOOLEAN fDone = FALSE;
@@ -613,6 +625,9 @@ void _FailMessage(UINT8 *pString, UINT32 uiLineNum, UINT8 *pSourceFile)
#endif
#else
BOOLEAN DbgInitialize(void) { return true; };
void DbgShutdown(void) {};
#endif
// This is NOT a _DEBUG only function! It is also needed in
+29 -16
View File
@@ -419,7 +419,7 @@ UINT32 GetWidth(HVOBJECT hSrcVObject, INT16 ssIndex)
// evaluate to is 512.
// 'uiCharCount' specifies how many characters of the string are counted.
//*****************************************************************************
INT16 StringPixLengthArg(INT32 usUseFont, UINT32 uiCharCount, UINT16 *pFontString, ...)
INT16 StringPixLengthArg(INT32 usUseFont, UINT32 uiCharCount, wchar_t *pFontString, ...)
{
va_list argptr;
wchar_t string[512];
@@ -457,12 +457,12 @@ wchar_t string[512];
// 'uiCharCount' specifies how many characters of the string are counted.
// YOU HAVE TO PREBUILD THE FAST HELP STRING!
//*****************************************************************************
INT16 StringPixLengthArgFastHelp(INT32 usUseFont, INT32 usBoldFont, UINT32 uiCharCount, UINT16 *pFontString )
INT16 StringPixLengthArgFastHelp(INT32 usUseFont, INT32 usBoldFont, UINT32 uiCharCount, wchar_t *pFontString )
{
wchar_t string[512];
UINT32 i, index;
INT16 sBoldDiff = 0;
UINT16 str[2];
wchar_t str[2];
Assert(pFontString!=NULL);
@@ -518,10 +518,10 @@ INT16 StringPixLengthArgFastHelp(INT32 usUseFont, INT32 usBoldFont, UINT32 uiCha
// Created on: 12/1/99
//
//*****************************************************************************************
INT16 StringNPixLength(UINT16 *string, UINT32 uiMaxCount, INT32 UseFont)
INT16 StringNPixLength(wchar_t *string, UINT32 uiMaxCount, INT32 UseFont)
{
UINT32 Cur, uiCharCount;
UINT16 *curletter,transletter;
wchar_t *curletter,transletter;
Cur = 0;
uiCharCount = 0;
@@ -545,6 +545,7 @@ INT16 StringNPixLength(UINT16 *string, UINT32 uiMaxCount, INT32 UseFont)
//*****************************************************************************
template INT16 StringPixLength<short *>(short *, INT32);
template INT16 StringPixLength<unsigned short const *>(unsigned short const *, INT32);
template INT16 StringPixLength<wchar_t const *>(wchar_t const *, INT32);
template <typename type1>
INT16 StringPixLength(type1 string, INT32 UseFont)
{
@@ -730,6 +731,8 @@ BOOLEAN SetFontDestBuffer(UINT32 DestBuffer, INT32 x1, INT32 y1, INT32 x2, INT32
// the parameters are identical to printf. The resulting string may be no longer
// than 512 word-characters. Uses monochrome font color settings
//*****************************************************************************
template UINT32 mprintf<wchar_t *>(INT32, INT32, wchar_t *, ...);
template UINT32 mprintf<wchar_t const *>(INT32, INT32, wchar_t const *, ...);
template UINT32 mprintf<short *>(INT32, INT32, short *, ...);
template UINT32 mprintf<unsigned short *>(INT32, INT32, unsigned short *, ...);
template UINT32 mprintf<unsigned short const *>(INT32, INT32, unsigned short const *, ...);
@@ -737,7 +740,7 @@ template <typename type3>
UINT32 mprintf(INT32 x, INT32 y, type3 pFontString, ...)
{
INT32 destx, desty;
UINT16 *curletter, transletter;
wchar_t *curletter, transletter;
va_list argptr;
wchar_t string[512];
UINT32 uiDestPitchBYTES;
@@ -787,6 +790,8 @@ UINT8 *pDestBuf;
template void VarFindFontRightCoordinates<short *>(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, short *, ...);
template void VarFindFontRightCoordinates<unsigned short *>(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, unsigned short *, ...);
template void VarFindFontRightCoordinates<wchar_t *>(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, wchar_t *, ...);
template void VarFindFontRightCoordinates<wchar_t const *>(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, wchar_t const *, ...);
template <typename type8>
void VarFindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT32 iFontIndex, INT16 *psNewX, INT16 *psNewY, type8 pFontString, ... )
{
@@ -800,6 +805,8 @@ void VarFindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 s
FindFontRightCoordinates( sLeft, sTop, sWidth, sHeight, string, iFontIndex, psNewX, psNewY );
}
template void VarFindFontCenterCoordinates<wchar_t *>(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, wchar_t *, ...);
template void VarFindFontCenterCoordinates<wchar_t const *>(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, wchar_t const*, ...);
template void VarFindFontCenterCoordinates<short *>(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, short *, ...);
template void VarFindFontCenterCoordinates<unsigned short *>(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, unsigned short *, ...);
template void VarFindFontCenterCoordinates<unsigned short const *>(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, unsigned short const*, ...);
@@ -816,10 +823,12 @@ void VarFindFontCenterCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, string, iFontIndex, psNewX, psNewY );
}
template void FindFontRightCoordinates<wchar_t *, unsigned short *, unsigned short *>(INT16, INT16, INT16, INT16, wchar_t *, INT32, unsigned short *, unsigned short *);
template void FindFontRightCoordinates<short *, unsigned short *, unsigned short *>(INT16, INT16, INT16, INT16, short *, INT32, unsigned short *, unsigned short *);
template void FindFontRightCoordinates<short *, short *, unsigned short *>(INT16, INT16, INT16, INT16, short *, INT32, short *, unsigned short *);
template void FindFontRightCoordinates<unsigned short *, short *, short *>(INT16, INT16, INT16, INT16, unsigned short *, INT32, short *, short *);
template void FindFontRightCoordinates<unsigned short *, unsigned short *, unsigned short *>(INT16, INT16, INT16, INT16, unsigned short *, INT32, unsigned short *, unsigned short *);
template void FindFontRightCoordinates<wchar_t *, wchar_t *, wchar_t *>(INT16, INT16, INT16, INT16, wchar_t *, INT32, wchar_t *, wchar_t *);
template <typename string5, typename string7, typename string8>
void FindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, string5 pStr, INT32 iFontIndex, string7 psNewX, string8 psNewY )
{
@@ -833,10 +842,12 @@ void FindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHei
*psNewY = yp;
}
template void FindFontCenterCoordinates<wchar_t *, unsigned short *, unsigned short *>(INT16, INT16, INT16, INT16, wchar_t *, INT32, unsigned short *, unsigned short *);
template void FindFontCenterCoordinates<short *, unsigned short *, unsigned short *>(INT16, INT16, INT16, INT16, short *, INT32, unsigned short *, unsigned short *);
template void FindFontCenterCoordinates<unsigned short *, unsigned short *, unsigned short *>(INT16, INT16, INT16, INT16, unsigned short *, INT32, unsigned short *, unsigned short *);
template void FindFontCenterCoordinates<unsigned short *, short *, short *>(INT16, INT16, INT16, INT16, unsigned short *, INT32, short *, short *);
template void FindFontCenterCoordinates<short *, short *, short *>(INT16, INT16, INT16, INT16, short *, INT32, short *, short *);
template void FindFontCenterCoordinates<wchar_t *, wchar_t *, wchar_t *>(INT16, INT16, INT16, INT16, wchar_t *, INT32, wchar_t *, wchar_t *);
template <typename string5, typename string7, typename string8>
void FindFontCenterCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, string5 pStr, INT32 iFontIndex, string7 psNewX, string8 psNewY )
{
@@ -858,10 +869,10 @@ void FindFontCenterCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHe
// the parameters are identical to printf. The resulting string may be no longer
// than 512 word-characters.
//*****************************************************************************
UINT32 gprintf(INT32 x, INT32 y, UINT16 *pFontString, ...)
UINT32 gprintf(INT32 x, INT32 y, wchar_t *pFontString, ...)
{
INT32 destx, desty;
UINT16 *curletter, transletter;
wchar_t *curletter, transletter;
va_list argptr;
wchar_t string[512];
UINT32 uiDestPitchBYTES;
@@ -909,10 +920,10 @@ UINT8 *pDestBuf;
return(0);
}
UINT32 gprintfDirty(INT32 x, INT32 y, UINT16 *pFontString, ...)
UINT32 gprintfDirty(INT32 x, INT32 y, wchar_t *pFontString, ...)
{
INT32 destx, desty;
UINT16 *curletter, transletter;
wchar_t *curletter, transletter;
va_list argptr;
wchar_t string[512];
UINT32 uiDestPitchBYTES;
@@ -978,10 +989,10 @@ UINT8 *pDestBuf;
// the parameters are identical to printf. The resulting string may be no longer
// than 512 word-characters.
//*****************************************************************************
UINT32 gprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, UINT16 *pFontString, ...)
UINT32 gprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, wchar_t *pFontString, ...)
{
INT32 destx, desty;
UINT16 *curletter, transletter;
wchar_t *curletter, transletter;
va_list argptr;
wchar_t string[512];
@@ -1025,11 +1036,13 @@ wchar_t string[512];
template UINT32 mprintf_buffer<short *>(UINT8 *, UINT32, UINT32, INT32, INT32, short *, ...);
template UINT32 mprintf_buffer<unsigned short *>(UINT8 *, UINT32, UINT32, INT32, INT32, unsigned short *, ...);
template UINT32 mprintf_buffer<unsigned short const*>(UINT8 *, UINT32, UINT32, INT32, INT32, unsigned short const*, ...);
template UINT32 mprintf_buffer<wchar_t *>(UINT8 *, UINT32, UINT32, INT32, INT32, wchar_t *, ...);
template UINT32 mprintf_buffer<wchar_t const*>(UINT8 *, UINT32, UINT32, INT32, INT32, wchar_t const*, ...);
template <typename string6>
UINT32 mprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, string6 pFontString, ...)
{
INT32 destx, desty;
UINT16 *curletter, transletter;
wchar_t *curletter, transletter;
va_list argptr;
wchar_t string[512];
@@ -1074,7 +1087,7 @@ template <typename string6>
UINT32 mprintf_buffer_coded( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, string6 pFontString, ...)
{
INT32 destx, desty;
UINT16 *curletter, transletter;
wchar_t *curletter, transletter;
va_list argptr;
wchar_t string[512];
UINT16 usOldForeColor;
@@ -1131,10 +1144,10 @@ UINT16 usOldForeColor;
}
UINT32 mprintf_coded( INT32 x, INT32 y, UINT16 *pFontString, ...)
UINT32 mprintf_coded( INT32 x, INT32 y, wchar_t *pFontString, ...)
{
INT32 destx, desty;
UINT16 *curletter, transletter;
wchar_t *curletter, transletter;
va_list argptr;
wchar_t string[512];
UINT16 usOldForeColor;
+7 -7
View File
@@ -123,11 +123,11 @@ UINT16 *GetFontObjectPalette16BPP(INT32 iFont);
void DestroyEnglishTransTable( void );
extern HVOBJECT GetFontObject(INT32 iFont);
extern UINT32 gprintf(INT32 x, INT32 y, UINT16 *pFontString, ...);
extern UINT32 gprintfDirty(INT32 x, INT32 y, UINT16 *pFontString, ...);
extern UINT32 gprintf(INT32 x, INT32 y, wchar_t *pFontString, ...);
extern UINT32 gprintfDirty(INT32 x, INT32 y, wchar_t *pFontString, ...);
template <typename type3>
extern UINT32 mprintf(INT32 x, INT32 y, type3 pFontString, ...);
extern UINT32 gprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, UINT16 *pFontString, ...);
extern UINT32 gprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, wchar_t *pFontString, ...);
template <typename string6>
extern UINT32 mprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, string6 pFontString, ...);
@@ -137,7 +137,7 @@ extern UINT32 mprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 F
template <typename string6>
UINT32 mprintf_buffer_coded( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, string6 pFontString, ...);
UINT32 mprintf_coded( INT32 x, INT32 y, UINT16 *pFontString, ...);
UINT32 mprintf_coded( INT32 x, INT32 y, wchar_t *pFontString, ...);
extern BOOLEAN SetFontDestBuffer(UINT32 DestBuffer, INT32 x1, INT32 y1, INT32 x2, INT32 y2, BOOLEAN wrap);
@@ -155,12 +155,12 @@ extern FontTranslationTable *CreateEnglishTransTable( );
extern INT16 GetIndex(UINT16 siChar);
extern UINT32 GetWidth(HVOBJECT hSrcVObject, INT16 ssIndex);
extern INT16 StringPixLengthArgFastHelp( INT32 usUseFont, INT32 usBoldFont, UINT32 uiCharCount, UINT16 *pFontString );
extern INT16 StringPixLengthArg(INT32 usUseFont, UINT32 uiCharCount, UINT16 *pFontString, ...);
extern INT16 StringPixLengthArgFastHelp( INT32 usUseFont, INT32 usBoldFont, UINT32 uiCharCount, wchar_t *pFontString );
extern INT16 StringPixLengthArg(INT32 usUseFont, UINT32 uiCharCount, wchar_t *pFontString, ...);
template <typename type1>
extern INT16 StringPixLength(type1 string,INT32 UseFont);
extern INT16 StringNPixLength(UINT16 *string, UINT32 uiMaxCount, INT32 UseFont);
extern INT16 StringNPixLength(wchar_t *string, UINT32 uiMaxCount, INT32 UseFont);
extern void SaveFontSettings(void);
extern void RestoreFontSettings(void);
+5 -5
View File
@@ -108,7 +108,7 @@ HWINFONT *GetWinFont( INT32 iFont )
}
}
UINT16 gzFontName[32];
wchar_t gzFontName[32];
INT32 CreateWinFont( INT32 iHeight, INT32 iWidth, INT32 iEscapement,
INT32 iWeight, BOOLEAN fItalic, BOOLEAN fUnderline, BOOLEAN fStrikeOut, STR16 szFontName, INT32 iCharSet )
@@ -191,7 +191,7 @@ void SetWinFontBackColor( INT32 iFont, COLORVAL *pColor )
}
void PrintWinFont( UINT32 uiDestBuf, INT32 iFont, INT32 x, INT32 y, UINT16 *pFontString, ...)
void PrintWinFont( UINT32 uiDestBuf, INT32 iFont, INT32 x, INT32 y, wchar_t *pFontString, ...)
{
va_list argptr;
wchar_t string2[512];
@@ -240,7 +240,7 @@ void PrintWinFont( UINT32 uiDestBuf, INT32 iFont, INT32 x, INT32 y, UINT16 *pFon
}
INT16 WinFontStringPixLength( UINT16 *string2, INT32 iFont )
INT16 WinFontStringPixLength( wchar_t *string2, INT32 iFont )
{
HWINFONT *pWinFont;
HDC hdc;
@@ -269,7 +269,7 @@ INT16 WinFontStringPixLength( UINT16 *string2, INT32 iFont )
}
INT16 GetWinFontHeight( UINT16 *string2, INT32 iFont )
INT16 GetWinFontHeight( wchar_t *string2, INT32 iFont )
{
HWINFONT *pWinFont;
HDC hdc;
@@ -297,7 +297,7 @@ INT16 GetWinFontHeight( UINT16 *string2, INT32 iFont )
return( (INT16)RectSize.cy );
}
UINT32 WinFont_mprintf( INT32 iFont, INT32 x, INT32 y, UINT16 *pFontString, ...)
UINT32 WinFont_mprintf( INT32 iFont, INT32 x, INT32 y, wchar_t *pFontString, ...)
{
va_list argptr;
wchar_t string[512];
+4 -4
View File
@@ -11,11 +11,11 @@ void DeleteWinFont( INT32 iFont );
void SetWinFontBackColor( INT32 iFont, COLORVAL *pColor );
void SetWinFontForeColor( INT32 iFont, COLORVAL *pColor );
void PrintWinFont( UINT32 uiDestBuf, INT32 iFont, INT32 x, INT32 y, UINT16 *pFontString, ...);
void PrintWinFont( UINT32 uiDestBuf, INT32 iFont, INT32 x, INT32 y, wchar_t *pFontString, ...);
INT16 WinFontStringPixLength( UINT16 *string, INT32 iFont );
INT16 GetWinFontHeight( UINT16 *string, INT32 iFont );
UINT32 WinFont_mprintf( INT32 iFont, INT32 x, INT32 y, UINT16 *pFontString, ...);
INT16 WinFontStringPixLength( wchar_t *string, INT32 iFont );
INT16 GetWinFontHeight( wchar_t *string, INT32 iFont );
UINT32 WinFont_mprintf( INT32 iFont, INT32 x, INT32 y, wchar_t *pFontString, ...);
BOOLEAN DoesWinFontExistOnSystem( STR16 pTypeFaceName, INT32 iCharSet );
+3 -1
View File
@@ -1234,6 +1234,8 @@ void RefreshMouseRegions( )
}
template void SetRegionFastHelpText<wchar_t *>(MOUSE_REGION *, wchar_t *);
template void SetRegionFastHelpText<wchar_t const*>(MOUSE_REGION *, wchar_t const*);
template void SetRegionFastHelpText<short *>(MOUSE_REGION *, short *);
template void SetRegionFastHelpText<unsigned short *>(MOUSE_REGION *, unsigned short *);
template void SetRegionFastHelpText<unsigned short const*>(MOUSE_REGION *, unsigned short const*);
@@ -1257,7 +1259,7 @@ void SetRegionFastHelpText( MOUSE_REGION *region, type2 szText )
return; //blank (or clear)
// Allocate memory for the button's FastHelp text string...
region->FastHelpText = (UINT16*)MemAlloc( (wcslen( (wchar_t *)szText ) + 1) * sizeof(UINT16) );
region->FastHelpText = (wchar_t*)MemAlloc( (wcslen( (wchar_t *)szText ) + 1) * sizeof(wchar_t) );
Assert( region->FastHelpText );
wcscpy( region->FastHelpText, szText );
+1 -1
View File
@@ -54,7 +54,7 @@ typedef struct _MOUSE_REGION {
//Fast help vars.
INT16 FastHelpTimer; // Countdown timer for FastHelp text
UINT16 *FastHelpText; // Text string for the FastHelp (describes buttons if left there a while)
wchar_t *FastHelpText; // Text string for the FastHelp (describes buttons if left there a while)
INT32 FastHelpRect;
MOUSE_HELPTEXT_DONE_CALLBACK HelpDoneCallback;