annotate GUIFont.cpp @ 2285:4fd03103be62

sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
author Grumpy7
date Sat, 15 Mar 2014 12:24:20 +0100
parents 7ffddbe09e55
children d6887ee81068
rev   line source
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2153
diff changeset
1 #define _CRT_SECURE_NO_WARNINGS
0
Ritor1
parents:
diff changeset
2 #include <string>
200
1527f66fd81b Buffer overflow in credits window
Nomad
parents: 189
diff changeset
3
180
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
4 #include "LOD.h"
0
Ritor1
parents:
diff changeset
5 #include "GUIFont.h"
Ritor1
parents:
diff changeset
6 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
7 #include "Render.h"
Ritor1
parents:
diff changeset
8
Ritor1
parents:
diff changeset
9 #include "mm7_data.h"
Ritor1
parents:
diff changeset
10
Ritor1
parents:
diff changeset
11
180
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
12 extern LODFile_IconsBitmaps *pIcons_LOD;
0
Ritor1
parents:
diff changeset
13
Ritor1
parents:
diff changeset
14
Ritor1
parents:
diff changeset
15 struct GUIFont *pAutonoteFont;
Ritor1
parents:
diff changeset
16 struct GUIFont *pSpellFont;
Ritor1
parents:
diff changeset
17 struct GUIFont *pFontArrus;
Ritor1
parents:
diff changeset
18 struct GUIFont *pFontLucida;
Ritor1
parents:
diff changeset
19 struct GUIFont *pBook2Font;
Ritor1
parents:
diff changeset
20 struct GUIFont *pBookFont;
Ritor1
parents:
diff changeset
21 struct GUIFont *pFontCreate;
Ritor1
parents:
diff changeset
22 struct GUIFont *pFontCChar;
Ritor1
parents:
diff changeset
23 struct GUIFont *pFontComic;
Ritor1
parents:
diff changeset
24 struct GUIFont *pFontSmallnum;
Ritor1
parents:
diff changeset
25
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 180
diff changeset
26 char temp_string[2048];
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 180
diff changeset
27
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1168
diff changeset
28 std::array<char, 10000> pTmpBuf3;
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 180
diff changeset
29
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
30 void DrawCharToBuff(unsigned short* uXpos,unsigned char* pCharPixels, int uCharWidth, int uCharHeight, unsigned __int16* pFontPalette, __int16 draw_color, int line_width);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
31
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
32
180
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
33 //----- (0044C448) --------------------------------------------------------
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
34 GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...)
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
35 {
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
36 int pallete_index; // eax@3
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
37 GUIFont *pFont;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
38 unsigned int palletes_count =0;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
39 va_list palettes_ptr;
180
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
40
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
41 pFont = (GUIFont *)pIcons_LOD->LoadRaw(pFontFile, 0);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
42 va_start(palettes_ptr, pFontFile);
180
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
43
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
44 while (NULL!=(pFontPalette=va_arg(palettes_ptr, const char *)))
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
45 {
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
46 pallete_index =pIcons_LOD->LoadTexture(pFontPalette, TEXTURE_16BIT_PALETTE);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
47 if (pallete_index == -1)
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1453
diff changeset
48 Error("Unable to open %s", pFontPalette);
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1453
diff changeset
49
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
50 pFont->pFontPalettes[palletes_count] = pIcons_LOD->pTextures[pallete_index].pPalette16;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
51 ++palletes_count;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
52 }
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
53 va_end(palettes_ptr);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
54 pFont->palletes_count = palletes_count;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
55 return pFont;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
56 }
0
Ritor1
parents:
diff changeset
57
Ritor1
parents:
diff changeset
58 //----- (0044D2FD) --------------------------------------------------------
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
59 void GUIFont::_44D2FD_prolly_draw_credits_entry( GUIFont *pSecondFont, int uFrameX, int uFrameY, unsigned int w, unsigned int h,
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
60 unsigned __int16 firstColor, unsigned __int16 secondColor, const char *pString,
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
61 unsigned __int16 *pPixels, unsigned int uPixelsWidth )
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
62 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
63 char *work_string; // eax@1
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
64 unsigned __int16 *curr_pixel_pos; // esi@1
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
65 GUIFont *currentFont; // edi@4
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
66 signed int start_str_pos; // ecx@4
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
67 signed int line_w; // eax@6
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
68 GUIWindow draw_window; // [sp+Ch] [bp-5Ch]@
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
69 int currentColor; // [sp+74h] [bp+Ch]@4
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
70 int half_frameX; // [sp+80h] [bp+18h]@2
0
Ritor1
parents:
diff changeset
71
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
72 draw_window.uFrameHeight = h;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
73 draw_window.uFrameW = uFrameY + h - 1;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
74 draw_window.uFrameWidth = w;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
75 draw_window.uFrameZ = uFrameX + w - 1;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
76 ui_current_text_color = firstColor;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
77 draw_window.uFrameX = uFrameX;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
78 draw_window.uFrameY = uFrameY;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
79
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
80 work_string = GUIFont::FitTwoFontStringINWindow(pString, this, pSecondFont, &draw_window, 0, 1);
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
81 work_string = strtok(work_string, "\n");
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
82 curr_pixel_pos = &pPixels[uPixelsWidth * uFrameY];
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
83 if ( work_string )
0
Ritor1
parents:
diff changeset
84 {
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
85 half_frameX = uFrameX >> 1;
0
Ritor1
parents:
diff changeset
86 while ( 1 )
Ritor1
parents:
diff changeset
87 {
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
88 currentFont = this;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
89 ui_current_text_color = firstColor;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
90 start_str_pos = 0;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
91 currentColor = firstColor;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
92 if ( *work_string == '_' )
0
Ritor1
parents:
diff changeset
93 {
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
94 currentFont = pSecondFont;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
95 currentColor = secondColor;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
96 ui_current_text_color = secondColor;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
97 start_str_pos = 1;
0
Ritor1
parents:
diff changeset
98 }
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
99 line_w = (signed int)(w - currentFont->GetLineWidth(&work_string[start_str_pos]))/2;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
100 if ( line_w < 0 )
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
101 line_w = 0;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
102 currentFont->DrawTextLineToBuff(currentColor, secondColor, &curr_pixel_pos[line_w + half_frameX], work_string, uPixelsWidth);
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
103 curr_pixel_pos += uPixelsWidth * (currentFont->uFontHeight - 3);
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
104 work_string = strtok(0, "\n");
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
105 if ( !work_string )
0
Ritor1
parents:
diff changeset
106 break;
Ritor1
parents:
diff changeset
107 }
Ritor1
parents:
diff changeset
108 }
Ritor1
parents:
diff changeset
109 }
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
110
0
Ritor1
parents:
diff changeset
111 //----- (0044D1E7) --------------------------------------------------------
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
112 void GUIFont::DrawTextLine( unsigned int uDefaultColor, signed int uX, signed int uY,
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
113 const char *text, int max_len_pix )
0
Ritor1
parents:
diff changeset
114 {
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
115 signed int uX_pos; // edi@3
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
116 unsigned char c; // cl@4
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
117 unsigned __int16 draw_color; // cx@12
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
118 unsigned __int8 *pCharPixels; // eax@12
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
119 char color_code[20]; // [sp+Ch] [bp-1Ch]@16
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
120 int text_length; // [sp+20h] [bp-8h]@2
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
121 int text_color; // [sp+24h] [bp-4h]@1
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
122 int uCharWidth; // [sp+30h] [bp+8h]@9
0
Ritor1
parents:
diff changeset
123
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
124 if ( !text )
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
125 return;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
126 text_color = ui_current_text_color;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
127 text_length = strlen(text);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
128 uX_pos=uX;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
129 for (int i=0; i<text_length; ++i )
0
Ritor1
parents:
diff changeset
130 {
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
131 c = text[i];
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
132 if ( IsCharValid(c) )
0
Ritor1
parents:
diff changeset
133 {
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
134 switch (c)
0
Ritor1
parents:
diff changeset
135 {
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
136 case '\n': //Line Feed 0A 10:
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
137 return;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
138 break;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
139 case '\f': //Form Feed, page eject 0C 12
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
140 strncpy(color_code, &text[i + 1], 5);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
141 color_code[5] = 0;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
142 text_color = atoi(color_code);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
143 ui_current_text_color = text_color;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
144 i += 5;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
145 break;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
146 case '\t': // Horizontal tab 09
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
147 case '\r': //Carriage Return 0D 13
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
148 break;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
149 default:
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
150 uCharWidth = pMetrics[c].uWidth;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
151 if ( uCharWidth )
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
152 {
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
153 if ( i > 0 )
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
154 uX_pos += pMetrics[c].uLeftSpacing;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
155 draw_color = text_color;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
156 pCharPixels = &pFontData[font_pixels_offset[c]];
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
157 if ( !text_color )
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
158 draw_color = -1;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
159 pRenderer->DrawText(uX_pos, uY, pCharPixels, uCharWidth, uFontHeight, pFontPalettes[0], draw_color, 0);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
160 uX_pos += uCharWidth;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
161 if ( i < text_length )
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
162 uX_pos += pMetrics[c].uRightSpacing;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
163 }
0
Ritor1
parents:
diff changeset
164 }
Ritor1
parents:
diff changeset
165 }
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
166 }
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
167
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
168 }
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
169
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
170 //----- (0040F845) --------------------------------------------------------
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
171 void DrawCharToBuff( unsigned short* uXpos,unsigned char* pCharPixels, int uCharWidth, int uCharHeight,
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
172 unsigned __int16* pFontPalette, __int16 draw_color, int line_width )
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
173 {
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
174 unsigned __int16* draw_buff; // edi@1
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
175 unsigned char* pPixels; // esi@1
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
176 unsigned char char_pxl; // eax@3
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
177
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
178 draw_buff = uXpos;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
179 pPixels = pCharPixels;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
180 for(int i=0; i<uCharHeight; ++i)
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
181 {
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
182 for(int j=0; j<uCharWidth; ++j)
0
Ritor1
parents:
diff changeset
183 {
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
184 char_pxl = *pPixels++;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
185 if ( char_pxl )
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
186 {
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
187 if ( char_pxl == 1 )
2073
38bf1c70fc70 some text rendering fix
Gloval
parents: 2069
diff changeset
188 *draw_buff = pFontPalette[1];
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
189 else
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
190 *draw_buff = draw_color;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
191 }
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
192 ++draw_buff;
0
Ritor1
parents:
diff changeset
193 }
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
194 draw_buff+=line_width-uCharWidth;
0
Ritor1
parents:
diff changeset
195 }
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
196
0
Ritor1
parents:
diff changeset
197 }
Ritor1
parents:
diff changeset
198
Ritor1
parents:
diff changeset
199 //----- (0044D0B5) --------------------------------------------------------
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
200 void GUIFont::DrawTextLineToBuff( int uColor, int a3, unsigned short* uX_buff_pos, const char *text, int line_width )
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
201 {
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
202
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
203 unsigned short* uX_pos; // edi@3
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
204 unsigned char c; // cl@4
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
205 unsigned __int16 draw_color; // cx@12
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
206 unsigned __int8 *pCharPixels; // eax@12
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
207 char color_code[20]; // [sp+Ch] [bp-1Ch]@16
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
208 int text_length; // [sp+20h] [bp-8h]@2
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
209 int text_color; // [sp+24h] [bp-4h]@1
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
210 int uCharWidth; // [sp+30h] [bp+8h]@9
0
Ritor1
parents:
diff changeset
211
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
212 if ( !text )
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
213 return;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
214 text_color = ui_current_text_color;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
215 text_length = strlen(text);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
216 uX_pos=uX_buff_pos;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
217 for (int i=0; i<text_length; ++i )
0
Ritor1
parents:
diff changeset
218 {
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
219 c = text[i];
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
220 if ( IsCharValid(c) )
0
Ritor1
parents:
diff changeset
221 {
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
222 switch (c)
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
223 {
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
224 case '\n': //Line Feed 0A 10:
0
Ritor1
parents:
diff changeset
225 return;
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
226 break;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
227 case '\f': //Form Feed, page eject 0C 12
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
228 strncpy(color_code, &text[i + 1], 5);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
229 color_code[5] = 0;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
230 text_color = atoi(color_code);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
231 ui_current_text_color = text_color;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
232 i += 5;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
233 break;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
234 case '\t': // Horizontal tab 09
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
235 case '_':
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
236 break;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
237 default:
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
238 uCharWidth = pMetrics[c].uWidth;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
239 if ( uCharWidth )
0
Ritor1
parents:
diff changeset
240 {
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
241 if ( i > 0 )
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
242 uX_pos += pMetrics[c].uLeftSpacing;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
243 draw_color = text_color;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
244 pCharPixels = &pFontData[font_pixels_offset[c]];
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
245 if ( !text_color )
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
246 draw_color = -1;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
247 DrawCharToBuff(uX_pos, pCharPixels, uCharWidth, uFontHeight, pFontPalettes[0], draw_color, line_width);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
248 uX_pos += uCharWidth;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
249 if ( i < text_length )
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
250 uX_pos += pMetrics[c].uRightSpacing;
0
Ritor1
parents:
diff changeset
251 }
Ritor1
parents:
diff changeset
252 }
Ritor1
parents:
diff changeset
253 }
Ritor1
parents:
diff changeset
254 }
Ritor1
parents:
diff changeset
255 }
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
256
0
Ritor1
parents:
diff changeset
257
Ritor1
parents:
diff changeset
258
Ritor1
parents:
diff changeset
259 //----- (0044C933) --------------------------------------------------------
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
260 char * GUIFont::FitTwoFontStringINWindow( const char *pString, GUIFont *pFontMain, GUIFont *pFontSecond, GUIWindow* pWindow, int startPixlOff, int a6 )
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
261 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
262
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
263 GUIFont *currentFont; // esi@3
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
264 unsigned char c;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
265 int uInStrLen;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
266 char digits[4];
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
267 int possible_transition_point;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
268 int string_pixel_Width;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
269 int start_pixel_offset;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
270
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
271 if (!pString)
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
272 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
273 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0);
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
274 return 0;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
275 }
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
276 currentFont=pFontMain; // esi@3
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
277 uInStrLen = strlen(pString);
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1453
diff changeset
278 Assert(uInStrLen < sizeof(pTmpBuf3));
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1168
diff changeset
279 strcpy(pTmpBuf3.data(), pString);
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
280 if (uInStrLen==0)
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1168
diff changeset
281 return pTmpBuf3.data();
0
Ritor1
parents:
diff changeset
282
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
283 start_pixel_offset=string_pixel_Width=startPixlOff;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
284 possible_transition_point=0;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
285 for(int i=0; i<uInStrLen; ++i)
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
286 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
287 c=pTmpBuf3[i];
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
288 if (pFontMain->IsCharValid(c))
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
289 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
290 switch (c)
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
291 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
292 case '\t': // Horizontal tab 09
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
293 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
294 strncpy(digits, &pTmpBuf3[i+1],3);
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
295 digits[3]=0;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
296 string_pixel_Width = atoi(digits)+startPixlOff;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
297 i+=3;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
298 break;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
299 }
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
300 case '\n': //Line Feed 0A 10
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
301 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
302 string_pixel_Width=start_pixel_offset;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
303 possible_transition_point=i;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
304 currentFont=pFontMain;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
305 break;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
306 }
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
307 case '\f': //Form Feed, page eject 0C 12
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
308 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
309 i+=5;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
310 break;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
311 }
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
312 case '\r': //Carriage Return 0D 13
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
313 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
314 if (!a6)
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
315 return (char*)pString;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
316 break;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
317 }
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
318 case ' ' :
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
319 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
320 string_pixel_Width+=currentFont->pMetrics[c].uWidth;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
321 possible_transition_point=i;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
322 break;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
323 }
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
324 case '_' :
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
325 currentFont=pFontSecond;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
326 break;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
327 default:
200
1527f66fd81b Buffer overflow in credits window
Nomad
parents: 189
diff changeset
328
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
329 if ((string_pixel_Width+currentFont->pMetrics[c].uWidth+ currentFont->pMetrics[c].uLeftSpacing+
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
330 currentFont->pMetrics[c].uRightSpacing)<pWindow->uFrameWidth)
0
Ritor1
parents:
diff changeset
331 {
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
332 if(i>possible_transition_point)
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
333 string_pixel_Width+=currentFont->pMetrics[c].uLeftSpacing;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
334 string_pixel_Width+=currentFont->pMetrics[c].uWidth;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
335 if (i<uInStrLen)
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
336 string_pixel_Width+=currentFont->pMetrics[c].uRightSpacing;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
337 }
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
338 else
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
339 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
340 pTmpBuf3[possible_transition_point]='\n';
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
341
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
342 if ( currentFont== pFontSecond)
0
Ritor1
parents:
diff changeset
343 {
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
344
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
345 for(int k=uInStrLen-1; k>=possible_transition_point+1; --k)
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
346 pTmpBuf3[k] = pTmpBuf3[k-1];
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
347
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
348 ++uInStrLen;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
349 ++possible_transition_point;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
350 pTmpBuf3[possible_transition_point] = '_';
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
351
0
Ritor1
parents:
diff changeset
352 }
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
353 string_pixel_Width=start_pixel_offset;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
354
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
355 for(int j=possible_transition_point;j<i; ++j )
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
356 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
357 c=pTmpBuf3[j];
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
358 if (pFontMain->IsCharValid(c))
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
359 {
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
360 if(j>possible_transition_point)
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
361 string_pixel_Width+=pFontMain->pMetrics[c].uLeftSpacing;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
362 string_pixel_Width+=pFontMain->pMetrics[c].uWidth;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
363 if (j<i)
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
364 string_pixel_Width+=pFontMain->pMetrics[c].uRightSpacing;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
365
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
366 }
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
367 }
0
Ritor1
parents:
diff changeset
368 }
Ritor1
parents:
diff changeset
369 }
Ritor1
parents:
diff changeset
370 }
Ritor1
parents:
diff changeset
371 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1168
diff changeset
372 return pTmpBuf3.data();
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
373
0
Ritor1
parents:
diff changeset
374 }
Ritor1
parents:
diff changeset
375
Ritor1
parents:
diff changeset
376
Ritor1
parents:
diff changeset
377 //----- (0044C6C2) --------------------------------------------------------
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
378 char* GUIFont::GetPageTop( const char *pInString, GUIWindow *pWindow, unsigned int uX, int a5 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
379 {
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
380 int text_height; // edi@1
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
381 char *text_str; // ebx@3
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
382 unsigned char c; // cl@4
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
383 int text_length;
0
Ritor1
parents:
diff changeset
384
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
385 text_height = 0;
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
386
0
Ritor1
parents:
diff changeset
387 if ( !pInString )
Ritor1
parents:
diff changeset
388 return 0;
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
389 text_str = FitTextInAWindow(pInString, this, pWindow, uX, 0);
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
390 text_length = strlen(text_str);
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
391 for ( int i = 0; i < text_length; ++i )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
392 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
393 c = text_str[i];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
394 if ( IsCharValid(c) )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
395 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
396 switch (c)
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
397 {
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
398 case '\n': //Line Feed 0A 10:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
399 text_height = text_height + (uFontHeight - 3);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
400 if ( text_height >= (signed int)(a5 * (pWindow->uFrameHeight - (uFontHeight - 3))) )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
401 return &text_str[i];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
402 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
403 case '\f': //Form Feed, page eject 0C 12
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
404 i += 5;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
405 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
406 case '\t': // Horizontal tab 09
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
407 case '\r': //Carriage Return 0D 13
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
408 i += 3;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
409 break;
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
410 }
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
411 if ( text_height >= (signed int)(a5 * pWindow->uFrameHeight) )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
412 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
413 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
414 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
415 return &text_str[0];
0
Ritor1
parents:
diff changeset
416 }
Ritor1
parents:
diff changeset
417
Ritor1
parents:
diff changeset
418 //----- (0044C62E) --------------------------------------------------------
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
419 int GUIFont::GetStringHeight2( GUIFont *secondFont, const char *text_str, GUIWindow* pWindow, int startX, int a6 )
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
420 {
1166
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
421
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
422 int uAllHeght;
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
423 int uStringLen;
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
424 unsigned char c;
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
425 char *test_string;
0
Ritor1
parents:
diff changeset
426
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
427 if ( !text_str )
0
Ritor1
parents:
diff changeset
428 return 0;
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
429 uAllHeght = uFontHeight - 3;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
430 test_string = FitTwoFontStringINWindow(text_str, this, secondFont, pWindow, startX, 0);
1166
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
431 uStringLen = strlen(test_string);
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
432 for (int i = 0; i < uStringLen; ++i)
0
Ritor1
parents:
diff changeset
433 {
1166
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
434 c = test_string[i];
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
435 if (IsCharValid(c))
0
Ritor1
parents:
diff changeset
436 {
1166
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
437 switch (c)
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
438 {
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
439 case '\n': //Line Feed 0A 10:
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
440 uAllHeght+= uFontHeight - 3;
1166
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
441 break;
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
442 case '\f': //Form Feed, page eject 0C 12
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
443 i += 5;
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
444 break;
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
445 case '\t': // Horizontal tab 09
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
446 case '\r': //Carriage Return 0D 13
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
447 if (a6 != 1)
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
448 i += 3;
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
449 break;
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
450 }
0
Ritor1
parents:
diff changeset
451 }
Ritor1
parents:
diff changeset
452 }
1166
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
453
11cda4934da3 font cleaning
Gloval
parents: 1165
diff changeset
454 return uAllHeght;
0
Ritor1
parents:
diff changeset
455 }
Ritor1
parents:
diff changeset
456
Ritor1
parents:
diff changeset
457 //----- (0044C59D) --------------------------------------------------------
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
458 int GUIFont::CalcTextHeight( const char *pString, struct GUIWindow *pWindow, int uXOffset, int a5 )
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
459 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
460 int uAllHeght;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
461 int uStringLen;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
462 unsigned char c;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
463 char *test_string;
0
Ritor1
parents:
diff changeset
464
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
465 if (!pString)
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
466 return 0;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
467 uAllHeght = uFontHeight - 6;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
468 test_string = FitTextInAWindow(pString, this, pWindow, uXOffset, 0);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
469 uStringLen = strlen(pString);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
470 for (int i = 0; i < uStringLen; ++i)
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
471 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
472 c = test_string[i];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
473 if (IsCharValid(c))
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
474 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
475 switch (c)
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
476 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
477 case '\n': //Line Feed 0A 10:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
478 uAllHeght += uFontHeight - 3;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
479 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
480 case '\f': //Form Feed, page eject 0C 12
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
481 i += 5;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
482 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
483 case '\t': // Horizontal tab 09
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
484 case '\r': //Carriage Return 0D 13
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
485 if (a5 != 1)
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
486 i += 3;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
487 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
488 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
489 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
490 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
491 return uAllHeght;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
492 }
0
Ritor1
parents:
diff changeset
493
Ritor1
parents:
diff changeset
494 //----- (0044C51E) --------------------------------------------------------
Ritor1
parents:
diff changeset
495 int GUIFont::GetLineWidth(const char *pString)
180
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
496 {
1160
502b8b2e36b4 font cleaning
Gloval
parents: 688
diff changeset
497 int str_len; // ebp@3
180
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
498 int string_line_width; // esi@3
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
499 unsigned char c;
0
Ritor1
parents:
diff changeset
500
180
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
501 if (!pString)
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
502 return 0;
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
503 str_len = strlen(pString);
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
504 string_line_width = 0;
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
505 for ( int i = 0; i < str_len; ++i )
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
506 {
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
507 c = pString[i];
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
508 if (IsCharValid(c))
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
509 {
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
510 switch (c)
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
511 {
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
512 case '\t':
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
513 case '\n':
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
514 case '\r':
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
515 return string_line_width;
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
516 case '\f':
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
517 i += 5;
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
518 break;
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
519 default:
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
520 if (i > 0)
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
521 string_line_width += pMetrics[c].uLeftSpacing;
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
522 string_line_width += pMetrics[c].uWidth;
180
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
523 if (i < str_len)
1168
8b3e7d5ba069 fonts all cleaned
Gloval
parents: 1166
diff changeset
524 string_line_width +=pMetrics[c].uRightSpacing;
180
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
525 }
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
526 }
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
527 }
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
528 return string_line_width;
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
529 }
0
Ritor1
parents:
diff changeset
530
Ritor1
parents:
diff changeset
531
Ritor1
parents:
diff changeset
532 //----- (0044C502) --------------------------------------------------------
Ritor1
parents:
diff changeset
533 int GUIFont::AlignText_Center(unsigned int uCenterX, const char *pString)
Ritor1
parents:
diff changeset
534 {
180
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
535 signed int position; // esi@1
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
536
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
537 position = (signed int)(uCenterX - GetLineWidth(pString)) >> 1;
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
538 if ( position >= 0 )
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
539 return position;
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
540 else
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
541 return 0;
0
Ritor1
parents:
diff changeset
542 }
Ritor1
parents:
diff changeset
543
180
c5bd7a825ef2 come back
Ritor1
parents: 178
diff changeset
544 //----- (0044C768) --------------------------------------------------------
688
c0bfb386b15f some ui cleanup
Gloval
parents: 200
diff changeset
545 char * FitTextInAWindow( const char *pInString, GUIFont *pFont, GUIWindow *pWindow, signed int uX, int a5 )
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
546 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
547 unsigned char c;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
548 int uInStrLen;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
549 char digits[4];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
550 int possible_transition_point;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
551 int string_pixel_Width;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
552 int start_pixel_offset;
0
Ritor1
parents:
diff changeset
553
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
554 if (!pInString)
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
555 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
556 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
557 return 0;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
558 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
559 uInStrLen = strlen(pInString);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
560 strcpy(&temp_string[0], pInString);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
561 if (uInStrLen == 0)
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
562 return &temp_string[0];
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 180
diff changeset
563
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
564 start_pixel_offset = string_pixel_Width=uX;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
565 possible_transition_point = 0;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
566 for ( int i = 0; i < uInStrLen; ++i )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
567 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
568 c = temp_string[i];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
569 if (pFont->IsCharValid(c))
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
570 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
571 switch (c)
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
572 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
573 case '\t': // Horizontal tab 09
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
574 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
575 strncpy(digits, &temp_string[i + 1],3);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
576 digits[3] = 0;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
577 string_pixel_Width = atoi(digits)+uX;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
578 i += 3;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
579 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
580 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
581 case '\n': //Line Feed 0A 10 (конец строки)
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
582 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
583 string_pixel_Width = start_pixel_offset;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
584 possible_transition_point = i;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
585 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
586 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
587 case '\f': //Form Feed, page eject 0C 12
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
588 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
589 i += 5;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
590 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
591 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
592 case '\r': //Carriage Return 0D 13
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
593 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
594 if ( !a5 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
595 return (char*)pInString;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
596 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
597 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
598 case ' '://пробел
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
599 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
600 string_pixel_Width += pFont->pMetrics[c].uWidth;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
601 possible_transition_point = i;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
602 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
603 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
604 default:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
605 if ((string_pixel_Width + pFont->pMetrics[c].uWidth + pFont->pMetrics[c].uLeftSpacing +
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
606 pFont->pMetrics[c].uRightSpacing) < pWindow->uFrameWidth )//наращивание длины строки или перенос
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
607 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
608 if ( i > possible_transition_point )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
609 string_pixel_Width += pFont->pMetrics[c].uLeftSpacing;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
610 string_pixel_Width += pFont->pMetrics[c].uWidth;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
611 if (i < uInStrLen)
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
612 string_pixel_Width += pFont->pMetrics[c].uRightSpacing;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
613 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
614 else//перенос строки и слова
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
615 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
616 temp_string[possible_transition_point] ='\n';
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
617 string_pixel_Width = start_pixel_offset;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
618 if ( i > possible_transition_point )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
619 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
620 for ( int j = possible_transition_point; j < i; ++j )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
621 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
622 c = temp_string[j];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
623 if (pFont->IsCharValid(c))
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
624 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
625 if ( j > possible_transition_point )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
626 string_pixel_Width += pFont->pMetrics[c].uLeftSpacing;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
627 string_pixel_Width += pFont->pMetrics[c].uWidth;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
628 if ( j < i )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
629 string_pixel_Width += pFont->pMetrics[c].uRightSpacing;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
630 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
631 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
632 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
633 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
634 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
635 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
636 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
637 return &temp_string[0];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1297
diff changeset
638 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1205
diff changeset
639 //----- (00414162) --------------------------------------------------------
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1205
diff changeset
640 void uGameUIFontMain_initialize()
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1205
diff changeset
641 {
2069
259df09dfb50 32bits almost there
Nomad
parents: 1545
diff changeset
642 uGameUIFontMain = Color16(0xAu, 0, 0);
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1205
diff changeset
643 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1205
diff changeset
644
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1205
diff changeset
645 //----- (00414174) --------------------------------------------------------
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1205
diff changeset
646 void uGameUIFontShadow_initialize()
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1205
diff changeset
647 {
2271
7ffddbe09e55 DrawMessageBox
Ritor1
parents: 2253
diff changeset
648 uGameUIFontShadow = Color16(0xE6u, 214, 193);
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1205
diff changeset
649 }