From 14dad53337ea94aabaf54ee320013f0d6062e059 Mon Sep 17 00:00:00 2001 From: mcmartin Date: Mon, 3 Sep 2007 07:14:14 +0000 Subject: [PATCH] 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 --- sc2/src/sc2code/intro.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/sc2/src/sc2code/intro.c b/sc2/src/sc2code/intro.c index c422965e7..6f12db49c 100644 --- a/sc2/src/sc2code/intro.c +++ b/sc2/src/sc2code/intro.c @@ -703,6 +703,32 @@ DoPresentation (void *pIS) utf8StringCopy (pPIS->Buffer, sizeof (pPIS->Buffer), pStr); 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) { /* no operation - must be a comment in script */ /* do nothing */