1 (* Copyright (C) Doom 2D: Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 *)
15 {$INCLUDE ../../../shared/a_modes.inc}
18 interface
20 uses
21 {$IFDEF ENABLE_MENU}
22 g_gui,
23 {$ENDIF}
24 g_base // TRectWH
25 ;
27 type
30 (* render startup *)
34 (* load globally used textures *)
38 (* load map specific textures *)
51 {$IFDEF ENABLE_GIBS}
53 {$ENDIF}
55 {$IFDEF ENABLE_GFX}
57 {$ENDIF}
59 {$IFDEF ENABLE_TOUCH}
60 // touch screen button location and size
62 {$ENDIF}
64 {$IFDEF ENABLE_MENU}
69 {$ENDIF}
77 {$IFDEF ENABLE_HOLMES}
81 {$ENDIF}
83 implementation
85 uses
86 {$I ../../../nogl/noGLuses.inc}
88 {$IFDEF ENABLE_MENU}
89 r_gui,
90 {$ENDIF}
91 {$IFDEF ENABLE_SYSTEM}
92 g_system,
93 {$ENDIF}
94 {$IFDEF ENABLE_TOUCH}
95 r_touch,
96 {$ENDIF}
97 {$IFDEF ENABLE_HOLMES}
98 r_holmes,
99 {$ENDIF}
101 g_basic,
104 g_game, g_map, g_panel, g_options, g_console, g_player, g_weapons, g_language, g_triggers, g_monsters,
107 ;
109 var
125 begin
126 r_Map_LoadTextures;
130 begin
131 r_Map_FreeTextures;
135 const
136 WeapName: array [0..WP_LAST] of AnsiString = ('KASTET', 'SAW', 'PISTOL', 'SHOTGUN1', 'SHOTGUN2', 'MGUN', 'RLAUNCHER', 'PGUN', 'BFG', 'SPULEMET', 'FLAMETHROWER');
137 var
139 begin
140 r_LoadScreen_Load;
141 r_Common_Load;
145 hudhp[false] := r_Common_LoadTextureFromFile(GameWAD + ':TEXTURES/MED2', [TGLHints.txNoRepeat]);
149 hudwp[i] := r_Common_LoadTextureFromFile(GameWAD + ':TEXTURES/' + WeapName[i], [TGLHints.txNoRepeat]);
155 hudrflag := r_Common_LoadTextureFromFile(GameWAD + ':TEXTURES/FLAGHUD_R_BASE', [TGLHints.txNoRepeat]);
156 hudrflags := r_Common_LoadTextureFromFile(GameWAD + ':TEXTURES/FLAGHUD_R_STOLEN', [TGLHints.txNoRepeat]);
157 hudrflagd := r_Common_LoadTextureFromFile(GameWAD + ':TEXTURES/FLAGHUD_R_DROP', [TGLHints.txNoRepeat]);
158 hudbflag := r_Common_LoadTextureFromFile(GameWAD + ':TEXTURES/FLAGHUD_B_BASE', [TGLHints.txNoRepeat]);
159 hudbflags := r_Common_LoadTextureFromFile(GameWAD + ':TEXTURES/FLAGHUD_B_STOLEN', [TGLHints.txNoRepeat]);
160 hudbflagd := r_Common_LoadTextureFromFile(GameWAD + ':TEXTURES/FLAGHUD_B_DROP', [TGLHints.txNoRepeat]);
161 r_Console_Load;
162 r_Map_Load;
163 {$IFDEF ENABLE_MENU}
164 r_GUI_Load;
165 {$ENDIF}
170 begin
171 {$IFDEF ENABLE_MENU}
172 r_GUI_Free;
173 {$ENDIF}
174 r_Map_Free;
175 r_Console_Free;
194 r_Common_Free;
197 {$IFDEF ENABLE_SYSTEM}
200 begin
209 {$IFDEF USE_GLES1}
211 {$ELSE}
213 {$ENDIF}
216 {$ENDIF}
220 begin
232 begin
233 {$IFDEF ENABLE_SYSTEM}
237 {$ENDIF}
238 {$IFDEF NOGL_INIT}
239 nogl_Init;
240 {$ENDIF}
241 r_Render_LogGLInfo;
242 r_LoadScreen_Initialize;
243 r_Textures_Initialize;
244 r_Console_Initialize;
245 r_Map_Initialize;
249 begin
250 r_Map_Finalize;
251 r_Console_Finalize;
252 r_Textures_Finalize;
253 r_LoadScreen_Finalize;
254 {$IFDEF NOGL_INIT}
255 nogl_Quit;
256 {$ENDIF}
260 begin
261 r_Map_Reset;
265 begin
266 r_Console_Update;
267 r_Map_Update;
272 begin
275 // hud area is 196 x 240 pixels
283 r_Common_DrawText(IntToStr(MAX(0, p.health)), x + 174, y + 56, 255, 0, 0, 255, menufont, TBasePoint.BP_RIGHT);
284 r_Common_DrawText(IntToStr(MAX(0, p.armor)), x + 174, y + 84, 255, 0, 0, 255, menufont, TBasePoint.BP_RIGHT);
293 begin
306 begin
309 r_Draw_FillRect(x + 14, y + 116 + 4, x + 14 + 168 * p.air div AIR_MAX, y + 116 + 4 + 4, 0, 0, 196, 255);
311 r_Draw_FillRect(x + 14, y + 126 + 4, x + 14 + 168 * p.JetFuel div JET_MAX, y + 126 + 4 + 4, 208, 0, 0, 255);
312 end
313 else
314 begin
317 r_Draw_FillRect(x + 14, y + 124 + 4, x + 14 + 168 * p.air div AIR_MAX, y + 124 + 4 + 4, 0, 0, 196, 255);
323 begin
327 begin
332 begin
333 r_Common_DrawText(_lc[I_PLAYER_SPECT], x + 4, y + 242, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
334 r_Common_DrawText(_lc[I_PLAYER_SPECT2], x + 4, y + 258, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
335 r_Common_DrawText(_lc[I_PLAYER_SPECT1], x + 4, y + 274, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
337 r_Common_DrawText(_lc[I_PLAYER_SPECT1S], x + 4, y + 290, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
343 begin
350 var fw, i, maxFrags, top, totalPlayers: Integer; sign: Char; stat: TPlayerStatArray; f: TGLTexture;
351 begin
355 begin
356 (* RED TEAM SCORE *)
359 begin
366 begin
368 r_Common_DrawTexture(f, x + w - 16, y + 240 - 72 - 4, f.width, f.height, TBasePoint.BP_RIGHTUP);
371 r_Common_DrawText(IntToStr(gTeamStat[TEAM_RED].Score), x + w - 16 - fw, y + 240 - 72 - 4, TEAMCOLOR[TEAM_RED].R, TEAMCOLOR[TEAM_RED].G, TEAMCOLOR[TEAM_RED].B, 255, menufont, TBasePoint.BP_RIGHTUP);
373 (* BLUE TEAM SCORE *)
376 begin
383 begin
385 r_Common_DrawTexture(f, x + w - 16, y + 240 - 32 - 4, f.width, f.height, TBasePoint.BP_RIGHTUP);
388 r_Common_DrawText(IntToStr(gTeamStat[TEAM_BLUE].Score), x + w - 16 - fw, y + 240 - 32 - 4, TEAMCOLOR[TEAM_BLUE].R, TEAMCOLOR[TEAM_BLUE].G, TEAMCOLOR[TEAM_BLUE].B, 255, menufont, TBasePoint.BP_RIGHTUP);
392 begin
394 begin
395 r_Common_DrawText(IntToStr(p.Frags), x + w - 16, y, 255, 0, 0, 255, menufont, TBasePoint.BP_RIGHTUP);
402 begin
405 begin
407 begin
415 r_Common_DrawText(IntToStr(top) + ' / ' + IntToStr(totalPlayers) + ' ' + sign + IntToStr(ABS(p.Frags - maxFrags)), x + w - 16, y + 32, 255, 0, 0, 255, smallfont, TBasePoint.BP_RIGHTUP);
419 begin
420 r_Common_DrawText(_lc[I_GAME_WARMUP], x + w - 16 - 64, y + h, 0, 255, 0, 255, menufont, TBasePoint.BP_RIGHTDOWN);
421 r_Common_DrawText(': ' + IntToStr((gLMSRespawnTime - gTime) div 1000), x + w - 16 - 64, y + h, 0, 255, 0, 255, menufont, TBasePoint.BP_LEFTDOWN);
422 end
424 begin
425 r_Common_DrawText(IntToStr(p.Lives), x + w - 16, y + h, 0, 255, 0, 255, menufont, TBasePoint.BP_RIGHTDOWN);
432 begin
438 begin
440 {$IFDEF ENABLE_HOLMES}
442 begin
446 {$ENDIF}
449 r_Common_DrawText(_lc[I_PLAYER_SPECT4], x div 2 + w div 2, y div 2 + h div 2, 255, 255, 255, 255, stdfont, TBasePoint.BP_CENTER);
450 end
451 else
452 begin
461 begin
470 begin
479 var ip: AnsiString; ww, hh, cw, ch, mw, mh, motdh, scrx, scry, i, mx, y: Integer; msg: SSArray; Srv: TNetServer;
480 begin
485 r_Common_DrawText(_lc[I_NET_SLIST], gScreenWidth div 2, 16, 255, 255, 255, 255, menufont, TBasePoint.BP_UP);
490 (* window background *)
494 r_Common_DrawText(_lc[I_NET_SLIST_HELP], gScreenWidth div 2, gScreenHeight - 8, 255, 255, 255, 255, stdfont, TBasePoint.BP_DOWN);
497 begin
499 r_Draw_FillRect(16 + 1, motdh + 1, gScreenWidth - 16 - 1, gScreenHeight - 44 - 1, 64, 64, 64, 145);
504 begin
509 r_Common_DrawText(_lc[I_NET_SLIST_URGENT], scrx, scry - 58, 255, 255, 255, 255, stdfont, TBasePoint.BP_UP);
510 r_Common_DrawText(_lc[I_NET_SLIST_URGENT_CONT], scrx, scry + 41, 255, 255, 255, 255, stdfont, TBasePoint.BP_UP);
512 end
514 begin
518 end
519 else
520 begin
523 begin
534 (* current selection *)
537 r_Draw_FillRect(16 + 1, sy + 1 + 40, gScreenWidth - 16 - 1, sy + 1 + 40 + 1, 255, 255, 255, 255);
539 (* line separators for name/ping/mode.. & address/pasword *)
543 (* column separators for name/ping/mode/players/version *)
556 begin
562 r_Common_DrawText('<1' + _lc[I_NET_SLIST_PING_MS], mx - 68, y, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP)
564 r_Common_DrawText(IntToStr(Srv.Ping) + _lc[I_NET_SLIST_PING_MS], mx - 68, y, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP)
565 else
566 r_Common_DrawText(_lc[I_NET_SLIST_NO_ACCESS], mx - 68, y, 255, 0, 0, 255, stdfont, TBasePoint.BP_LEFTUP);
568 r_Common_DrawText('<' + IntToStr(Length(ST[I].Indices)) + '>', mx - 68, y + 16, 210, 210, 210, 255, stdfont, TBasePoint.BP_LEFTUP);
570 r_Common_DrawText(g_Game_ModeToText(Srv.GameMode), mx + 2, y, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
572 r_Common_DrawText(IntToStr(Srv.Players) + '/' + IntToStr(Srv.MaxPlayers), mx + 54, y, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
573 r_Common_DrawText(IntToStr(Srv.LocalPl) + '+' + IntToStr(Srv.Bots), mx + 54, y + 16, 210, 210, 210, 255, stdfont, TBasePoint.BP_LEFTUP);
575 r_Common_DrawText(IntToStr(Srv.Protocol), mx + 106, y, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
581 r_Common_DrawText(IntToStr(Length(ST)) + _lc[I_NET_SLIST_SERVERS], gScreenWidth - 48, motdh - 20 + 3, 255, 255, 255, 255, stdfont, TBasePoint.BP_RIGHTUP);
585 procedure r_Render_DrawStatsColumns (constref cs: TEndCustomGameStat; x, y, w: Integer; endview: Boolean);
586 var i, cw, ch, yy, team, players, w1, w2, w3, w4, tw: Integer; r, g, b, rr, gg, bb: Byte; s: AnsiString;
587 begin
597 begin
599 begin
601 TEAM_RED:
602 begin
606 TEAM_BLUE:
607 begin
613 r_Common_DrawText(IntToStr(cs.TeamStat[team].Score), x + tw, yy, r, g, b, 255, stdfont, TBasePoint.BP_UP);
617 r_Common_DrawText(_lc[I_GAME_DEATHS], x + w1 + w2 + w3, yy, r, g, b, 255, stdfont, TBasePoint.BP_UP);
625 begin
627 begin
630 begin
634 // Player name
635 if gShowPIDs then s := Format('[%5d] %s', [cs.PlayerStat[i].UID, cs.PlayerStat[i].Name]) else s := cs.PlayerStat[i].Name;
636 if (gPlayers[cs.PlayerStat[i].Num] <> nil) and (gPlayers[cs.PlayerStat[i].Num].FReady) then s := s + ' *';
639 begin
640 // Player ping/loss
644 // Player frags
647 // Player deaths
656 end
658 begin
659 r_Common_DrawText(_lc[I_GAME_PLAYER_NAME], x, yy, 255, 127, 0, 255, stdfont, TBasePoint.BP_LEFTUP);
662 r_Common_DrawText(_lc[I_GAME_FRAGS], x + w1 + w2, yy, 255, 127, 0, 255, stdfont, TBasePoint.BP_UP);
663 r_Common_DrawText(_lc[I_GAME_DEATHS], x + w1 + w2 + w3, yy, 255, 127, 0, 255, stdfont, TBasePoint.BP_UP);
666 begin
667 // rr := 255; gg := 127; bb := 0;
670 begin
674 // Player color
676 r_Draw_FillRect(x + 1, yy + 1, x + 16 - 1, yy + 16 - 1, cs.PlayerStat[i].Color.R, cs.PlayerStat[i].Color.G, cs.PlayerStat[i].Color.B, 255);
677 // Player name
678 if gShowPIDs then s := Format('[%5d] %s', [cs.PlayerStat[i].UID, cs.PlayerStat[i].Name]) else s := cs.PlayerStat[i].Name;
679 if (gPlayers[cs.PlayerStat[i].Num] <> nil) and (gPlayers[cs.PlayerStat[i].Num].FReady) then s := s + ' *';
682 begin
683 // Player ping/loss
687 // Player frags
690 // Player deaths
699 procedure r_Render_DrawStatsWindow (x, y, w, h: Integer; cs: TEndCustomGameStat; endview: Boolean);
701 begin
707 (* LINE 1 *)
710 begin
729 begin
736 (* LINE 2/3 *)
743 begin
749 GM_COOP: s := _lc[I_GAME_MONSTERS] + ' ' + IntToStr(gCoopMonstersKilled) + '/' + IntToStr(gTotalMonsters);
754 GM_DM, GM_TDM, GM_CTF: s := Format(_lc[I_GAME_TIME_LIMIT], [gGameSettings.TimeLimit div 3600, (gGameSettings.TimeLimit div 60) mod 60, gGameSettings.TimeLimit mod 60]);
755 GM_COOP: s := _lc[I_GAME_SECRETS] + ' ' + IntToStr(gCoopSecretsFound) + '/' + IntToStr(gSecretsCount);
760 end
761 else
762 begin
764 r_Common_DrawText(_lc[I_MENU_MAP], x + 16, y + yoff, 255, 127, 0, 255, stdfont, TBasePoint.BP_LEFTUP);
765 r_Common_DrawText(s, x + 16 + xoff, y + yoff, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
767 r_Common_DrawText(_lc[I_GAME_GAME_TIME], x + 16, y + yoff, 255, 127, 0, 255, stdfont, TBasePoint.BP_LEFTUP);
768 r_Common_DrawText(r_Common_TimeToStr(cs.GameTime), x + 16 + xoff, y + yoff, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
774 (* LINE 4/5 *)
777 begin
779 r_Common_DrawText(_lc[I_GAME_MONSTERS], x + 16, y + yoff, 255, 127, 0, 255, stdfont, TBasePoint.BP_LEFTUP);
780 r_Common_DrawText(IntToStr(gCoopMonstersKilled) + '/' + IntToStr(gTotalMonsters), x + 16 + xoff, y + yoff, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
782 r_Common_DrawText(_lc[I_GAME_SECRETS], x + 16, y + yoff, 255, 127, 0, 255, stdfont, TBasePoint.BP_LEFTUP);
783 r_Common_DrawText(IntToStr(gCoopSecretsFound) + '/' + IntToStr(gSecretsCount), x + 16 + xoff, y + yoff, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
788 (* LINE 6/7 *)
791 begin
792 xoff := MAX(Length(_lc[I_GAME_MONSTERS_TOTAL]) + 1, Length(_lc[I_GAME_SECRETS_TOTAL]) + 1) * cw;
793 r_Common_DrawText(_lc[I_GAME_MONSTERS_TOTAL], x + 16, y + yoff, 255, 127, 0, 255, stdfont, TBasePoint.BP_LEFTUP);
794 r_Common_DrawText(IntToStr(gCoopTotalMonstersKilled) + '/' + IntToStr(gCoopTotalMonsters), x + 16 + xoff, y + yoff, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
796 r_Common_DrawText(_lc[I_GAME_SECRETS_TOTAL], x + 16, y + yoff, 255, 127, 0, 255, stdfont, TBasePoint.BP_LEFTUP);
797 r_Common_DrawText(IntToStr(gCoopTotalSecretsFound) + '/' + IntToStr(gCoopTotalSecrets), x + 16 + xoff, y + yoff, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
802 (* LINE *)
805 begin
807 else if cs.TeamStat[TEAM_BLUE].Score > cs.TeamStat[TEAM_RED].Score then s := _lc[I_GAME_WIN_BLUE]
814 (* LINE n *)
821 begin
832 begin
850 begin
852 begin
853 r_Common_DrawText(_lc[I_MENU_INTER_NOTICE_TAB], gScreenWidth div 2, 8, 255, 255, 255, 255, stdfont, TBasePoint.BP_UP);
854 end
855 else
856 begin
858 GM_COOP: if gMissionFailed then s := _lc[I_MENU_INTER_MISSION_FAIL] else s := _lc[I_MENU_INTER_LEVEL_COMPLETE];
864 begin
865 if g_Game_IsClient then s := _lc[I_MENU_INTER_NOTICE_MAP] else s := _lc[I_MENU_INTER_NOTICE_SPACE];
866 r_Common_DrawText(s, gScreenWidth div 2, gScreenHeight - 4, 255, 255, 255, 255, stdfont, TBasePoint.BP_DOWN);
868 begin
870 r_Common_DrawText(s, gScreenWidth div 2, gScreenHeight - 16 - 4, 255, 255, 255, 255, stdfont, TBasePoint.BP_DOWN);
874 r_Render_DrawStatsWindow(32, 64, gScreenWidth - 32 * 2, gScreenHeight - 64 * 2, CustomStat, true);
880 begin
892 begin
893 r_Common_DrawText(_lc[I_MENU_INTER_KILLS], x, y, 255, 255, 255, 255, menufont, TBasePoint.BP_LEFTUP);
895 r_Common_DrawText(_lc[I_MENU_INTER_KPM], x, y + 32, 255, 255, 255, 255, menufont, TBasePoint.BP_LEFTUP);
899 r_Common_DrawText(Format('%.1f', [kpm]), x + w1, y + 32, 255, 0, 0, 255, menufont, TBasePoint.BP_LEFTUP);
900 r_Common_DrawText(_lc[I_MENU_INTER_SECRETS], x, y + 64, 255, 255, 255, 255, menufont, TBasePoint.BP_LEFTUP);
901 r_Render_DrawValueOf(SingleStat.PlayerStat[player].Secrets, SingleStat.TotalSecrets, x + w1, y + 64, MenuFont);
906 begin
907 r_Common_DrawText(_lc[I_MENU_INTER_LEVEL_COMPLETE], gScreenWidth div 2, 32, 255, 255, 255, 255, menufont, TBasePoint.BP_UP);
915 r_Common_DrawText(_lc[I_MENU_INTER_TIME], xx, 80, 255, 255, 255, 255, menufont, TBasePoint.BP_LEFTUP);
919 begin
920 r_Common_DrawText(_lc[I_MENU_PLAYER_1], gScreenWidth div 2, 128, 255, 255, 255, 255, menufont, TBasePoint.BP_UP);
922 r_Common_DrawText(_lc[I_MENU_PLAYER_2], gScreenWidth div 2, 288, 255, 255, 255, 255, menufont, TBasePoint.BP_UP);
924 end
925 else
926 begin
936 begin
940 r_Common_DrawText(s1, xoff + ww div 2, gScreenHeight - ch, 255, 255, 255, 255, stdfont, TBasePoint.BP_DOWN);
941 r_Common_DrawText(s2, xoff + ww div 2, gScreenHeight - ch, 255, 255, 255, 255, stdfont, TBasePoint.BP_UP);
945 begin
959 begin
969 begin
972 begin
974 while (i < len) and ((IsActivePlayer(gPlayers[i]) = false) or (gPlayers[i].UID <> id)) do INC(i);
984 begin
987 begin
993 otherwise
1001 begin
1011 begin
1013 begin
1015 begin
1018 begin
1045 begin
1047 begin
1049 begin
1052 begin
1065 begin
1071 begin
1072 r_Draw_FillRect(x, y, (x + gMapInfo.Width) div scale, (y + gMapInfo.Height) div scale, 0, 0, 0, alpha);
1080 DrawPlayers;
1085 begin
1089 begin
1091 begin
1094 end
1095 else
1096 begin
1105 begin
1109 begin
1111 begin
1116 begin
1119 begin
1121 begin
1131 else
1137 begin
1139 exit;
1141 {$IFDEF ENABLE_SYSTEM}
1142 (* hack: if r_pixel_scale changed, reset menu and other things *)
1148 {$ENDIF}
1153 begin
1167 begin
1169 begin
1171 begin
1174 end
1175 else
1176 begin
1180 end
1182 begin
1184 end
1186 begin
1190 begin
1195 begin
1204 begin
1206 begin
1207 r_Render_DrawMapView(0, 0, gScreenWidth, gScreenHeight, gSpectX + gScreenWidth div 2, gSpectY + gScreenHeight div 2);
1208 end
1210 begin
1213 end
1215 begin
1217 end
1219 begin
1226 {$IFDEF ENABLE_HOLMES}
1227 r_Holmes_Draw;
1228 {$ENDIF}
1231 r_Common_DrawFormatText(MessageText, (gScreenWidth - 196) div 2, gScreenHeight div 2, 255, menufont, TBasePoint.BP_CENTER);
1234 r_Render_DrawStats;
1236 if gSpectHUD and (gChatShow = false) and (gSpectMode <> SPECT_NONE) and (gSpectAuto = false) then
1237 r_Render_DrawSpectHud;
1241 begin
1243 r_Common_DrawText(_lc[I_MENU_PAUSE], gScreenWidth div 2, gScreenHeight div 2, 255, 255, 255, 255, menufont, TBasePoint.BP_CENTER);
1247 begin
1248 // TODO F key handle
1251 STATE_MENU:
1252 begin
1254 {$IFDEF ENABLE_MENU}
1257 {$ENDIF}
1259 STATE_FOLD:
1260 begin
1262 r_Draw_FillRect(0, 0, gScreenWidth, gScreenHeight, 0, 0, 0, MIN(MAX(255 - EndingGameCounter, 0), 255));
1264 STATE_INTERCUSTOM:
1265 begin
1269 else
1271 else
1274 r_Render_DrawCustomStats;
1276 {$IFDEF ENABLE_MENU}
1279 {$ENDIF}
1282 begin
1284 begin
1285 r_Draw_FillRect(0, 0, gScreenWidth, gScreenHeight, 0, 0, 0, MIN(MAX(255 - EndingGameCounter, 0), 255));
1286 end
1287 else
1288 begin
1290 r_Render_DrawSingleStats;
1291 {$IFDEF ENABLE_MENU}
1294 {$ENDIF}
1297 STATE_ENDPIC:
1298 begin
1301 else
1303 {$IFDEF ENABLE_MENU}
1306 {$ENDIF}
1308 STATE_SLIST:
1309 begin
1317 {$IFDEF ENABLE_MENU}
1319 begin
1324 {$ENDIF}
1329 begin
1336 begin
1337 r_Common_DrawText('FPS: ' + IntToStr(FPS), 0, 0, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
1338 r_Common_DrawText('UPS: ' + IntToStr(UPS), 0, 16, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
1342 begin
1343 r_Common_DrawText(r_Common_TimeToStr(gTime), gScreenWidth - 4, gScreenHeight - 1, 255, 255, 255, 255, stdfont, TBasePoint.BP_RIGHTDOWN);
1346 // TODO draw profilers
1348 {$IFDEF ENABLE_HOLMES}
1349 r_Holmes_DrawUI;
1350 {$ENDIF}
1352 {$IFDEF ENABLE_TOUCH}
1354 r_Touch_Draw;
1355 {$ENDIF}
1358 begin
1363 (* take stats screenshot immediately after the first frame of the stats showing *)
1365 begin
1370 sys_Repaint;
1374 begin
1384 begin
1385 {$IFDEF ENABLE_SYSTEM}
1388 else
1391 {$ENDIF}
1392 {$IFDEF NOGL_INIT}
1393 nogl_Init;
1394 {$ENDIF}
1398 begin
1402 {$IFDEF ENABLE_GIBS}
1404 begin
1407 {$ENDIF}
1409 {$IFDEF ENABLE_GFX}
1411 begin
1414 {$ENDIF}
1416 {$IFDEF ENABLE_TOUCH}
1418 begin
1421 {$ENDIF}
1423 {$IFDEF ENABLE_MENU}
1425 begin
1430 begin
1435 begin
1440 begin
1443 {$ENDIF}
1446 begin
1451 begin
1452 r_Common_ClearLoading;
1456 begin
1461 begin
1466 begin
1470 {$IFDEF ENABLE_HOLMES}
1472 begin
1477 begin
1482 begin
1485 {$ENDIF}
1487 begin