|
|
@ -65,7 +65,7 @@ void plDynamicTextMsg::SetFont( const char *face, int16_t size, bool isBold ) |
|
|
|
hsAssert( ( fCmd & ( kPosCmds | kStringCmds | kFlagCmds ) ) == 0, "Attempting to issue conflicting drawText commands" ); |
|
|
|
hsAssert( ( fCmd & ( kPosCmds | kStringCmds | kFlagCmds ) ) == 0, "Attempting to issue conflicting drawText commands" ); |
|
|
|
fCmd &= ~( kPosCmds | kStringCmds | kFlagCmds ); |
|
|
|
fCmd &= ~( kPosCmds | kStringCmds | kFlagCmds ); |
|
|
|
fCmd |= kSetFont;
|
|
|
|
fCmd |= kSetFont;
|
|
|
|
fString = hsStringToWString( face ); |
|
|
|
fString = face; |
|
|
|
fX = size; |
|
|
|
fX = size; |
|
|
|
fFlags = (uint32_t)isBold; |
|
|
|
fFlags = (uint32_t)isBold; |
|
|
|
} |
|
|
|
} |
|
|
@ -123,9 +123,7 @@ void plDynamicTextMsg::DrawString( int16_t x, int16_t y, const wchar_t *text |
|
|
|
fCmd &= ~( kStringCmds | kPosCmds ); |
|
|
|
fCmd &= ~( kStringCmds | kPosCmds ); |
|
|
|
fCmd |= kDrawString;
|
|
|
|
fCmd |= kDrawString;
|
|
|
|
|
|
|
|
|
|
|
|
fString = new wchar_t[wcslen(text)+1]; |
|
|
|
fString = plString::FromWchar(text); |
|
|
|
wcscpy( fString, text ); |
|
|
|
|
|
|
|
fString[wcslen(text)] = L'\0'; |
|
|
|
|
|
|
|
fX = x; |
|
|
|
fX = x; |
|
|
|
fY = y; |
|
|
|
fY = y; |
|
|
|
} |
|
|
|
} |
|
|
@ -143,9 +141,7 @@ void plDynamicTextMsg::DrawClippedString( int16_t x, int16_t y, uint16_t clip |
|
|
|
fCmd &= ~( kStringCmds | kPosCmds | kRectCmds ); |
|
|
|
fCmd &= ~( kStringCmds | kPosCmds | kRectCmds ); |
|
|
|
fCmd |= kDrawClippedString;
|
|
|
|
fCmd |= kDrawClippedString;
|
|
|
|
|
|
|
|
|
|
|
|
fString = new wchar_t[wcslen(text)+1]; |
|
|
|
fString = plString::FromWchar(text); |
|
|
|
wcscpy( fString, text ); |
|
|
|
|
|
|
|
fString[wcslen(text)] = L'\0'; |
|
|
|
|
|
|
|
fX = x; |
|
|
|
fX = x; |
|
|
|
fY = y; |
|
|
|
fY = y; |
|
|
|
|
|
|
|
|
|
|
@ -168,9 +164,7 @@ void plDynamicTextMsg::DrawWrappedString( int16_t x, int16_t y, uint16_t wrap |
|
|
|
fCmd &= ~( kStringCmds | kPosCmds | kRectCmds ); |
|
|
|
fCmd &= ~( kStringCmds | kPosCmds | kRectCmds ); |
|
|
|
fCmd |= kDrawWrappedString;
|
|
|
|
fCmd |= kDrawWrappedString;
|
|
|
|
|
|
|
|
|
|
|
|
fString = new wchar_t[wcslen(text)+1]; |
|
|
|
fString = plString::FromWchar(text); |
|
|
|
wcscpy( fString, text ); |
|
|
|
|
|
|
|
fString[wcslen(text)] = L'\0'; |
|
|
|
|
|
|
|
fX = x; |
|
|
|
fX = x; |
|
|
|
fY = y; |
|
|
|
fY = y; |
|
|
|
|
|
|
|
|
|
|
@ -222,7 +216,7 @@ void plDynamicTextMsg::Read( hsStream *s, hsResMgr *mgr ) |
|
|
|
fClearColor.Read( s ); |
|
|
|
fClearColor.Read( s ); |
|
|
|
fColor.Read( s ); |
|
|
|
fColor.Read( s ); |
|
|
|
|
|
|
|
|
|
|
|
fString = s->ReadSafeWString(); |
|
|
|
fString = s->ReadSafeWString_TEMP(); |
|
|
|
fImageKey = mgr->ReadKey( s ); |
|
|
|
fImageKey = mgr->ReadKey( s ); |
|
|
|
|
|
|
|
|
|
|
|
s->ReadLE( &fFlags ); |
|
|
|
s->ReadLE( &fFlags ); |
|
|
@ -253,7 +247,8 @@ void plDynamicTextMsg::Write( hsStream *s, hsResMgr *mgr ) |
|
|
|
fClearColor.Write( s ); |
|
|
|
fClearColor.Write( s ); |
|
|
|
fColor.Write( s ); |
|
|
|
fColor.Write( s ); |
|
|
|
|
|
|
|
|
|
|
|
s->WriteSafeWString( plString::FromWchar(fString) ); |
|
|
|
s->WriteSafeWString(fString); |
|
|
|
|
|
|
|
|
|
|
|
mgr->WriteKey( s, fImageKey ); |
|
|
|
mgr->WriteKey( s, fImageKey ); |
|
|
|
|
|
|
|
|
|
|
|
s->WriteLE( fFlags ); |
|
|
|
s->WriteLE( fFlags ); |
|
|
@ -306,7 +301,7 @@ void plDynamicTextMsg::ReadVersion(hsStream* s, hsResMgr* mgr) |
|
|
|
if (contentFlags.IsBitSet(kDynTextMsgColor)) |
|
|
|
if (contentFlags.IsBitSet(kDynTextMsgColor)) |
|
|
|
fColor.Read( s ); |
|
|
|
fColor.Read( s ); |
|
|
|
if (contentFlags.IsBitSet(kDynTextMsgString)) |
|
|
|
if (contentFlags.IsBitSet(kDynTextMsgString)) |
|
|
|
fString = s->ReadSafeWString(); |
|
|
|
fString = s->ReadSafeWString_TEMP(); |
|
|
|
if (contentFlags.IsBitSet(kDynTextMsgImageKey)) |
|
|
|
if (contentFlags.IsBitSet(kDynTextMsgImageKey)) |
|
|
|
fImageKey = mgr->ReadKey( s ); |
|
|
|
fImageKey = mgr->ReadKey( s ); |
|
|
|
if (contentFlags.IsBitSet(kDynTextMsgFlags)) |
|
|
|
if (contentFlags.IsBitSet(kDynTextMsgFlags)) |
|
|
@ -360,7 +355,7 @@ void plDynamicTextMsg::WriteVersion(hsStream* s, hsResMgr* mgr) |
|
|
|
fColor.Write( s ); |
|
|
|
fColor.Write( s ); |
|
|
|
|
|
|
|
|
|
|
|
// kDynTextMsgString
|
|
|
|
// kDynTextMsgString
|
|
|
|
s->WriteSafeWString( plString::FromWchar(fString) ); |
|
|
|
s->WriteSafeWString( fString ); |
|
|
|
// kDynTextMsgImageKey
|
|
|
|
// kDynTextMsgImageKey
|
|
|
|
mgr->WriteKey( s, fImageKey ); |
|
|
|
mgr->WriteKey( s, fImageKey ); |
|
|
|
|
|
|
|
|
|
|
|