begin
itmp := 0;
val(ParamStr(idx), itmp, valres);
- {$IFNDEF HEADLESS}
if (valres = 0) and (not g_holmes_imfunctional) then
begin
case itmp of
16: uiContext.font := 'win16';
end;
end;
- {$ELSE}
- // fuck off, fpc!
- itmp := itmp;
- valres := valres;
- {$ENDIF}
Inc(idx);
end;
end;
//SetLength(ConsoleHistory, Length(ConsoleHistory)+1);
//ConsoleHistory[High(ConsoleHistory)] := L;
-
- (*
-{$IFDEF HEADLESS}
- e_WriteLog('CON: ' + L, MSG_NOTIFY);
-{$ENDIF}
- *)
end;
procedure g_Corpses_RemoveAll;
procedure g_Corpses_Update;
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
function g_Corpses_GetCameraObj (Player: TPlayer): TObj;
{$ENDIF}
SetLength(gCorpses, MaxCorpses);
end;
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_RENDER}
function g_Corpses_GetCameraObj (Player: TPlayer): TObj;
begin
{$IFDEF ENABLE_CORPSES}
{$IFDEF ENABLE_MENU}
procedure g_Game_InGameMenu(Show: Boolean);
{$ENDIF}
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_SYSTEM}
procedure CharPress (C: AnsiChar);
{$ENDIF}
+
procedure KeyPress (K: Word);
{ procedure SetWinPause(Enable: Boolean); }
end;
{$ENDIF}
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_SYSTEM}
procedure CharPress (C: AnsiChar);
{$IFDEF ENABLE_MENU}
var Msg: g_gui.TMessage;
// Нужно сменить разрешение:
if gResolutionChange then
begin
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
e_WriteLog('Changing resolution', TMsgType.Notify);
r_Render_Apply;
{$ENDIF}
gMusic.Free();
g_Game_FreeData();
g_PlayerModel_FreeData();
-{$IFNDEF HEADLESS}
- //g_Menu_Free(); //k8: this segfaults after resolution change; who cares?
-{$ENDIF}
+ {$IFDEF ENABLE_MENU}
+ // g_Menu_Free(); //k8: this segfaults after resolution change; who cares?
+ {$ENDIF}
if NetInitDone then g_Net_Free;
// ////////////////////////////////////////////////////////////////////////// //
procedure g_Holmes_OnEvent (var ev: TFUIEvent);
-{$IF not DEFINED(HEADLESS)}
-var
- doeat: Boolean = false;
-{$ENDIF}
+ var doeat: Boolean = false;
begin
-{$IF not DEFINED(HEADLESS)}
if g_Game_IsNet then exit;
if not g_holmes_enabled then exit;
if g_holmes_imfunctional then exit;
if (ev.key) then
begin
+{$IFDEF USE_SDL2}
case ev.scan of
SDL_SCANCODE_LCTRL, SDL_SCANCODE_RCTRL,
SDL_SCANCODE_LALT, SDL_SCANCODE_RALT,
SDL_SCANCODE_LSHIFT, SDL_SCANCODE_RSHIFT:
doeat := true;
end;
+{$ENDIF}
end
else if (ev.mouse) then
begin
end;
if (doeat) then ev.eat();
-{$ENDIF}
end;
if not g_holmes_enabled then exit;
if g_holmes_imfunctional then exit;
- {$IF not DEFINED(HEADLESS)}
holmesInitCommands();
holmesInitBinds();
+{$IFDEF ENABLE_RENDER}
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); // modify color buffer
glDisable(GL_STENCIL_TEST);
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
if gGameOn then plrDebugDraw();
- {$ENDIF}
+{$ENDIF}
laserSet := false;
end;
if not g_holmes_enabled then exit;
if g_holmes_imfunctional then exit;
- {$IF not DEFINED(HEADLESS)}
gGfxDoClear := false;
+
+{$IFDEF ENABLE_RENDER}
//if assigned(prerenderFrameCB) then prerenderFrameCB();
uiDraw();
glMatrixMode(GL_MODELVIEW);
finally
glPopMatrix();
end;
- {$ENDIF}
+{$ENDIF}
end;
// HACK: take stats screenshot immediately after the first frame of the stats showing
if gScreenshotStats and (not StatShotDone) and (Length(CustomStat.PlayerStat) > 1) then
begin
-{$IFNDEF HEADLESS}
g_TakeScreenShot('stats/' + StatFilename);
-{$ENDIF}
StatShotDone := True;
end;
end;
end;
{$ENDIF}
-{$IFNDEF HEADLESS}
r_Console_Draw();
-{$ENDIF}
if g_debug_Sounds and gGameOn then
begin
procedure sys_ShowKeyboard (yes: Boolean);
begin
- {$IFNDEF HEADLESS}
- if g_dbg_input then
- e_LogWritefln('g_Touch_ShowKeyboard(%s)', [yes]);
- (* on desktop we always receive text (needed for cheats) *)
- if yes or (SDL_HasScreenKeyboardSupport() = SDL_FALSE) then
- SDL_StartTextInput
- else
- SDL_StopTextInput
- {$ENDIF}
+ if g_dbg_input then
+ e_LogWritefln('g_Touch_ShowKeyboard(%s)', [yes]);
+ (* on desktop we always receive text (needed for cheats) *)
+ if yes or (SDL_HasScreenKeyboardSupport() = SDL_FALSE) then
+ SDL_StartTextInput
+ else
+ SDL_StopTextInput
end;
procedure HandleTouch (const ev: TSDL_TouchFingerEvent);
{$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_GLES1)}
{$ERROR Only one render driver must be selected!}
{$ENDIF}
-{$ELSE}
+{$ELSEIF DEFINED(ENABLE_RENDER)}
{$DEFINE USE_OPENGL}
{.$ERROR Render driver not selected. Use -dUSE_GLSTUB or -dUSE_GLES1 or -dUSE_OPENGL}
{$ENDIF}
{$IFDEF ENABLE_HOLMES}
+ {$IFDEF DISABLE_SYSTEM}
+ {$FATAL System driver required for current Holmes implementation}
+ {$ENDIF}
+ {$IFDEF DISABLE_RENDER}
+ {$FATAL Render driver required for current Holmes implementation}
+ {$ENDIF}
{$IFNDEF USE_SDL2}
- {$ERROR Holmes supported only with SDL2}
+ {$FATAL SDL2 required for current Holmes implementation}
{$ENDIF}
{$IFNDEF USE_OPENGL}
- {$ERROR Holmes supported only with desktop OpenGL}
+ {$FATAL Desktop OpenGL required for current Holmes implementation}
{$ENDIF}
{$ENDIF}