DEADSOFTWARE

darkened interpic a little, to make loading log more readable
[d2df-sdl.git] / src / game / g_window.pas
index 258b489b1f8f35f335061f207515c48406bab2b0..d04c8b37477b2dfe1147558a302e48322efe824d 100644 (file)
@@ -1,4 +1,4 @@
-(* Copyright (C)  DooM 2D:Forever Developers
+(* 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
@@ -61,7 +61,7 @@ uses
 
 
 const
-  ProgressUpdateMSecs = 100;
+  ProgressUpdateMSecs = 1;//100;
 
 var
   h_Wnd: PSDL_Window = nil;
@@ -83,10 +83,7 @@ var
 
 procedure KillGLWindow ();
 begin
-  if (h_Wnd <> nil) then
-  begin
-    if assigned(oglDeinitCB) then oglDeinitCB();
-  end;
+  if (h_GL <> nil) then begin if (assigned(oglDeinitCB)) then oglDeinitCB(); end;
   if (h_Wnd <> nil) then SDL_DestroyWindow(h_Wnd);
   if (h_GL <> nil) then SDL_GL_DeleteContext(h_GL);
   h_Wnd := nil;
@@ -136,10 +133,9 @@ begin
 
   SDL_GL_MakeCurrent(h_Wnd, h_GL);
   SDL_ShowCursor(SDL_DISABLE);
-  if (h_GL <> nil) then
-  begin
-    if assigned(oglInitCB) then oglInitCB();
-  end;
+  fuiScrWdt := gScreenWidth;
+  fuiScrHgt := gScreenHeight;
+  if (h_GL <> nil) then begin if (assigned(oglInitCB)) then oglInitCB(); end;
 {$ENDIF}
 
   result := true;
@@ -185,6 +181,8 @@ begin
   gWinSizeX := gScreenWidth;
   gWinSizeY := gScreenHeight;
 {$IF not DEFINED(HEADLESS)}
+  fuiScrWdt := gScreenWidth;
+  fuiScrHgt := gScreenHeight;
   e_ResizeWindow(gScreenWidth, gScreenHeight);
   g_Game_SetupScreenSize();
   g_Menu_Reset();
@@ -469,7 +467,9 @@ begin
 {$IF not DEFINED(HEADLESS)}
   h_Gl := SDL_GL_CreateContext(h_Wnd);
   if (h_Gl = nil) then exit;
-  if assigned(oglInitCB) then oglInitCB();
+  fuiScrWdt := gScreenWidth;
+  fuiScrHgt := gScreenHeight;
+  if (assigned(oglInitCB)) then oglInitCB();
 {$ENDIF}
 
   e_ResizeWindow(gScreenWidth, gScreenHeight);
@@ -577,7 +577,8 @@ begin
     begin
       if g_Texture_Get('INTER', ID) then
       begin
-        e_DrawSize(ID, 0, 0, 0, false, false, gScreenWidth, gScreenHeight)
+        e_DrawSize(ID, 0, 0, 0, false, false, gScreenWidth, gScreenHeight);
+        e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 100);
       end
       else
       begin
@@ -767,9 +768,17 @@ var
   {$ENDIF}
   arg: AnsiString;
   mdfo: TStream;
+  itmp: Integer;
+  valres: Word;
 begin
 {$IFDEF HEADLESS}
   e_NoGraphics := true;
+{$ELSE}
+  if (not g_holmes_imfunctional) then
+  begin
+    uiInitialize();
+    uiContext.font := 'win14';
+  end;
 {$ENDIF}
 
   idx := 1;
@@ -799,6 +808,7 @@ begin
     {.$ENDIF}
 
     if arg = '--holmes' then begin g_holmes_enabled := true; g_Game_SetDebugMode(); end;
+
     if (arg = '--holmes-ui-scale') or (arg = '-holmes-ui-scale') then
     begin
       if (idx <= ParamCount) then
@@ -808,6 +818,30 @@ begin
       end;
     end;
 
+    if (arg = '--holmes-font') or (arg = '-holmes-font') then
+    begin
+      if (idx <= ParamCount) then
+      begin
+        itmp := 0;
+        val(ParamStr(idx), itmp, valres);
+        {$IFNDEF HEADLESS}
+        if (valres = 0) and (not g_holmes_imfunctional) then
+        begin
+          case itmp of
+            8: uiContext.font := 'win8';
+            14: uiContext.font := 'win14';
+            16: uiContext.font := 'win16';
+          end;
+        end;
+        {$ELSE}
+        // fuck off, fpc!
+        itmp := itmp;
+        valres := valres;
+        {$ENDIF}
+        Inc(idx);
+      end;
+    end;
+
     if (arg = '--game-scale') or (arg = '-game-scale') then
     begin
       if (idx <= ParamCount) then