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 (* render startup *)
31 (* load globally used textures *)
35 (* load map specific textures *)
47 {$IFDEF ENABLE_GIBS}
49 {$ENDIF}
51 {$IFDEF ENABLE_GFX}
53 {$ENDIF}
55 {$IFDEF ENABLE_TOUCH}
56 // touch screen button location and size
58 {$ENDIF}
60 {$IFDEF ENABLE_MENU}
65 {$ENDIF}
69 implementation
71 uses
72 {$IFDEF USE_GLES1}
73 GLES11,
74 {$ELSE}
76 {$ENDIF}
77 {$IFDEF ENABLE_SYSTEM}
78 g_system,
79 {$ENDIF}
83 g_net,
85 ;
87 var
103 begin
104 r_Map_LoadTextures;
108 begin
109 r_Map_FreeTextures;
114 begin
118 result := r_Textures_LoadFontFromFile(GameWad + ':FONTS/' + name + 'FONT', info, skiphack, true);
124 const
125 WeapName: array [0..WP_LAST] of AnsiString = ('KASTET', 'SAW', 'PISTOL', 'SHOTGUN1', 'SHOTGUN2', 'MGUN', 'RLAUNCHER', 'PGUN', 'BFG', 'SPULEMET', 'FLAMETHROWER');
126 var
128 begin
145 r_Map_Load;
150 begin
151 r_Map_Free;
158 begin
174 {$IFDEF ENABLE_SYSTEM}
177 begin
189 {$ENDIF}
192 begin
193 {$IFDEF ENABLE_SYSTEM}
197 {$ENDIF}
198 r_Textures_Initialize;
199 r_Map_Initialize;
203 begin
204 r_Map_Finalize;
205 r_Textures_Finalize;
209 begin
210 r_Map_Update;
214 begin
218 glLoadIdentity;
221 glLoadIdentity;
226 begin
234 r_Draw_Texture(hudap, x + 34, y + 77, hudap.width, hudap.height, false, 255, 255, 255, 255, false);
236 r_Draw_Text(IntToStr(MAX(0, p.health)), x + 105{178}, y + 40, 255, 0, 0, 255, menufont); // TODO draw at center
237 r_Draw_Text(IntToStr(MAX(0, p.armor)), x + 105{178}, y + 68, 255, 0, 0, 255, menufont); // TODO draw at center
246 begin
259 begin
260 r_Draw_Texture(hudair, x, y + 116, hudair.width, hudair.height, false, 255, 255, 255, 255, false);
262 r_Draw_FillRect(x + 14, y + 116 + 4, x + 14 + 168 * p.air div AIR_MAX, y + 116 + 4 + 4, 0, 0, 196, 255);
263 r_Draw_Texture(hudjet, x, y + 126, hudjet.width, hudjet.height, false, 255, 255, 255, 255, false);
264 r_Draw_FillRect(x + 14, y + 126 + 4, x + 14 + 168 * p.JetFuel div JET_MAX, y + 126 + 4 + 4, 208, 0, 0, 255);
265 end
266 else
267 begin
268 r_Draw_Texture(hudair, x, y + 124, hudair.width, hudair.height, false, 255, 255, 255, 255, false);
270 r_Draw_FillRect(x + 14, y + 124 + 4, x + 14 + 168 * p.air div AIR_MAX, y + 124 + 4 + 4, 0, 0, 196, 255);
276 begin
283 begin
289 begin
299 begin
302 else
305 // TODO draw stats
308 begin
310 begin
311 // TODO draw at center
312 r_Draw_Text(_lc[I_PLAYER_SPECT4], x div 2 + w div 2, y div 2 + h div 2, 255, 255, 255, 255, stdfont);
318 begin
324 begin
326 exit;
328 SetupMatrix;
335 //e_LogWritefln('r_render_draw: %sx%s', [gScreenWidth, gScreenHeight]);
338 begin
339 // TODO setup player view
340 // TODO setup sectator mode
341 // TODO setup player hear point
342 // TODO setup player view siz
344 // TODO draw player view + setup screen coords
347 // TODO draw holmes inspector
349 // TODO draw messages
350 // TODO draw stats (?)
351 // TODO draw spectator hud
355 begin
356 // TODO draw pause screen
360 begin
363 STATE_FOLD: ;
364 STATE_INTERCUSTOM: ;
365 STATE_INTERSINGLE: ;
366 STATE_ENDPIC: ;
367 STATE_SLIST: ;
371 {$IFDEF ENABLE_MENU}
373 begin
374 // TODO draw menu widgets
376 {$ENDIF}
378 // TODO draw console
380 // TODO draw holmes interface
384 sys_Repaint;
388 begin
398 begin
399 {$IFDEF ENABLE_SYSTEM}
402 else
405 {$ENDIF}
409 begin
413 {$IFDEF ENABLE_GIBS}
415 begin
418 {$ENDIF}
420 {$IFDEF ENABLE_GFX}
422 begin
425 {$ENDIF}
427 {$IFDEF ENABLE_TOUCH}
429 begin
432 {$ENDIF}
434 {$IFDEF ENABLE_MENU}
436 begin
441 begin
446 begin
451 begin
454 {$ENDIF}
457 begin