mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-16 04:50:32 +00:00
Character encoding fixups
This commit is contained in:
@@ -144,9 +144,9 @@ void DrawHighScores (DrawSurface *surface)
|
|||||||
|
|
||||||
PortabilityLayer::RenderedFont *appFont14 = GetApplicationFont(14, PortabilityLayer::FontFamilyFlag_Bold, true);
|
PortabilityLayer::RenderedFont *appFont14 = GetApplicationFont(14, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||||
|
|
||||||
PasStringCopy(PSTR("<EFBFBD> "), tempStr);
|
PasStringCopy(PSTR("\xa5 "), tempStr);
|
||||||
PasStringConcat(tempStr, thisHouseName);
|
PasStringConcat(tempStr, thisHouseName);
|
||||||
PasStringConcat(tempStr, PSTR(" <EFBFBD>"));
|
PasStringConcat(tempStr, PSTR(" \xa5"));
|
||||||
|
|
||||||
const Point scoreShadowPoint = Point::Create(scoreLeft + ((kScoreWide - appFont14->MeasurePStr(tempStr)) / 2) - 1, dropIt - 66);
|
const Point scoreShadowPoint = Point::Create(scoreLeft + ((kScoreWide - appFont14->MeasurePStr(tempStr)) / 2) - 1, dropIt - 66);
|
||||||
surface->DrawString(scoreShadowPoint, tempStr, blackColor, appFont14);
|
surface->DrawString(scoreShadowPoint, tempStr, blackColor, appFont14);
|
||||||
|
|||||||
@@ -785,7 +785,7 @@ void ShiftWholeHouse (short howFar)
|
|||||||
short i, h, numRooms;
|
short i, h, numRooms;
|
||||||
char wasState;
|
char wasState;
|
||||||
|
|
||||||
OpenMessageWindow(PSTR("Shifting Whole House<EFBFBD>"));
|
OpenMessageWindow(PSTR("Shifting Whole House\xc9"));
|
||||||
SpinCursor(3);
|
SpinCursor(3);
|
||||||
|
|
||||||
CopyThisRoomToRoom();
|
CopyThisRoomToRoom();
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ void RefreshRoomTitle (short mode)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case kSavingTitleMode:
|
case kSavingTitleMode:
|
||||||
surface->DrawString(strShadowPoint, PSTR("Saving Game<EFBFBD>"), blackColor, appFont);
|
surface->DrawString(strShadowPoint, PSTR("Saving Game\xc9"), blackColor, appFont);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -190,7 +190,7 @@ void RefreshRoomTitle (short mode)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case kSavingTitleMode:
|
case kSavingTitleMode:
|
||||||
surface->DrawString(strPoint, PSTR("Saving Game<EFBFBD>"), whiteColor, appFont);
|
surface->DrawString(strPoint, PSTR("Saving Game\xc9"), whiteColor, appFont);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -14,12 +14,12 @@
|
|||||||
|
|
||||||
//============================================================== Functions
|
//============================================================== Functions
|
||||||
//-------------------------------------------------------------- PasStringCopy
|
//-------------------------------------------------------------- PasStringCopy
|
||||||
// Given a source string and storage for a second, this function<EFBFBD>
|
// Given a source string and storage for a second, this function?
|
||||||
// copies from one to the other. It assumes Pascal style strings.
|
// copies from one to the other. It assumes Pascal style strings.
|
||||||
|
|
||||||
void PasStringCopy (StringPtr p1, StringPtr p2)
|
void PasStringCopy (StringPtr p1, StringPtr p2)
|
||||||
{
|
{
|
||||||
register short stringLength;
|
short stringLength;
|
||||||
|
|
||||||
stringLength = *p2++ = *p1++;
|
stringLength = *p2++ = *p1++;
|
||||||
while (--stringLength >= 0)
|
while (--stringLength >= 0)
|
||||||
@@ -28,9 +28,9 @@ void PasStringCopy (StringPtr p1, StringPtr p2)
|
|||||||
|
|
||||||
//-------------------------------------------------------------- WhichStringFirst
|
//-------------------------------------------------------------- WhichStringFirst
|
||||||
|
|
||||||
// This is a sorting function that handles two Pascal strings. It<EFBFBD>
|
// This is a sorting function that handles two Pascal strings. It?
|
||||||
// will return a 1 to indicate the 1st string is "greater", a 1 to<EFBFBD>
|
// will return a 1 to indicate the 1st string is "greater", a 1 to?
|
||||||
// indicate the 2nd was greater and a 0 to indicate that the strings<EFBFBD>
|
// indicate the 2nd was greater and a 0 to indicate that the strings?
|
||||||
// are equal.
|
// are equal.
|
||||||
|
|
||||||
short WhichStringFirst (StringPtr p1, StringPtr p2)
|
short WhichStringFirst (StringPtr p1, StringPtr p2)
|
||||||
@@ -85,7 +85,7 @@ short WhichStringFirst (StringPtr p1, StringPtr p2)
|
|||||||
|
|
||||||
//-------------------------------------------------------------- PasStringCopyNum
|
//-------------------------------------------------------------- PasStringCopyNum
|
||||||
|
|
||||||
// This function copies a specified number of characters from one<EFBFBD>
|
// This function copies a specified number of characters from one?
|
||||||
// Pascal string to another.
|
// Pascal string to another.
|
||||||
|
|
||||||
void PasStringCopyNum (StringPtr p1, StringPtr p2, short charsToCopy)
|
void PasStringCopyNum (StringPtr p1, StringPtr p2, short charsToCopy)
|
||||||
@@ -97,15 +97,15 @@ void PasStringCopyNum (StringPtr p1, StringPtr p2, short charsToCopy)
|
|||||||
|
|
||||||
*p2 = static_cast<unsigned char>(charsToCopy);
|
*p2 = static_cast<unsigned char>(charsToCopy);
|
||||||
|
|
||||||
*p2++;
|
p2++;
|
||||||
*p1++;
|
p1++;
|
||||||
|
|
||||||
for (i = 0; i < charsToCopy; i++)
|
for (i = 0; i < charsToCopy; i++)
|
||||||
*p2++ = *p1++;
|
*p2++ = *p1++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------- PasStringConcat
|
//-------------------------------------------------------------- PasStringConcat
|
||||||
// This function concatenates the second Pascal string to the end of<EFBFBD>
|
// This function concatenates the second Pascal string to the end of?
|
||||||
// the first Pascal string.
|
// the first Pascal string.
|
||||||
|
|
||||||
void PasStringConcat (StringPtr p1, const PLPasStr &p2)
|
void PasStringConcat (StringPtr p1, const PLPasStr &p2)
|
||||||
@@ -129,9 +129,9 @@ void PasStringConcat (StringPtr p1, const PLPasStr &p2)
|
|||||||
|
|
||||||
//-------------------------------------------------------------- GetLineOfText
|
//-------------------------------------------------------------- GetLineOfText
|
||||||
|
|
||||||
// This function walks through a source string and looks for an<EFBFBD>
|
// This function walks through a source string and looks for an?
|
||||||
// entire line of text. A "line" of text is assumed to be bounded<EFBFBD>
|
// entire line of text. A "line" of text is assumed to be bounded?
|
||||||
// by carriage returns. The index variable indicates which line<EFBFBD>
|
// by carriage returns. The index variable indicates which line?
|
||||||
// is sought.
|
// is sought.
|
||||||
|
|
||||||
void GetLineOfText (StringPtr srcStr, short index, StringPtr textLine)
|
void GetLineOfText (StringPtr srcStr, short index, StringPtr textLine)
|
||||||
@@ -206,8 +206,8 @@ void GetLineOfText (StringPtr srcStr, short index, StringPtr textLine)
|
|||||||
|
|
||||||
//-------------------------------------------------------------- WrapText
|
//-------------------------------------------------------------- WrapText
|
||||||
|
|
||||||
// Given a string and the maximum number of characters to put on<EFBFBD>
|
// Given a string and the maximum number of characters to put on?
|
||||||
// one line, this function goes through and inserts carriage returns<EFBFBD>
|
// one line, this function goes through and inserts carriage returns?
|
||||||
// in order to ensure that no line of text exceeds maxChars.
|
// in order to ensure that no line of text exceeds maxChars.
|
||||||
|
|
||||||
void WrapText (StringPtr theText, short maxChars)
|
void WrapText (StringPtr theText, short maxChars)
|
||||||
@@ -271,24 +271,24 @@ void GetFirstWordOfString (StringPtr stringIn, StringPtr stringOut)
|
|||||||
|
|
||||||
//-------------------------------------------------------------- CollapseStringToWidth
|
//-------------------------------------------------------------- CollapseStringToWidth
|
||||||
|
|
||||||
// Given a string and a maximum width (in pixels), this function<EFBFBD>
|
// Given a string and a maximum width (in pixels), this function?
|
||||||
// calculates how wide the text would be drawn with the current<EFBFBD>
|
// calculates how wide the text would be drawn with the current?
|
||||||
// font. If the text would exceed our width limit, characters<EFBFBD>
|
// font. If the text would exceed our width limit, characters?
|
||||||
// are dropped off the end of the string and "<EFBFBD>" appended.
|
// are dropped off the end of the string and "?" appended.
|
||||||
|
|
||||||
void CollapseStringToWidth (PortabilityLayer::RenderedFont *font, StringPtr theStr, short wide)
|
void CollapseStringToWidth (PortabilityLayer::RenderedFont *font, StringPtr theStr, short wide)
|
||||||
{
|
{
|
||||||
short dotsWide;
|
short dotsWide;
|
||||||
Boolean tooWide;
|
Boolean tooWide;
|
||||||
|
|
||||||
dotsWide = font->MeasurePStr(PSTR("<EFBFBD>"));
|
dotsWide = font->MeasurePStr(PSTR("\xc9"));
|
||||||
tooWide = font->MeasurePStr(theStr) > wide;
|
tooWide = font->MeasurePStr(theStr) > wide;
|
||||||
while (tooWide && theStr[0] > 0)
|
while (tooWide && theStr[0] > 0)
|
||||||
{
|
{
|
||||||
theStr[0]--;
|
theStr[0]--;
|
||||||
tooWide = ((font->MeasurePStr(theStr) + dotsWide) > wide);
|
tooWide = ((font->MeasurePStr(theStr) + dotsWide) > wide);
|
||||||
if (!tooWide)
|
if (!tooWide)
|
||||||
PasStringConcat(theStr, PSTR("<EFBFBD>"));
|
PasStringConcat(theStr, PSTR("\xc9"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ extern Boolean switchedOut;
|
|||||||
|
|
||||||
//-------------------------------------------------------------- ToolBoxInit
|
//-------------------------------------------------------------- ToolBoxInit
|
||||||
|
|
||||||
// The standard ToolBox intialization that must happen when any Mac<61>
|
// The standard ToolBox intialization that must happen when any Mac<61>
|
||||||
// program first launches.
|
// program first launches.
|
||||||
|
|
||||||
void ToolBoxInit (void)
|
void ToolBoxInit (void)
|
||||||
@@ -48,7 +48,7 @@ void ToolBoxInit (void)
|
|||||||
|
|
||||||
short RandomInt (short range)
|
short RandomInt (short range)
|
||||||
{
|
{
|
||||||
register long rawResult;
|
long rawResult;
|
||||||
|
|
||||||
rawResult = Random();
|
rawResult = Random();
|
||||||
if (rawResult < 0L)
|
if (rawResult < 0L)
|
||||||
@@ -64,8 +64,8 @@ short RandomInt (short range)
|
|||||||
|
|
||||||
long RandomLong (long range)
|
long RandomLong (long range)
|
||||||
{
|
{
|
||||||
register long highWord, lowWord;
|
long highWord, lowWord;
|
||||||
register long rawResultHi, rawResultLo;
|
long rawResultHi, rawResultLo;
|
||||||
|
|
||||||
highWord = (range & 0xFFFF0000) >> 16;
|
highWord = (range & 0xFFFF0000) >> 16;
|
||||||
lowWord = range & 0x0000FFFF;
|
lowWord = range & 0x0000FFFF;
|
||||||
@@ -87,7 +87,7 @@ long RandomLong (long range)
|
|||||||
|
|
||||||
//-------------------------------------------------------------- RedAlert
|
//-------------------------------------------------------------- RedAlert
|
||||||
|
|
||||||
// Called when we must quit app. Brings up a dialog informing user<65>
|
// Called when we must quit app. Brings up a dialog informing user<65>
|
||||||
// of the problem and the exits to shell.
|
// of the problem and the exits to shell.
|
||||||
|
|
||||||
void RedAlert (short errorNumber)
|
void RedAlert (short errorNumber)
|
||||||
@@ -210,7 +210,7 @@ void CreateOffScreenPixMap (Rect *theRect, CGrafPtr *offScreen)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
//-------------------------------------------------------------------- CreateOffScreenGWorld
|
//-------------------------------------------------------------------- CreateOffScreenGWorld
|
||||||
// Creates an offscreen GWorld<6C>using the depth passed in.
|
// Creates an offscreen GWorld<6C>using the depth passed in.
|
||||||
|
|
||||||
PLError_t CreateOffScreenGWorld (DrawSurface **theGWorld, Rect *bounds)
|
PLError_t CreateOffScreenGWorld (DrawSurface **theGWorld, Rect *bounds)
|
||||||
{
|
{
|
||||||
@@ -257,8 +257,8 @@ void KillOffScreenBitMap (GrafPtr offScreen)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
//-------------------------------------------------------------- LoadGraphic
|
//-------------------------------------------------------------- LoadGraphic
|
||||||
// Function loads the specified 'PICT' from disk and draws it to<74>
|
// Function loads the specified 'PICT' from disk and draws it to<74>
|
||||||
// the current port (no scaling, clipping, etc, are done). Always<79>
|
// the current port (no scaling, clipping, etc, are done). Always<79>
|
||||||
// draws in the upper left corner of current port.
|
// draws in the upper left corner of current port.
|
||||||
|
|
||||||
void LoadGraphic (DrawSurface *surface, short resID)
|
void LoadGraphic (DrawSurface *surface, short resID)
|
||||||
@@ -296,8 +296,8 @@ void LoadGraphicCustom(DrawSurface *surface, short resID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------- LoadScaledGraphic
|
//-------------------------------------------------------------- LoadScaledGraphic
|
||||||
// Loads the specified 'PICT' and draws it mapped to the rectangle<6C>
|
// Loads the specified 'PICT' and draws it mapped to the rectangle<6C>
|
||||||
// specified. If this rect isn't the same size of the 'PICT', scaling<6E>
|
// specified. If this rect isn't the same size of the 'PICT', scaling<6E>
|
||||||
// will occur.
|
// will occur.
|
||||||
|
|
||||||
void LoadScaledGraphic (DrawSurface *surface, short resID, Rect *theRect)
|
void LoadScaledGraphic (DrawSurface *surface, short resID, Rect *theRect)
|
||||||
@@ -312,8 +312,8 @@ void LoadScaledGraphic (DrawSurface *surface, short resID, Rect *theRect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------- LoadScaledGraphic
|
//-------------------------------------------------------------- LoadScaledGraphic
|
||||||
// Loads the specified 'PICT' and draws it mapped to the rectangle<6C>
|
// Loads the specified 'PICT' and draws it mapped to the rectangle<6C>
|
||||||
// specified. If this rect isn't the same size of the 'PICT', scaling<6E>
|
// specified. If this rect isn't the same size of the 'PICT', scaling<6E>
|
||||||
// will occur.
|
// will occur.
|
||||||
|
|
||||||
void LoadScaledGraphicCustom(DrawSurface *surface, short resID, Rect *theRect)
|
void LoadScaledGraphicCustom(DrawSurface *surface, short resID, Rect *theRect)
|
||||||
@@ -393,8 +393,8 @@ void DrawCIcon (DrawSurface *surface, short theID, short h, short v)
|
|||||||
|
|
||||||
//-------------------------------------------------------------- LongSquareRoot
|
//-------------------------------------------------------------- LongSquareRoot
|
||||||
|
|
||||||
// This is a quick and dirty square root function that returns pretty<74>
|
// This is a quick and dirty square root function that returns pretty<74>
|
||||||
// accurate long integer results. It uses no transcendental functions or<6F>
|
// accurate long integer results. It uses no transcendental functions or<6F>
|
||||||
// floating point.
|
// floating point.
|
||||||
|
|
||||||
long LongSquareRoot (long theNumber)
|
long LongSquareRoot (long theNumber)
|
||||||
@@ -496,7 +496,7 @@ char KeyMapOffsetFromRawKey (char rawKeyCode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------- GetKeyName
|
//-------------------------------------------------------------- GetKeyName
|
||||||
// Given a keyDown event (it's message field), this function returns<6E>
|
// Given a keyDown event (it's message field), this function returns<6E>
|
||||||
// a string with that key's name (so we get "Shift" and "Esc", etc.).
|
// a string with that key's name (so we get "Shift" and "Esc", etc.).
|
||||||
|
|
||||||
static const char *gs_specialKeyNames[GpKeySpecials::kCount] =
|
static const char *gs_specialKeyNames[GpKeySpecials::kCount] =
|
||||||
@@ -591,6 +591,8 @@ void GetKeyName (intptr_t message, StringPtr theName)
|
|||||||
// This should never happen
|
// This should never happen
|
||||||
assert(false);
|
assert(false);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const size_t name1Length = (name1 == nullptr) ? 0 : strlen(name1);
|
const size_t name1Length = (name1 == nullptr) ? 0 : strlen(name1);
|
||||||
@@ -631,7 +633,7 @@ long ExtractCTSeed (CGrafPtr porter)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
//-------------------------------------------------------------- ForceCTSeed
|
//-------------------------------------------------------------- ForceCTSeed
|
||||||
// Forces the "color table seed" from a specified graf port to a<>
|
// Forces the "color table seed" from a specified graf port to a<>
|
||||||
// specified value.
|
// specified value.
|
||||||
/*
|
/*
|
||||||
void ForceCTSeed (CGrafPtr porter, long newSeed)
|
void ForceCTSeed (CGrafPtr porter, long newSeed)
|
||||||
@@ -640,7 +642,7 @@ void ForceCTSeed (CGrafPtr porter, long newSeed)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
//-------------------------------------------------------------- DelayTicks
|
//-------------------------------------------------------------- DelayTicks
|
||||||
// Lil' function that just sits and waits a specified number of<6F>
|
// Lil' function that just sits and waits a specified number of<6F>
|
||||||
// Ticks (1/60 of a second).
|
// Ticks (1/60 of a second).
|
||||||
|
|
||||||
void DelayTicks (long howLong)
|
void DelayTicks (long howLong)
|
||||||
@@ -651,7 +653,7 @@ void DelayTicks (long howLong)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------- UnivGetSoundVolume
|
//-------------------------------------------------------------- UnivGetSoundVolume
|
||||||
// Returns the speaker volume (as set by the user) in the range of<6F>
|
// Returns the speaker volume (as set by the user) in the range of<6F>
|
||||||
// zero to seven (handles Sound Manager 3 case as well).
|
// zero to seven (handles Sound Manager 3 case as well).
|
||||||
|
|
||||||
void UnivGetSoundVolume (short *volume, Boolean hasSM3)
|
void UnivGetSoundVolume (short *volume, Boolean hasSM3)
|
||||||
@@ -674,7 +676,7 @@ void UnivGetSoundVolume (short *volume, Boolean hasSM3)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------- UnivSetSoundVolume
|
//-------------------------------------------------------------- UnivSetSoundVolume
|
||||||
// Sets the speaker volume to a specified value (in the range of<6F>
|
// Sets the speaker volume to a specified value (in the range of<6F>
|
||||||
// zero to seven (handles Sound Manager 3 case as well).
|
// zero to seven (handles Sound Manager 3 case as well).
|
||||||
|
|
||||||
void UnivSetSoundVolume (short volume, Boolean hasSM3)
|
void UnivSetSoundVolume (short volume, Boolean hasSM3)
|
||||||
|
|||||||
Reference in New Issue
Block a user