summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6d3998e)
raw | patch | inline | side by side (parent: 6d3998e)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 13 Apr 2022 19:55:28 +0000 (22:55 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 08:27:35 +0000 (11:27 +0300) |
src/game/Doom2DF.lpr | patch | blob | history | |
src/game/renders/stub/r_render.pas | [new file with mode: 0644] | patch | blob |
src/shared/a_modes.inc | patch | blob | history |
diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr
index a93c9bb4a3cd5733d3d633b31badece02122ac43..ff748ecccdf7a17293099fd4fd4f4e5533124627 100644 (file)
--- a/src/game/Doom2DF.lpr
+++ b/src/game/Doom2DF.lpr
{$ENDIF}
{$IFDEF ENABLE_RENDER}
- {$I ../shared/vampimg.inc}
- r_animations in 'opengl/r_animations.pas',
- r_console in 'opengl/r_console.pas',
- r_game in 'opengl/r_game.pas',
- {$IFDEF ENABLE_GFX}
- r_gfx in 'opengl/r_gfx.pas',
- {$ENDIF}
- r_graphics in 'opengl/r_graphics.pas',
- r_items in 'opengl/r_items.pas',
- r_map in 'opengl/r_map.pas',
- r_monsters in 'opengl/r_monsters.pas',
- r_netmaster in 'opengl/r_netmaster.pas',
- r_player in 'opengl/r_player.pas',
- r_playermodel in 'opengl/r_playermodel.pas',
- r_render in 'opengl/r_render.pas',
- r_texture in 'opengl/r_texture.pas',
- r_textures in 'opengl/r_textures.pas',
- r_weapons in 'opengl/r_weapons.pas',
- r_window in 'opengl/r_window.pas',
- {$IFDEF ENABLE_TOUCH}
- r_touch in 'opengl/r_touch.pas',
- {$ENDIF}
- {$IFDEF ENABLE_MENU}
- r_gui in 'opengl/r_gui.pas',
+ {$IF DEFINED(USE_OPENGL) OR DEFINED(USE_GLES1) OR DEFINED(USE_GLSTUB)}
+ {$I ../shared/vampimg.inc}
+ r_animations in 'opengl/r_animations.pas',
+ r_console in 'opengl/r_console.pas',
+ r_game in 'opengl/r_game.pas',
+ {$IFDEF ENABLE_GFX}
+ r_gfx in 'opengl/r_gfx.pas',
+ {$ENDIF}
+ r_graphics in 'opengl/r_graphics.pas',
+ r_items in 'opengl/r_items.pas',
+ r_map in 'opengl/r_map.pas',
+ r_monsters in 'opengl/r_monsters.pas',
+ r_netmaster in 'opengl/r_netmaster.pas',
+ r_player in 'opengl/r_player.pas',
+ r_playermodel in 'opengl/r_playermodel.pas',
+ r_render in 'opengl/r_render.pas',
+ r_texture in 'opengl/r_texture.pas',
+ r_textures in 'opengl/r_textures.pas',
+ r_weapons in 'opengl/r_weapons.pas',
+ r_window in 'opengl/r_window.pas',
+ {$IFDEF ENABLE_TOUCH}
+ r_touch in 'opengl/r_touch.pas',
+ {$ENDIF}
+ {$IFDEF ENABLE_MENU}
+ r_gui in 'opengl/r_gui.pas',
+ {$ENDIF}
+ {$ELSEIF DEFINED(USE_STUBRENDER)}
+ r_render in 'renders/stub/r_render.pas',
+ {$ELSE}
+ {$FATAL render driver not selected}
{$ENDIF}
{$ENDIF}
diff --git a/src/game/renders/stub/r_render.pas b/src/game/renders/stub/r_render.pas
--- /dev/null
@@ -0,0 +1,188 @@
+(* Copyright (C) Doom 2D: Forever Developers
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3 of the License ONLY.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *)
+{$INCLUDE ../../../shared/a_modes.inc}
+unit r_render;
+
+interface
+
+ uses
+ {$IFDEF ENABLE_MENU}
+ g_gui,
+ {$ENDIF}
+ g_base // TRectWH
+ ;
+
+ procedure r_Render_Initialize;
+ procedure r_Render_Finalize;
+
+ procedure r_Render_Load;
+ procedure r_Render_Free;
+
+ procedure r_Render_LoadTextures;
+ procedure r_Render_FreeTextures;
+
+ procedure r_Render_Update;
+ procedure r_Render_Draw;
+
+ procedure r_Render_Resize (w, h: Integer);
+ procedure r_Render_Apply;
+
+ function r_Render_WriteScreenShot (filename: String): Boolean;
+
+ {$IFDEF ENABLE_GIBS}
+ function r_Render_GetGibRect (m, id: Integer): TRectWH;
+ {$ENDIF}
+
+ {$IFDEF ENABLE_GFX}
+ procedure r_Render_QueueEffect (AnimType, X, Y: Integer);
+ {$ENDIF}
+
+ {$IFDEF ENABLE_TOUCH}
+ // touch screen button location and size
+ procedure r_Render_GetKeyRect (key: Integer; out x, y, w, h: Integer; out founded: Boolean);
+ {$ENDIF}
+
+ {$IFDEF ENABLE_MENU}
+ procedure r_Render_GetControlSize (ctrl: TGUIControl; out w, h: Integer);
+ procedure r_Render_GetLogoSize (out w, h: Integer);
+ procedure r_Render_GetMaxFontSize (BigFont: Boolean; out w, h: Integer);
+ procedure r_Render_GetStringSize (BigFont: Boolean; str: String; out w, h: Integer);
+ {$ENDIF}
+
+ procedure r_Render_DrawLoading (force: Boolean); // !!! remove it
+
+implementation
+
+ uses
+ {$IFDEF ENABLE_SYSTEM}
+ g_system,
+ {$ENDIF}
+ SysUtils, Classes, Math,
+ e_log, utils,
+ g_game, g_options, g_console
+ ;
+
+ procedure r_Render_LoadTextures;
+ begin
+ end;
+
+ procedure r_Render_FreeTextures;
+ begin
+ end;
+
+ procedure r_Render_Load;
+ begin
+ end;
+
+ procedure r_Render_Free;
+ begin
+ end;
+
+ procedure r_Render_Initialize;
+ begin
+ {$IFDEF ENABLE_SYSTEM}
+ if sys_SetDisplayMode(gRC_Width, gRC_Height, gBPP, gRC_FullScreen, gRC_Maximized) = False then
+ raise Exception.Create('Failed to set videomode on startup.');
+ {$ENDIF}
+ end;
+
+ procedure r_Render_Finalize;
+ begin
+ end;
+
+ procedure r_Render_Update;
+ begin
+ end;
+
+ procedure r_Render_Draw;
+ begin
+ end;
+
+ procedure r_Render_Resize (w, h: Integer);
+ begin
+ gWinSizeX := w;
+ gWinSizeY := h;
+ gRC_Width := w;
+ gRC_Height := h;
+ gScreenWidth := w;
+ gScreenHeight := h;
+ end;
+
+ procedure r_Render_Apply;
+ begin
+ {$IFDEF ENABLE_SYSTEM}
+ if sys_SetDisplayMode(Max(1, gRC_Width), Max(1, gRC_Height), Max(1, gBPP), gRC_FullScreen, gRC_Maximized) then
+ e_LogWriteln('resolution changed')
+ else
+ e_LogWriteln('resolution not changed');
+ sys_EnableVSync(gVSync)
+ {$ENDIF}
+ end;
+
+ function r_Render_WriteScreenShot (filename: String): Boolean;
+ begin
+ Result := False;
+ end;
+
+{$IFDEF ENABLE_GIBS}
+ function r_Render_GetGibRect (m, id: Integer): TRectWH;
+ begin
+ Result.X := 16;
+ Result.Y := 16;
+ Result.Width := 16;
+ Result.Height := 16;
+ end;
+{$ENDIF}
+
+{$IFDEF ENABLE_GFX}
+ procedure r_Render_QueueEffect (AnimType, X, Y: Integer);
+ begin
+ end;
+{$ENDIF}
+
+{$IFDEF ENABLE_TOUCH}
+ procedure r_Render_GetKeyRect (key: Integer; out x, y, w, h: Integer; out founded: Boolean);
+ begin
+ founded := False;
+ end;
+{$ENDIF}
+
+{$IFDEF ENABLE_MENU}
+ procedure r_Render_GetControlSize (ctrl: TGUIControl; out w, h: Integer);
+ begin
+ w := 0; h := 0;
+ end;
+
+ procedure r_Render_GetLogoSize (out w, h: Integer);
+ begin
+ w := 0; h := 0;
+ end;
+
+ procedure r_Render_GetMaxFontSize (BigFont: Boolean; out w, h: Integer);
+ begin
+ w := 0; h := 0;
+ end;
+
+ procedure r_Render_GetStringSize (BigFont: Boolean; str: String; out w, h: Integer);
+ begin
+ w := 0; h := 0;
+ end;
+{$ENDIF}
+
+ procedure r_Render_DrawLoading (force: Boolean);
+ begin
+ end;
+
+end.
diff --git a/src/shared/a_modes.inc b/src/shared/a_modes.inc
index 42c44dd7c6d0c459b7e20a1aaa2af837c3b7acf5..058f2b9406c519c9f2d9a94b75c08075c54b5e59 100644 (file)
--- a/src/shared/a_modes.inc
+++ b/src/shared/a_modes.inc
{$ENDIF}
{$IF DEFINED(USE_GLSTUB)}
- {$IF DEFINED(USE_GLES1) OR DEFINED(USE_OPENGL)}
+ {$IF DEFINED(USE_GLES1) OR DEFINED(USE_OPENGL) OR DEFINED(USE_STUBRENDER)}
{$ERROR Only one render driver must be selected!}
{$ENDIF}
{$ELSEIF DEFINED(USE_GLES1)}
- {$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_OPENGL)}
+ {$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_OPENGL) OR DEFINED(USE_STUBRENDER)}
{$ERROR Only one render driver must be selected!}
{$ENDIF}
{$ELSEIF DEFINED(USE_OPENGL)}
- {$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_GLES1)}
+ {$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_GLES1) OR DEFINED(USE_STUBRENDER)}
+ {$ERROR Only one render driver must be selected!}
+ {$ENDIF}
+{$ELSEIF DEFINED(USE_STUBRENDER)}
+ {$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_OPENGL) OR DEFINED(USE_GLES1)}
{$ERROR Only one render driver must be selected!}
{$ENDIF}
{$ELSEIF DEFINED(ENABLE_RENDER)}
{$DEFINE USE_OPENGL}
- {.$ERROR Render driver not selected. Use -dUSE_GLSTUB or -dUSE_GLES1 or -dUSE_OPENGL}
+ {.$ERROR Render driver not selected. Use -dUSE_OPENGL or -dUSE_GLES1}
+{$ENDIF}
+
+{$IFDEF DISABLE_RENDER}
+ {$UNDEF USE_GLSTUB}
+ {$UNDEF USE_GLES1}
+ {$UNDEF USE_OPENGL}
+ {$UNDEF USE_STUBRENDER}
{$ENDIF}
{$IFDEF ENABLE_HOLMES}