~vcs-imports/rtciv/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
Imperium: Sticks
Copyright(c) 2004-2010 by Jason Olson

Version 0.1.7

This file is part of Imperium: Sticks.

This program is free software; you can redistribute this version and/or modify
this version under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef _TEXT_H
#define _TEXT_H

#include "SDL.h"

#define STATUS 1
#define ROLLOVER 2

#define WHITE 10
#define YELLOW 0
#define PURPLE 1
#define RED 2
#define BLUE 3
#define GREEN 4
#define ORANGE 5
#define BLACK 6

/*struct letter {
   Uint8 letterwidth;
   Uint16 xoffset;
   Uint16 yoffset;
};*/

/*struct text {
   struct letter letters[82];
   SDL_Surface *textimage;
   SDL_Surface *coloured[6];
};*/

struct Message {
   char message[80];
   int type;
   int position;
   int time;
   int start;
   struct Message *nextmessage;
   struct Message *previousmessage;
   int x;
   int y;
   int civ;
};

void InitCommonText(void);
char GetLetter(SDL_keysym *);
void CreateTimedMessage(const char *, int, int, int, int, int); /*Note: last argument is time in 1/10 second increments*/
void DisplayTimedMessages(void);
void RemoveMessageFromQueue(struct Message *);
void CheckStatusMessageLine(struct Message *);
void WriteTTFTextOnSurface(const char *, int, int, SDL_Surface *);
void WriteColouredTTFTextOnSurface(const char *, int, int, Uint8, SDL_Surface *);
void CreateCannedMessage(int, int, int, int, int, int);
void WriteTTFCivTextOnSurface(const char *, int, int, int, SDL_Surface *);
void WriteTTFMessageOnSurface(int, int, int, SDL_Surface *);
void StripNewline(char *);

#endif