1 //=============================================================================
2 //
3 // Adventure Game Studio (AGS)
4 //
5 // Copyright (C) 1999-2011 Chris Jones and 2011-20xx others
6 // The full list of copyright holders can be found in the Copyright.txt
7 // file, which is part of this source code distribution.
8 //
9 // The AGS source code is provided under the Artistic License 2.0.
10 // A copy of this license can be found in the file License.txt and at
11 // http://www.opensource.org/licenses/artistic-license-2.0.php
12 //
13 //=============================================================================
14 
15 #include <string.h>
16 #include "ac/display.h"
17 #include "ac/gamesetup.h"
18 #include "ac/string.h"
19 #include "font/fonts.h"
20 #include "gui/guidefines.h"
21 #include "gui/mylabel.h"
22 #include "gui/guidialoginternaldefs.h"
23 
24 using Common::Bitmap;
25 
26 extern GameSetup usetup;
27 // ac_guimain
28 extern int numlines;
29 extern char lines[MAXLINE][200];
30 
31 extern int acdialog_font;
32 
MyLabel(int xx,int yy,int wii,const char * tee)33 MyLabel::MyLabel(int xx, int yy, int wii, const char *tee)
34 {
35     strncpy(text, tee, 150);
36     text[149] = 0;
37     x = xx;
38     y = yy;
39     wid = wii;
40     hit = TEXT_HT;
41 }
42 
draw(Bitmap * ds)43 void MyLabel::draw(Bitmap *ds)
44 {
45     int cyp = y;
46     char *teptr = &text[0];
47     color_t text_color = ds->GetCompatibleColor(0);
48 
49     break_up_text_into_lines(wid, acdialog_font, teptr);
50     for (int ee = 0; ee < numlines; ee++) {
51         wouttext_outline(ds, x, cyp, acdialog_font, text_color, lines[ee]);
52         cyp += TEXT_HT;
53     }
54 }
55 
pressedon()56 int MyLabel::pressedon()
57 {
58     return 0;
59 }
60 
processmessage(int mcode,int wParam,long lParam)61 int MyLabel::processmessage(int mcode, int wParam, long lParam)
62 {
63     return -1;                  // doesn't support messages
64 }
65