Added the LINE command to presentations.

Format:
LINE x1 y1 x2 y2
It treats TC as the desired color to use.


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2846 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2007-09-03 07:14:14 +00:00
parent a6d90b4dfe
commit 14dad53337
+26
View File
@@ -703,6 +703,32 @@ DoPresentation (void *pIS)
utf8StringCopy (pPIS->Buffer, sizeof (pPIS->Buffer), pStr); utf8StringCopy (pPIS->Buffer, sizeof (pPIS->Buffer), pStr);
ShowPresentationFile (pPIS->Buffer); ShowPresentationFile (pPIS->Buffer);
} }
else if (strcmp (Opcode, "LINE") == 0)
{
int x1, x2, y1, y2;
if (4 == sscanf (pStr, "%d %d %d %d", &x1, &y1, &x2, &y2))
{
COLOR old_color;
LINE l;
l.first.x = x1;
l.first.y = y1;
l.second.x = x2;
l.second.y = y2;
if (!pPIS->Batched)
LockMutex (GraphicsLock);
old_color = SetContextForeGroundColor (pPIS->TextColor);
DrawLine (&l);
SetContextForeGroundColor (old_color);
if (!pPIS->Batched)
UnlockMutex (GraphicsLock);
}
else
{
log_add (log_Warning, "Bad LINE command '%s'", pStr);
}
}
else if (strcmp (Opcode, "NOOP") == 0) else if (strcmp (Opcode, "NOOP") == 0)
{ /* no operation - must be a comment in script */ { /* no operation - must be a comment in script */
/* do nothing */ /* do nothing */