be9192d8a0a8e0aeec87ba210fea2f61d9745f88
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 type
88 TBasePoint = (
92 );
94 var
110 begin
111 r_Map_LoadTextures;
115 begin
116 r_Map_FreeTextures;
121 begin
125 result := r_Textures_LoadFontFromFile(GameWad + ':FONTS/' + name + 'FONT', info, skiphack, true);
131 const
132 WeapName: array [0..WP_LAST] of AnsiString = ('KASTET', 'SAW', 'PISTOL', 'SHOTGUN1', 'SHOTGUN2', 'MGUN', 'RLAUNCHER', 'PGUN', 'BFG', 'SPULEMET', 'FLAMETHROWER');
133 var
135 begin
152 r_Map_Load;
157 begin
158 r_Map_Free;
165 begin
181 {$IFDEF ENABLE_SYSTEM}
184 begin
196 {$ENDIF}
199 begin
200 {$IFDEF ENABLE_SYSTEM}
204 {$ENDIF}
205 r_Textures_Initialize;
206 r_Map_Initialize;
210 begin
211 r_Map_Finalize;
212 r_Textures_Finalize;
216 begin
217 r_Map_Update;
221 begin
225 glLoadIdentity;
228 glLoadIdentity;
232 begin
245 procedure r_Render_DrawText (const text: AnsiString; x, y: Integer; r, g, b, a: Byte; f: TGLFont; p: TBasePoint);
247 begin
249 begin
257 begin
264 begin
267 // hud area is 196 x 240 pixels
275 r_Render_DrawText(IntToStr(MAX(0, p.health)), x + 174, y + 56, 255, 0, 0, 255, menufont, TBasePoint.BP_RIGHT);
276 r_Render_DrawText(IntToStr(MAX(0, p.armor)), x + 174, y + 84, 255, 0, 0, 255, menufont, TBasePoint.BP_RIGHT);
285 begin
298 begin
301 r_Draw_FillRect(x + 14, y + 116 + 4, x + 14 + 168 * p.air div AIR_MAX, y + 116 + 4 + 4, 0, 0, 196, 255);
303 r_Draw_FillRect(x + 14, y + 126 + 4, x + 14 + 168 * p.JetFuel div JET_MAX, y + 126 + 4 + 4, 208, 0, 0, 255);
304 end
305 else
306 begin
309 r_Draw_FillRect(x + 14, y + 124 + 4, x + 14 + 168 * p.air div AIR_MAX, y + 124 + 4 + 4, 0, 0, 196, 255);
315 begin
322 begin
328 begin
329 r_Render_DrawText(_lc[I_PLAYER_SPECT], x + 4, y + 242, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
330 r_Render_DrawText(_lc[I_PLAYER_SPECT2], x + 4, y + 258, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
331 r_Render_DrawText(_lc[I_PLAYER_SPECT1], x + 4, y + 274, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
333 r_Render_DrawText(_lc[I_PLAYER_SPECT1S], x + 4, y + 290, 255, 255, 255, 255, stdfont, TBasePoint.BP_LEFTUP);
338 begin
341 else
344 // TODO draw stats
347 begin
349 r_Render_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);
354 begin
360 begin
362 exit;
364 SetupMatrix;
371 //e_LogWritefln('r_render_draw: %sx%s', [gScreenWidth, gScreenHeight]);
374 begin
375 // TODO setup player view
376 // TODO setup sectator mode
377 // TODO setup player hear point
378 // TODO setup player view siz
380 // TODO draw player view + setup screen coords
383 // TODO draw holmes inspector
385 // TODO draw messages
386 // TODO draw stats (?)
387 // TODO draw spectator hud
391 begin
392 // TODO draw pause screen
396 begin
399 STATE_FOLD: ;
400 STATE_INTERCUSTOM: ;
401 STATE_INTERSINGLE: ;
402 STATE_ENDPIC: ;
403 STATE_SLIST: ;
407 {$IFDEF ENABLE_MENU}
409 begin
410 // TODO draw menu widgets
412 {$ENDIF}
414 // TODO draw console
416 // TODO draw holmes interface
420 sys_Repaint;
424 begin
434 begin
435 {$IFDEF ENABLE_SYSTEM}
438 else
441 {$ENDIF}
445 begin
449 {$IFDEF ENABLE_GIBS}
451 begin
454 {$ENDIF}
456 {$IFDEF ENABLE_GFX}
458 begin
461 {$ENDIF}
463 {$IFDEF ENABLE_TOUCH}
465 begin
468 {$ENDIF}
470 {$IFDEF ENABLE_MENU}
472 begin
477 begin
482 begin
487 begin
490 {$ENDIF}
493 begin