Make border and box math dependent on symbolic constants instead of literals (easier to change)
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3184 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -88,14 +88,14 @@ DrawSISFrame (void)
|
|||||||
r.extent.height = SIS_ORG_Y;
|
r.extent.height = SIS_ORG_Y;
|
||||||
|
|
||||||
r.corner.x = SIS_ORG_X;
|
r.corner.x = SIS_ORG_X;
|
||||||
r.extent.width = SIS_SCREEN_WIDTH - 69;
|
r.extent.width = SIS_MESSAGE_BOX_WIDTH;
|
||||||
DrawStarConBox (&r, 1,
|
DrawStarConBox (&r, 1,
|
||||||
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x0E), 0x54),
|
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x0E), 0x54),
|
||||||
BUILD_COLOR (MAKE_RGB15 (0x00, 0x01, 0x1C), 0x4E),
|
BUILD_COLOR (MAKE_RGB15 (0x00, 0x01, 0x1C), 0x4E),
|
||||||
TRUE, BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01));
|
TRUE, BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x14), 0x01));
|
||||||
|
|
||||||
r.extent.width = 57;
|
r.extent.width = SIS_TITLE_BOX_WIDTH;
|
||||||
r.corner.x = SIS_ORG_X + SIS_SCREEN_WIDTH - 57;
|
r.corner.x = SIS_ORG_X + SIS_SCREEN_WIDTH - SIS_TITLE_BOX_WIDTH;
|
||||||
DrawStarConBox (&r, 1,
|
DrawStarConBox (&r, 1,
|
||||||
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x0E), 0x54),
|
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x0E), 0x54),
|
||||||
BUILD_COLOR (MAKE_RGB15 (0x00, 0x01, 0x1C), 0x4E),
|
BUILD_COLOR (MAKE_RGB15 (0x00, 0x01, 0x1C), 0x4E),
|
||||||
@@ -117,10 +117,10 @@ DrawSISFrame (void)
|
|||||||
BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19));
|
BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19));
|
||||||
r.corner.y = 1;
|
r.corner.y = 1;
|
||||||
r.extent.width = 1;
|
r.extent.width = 1;
|
||||||
r.extent.height = SAFE_Y + 8;
|
r.extent.height = SAFE_Y + SIS_TITLE_HEIGHT;
|
||||||
r.corner.x = SIS_ORG_X - 1;
|
r.corner.x = SIS_ORG_X - 1;
|
||||||
DrawFilledRectangle (&r);
|
DrawFilledRectangle (&r);
|
||||||
r.corner.x = SIS_ORG_X + SIS_SCREEN_WIDTH - 57 - 1;
|
r.corner.x = SIS_ORG_X + SIS_SCREEN_WIDTH - SIS_TITLE_BOX_WIDTH - 1;
|
||||||
DrawFilledRectangle (&r);
|
DrawFilledRectangle (&r);
|
||||||
|
|
||||||
r.corner.x = 0;
|
r.corner.x = 0;
|
||||||
@@ -153,8 +153,8 @@ DrawSISFrame (void)
|
|||||||
BUILD_COLOR (MAKE_RGB15 (0x08, 0x08, 0x08), 0x1F));
|
BUILD_COLOR (MAKE_RGB15 (0x08, 0x08, 0x08), 0x1F));
|
||||||
r.corner.y = 1;
|
r.corner.y = 1;
|
||||||
r.extent.width = 1;
|
r.extent.width = 1;
|
||||||
r.extent.height = SAFE_Y + 8;
|
r.extent.height = SAFE_Y + SIS_MESSAGE_HEIGHT;
|
||||||
r.corner.x = SIS_ORG_X + (SIS_SCREEN_WIDTH - 69);
|
r.corner.x = SIS_ORG_X + SIS_MESSAGE_BOX_WIDTH;
|
||||||
DrawFilledRectangle (&r);
|
DrawFilledRectangle (&r);
|
||||||
r.corner.x = SIS_ORG_X + SIS_SCREEN_WIDTH;
|
r.corner.x = SIS_ORG_X + SIS_SCREEN_WIDTH;
|
||||||
++r.extent.height;
|
++r.extent.height;
|
||||||
@@ -166,8 +166,8 @@ DrawSISFrame (void)
|
|||||||
r.corner.x = 0;
|
r.corner.x = 0;
|
||||||
r.extent.width = SIS_ORG_X - r.corner.x;
|
r.extent.width = SIS_ORG_X - r.corner.x;
|
||||||
DrawFilledRectangle (&r);
|
DrawFilledRectangle (&r);
|
||||||
r.corner.x = SIS_ORG_X + (SIS_SCREEN_WIDTH - 69);
|
r.corner.x = SIS_ORG_X + SIS_MESSAGE_BOX_WIDTH;
|
||||||
r.extent.width = (SIS_ORG_X + SIS_SCREEN_WIDTH - 57) - r.corner.x;
|
r.extent.width = SIS_SPACER_BOX_WIDTH;
|
||||||
DrawFilledRectangle (&r);
|
DrawFilledRectangle (&r);
|
||||||
|
|
||||||
r.corner.x = 0;
|
r.corner.x = 0;
|
||||||
|
|||||||
@@ -804,7 +804,8 @@ ShowSummary (SUMMARY_DESC *pSD)
|
|||||||
t.CharCount = (COUNT)~0;
|
t.CharCount = (COUNT)~0;
|
||||||
font_DrawText (&t);
|
font_DrawText (&t);
|
||||||
t.align = ALIGN_CENTER;
|
t.align = ALIGN_CENTER;
|
||||||
t.baseline.x = SIS_SCREEN_WIDTH - 57 - 3 + (SIS_TITLE_WIDTH >> 1);
|
t.baseline.x = SIS_SCREEN_WIDTH - SIS_TITLE_BOX_WIDTH - 3
|
||||||
|
+ (SIS_TITLE_WIDTH >> 1);
|
||||||
if (pSD->Activity == IN_STARBASE)
|
if (pSD->Activity == IN_STARBASE)
|
||||||
utf8StringCopy (buf, sizeof (buf),
|
utf8StringCopy (buf, sizeof (buf),
|
||||||
GAME_STRING (STARBASE_STRING_BASE));
|
GAME_STRING (STARBASE_STRING_BASE));
|
||||||
|
|||||||
+7
-10
@@ -112,6 +112,7 @@ DrawSISTitle (UNICODE *pStr)
|
|||||||
{
|
{
|
||||||
TEXT t;
|
TEXT t;
|
||||||
CONTEXT OldContext;
|
CONTEXT OldContext;
|
||||||
|
RECT r;
|
||||||
|
|
||||||
t.baseline.x = SIS_TITLE_WIDTH >> 1;
|
t.baseline.x = SIS_TITLE_WIDTH >> 1;
|
||||||
t.baseline.y = SIS_TITLE_HEIGHT - 2;
|
t.baseline.y = SIS_TITLE_HEIGHT - 2;
|
||||||
@@ -120,16 +121,12 @@ DrawSISTitle (UNICODE *pStr)
|
|||||||
t.CharCount = (COUNT)~0;
|
t.CharCount = (COUNT)~0;
|
||||||
|
|
||||||
OldContext = SetContext (OffScreenContext);
|
OldContext = SetContext (OffScreenContext);
|
||||||
{
|
r.corner.x = SIS_ORG_X + SIS_SCREEN_WIDTH - SIS_TITLE_BOX_WIDTH + 1;
|
||||||
RECT r;
|
r.corner.y = SIS_ORG_Y - SIS_TITLE_HEIGHT;
|
||||||
|
r.extent.width = SIS_TITLE_WIDTH;
|
||||||
r.corner.x = SIS_ORG_X + SIS_SCREEN_WIDTH - 57 + 1;
|
r.extent.height = SIS_TITLE_HEIGHT - 1;
|
||||||
r.corner.y = SIS_ORG_Y - SIS_TITLE_HEIGHT;
|
SetContextFGFrame (Screen);
|
||||||
r.extent.width = SIS_TITLE_WIDTH;
|
SetContextClipRect (&r);
|
||||||
r.extent.height = SIS_TITLE_HEIGHT - 1;
|
|
||||||
SetContextFGFrame (Screen);
|
|
||||||
SetContextClipRect (&r);
|
|
||||||
}
|
|
||||||
SetContextFont (TinyFont);
|
SetContextFont (TinyFont);
|
||||||
|
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
|
|||||||
+10
-6
@@ -189,12 +189,16 @@ enum
|
|||||||
{3 + 0, 30 + (5 * 16)}, \
|
{3 + 0, 30 + (5 * 16)}, \
|
||||||
{3 + 42, 30 + (5 * 16)},
|
{3 + 42, 30 + (5 * 16)},
|
||||||
|
|
||||||
#define SIS_MESSAGE_WIDTH (SIS_SCREEN_WIDTH - 69 - 2)
|
#define SIS_TITLE_BOX_WIDTH 57
|
||||||
#define SIS_MESSAGE_HEIGHT 8
|
#define SIS_TITLE_WIDTH (SIS_TITLE_BOX_WIDTH - 2)
|
||||||
#define SIS_TITLE_WIDTH 55
|
#define SIS_TITLE_HEIGHT 8
|
||||||
#define SIS_TITLE_HEIGHT 8
|
#define SIS_SPACER_BOX_WIDTH 12
|
||||||
#define STATUS_MESSAGE_WIDTH 60
|
#define SIS_MESSAGE_BOX_WIDTH (SIS_SCREEN_WIDTH - SIS_TITLE_BOX_WIDTH \
|
||||||
#define STATUS_MESSAGE_HEIGHT 7
|
- SIS_SPACER_BOX_WIDTH)
|
||||||
|
#define SIS_MESSAGE_WIDTH (SIS_MESSAGE_BOX_WIDTH - 2)
|
||||||
|
#define SIS_MESSAGE_HEIGHT SIS_TITLE_HEIGHT
|
||||||
|
#define STATUS_MESSAGE_WIDTH (STATUS_WIDTH - 4)
|
||||||
|
#define STATUS_MESSAGE_HEIGHT 7
|
||||||
|
|
||||||
#define SIS_NAME_SIZE 16
|
#define SIS_NAME_SIZE 16
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user