From 1d133995b503c667d3d41ff294f9c57659e6d82c Mon Sep 17 00:00:00 2001 From: ghaushe Date: Sun, 12 Jan 2003 22:46:38 +0000 Subject: [PATCH] Renamed DrawText function to prevent name collisions in OSX - from peterb git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@548 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/sc2code/comm.c | 20 ++++++------ sc2/src/sc2code/encount.c | 30 ++++++++--------- sc2/src/sc2code/gameopt.c | 18 +++++------ sc2/src/sc2code/libs/gfxlib.h | 2 +- sc2/src/sc2code/libs/graphics/font.c | 2 +- sc2/src/sc2code/melee.c | 20 ++++++------ sc2/src/sc2code/outfit.c | 2 +- sc2/src/sc2code/pickmele.c | 6 ++-- sc2/src/sc2code/pickship.c | 6 ++-- sc2/src/sc2code/planets/cargo.c | 24 +++++++------- sc2/src/sc2code/planets/devices.c | 14 ++++---- sc2/src/sc2code/planets/lander.c | 6 ++-- sc2/src/sc2code/planets/pstarmap.c | 2 +- sc2/src/sc2code/planets/report.c | 4 +-- sc2/src/sc2code/planets/scan.c | 48 ++++++++++++++-------------- sc2/src/sc2code/save.c | 2 +- sc2/src/sc2code/shipstat.c | 6 ++-- sc2/src/sc2code/shipyard.c | 4 +-- sc2/src/sc2code/sis.c | 28 ++++++++-------- sc2/src/sc2code/starbase.c | 6 ++-- sc2/src/sc2code/status.c | 4 +-- 22 files changed, 128 insertions(+), 127 deletions(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index dfee71574..3671ef4ce 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.2: +- Function name conflict fixes for Mac OSX -by peterb - Minor fixes for pc-fonts (Outfit screen, gradient color swap) -by Nic - DCQ is now accessed uniformly by routines in gfx_common.c - Fixed OpenGL colors on MacOS X -Mika diff --git a/sc2/src/sc2code/comm.c b/sc2/src/sc2code/comm.c index ef433c5da..78d2944a7 100644 --- a/sc2/src/sc2code/comm.c +++ b/sc2/src/sc2code/comm.c @@ -152,7 +152,7 @@ add_text (int status, PTEXT pTextIn) locText.CharCount = 1; ch = '*'; locText.pStr = &ch; - DrawText (&locText); + font_DrawText (&locText); locText = *pTextIn; pText = &locText; @@ -203,7 +203,7 @@ add_text (int status, PTEXT pTextIn) if (status <= 0) { if (pText->baseline.y < SIS_SCREEN_HEIGHT) - DrawText (pText); + font_DrawText (pText); pStr = pText->pStr + pText->CharCount; if(status < -4 && pText->baseline.y >= -status - 10) @@ -217,24 +217,24 @@ add_text (int status, PTEXT pTextIn) SetContextForeGroundColor (CommData.AlienTextBColor); --pText->baseline.x; - DrawText (pText); + font_DrawText (pText); ++pText->baseline.x; --pText->baseline.y; - DrawText (pText); + font_DrawText (pText); ++pText->baseline.x; ++pText->baseline.y; - DrawText (pText); + font_DrawText (pText); --pText->baseline.x; ++pText->baseline.y; - DrawText (pText); + font_DrawText (pText); SetContextForeGroundColor (CommData.AlienTextFColor); --pText->baseline.y; - DrawText (pText); + font_DrawText (pText); pStr = pText->pStr + pText->CharCount; } @@ -290,12 +290,12 @@ DrawSISComWindow (void) t.pStr = (UNICODE *)GetStringAddress (OldStrings); t.CharCount = GetStringLength (OldStrings); OldStrings = SetRelStringTableIndex (OldStrings, 1); - DrawText (&t); + font_DrawText (&t); SetContextForeGroundColor (WHITE_COLOR); t.pStr = (PBYTE)GetStringAddress (CreditStrings); t.CharCount = GetStringLength (CreditStrings); CreditStrings = SetRelStringTableIndex (CreditStrings, 1); - DrawText (&t); + font_DrawText (&t); if (j) t.baseline.y += 12; @@ -628,7 +628,7 @@ FeedbackPlayerPhrase (UNICODE *pStr) ct.pStr = GAME_STRING (FEEDBACK_STRING_BASE); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xC, 0x1F), 0x48)); - DrawText (&ct); + font_DrawText (&ct); ct.baseline.y += 16; SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x12, 0x14, 0x4F), 0x44)); ct.pStr = pStr; diff --git a/sc2/src/sc2code/encount.c b/sc2/src/sc2code/encount.c index d2ae0fd06..02d3ecb4c 100644 --- a/sc2/src/sc2code/encount.c +++ b/sc2/src/sc2code/encount.c @@ -231,11 +231,11 @@ SetSemaphore (GraphicsSem); { t.pStr = GAME_STRING (ENCOUNTER_STRING_BASE + 0); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += 12; t.pStr = GAME_STRING (ENCOUNTER_STRING_BASE + 1); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); } else { @@ -243,16 +243,16 @@ SetSemaphore (GraphicsSem); t.pStr = GAME_STRING (ENCOUNTER_STRING_BASE + 2); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += 12; GetClusterName (CurStarDescPtr, buf); t.pStr = buf; t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += 12; t.pStr = GLOBAL_SIS (PlanetName); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); } s.origin.x = SIS_SCREEN_WIDTH >> 1; @@ -383,8 +383,8 @@ DrawFadeText (UNICODE *str1, UNICODE *str2, BOOLEAN fade_in, PRECT SetSemaphore (GraphicsSem); SetContextForeGroundColor (fade_cycle[i]); - DrawText (&t1); - DrawText (&t2); + font_DrawText (&t1); + font_DrawText (&t2); SleepThreadUntil (TimeIn + (ONE_SECOND / 20)); TimeIn = GetTimeCounter (); } @@ -399,14 +399,14 @@ DrawFadeText (UNICODE *str1, UNICODE *str2, BOOLEAN fade_in, PRECT SetSemaphore (GraphicsSem); SetContextForeGroundColor (fade_cycle[i]); - DrawText (&t1); - DrawText (&t2); + font_DrawText (&t1); + font_DrawText (&t2); SleepThreadUntil (TimeIn + (ONE_SECOND / 20)); TimeIn = GetTimeCounter (); } SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0xA), 0x08)); - DrawText (&t1); - DrawText (&t2); + font_DrawText (&t1); + font_DrawText (&t2); } } @@ -560,11 +560,11 @@ UninitEncounter (void) t.align = ALIGN_CENTER; t.pStr = buf; t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += 6; t.pStr = GAME_STRING (ENCOUNTER_STRING_BASE + 3); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); ship_s.frame = FragPtr->ShipInfo.icons; @@ -599,7 +599,7 @@ UninitEncounter (void) SetContextForeGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x18), 0x50) ); - DrawText (&t); + font_DrawText (&t); DeltaSISGauges (0, 0, j); if ((VictoryState++ - 1) % MAX_DEAD_DISPLAYED) @@ -681,7 +681,7 @@ UninitEncounter (void) SetContextForeGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x18), 0x50) ); - DrawText (&t); + font_DrawText (&t); DrawFadeText ( str1 = GAME_STRING (ENCOUNTER_STRING_BASE + 6), diff --git a/sc2/src/sc2code/gameopt.c b/sc2/src/sc2code/gameopt.c index 757fb96e1..817cc3357 100644 --- a/sc2/src/sc2code/gameopt.c +++ b/sc2/src/sc2code/gameopt.c @@ -74,7 +74,7 @@ ConfirmSaveLoad (STAMP *MsgStamp) BUILD_COLOR (MAKE_RGB15 (0x8, 0x8, 0x8), 0x1F), TRUE, BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0xA), 0x08)); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x14, 0x14, 0x14), 0x0F)); - DrawText (&t); + font_DrawText (&t); } enum @@ -228,7 +228,7 @@ DrawDescriptionString (PMENU_STATE pMS, COUNT which_string, SIZE state) DrawFilledRectangle (&r); SetContextForeGroundColor (OldColor); } - DrawText (&lf); + font_DrawText (&lf); } SetFlashRect (&r, (FRAME)0); SetFlashRect ((PRECT)~0L, (FRAME)0); @@ -272,7 +272,7 @@ DrawDescriptionString (PMENU_STATE pMS, COUNT which_string, SIZE state) DrawFilledRectangle (&text_r); SetContextForeGroundColor (ForeGround); - DrawText (&lf); + font_DrawText (&lf); SetFlashRect (&r, (FRAME)0); } @@ -687,7 +687,7 @@ DrawCargo (COUNT redraw_state) SetContextForeGroundColor (cargo_color[i]); wsprintf (buf, "%u", GLOBAL_SIS (ElementAmounts[i])); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += 12; } t.baseline.x = 50; @@ -699,7 +699,7 @@ DrawCargo (COUNT redraw_state) SetContextForeGroundColor (cargo_color[i]); wsprintf (buf, "%u", GLOBAL_SIS (TotalBioMass)); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); } } @@ -830,7 +830,7 @@ ShowSummary (SUMMARY_DESC *pSD) SetContextForeGroundColor (BLACK_COLOR); DrawFilledRectangle (&r); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x10, 0x00, 0x10), 0x01)); - DrawText (&t); + font_DrawText (&t); t.CharCount = (COUNT)~0; } t.baseline.y = 126; @@ -842,7 +842,7 @@ ShowSummary (SUMMARY_DESC *pSD) SetContextForeGroundColor (BLACK_COLOR); DrawFilledRectangle (&r); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x10, 0x00, 0x10), 0x01)); - DrawText (&t); + font_DrawText (&t); r.corner.x = 1; r.corner.y = 141; @@ -891,7 +891,7 @@ ShowSummary (SUMMARY_DESC *pSD) SetContextFont (TinyFont); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33)); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.x = SIS_SCREEN_WIDTH - 57 + 1 + (SIS_TITLE_WIDTH >> 1); if (pSD->Activity == IN_STARBASE) wstrcpy (buf, GAME_STRING (STARBASE_STRING_BASE)); @@ -902,7 +902,7 @@ ShowSummary (SUMMARY_DESC *pSD) r.corner.x / 10, r.corner.x % 10, r.corner.y / 10, r.corner.y % 10); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); SetContext (OldContext); diff --git a/sc2/src/sc2code/libs/gfxlib.h b/sc2/src/sc2code/libs/gfxlib.h index 58c2a94ef..e1167c425 100644 --- a/sc2/src/sc2code/libs/gfxlib.h +++ b/sc2/src/sc2code/libs/gfxlib.h @@ -303,7 +303,7 @@ extern void DrawPoint (PPOINT pPoint); extern void DrawRectangle (PRECT pRect); extern void DrawFilledRectangle (PRECT pRect); extern void DrawLine (PLINE pLine); -extern void DrawText (PTEXT pText); +extern void font_DrawText (PTEXT pText); extern void DrawPolygon (POLYGON Polygon); extern void DrawFilledPolygon (POLYGON Polygon); extern void DrawBatch (PPRIMITIVE pBasePrim, PRIM_LINKS PrimLinks, diff --git a/sc2/src/sc2code/libs/graphics/font.c b/sc2/src/sc2code/libs/graphics/font.c index 6f55ad2dc..080755437 100644 --- a/sc2/src/sc2code/libs/graphics/font.c +++ b/sc2/src/sc2code/libs/graphics/font.c @@ -99,7 +99,7 @@ ReleaseFont (FONT Font) } void -DrawText (PTEXT lpText) +font_DrawText (PTEXT lpText) { SetPrimType (&_locPrim, TEXT_PRIM); _locPrim.Object.Text = *lpText; diff --git a/sc2/src/sc2code/melee.c b/sc2/src/sc2code/melee.c index 38b8efdf6..2f6cd349d 100644 --- a/sc2/src/sc2code/melee.c +++ b/sc2/src/sc2code/melee.c @@ -330,8 +330,8 @@ DrawTeamString (PMELEE_STATE pMS, COUNT HiLiteState) SetContextForeGroundColor (HiLiteState == 0 ? TEAM_NAME_TEXT_COLOR : TEAM_NAME_EDIT_TEXT_COLOR); - DrawText (&lfText); - DrawText (&rtText); + font_DrawText (&lfText); + font_DrawText (&rtText); } else { @@ -369,7 +369,7 @@ DrawTeamString (PMELEE_STATE pMS, COUNT HiLiteState) DrawFilledRectangle (&text_r); SetContextForeGroundColor (BLACK_COLOR); // TEAM_NAME_EDIT_TEXT_COLOR); - DrawText (&lfText); + font_DrawText (&lfText); } UnbatchGraphics (); } @@ -594,19 +594,19 @@ DrawMeleeShipStrings (PMELEE_STATE pMS, BYTE NewStarShip) { t.pStr = GAME_STRING (MELEE_STRING_BASE + 0); // "Empty" t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.pStr = GAME_STRING (MELEE_STRING_BASE + 1); // "Slot" } else { t.pStr = GAME_STRING (MELEE_STRING_BASE + 2); // "Team" t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.pStr = GAME_STRING (MELEE_STRING_BASE + 3); // "Name" } t.baseline.y += TINY_TEXT_HEIGHT; t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); } else { @@ -750,12 +750,12 @@ DrawFileStrings (PMELEE_STATE pMS, int HiLiteState) ? BUILD_COLOR (MAKE_RGB15 (15, 16, 27), 0x00) : BUILD_COLOR (MAKE_RGB15 (23, 24, 29), 0x00) ); - DrawText (&Text); + font_DrawText (&Text); rtText.baseline.y = Text.baseline.y; wsprintf (buf, "%d", GetTeamValue (&pMS->FileList[bot])); rtText.CharCount = (COUNT)~0; - DrawText (&rtText); + font_DrawText (&rtText); } else { @@ -794,12 +794,12 @@ DrawFileStrings (PMELEE_STATE pMS, int HiLiteState) Text.pStr = pMS->FileList[bot - top].TeamName; Text.CharCount = (COUNT)~0; SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (15, 16, 27), 0x00)); - DrawText (&Text); + font_DrawText (&Text); rtText.baseline.y = Text.baseline.y; wsprintf (buf, "%d", GetTeamValue (&pMS->FileList[bot - top])); rtText.CharCount = (COUNT)~0; - DrawText (&rtText); + font_DrawText (&rtText); } s.origin.x = Text.baseline.x + 1; diff --git a/sc2/src/sc2code/outfit.c b/sc2/src/sc2code/outfit.c index 02526bf56..6ea9bbef5 100644 --- a/sc2/src/sc2code/outfit.c +++ b/sc2/src/sc2code/outfit.c @@ -75,7 +75,7 @@ DrawModuleStrings (PMENU_STATE pMS, BYTE NewModule) wsprintf (buf, "%u", GLOBAL (ModuleCost[NewModule]) * MODULE_COST_SCALE); SetContextFont (TinyFont); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x1F, 0x00), 0x02)); - DrawText (&t); + font_DrawText (&t); } UnbatchGraphics (); SetContext (OldContext); diff --git a/sc2/src/sc2code/pickmele.c b/sc2/src/sc2code/pickmele.c index 9de62b179..b58d300ae 100644 --- a/sc2/src/sc2code/pickmele.c +++ b/sc2/src/sc2code/pickmele.c @@ -62,7 +62,7 @@ DrawMeleeFrame (STARSHIPPTR LastStarShipPtr, COUNT which_player) t.CharCount = (COUNT)~0; SetContextFont (TinyFont); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0x1F), 0x9)); - DrawText (&t); + font_DrawText (&t); r.corner.x = PICK_X_OFFS - 3; r.corner.y = PICK_Y_OFFS - 9 + ((1 - which_player) * PICK_SIDE_OFFS); @@ -74,7 +74,7 @@ DrawMeleeFrame (STARSHIPPTR LastStarShipPtr, COUNT which_player) t.pStr = buf; t.CharCount = (COUNT)~0; SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x4, 0x5, 0x1F), 0x4B)); - DrawText (&t); + font_DrawText (&t); if (LastStarShipPtr == 0 || LastStarShipPtr->special_counter == 0) { @@ -132,7 +132,7 @@ DrawMeleeFrame (STARSHIPPTR LastStarShipPtr, COUNT which_player) t.CharCount = (COUNT)~0; SetContextFont (TinyFont); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x13, 0x00, 0x00), 0x2C)); - DrawText (&t); + font_DrawText (&t); } } diff --git a/sc2/src/sc2code/pickship.c b/sc2/src/sc2code/pickship.c index b55b80066..3d76a9192 100644 --- a/sc2/src/sc2code/pickship.c +++ b/sc2/src/sc2code/pickship.c @@ -179,7 +179,7 @@ ChangeSelection: UnlockStarShip (&race_q[0], hBattleShip); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x14, 0x0A, 0x00), 0x0C)); - DrawText (&t); + font_DrawText (&t); SetContextForeGroundColor (BLACK_COLOR); } @@ -200,7 +200,7 @@ ChangeSelection: else wsprintf (buf, "%u/%u", crew_level, max_crew); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x14, 0x00), 0x02)); - DrawText (&t); + font_DrawText (&t); } SetFlashRect (&pMS->flash_rect0, (FRAME)0); @@ -445,7 +445,7 @@ DrawArmadaPickShip (BOOLEAN draw_salvage_frame, PRECT pPickRect) t.CharCount = (COUNT)~0; SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x12, 0x12, 0x12), 0x17)); SetContextFont (StarConFont); - DrawText (&t); + font_DrawText (&t); r.extent.width = ICON_WIDTH; r.extent.height = ICON_HEIGHT; diff --git a/sc2/src/sc2code/planets/cargo.c b/sc2/src/sc2code/planets/cargo.c index 0954f975b..f1443de12 100644 --- a/sc2/src/sc2code/planets/cargo.c +++ b/sc2/src/sc2code/planets/cargo.c @@ -53,7 +53,7 @@ ShowRemainingCapacity (void) SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01)); DrawFilledRectangle (&r); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0x1F), 0x09)); - DrawText (&rt); + font_DrawText (&rt); UnbatchGraphics (); SetContext (OldContext); @@ -105,7 +105,7 @@ DrawCargoStrings (BYTE OldElement, BYTE NewElement) ct.pStr = GAME_STRING (CARGO_STRING_BASE); ct.CharCount = (COUNT)~0; SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0x1F, 0x1F), 0x0B)); - DrawText (&ct); + font_DrawText (&ct); SetContextFont (TinyFont); } @@ -127,11 +127,11 @@ DrawCargoStrings (BYTE OldElement, BYTE NewElement) SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0x1F), 0x09)); rt.baseline.x = 32; rt_amount_buf[0] = '$'; - DrawText (&rt); + font_DrawText (&rt); rt.baseline.x = 58; rt_amount_buf[0] = '#'; - DrawText (&rt); + font_DrawText (&rt); for (OldElement = 0; OldElement < NUM_ELEMENT_CATEGORIES; ++OldElement) @@ -153,14 +153,14 @@ DrawCargoStrings (BYTE OldElement, BYTE NewElement) wsprintf (rt_amount_buf, "%u", GLOBAL (ElementWorth[OldElement])); rt.CharCount = (COUNT)~0; - DrawText (&rt); + font_DrawText (&rt); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x14, 0x14), 0x03)); rt.baseline.x = 58; wsprintf (rt_amount_buf, "%u", GLOBAL_SIS (ElementAmounts[OldElement])); rt.CharCount = (COUNT)~0; - DrawText (&rt); + font_DrawText (&rt); } cy += 9; @@ -182,7 +182,7 @@ DrawCargoStrings (BYTE OldElement, BYTE NewElement) rt.baseline.x = 58; wsprintf (rt_amount_buf, "%u", GLOBAL_SIS (TotalBioMass)); rt.CharCount = (COUNT)~0; - DrawText (&rt); + font_DrawText (&rt); r.corner.x = 4; r.corner.y = 117; @@ -199,7 +199,7 @@ DrawCargoStrings (BYTE OldElement, BYTE NewElement) lt.align = ALIGN_LEFT; lt.pStr = GAME_STRING (CARGO_STRING_BASE + 1); lt.CharCount = (COUNT)~0; - DrawText (<); + font_DrawText (<); } ShowRemainingCapacity (); @@ -229,14 +229,14 @@ DrawCargoStrings (BYTE OldElement, BYTE NewElement) rt.baseline.x = 32; wsprintf (rt_amount_buf, "%u", GLOBAL (ElementWorth[OldElement])); rt.CharCount = (COUNT)~0; - DrawText (&rt); + font_DrawText (&rt); wsprintf (rt_amount_buf, "%u", GLOBAL_SIS (ElementAmounts[OldElement])); } SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x14, 0x14), 0x03)); rt.baseline.x = 58; rt.CharCount = (COUNT)~0; - DrawText (&rt); + font_DrawText (&rt); } if (NewElement != (BYTE)~0) @@ -259,14 +259,14 @@ DrawCargoStrings (BYTE OldElement, BYTE NewElement) rt.baseline.x = 32; wsprintf (rt_amount_buf, "%u", GLOBAL (ElementWorth[NewElement])); rt.CharCount = (COUNT)~0; - DrawText (&rt); + font_DrawText (&rt); wsprintf (rt_amount_buf, "%u", GLOBAL_SIS (ElementAmounts[NewElement])); } SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0x1F, 0x1F), 0x0B)); rt.baseline.x = 58; rt.CharCount = (COUNT)~0; - DrawText (&rt); + font_DrawText (&rt); } UnbatchGraphics (); diff --git a/sc2/src/sc2code/planets/devices.c b/sc2/src/sc2code/planets/devices.c index b1bcefa93..9053ac91a 100644 --- a/sc2/src/sc2code/planets/devices.c +++ b/sc2/src/sc2code/planets/devices.c @@ -89,7 +89,7 @@ DrawDevices (PMENU_STATE pMS, BYTE OldDevice, BYTE NewDevice) ct.pStr = GAME_STRING (DEVICE_STRING_BASE); ct.CharCount = (COUNT)~0; SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0x1F, 0x1F), 0x0B)); - DrawText (&ct); + font_DrawText (&ct); SetContextFont (TinyFont); } @@ -119,11 +119,11 @@ DrawDevices (PMENU_STATE pMS, BYTE OldDevice, BYTE NewDevice) t.baseline.y = cy; t.pStr = GAME_STRING (pDeviceMap[OldDevice] + DEVICE_STRING_BASE + 1); t.CharCount = lpstrchr (t.pStr, ' '); - DrawText (&t); + font_DrawText (&t); t.baseline.y += 7; t.pStr += t.CharCount + 1; t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); } cy += 18; @@ -148,11 +148,11 @@ DrawDevices (PMENU_STATE pMS, BYTE OldDevice, BYTE NewDevice) t.baseline.y = cy; t.pStr = GAME_STRING (pDeviceMap[OldDevice] + DEVICE_STRING_BASE + 1); t.CharCount = lpstrchr (t.pStr, ' '); - DrawText (&t); + font_DrawText (&t); t.baseline.y += 7; t.pStr += t.CharCount + 1; t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); } if (NewDevice < NUM_DEVICES) @@ -166,11 +166,11 @@ DrawDevices (PMENU_STATE pMS, BYTE OldDevice, BYTE NewDevice) t.baseline.y = cy; t.pStr = GAME_STRING (pDeviceMap[NewDevice] + DEVICE_STRING_BASE + 1); t.CharCount = lpstrchr (t.pStr, ' '); - DrawText (&t); + font_DrawText (&t); t.baseline.y += 7; t.pStr += t.CharCount + 1; t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); } ClearSemaphore (GraphicsSem); diff --git a/sc2/src/sc2code/planets/lander.c b/sc2/src/sc2code/planets/lander.c index 3ab110d87..e800896ec 100644 --- a/sc2/src/sc2code/planets/lander.c +++ b/sc2/src/sc2code/planets/lander.c @@ -1299,13 +1299,13 @@ ScrollPlanetSide (SIZE dx, SIZE dy, SIZE CountDown) pPSD->MineralText[0].baseline.x -= dx; pPSD->MineralText[0].baseline.y -= dy; - DrawText (&pPSD->MineralText[0]); + font_DrawText (&pPSD->MineralText[0]); pPSD->MineralText[1].baseline.x = pPSD->MineralText[0].baseline.x; pPSD->MineralText[1].baseline.y = pPSD->MineralText[0].baseline.y + 7; - DrawText (&pPSD->MineralText[1]); + font_DrawText (&pPSD->MineralText[1]); pPSD->MineralText[2].baseline.x = pPSD->MineralText[1].baseline.x; pPSD->MineralText[2].baseline.y = pPSD->MineralText[1].baseline.y + 7; - DrawText (&pPSD->MineralText[2]); + font_DrawText (&pPSD->MineralText[2]); } } diff --git a/sc2/src/sc2code/planets/pstarmap.c b/sc2/src/sc2code/planets/pstarmap.c index a8307d473..fd8323095 100644 --- a/sc2/src/sc2code/planets/pstarmap.c +++ b/sc2/src/sc2code/planets/pstarmap.c @@ -429,7 +429,7 @@ DrawStarMap (COUNT race_update, PRECT pClipRect) BUILD_COLOR (MAKE_RGB15 (r, g, b), COLOR_256 (c) - 1) ); } - DrawText (&t); + font_DrawText (&t); } } diff --git a/sc2/src/sc2code/planets/report.c b/sc2/src/sc2code/planets/report.c index d47f377b0..6dce5b042 100644 --- a/sc2/src/sc2code/planets/report.c +++ b/sc2/src/sc2code/planets/report.c @@ -133,11 +133,11 @@ MakeReport (SOUND ReadOutSounds, UNICODE *pStr, COUNT StrLen) while (word_chars--) { if (!Sleepy) - DrawText (&t); + font_DrawText (&t); else { SetSemaphore (GraphicsSem); - DrawText (&t); + font_DrawText (&t); ClearSemaphore (GraphicsSem); PlaySound (ReadOutSounds, GAME_SOUND_PRIORITY); diff --git a/sc2/src/sc2code/planets/scan.c b/sc2/src/sc2code/planets/scan.c index e97442fde..7ed80420a 100644 --- a/sc2/src/sc2code/planets/scan.c +++ b/sc2/src/sc2code/planets/scan.c @@ -97,7 +97,7 @@ PrintScanTitlePC (TEXT *t, RECT *r, char *txt, int xpos) SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x15), 0x3B)); wsprintf (t->pStr, txt); t->CharCount = (COUNT)~0; - DrawText (t); + font_DrawText (t); TextRect (t, r, NULL_PTR); t->baseline.x += r->extent.width; SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xF, 0x00, 0x19), 0x3B)); @@ -174,7 +174,7 @@ PrintCoarseScanPC (void) SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x15), 0x3B)); SetContextFont (MicroFont); - DrawText (&t); + font_DrawText (&t); SetContextFont (TinyFont); ClearSemaphore (GraphicsSem); @@ -195,7 +195,7 @@ PrintCoarseScanPC (void) else wsprintf (buf, "%u.%02u a.u.", temp / 100, temp % 100); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING_PC; ClearSemaphore (GraphicsSem); @@ -216,7 +216,7 @@ PrintCoarseScanPC (void) wsprintf (buf, "%u.%02u atm", temp / 100, temp % 100); } t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING_PC; ClearSemaphore (GraphicsSem); @@ -225,7 +225,7 @@ PrintCoarseScanPC (void) PrintScanTitlePC (&t, &r, "Temp: ", LEFT_SIDE_BASELINE_X_PC); wsprintf (buf, "%d^ c", pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING_PC; ClearSemaphore (GraphicsSem); @@ -237,7 +237,7 @@ PrintCoarseScanPC (void) else wsprintf (buf, "Class %u", pSolarSysState->SysInfo.PlanetInfo.Weather + 1); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING_PC; ClearSemaphore (GraphicsSem); @@ -249,7 +249,7 @@ PrintCoarseScanPC (void) else wsprintf (buf, "Class %u", pSolarSysState->SysInfo.PlanetInfo.Tectonics + 1); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); ClearSemaphore (GraphicsSem); t.baseline.y = SCAN_BASELINE_Y_PC; @@ -272,7 +272,7 @@ PrintCoarseScanPC (void) wsprintf (buf, "%lu.%02lu e.s.", tr / 100, tr % 100); } t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING_PC; ClearSemaphore (GraphicsSem); @@ -284,7 +284,7 @@ PrintCoarseScanPC (void) else wsprintf (buf, "%u.%02u e.s.", temp / 100, temp % 100); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING_PC; ClearSemaphore (GraphicsSem); @@ -300,7 +300,7 @@ PrintCoarseScanPC (void) wsprintf (buf, "%u.%02u g.", temp / 100, temp % 100); } t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING_PC; ClearSemaphore (GraphicsSem); @@ -319,7 +319,7 @@ PrintCoarseScanPC (void) wsprintf (buf, "%u.%u days", temp / 10, temp % 10); } t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING_PC; ClearSemaphore (GraphicsSem); @@ -330,7 +330,7 @@ PrintCoarseScanPC (void) temp = -temp; wsprintf (buf, "%u^", temp); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); ClearSemaphore (GraphicsSem); } @@ -404,7 +404,7 @@ PrintCoarseScan3DO (void) t.CharCount = (COUNT)~0; SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xF, 0x00, 0x19), 0x3B)); SetContextFont (MicroFont); - DrawText (&t); + font_DrawText (&t); s.origin.x = s.origin.y = 0; s.origin.x = 16 - SAFE_X; @@ -430,7 +430,7 @@ PrintCoarseScan3DO (void) else wsprintf (buf, "%u.%02u&", temp / 100, temp % 100); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING; ClearSemaphore (GraphicsSem); @@ -448,7 +448,7 @@ PrintCoarseScan3DO (void) wsprintf (buf, "%u.%02u&", temp / 100, temp % 100); } t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING; ClearSemaphore (GraphicsSem); @@ -456,7 +456,7 @@ PrintCoarseScan3DO (void) t.pStr = buf; wsprintf (buf, "%d^", pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING; ClearSemaphore (GraphicsSem); @@ -465,7 +465,7 @@ PrintCoarseScan3DO (void) wsprintf (buf, "<%u>", pSolarSysState->SysInfo.PlanetInfo.AtmoDensity == 0 ? 0 : (pSolarSysState->SysInfo.PlanetInfo.Weather + 1)); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING; ClearSemaphore (GraphicsSem); @@ -477,7 +477,7 @@ PrintCoarseScan3DO (void) ) == GAS_GIANT ? 0 : (pSolarSysState->SysInfo.PlanetInfo.Tectonics + 1)); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); ClearSemaphore (GraphicsSem); t.baseline.x = RIGHT_SIDE_BASELINE_X; @@ -501,7 +501,7 @@ PrintCoarseScan3DO (void) wsprintf (buf, "%lu.%02lu&", tr / 100, tr % 100); } t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING; ClearSemaphore (GraphicsSem); @@ -512,7 +512,7 @@ PrintCoarseScan3DO (void) else wsprintf (buf, "%u.%02u&", temp / 100, temp % 100); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING; ClearSemaphore (GraphicsSem); @@ -527,7 +527,7 @@ PrintCoarseScan3DO (void) wsprintf (buf, "%u.%02u&", temp / 100, temp % 100); } t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING; ClearSemaphore (GraphicsSem); @@ -537,7 +537,7 @@ PrintCoarseScan3DO (void) temp = -temp; wsprintf (buf, "%u^", temp); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += SCAN_LEADING; ClearSemaphore (GraphicsSem); @@ -555,7 +555,7 @@ PrintCoarseScan3DO (void) wsprintf (buf, "%u.%u&", temp / 10, temp % 10); } t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); ClearSemaphore (GraphicsSem); } @@ -1066,7 +1066,7 @@ DoScan (INPUT_STATE InputState, PMENU_STATE ); break; } - DrawText (&t); + font_DrawText (&t); SetContext (ScanContext); ClearSemaphore (GraphicsSem); diff --git a/sc2/src/sc2code/save.c b/sc2/src/sc2code/save.c index 197974e69..b7a028025 100644 --- a/sc2/src/sc2code/save.c +++ b/sc2/src/sc2code/save.c @@ -196,7 +196,7 @@ SaveProblemMessage (STAMP *MsgStamp) if (*t.pStr == '\0') break; t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); t.baseline.y += 11; } UnbatchGraphics (); diff --git a/sc2/src/sc2code/shipstat.c b/sc2/src/sc2code/shipstat.c index d334f7831..203cb1285 100644 --- a/sc2/src/sc2code/shipstat.c +++ b/sc2/src/sc2code/shipstat.c @@ -60,10 +60,10 @@ DrawShipNameString (UNICODE *pStr, COUNT CharCount, COORD y) Text.baseline.x = STATUS_WIDTH >> 1; SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19)); - DrawText (&Text); + font_DrawText (&Text); --Text.baseline.y; SetContextForeGroundColor (BLACK_COLOR); - DrawText (&Text); + font_DrawText (&Text); SetContextFont (OldFont); } @@ -250,7 +250,7 @@ InitShipStatus (STARSHIPPTR StarShipPtr, PRECT pClipRect) Text.baseline.y = y + GAUGE_YOFFS + 9; SetContextForeGroundColor (BLACK_COLOR); - DrawText (&Text); + font_DrawText (&Text); SetContextFont (OldFont); } diff --git a/sc2/src/sc2code/shipyard.c b/sc2/src/sc2code/shipyard.c index 5075da352..e79f962ab 100644 --- a/sc2/src/sc2code/shipyard.c +++ b/sc2/src/sc2code/shipyard.c @@ -175,7 +175,7 @@ DrawRaceStrings (BYTE NewRaceItem) wsprintf (buf, "%u", ShipCost[NewRaceItem]); SetContextFont (TinyFont); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x1F, 0x00), 0x02)); - DrawText (&t); + font_DrawText (&t); } UnbatchGraphics (); @@ -230,7 +230,7 @@ ShowShipCrew (SHIP_FRAGMENTPTR StarShipPtr, PRECT pRect) DrawFilledRectangle (&r); } SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x14, 0x00), 0x02)); - DrawText (&t); + font_DrawText (&t); } static void diff --git a/sc2/src/sc2code/sis.c b/sc2/src/sc2code/sis.c index 15b132629..5e14caaab 100644 --- a/sc2/src/sc2code/sis.c +++ b/sc2/src/sc2code/sis.c @@ -123,7 +123,7 @@ SetContextClipRect (&r); SetContextBackGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01)); ClearDrawable (); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33)); - DrawText (&t); + font_DrawText (&t); UnbatchGraphics (); SetContextClipRect (NULL_PTR); @@ -207,7 +207,7 @@ SetContextClipRect (&r); t.CharCount = (COUNT)~0; SetContextFont (TinyFont); - DrawText (&t); + font_DrawText (&t); } UnbatchGraphics (); @@ -295,7 +295,7 @@ DrawStatusMessage (UNICODE *pStr) SetContextFont (TinyFont); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x10, 0x00), 0x6B)); - DrawText (&t); + font_DrawText (&t); UnbatchGraphics (); SetContextClipRect (NULL_PTR); @@ -328,7 +328,7 @@ DrawCaptainsName (void) t.pStr = GLOBAL_SIS (CommanderName); t.CharCount = (COUNT)~0; SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x16, 0xB, 0x1F), 0x38)); - DrawText (&t); + font_DrawText (&t); SetContextForeGroundColor (OldColor); SetContextFont (OldFont); @@ -390,7 +390,7 @@ DrawFlagshipName (BOOLEAN InStatusArea) } else SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x14, 0x0A, 0x00), 0x0C)); - DrawText (&t); + font_DrawText (&t); if (optWhichFonts == OPT_PC) SetContextFontEffect (0, 0, 0); @@ -537,7 +537,7 @@ void DrawPC_SIS () BUILD_COLOR_RGBA (0x6B, 0x00, 0x00, 0xFF), BUILD_COLOR_RGBA (0xF7, 0x00, 0x00, 0xFF)); wsprintf (buf, "FUEL"); - DrawText (&t); + font_DrawText (&t); r.corner.y += 79; t.baseline.y += 79; @@ -547,7 +547,7 @@ void DrawPC_SIS () BUILD_COLOR_RGBA (0x00, 0x4D, 0x00, 0xFF), BUILD_COLOR_RGBA (0x00, 0xAE, 0x00, 0xFF)); wsprintf (buf, "CREW"); - DrawText (&t); + font_DrawText (&t); SetContextFontEffect (0, 0, 0); r.corner.x = 2 + 1; @@ -559,7 +559,7 @@ void DrawPC_SIS () SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x02, 0x04, 0x1E), 0x38)); t.baseline.y = r.corner.y + 6; wsprintf (buf, "CAPTAIN"); - DrawText (&t); + font_DrawText (&t); } void @@ -706,7 +706,7 @@ DeltaSISGauges (SIZE crew_delta, SIZE fuel_delta, int resunit_delta) SetContextForeGroundColor (BLACK_COLOR); DrawFilledRectangle (&r); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0xE, 0x00), 0x6C)); - DrawText (&t); + font_DrawText (&t); } if (fuel_delta != 0) @@ -742,7 +742,7 @@ DeltaSISGauges (SIZE crew_delta, SIZE fuel_delta, int resunit_delta) SetContextForeGroundColor (BLACK_COLOR); DrawFilledRectangle (&r); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x13, 0x00, 0x00), 0x2C)); - DrawText (&t); + font_DrawText (&t); } } @@ -1262,11 +1262,11 @@ DrawPCMenu (BYTE beg_index, BYTE end_index, BYTE NewState, BYTE hilite, RECT *r) r->extent.height = PC_MENU_HEIGHT - 1; DrawFilledRectangle (r); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x0A, 0x1F, 0x1F), 0x08)); - DrawText (&t); + font_DrawText (&t); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x15, 0x15), 0x08)); } else - DrawText (&t); + font_DrawText (&t); t.baseline.y += PC_MENU_HEIGHT; } } @@ -1400,7 +1400,7 @@ DrawMenuStateStrings (BYTE beg_index, SWORD NewState) wsprintf (buf, "%u", GLOBAL (CrewCost)); SetContextFont (TinyFont); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x1F, 0x00), 0x02)); - DrawText (&t); + font_DrawText (&t); break; case PM_FUEL: t.baseline.x = s.origin.x + RADAR_WIDTH - 2; @@ -1411,7 +1411,7 @@ DrawMenuStateStrings (BYTE beg_index, SWORD NewState) wsprintf (buf, "%u", GLOBAL (FuelCost)); SetContextFont (TinyFont); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x1F, 0x00), 0x02)); - DrawText (&t); + font_DrawText (&t); break; } } diff --git a/sc2/src/sc2code/starbase.c b/sc2/src/sc2code/starbase.c index 11aef6909..34e97545d 100644 --- a/sc2/src/sc2code/starbase.c +++ b/sc2/src/sc2code/starbase.c @@ -44,7 +44,7 @@ DrawBaseStateStrings (STARBASE_STATE OldState, STARBASE_STATE NewState) { t.pStr = GAME_STRING (STARBASE_STRING_BASE + 1 + OldState); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); } t.baseline.y += (23 - 4); } @@ -53,13 +53,13 @@ DrawBaseStateStrings (STARBASE_STATE OldState, STARBASE_STATE NewState) t.baseline.y = 106 + 28 + (SAFE_Y + 4) + ((23 - 4) * OldState); t.pStr = GAME_STRING (STARBASE_STRING_BASE + 1 + OldState); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x1F, 0x1F, 0xA), 0x0E)); t.baseline.y = 106 + 28 + (SAFE_Y + 4) + ((23 - 4) * NewState); t.pStr = GAME_STRING (STARBASE_STRING_BASE + 1 + NewState); t.CharCount = (COUNT)~0; - DrawText (&t); + font_DrawText (&t); } void diff --git a/sc2/src/sc2code/status.c b/sc2/src/sc2code/status.c index 78f757e30..9cad3e349 100644 --- a/sc2/src/sc2code/status.c +++ b/sc2/src/sc2code/status.c @@ -134,7 +134,7 @@ DrawBattleCrewAmount (BOOLEAN CountPlayer) SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0xA), 0x08)); DrawFilledRectangle (&r); SetContextForeGroundColor (BLACK_COLOR); - DrawText (&t); + font_DrawText (&t); } void @@ -249,7 +249,7 @@ DrawCaptainsWindow (STARSHIPPTR StarShipPtr) DrawBattleCrewAmount (TRUE); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x14, 0x00), 0x02)); SetContextFont (TinyFont); - DrawText (&t); + font_DrawText (&t); } }