DEADSOFTWARE

gl: implement touch screen controls
[d2df-sdl.git] / src / game / Doom2DF.lpr
index ff748ecccdf7a17293099fd4fd4f4e5533124627..f0c3a90a2bc108c090755d66697d701e8cce893b 100644 (file)
@@ -144,7 +144,7 @@ uses
   g_playermodel in 'g_playermodel.pas',
   g_saveload in 'g_saveload.pas',
   g_sound in 'g_sound.pas',
-  g_textures in 'g_textures.pas',
+  g_animations in 'g_animations.pas',
   g_triggers in 'g_triggers.pas',
   g_weapons in 'g_weapons.pas',
   g_window in 'g_window.pas',
@@ -195,6 +195,27 @@ uses
     {$ENDIF}
   {$ELSEIF DEFINED(USE_STUBRENDER)}
     r_render in 'renders/stub/r_render.pas',
+  {$ELSEIF DEFINED(USE_NEWGL)}
+    {$I ../shared/vampimg.inc}
+    r_render in 'renders/opengl/r_render.pas',
+    r_atlas in 'renders/opengl/r_atlas.pas',
+    r_textures in 'renders/opengl/r_textures.pas',
+    r_draw in 'renders/opengl/r_draw.pas',
+    r_map in 'renders/opengl/r_map.pas',
+    r_fonts in 'renders/opengl/r_fonts.pas',
+    r_common in 'renders/opengl/r_common.pas',
+    r_console in 'renders/opengl/r_console.pas',
+    {$IFDEF ENABLE_MENU}
+      r_gui in 'renders/opengl/r_gui.pas',
+    {$ENDIF}
+    r_loadscreen in 'renders/opengl/r_loadscreen.pas',
+    {$IFDEF ENABLE_TOUCH}
+      r_touch in 'renders/opengl/r_touch.pas',
+    {$ENDIF}
+    {$IFDEF ENABLE_HOLMES}
+      r_fui_gfx_gl in 'renders/opengl/r_fui_gfx_gl.pas',
+      r_holmes in 'renders/opengl/r_holmes.pas',
+    {$ENDIF}
   {$ELSE}
     {$FATAL render driver not selected}
   {$ENDIF}
@@ -226,7 +247,7 @@ uses
 
   fui_wadread in '../flexui/fui_wadread.pas',
   fui_common in '../flexui/fui_common.pas',
-  fui_gfx_gl in '../flexui/fui_gfx_gl.pas',
+  fui_gfx in '../flexui/fui_gfx.pas',
   fui_events in '../flexui/fui_events.pas',
   fui_style in '../flexui/fui_style.pas',
   fui_flexlay in '../flexui/fui_flexlay.pas',
@@ -332,9 +353,6 @@ begin
     {$IFDEF ENABLE_RENDER}
       r_Render_Draw;
     {$ENDIF}
-    {$IFDEF ENABLE_SYSTEM}
-      sys_Repaint;
-    {$ENDIF}
     Frame := Time
   end
   else
@@ -885,11 +903,11 @@ end;
       if not fuiAddWad('./data/flexui.wad') then fuiAddWad('./flexui.wad');
     end;
     try
-      fuiGfxLoadFont('win8', 'flexui/fonts/win8.fuifont');
-      fuiGfxLoadFont('win14', 'flexui/fonts/win14.fuifont');
-      fuiGfxLoadFont('win16', 'flexui/fonts/win16.fuifont');
-      fuiGfxLoadFont('dos8', 'flexui/fonts/dos8.fuifont');
-      fuiGfxLoadFont('msx6', 'flexui/fonts/msx6.fuifont');
+      gxGfxLoadFont('win8', 'flexui/fonts/win8.fuifont');
+      gxGfxLoadFont('win14', 'flexui/fonts/win14.fuifont');
+      gxGfxLoadFont('win16', 'flexui/fonts/win16.fuifont');
+      gxGfxLoadFont('dos8', 'flexui/fonts/dos8.fuifont');
+      gxGfxLoadFont('msx6', 'flexui/fonts/msx6.fuifont');
     except on e: Exception do
       begin
         writeln('ERROR loading FlexUI fonts');
@@ -1003,6 +1021,26 @@ end;
     {$ENDIF}
   end;
 
+  procedure ProcessLoading;
+    var update: Boolean;
+  begin
+    {$IFDEF ENABLE_SYSTEM}
+      update := sys_HandleInput() = False;
+    {$ELSE}
+      update := True;
+    {$ENDIF}
+    if update then
+    begin
+      e_SoundUpdate;
+      // TODO: At the moment, I left here only host network processing, because the client code must
+      // handle network events on its own. Otherwise separate network cases that use different calls to
+      // enet_host_service() WILL lose their packets (for example, resource downloading). So they have
+      // to handle everything by themselves. But in general, this MUST be removed completely, since
+      // updating the window should never affect the network. Use single enet_host_service(), period.
+      if NetMode = NET_SERVER then g_Net_Host_Update();
+    end
+  end;
+
   procedure Startup;
   begin
     Randomize;
@@ -1027,6 +1065,11 @@ end;
     DebugOptions;
     g_Net_InitLowLevel;
     // TODO init serverlist
+    {$IFDEF ENABLE_RENDER}
+      r_Render_SetProcessLoadingCallback(@ProcessLoading);
+    {$ENDIF}
+    g_Game_SetLoadingText(Format('Doom 2D: Forever %s', [GAME_VERSION]), 0, False);
+    g_Game_SetLoadingText('', 0, False);
     {$IFDEF ENABLE_HOLMES}
       InitHolmes;
     {$ENDIF}
@@ -1049,6 +1092,9 @@ end;
     {$ENDIF}
     Time_Old := GetTickCount64();
     while not ProcessMessage() do begin end;
+    {$IFDEF ENABLE_RENDER}
+      r_Render_SetProcessLoadingCallback(nil);
+    {$ENDIF}
     g_Console_WriteGameConfig;
     {$IFDEF ENABLE_MENU}
       g_GUI_Destroy;