DrawTracedText abstraction; bug #1029; from Nic, modified
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3081 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Changes towards version 0.7:
|
||||
- DrawTracedText abstraction (bug #1029), from Nic
|
||||
- Experimental support for Symbian S60 3rd edition - Mika & SvdB
|
||||
- Pthread support - Mika
|
||||
- Content Dirs completely reorganized; 3DO and PC segregation - Coredev
|
||||
|
||||
+2
-24
@@ -250,30 +250,8 @@ add_text (int status, TEXT *pTextIn)
|
||||
else
|
||||
{
|
||||
// Alien speech
|
||||
|
||||
// Draw the background by drawing the same text in the
|
||||
// background color one pixel shifted to all 4 directions.
|
||||
SetContextForeGroundColor (CommData.AlienTextBColor);
|
||||
|
||||
--pText->baseline.x;
|
||||
font_DrawText (pText);
|
||||
|
||||
++pText->baseline.x;
|
||||
--pText->baseline.y;
|
||||
font_DrawText (pText);
|
||||
|
||||
++pText->baseline.x;
|
||||
++pText->baseline.y;
|
||||
font_DrawText (pText);
|
||||
|
||||
--pText->baseline.x;
|
||||
++pText->baseline.y;
|
||||
font_DrawText (pText);
|
||||
|
||||
SetContextForeGroundColor (CommData.AlienTextFColor);
|
||||
|
||||
--pText->baseline.y;
|
||||
font_DrawText (pText);
|
||||
font_DrawTracedText (pText,
|
||||
CommData.AlienTextFColor, CommData.AlienTextBColor);
|
||||
}
|
||||
} while (!eol && maxchars);
|
||||
pText->pStr = pStr;
|
||||
|
||||
+1
-19
@@ -148,30 +148,12 @@ DoFadeScreen (PRESENTATION_INPUT_STATE* pPIS, const char *Src, BYTE FadeType)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
DrawTracedText (TEXT *pText, COLOR Fore, COLOR Back)
|
||||
{
|
||||
SetContextForeGroundColor (Back);
|
||||
pText->baseline.x--;
|
||||
font_DrawText (pText);
|
||||
pText->baseline.x += 2;
|
||||
font_DrawText (pText);
|
||||
pText->baseline.x--;
|
||||
pText->baseline.y--;
|
||||
font_DrawText (pText);
|
||||
pText->baseline.y += 2;
|
||||
font_DrawText (pText);
|
||||
pText->baseline.y--;
|
||||
SetContextForeGroundColor (Fore);
|
||||
font_DrawText (pText);
|
||||
}
|
||||
|
||||
static void
|
||||
DrawTextEffect (TEXT *pText, COLOR Fore, COLOR Back, int Effect)
|
||||
{
|
||||
if (Effect == 'T')
|
||||
{
|
||||
DrawTracedText (pText, Fore, Back);
|
||||
font_DrawTracedText (pText, Fore, Back);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -183,6 +183,7 @@ extern void DrawRectangle (RECT *pRect);
|
||||
extern void DrawFilledRectangle (RECT *pRect);
|
||||
extern void DrawLine (LINE *pLine);
|
||||
extern void font_DrawText (TEXT *pText);
|
||||
extern void font_DrawTracedText (TEXT *pText, COLOR text, COLOR trace);
|
||||
extern void DrawBatch (PRIMITIVE *pBasePrim, PRIM_LINKS PrimLinks,
|
||||
BATCH_FLAGS BatchFlags);
|
||||
extern void BatchGraphics (void);
|
||||
|
||||
@@ -62,6 +62,30 @@ font_DrawText (TEXT *lpText)
|
||||
DrawBatch (&_locPrim, 0, BATCH_SINGLE);
|
||||
}
|
||||
|
||||
|
||||
/* Draw the stroke by drawing the same text in the
|
||||
* background color one pixel shifted to all 4 directions.
|
||||
*/
|
||||
void
|
||||
font_DrawTracedText (TEXT *pText, COLOR text, COLOR trace)
|
||||
{
|
||||
// Preserve current foreground color for full correctness
|
||||
COLOR oldfg = SetContextForeGroundColor (trace);
|
||||
pText->baseline.x--;
|
||||
font_DrawText (pText);
|
||||
pText->baseline.x += 2;
|
||||
font_DrawText (pText);
|
||||
pText->baseline.x--;
|
||||
pText->baseline.y--;
|
||||
font_DrawText (pText);
|
||||
pText->baseline.y += 2;
|
||||
font_DrawText (pText);
|
||||
pText->baseline.y--;
|
||||
SetContextForeGroundColor (text);
|
||||
font_DrawText (pText);
|
||||
SetContextForeGroundColor (oldfg);
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
GetContextFontLeading (SIZE *pheight)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user