annotate GUI/GUIFont.h @ 2541:a902abdfc7f2

1. Renamed class Game to class Engine. 2. Separated game logic as state of FSM from game logic as engine. 3. Found out that many UI screen initializers were optimized away, intially they all returned newly created window as separate object like it is done in CharacterUI_Initialize.
author a.parshin
date Sun, 10 May 2015 01:29:11 +0200
parents a77c34acdbc9
children dd36326a9994
rev   line source
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
1 #pragma once
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
2
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
3
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
4 /* 171 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
5 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
6 struct GUICharMetric
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
7 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
8 unsigned int uLeftSpacing;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
9 unsigned int uWidth;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
10 unsigned int uRightSpacing;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
11 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
12 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
13
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
14 /* 170 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
15 #pragma warning( push )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
16 #pragma warning( disable : 4200 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
17 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
18 struct GUIFont
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
19 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
20
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
21 //----- (0044C4DE) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
22 bool IsCharValid(unsigned char c) { return (c >= cFirstChar) && (c <= cLastChar) || (c == '\f') || (c == '\r') || (c == '\t') || (c == '\n');}
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
23 int AlignText_Center(unsigned int uCenterX, const char *pString);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
24 int GetLineWidth(const char *pString);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
25 int CalcTextHeight(const char *pString, struct GUIWindow *pWindow, int uXOffset, int a5);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
26 int GetStringHeight2(GUIFont *secondFont, const char *text_str, GUIWindow* pWindow, int startX, int a6);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
27 char* GetPageTop(const char *pInString, GUIWindow *pWindow, unsigned int uX, int a5);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
28 void DrawTextLineToBuff(int uColor, int a3, unsigned short* uX_buff_pos, const char *text, int line_width);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
29 void DrawTextLine(unsigned int uDefaultColor, signed int uX, signed int uY, const char *text, int max_len_pix);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
30 void _44D2FD_prolly_draw_credits_entry(GUIFont *pSecondFont, int uFrameX, int uFrameY, unsigned int w, unsigned int h,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
31 unsigned __int16 firstColor, unsigned __int16 secondColor, const char *pString,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
32 unsigned __int16 *pPixels, unsigned int uPixelsWidth);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
33
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
34 static char * FitTwoFontStringINWindow(const char *pString, GUIFont *pFontMain, GUIFont *pFontSecond, GUIWindow* pWindow, int startPixlOff, int a6);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
35 static void uGameUIFontMain_initialize();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
36 static void uGameUIFontShadow_initialize();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
37
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
38 unsigned char cFirstChar; //0
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
39 unsigned char cLastChar; //1
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
40 char field_2;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
41 char field_3;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
42 char field_4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
43 __int16 uFontHeight; //5-6
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
44 char field_7;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
45 int palletes_count;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
46 unsigned __int16 *pFontPalettes[5];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
47 GUICharMetric pMetrics[256];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
48 int font_pixels_offset[256];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
49 unsigned char pFontData[0]; //array of font pixels
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
50
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
51 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
52 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
53 #pragma warning( pop )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
54
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
55 GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
56 char * FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, signed int uX, int a5);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
57
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
58
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
59 extern struct GUIFont *pAutonoteFont;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
60 extern struct GUIFont *pSpellFont;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
61 extern struct GUIFont *pFontArrus;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
62 extern struct GUIFont *pFontLucida;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
63 extern struct GUIFont *pBook2Font;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
64 extern struct GUIFont *pBookFont;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
65 extern struct GUIFont *pFontCreate;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
66 extern struct GUIFont *pFontCChar;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
67 extern struct GUIFont *pFontComic;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
68 extern struct GUIFont *pFontSmallnum;