summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (from parent 1: 4171d8d)
raw | patch | inline | side by side (from parent 1: 4171d8d)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 12 Oct 2019 20:26:16 +0000 (23:26 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 13 Oct 2019 14:19:20 +0000 (17:19 +0300) |
index 6f1df29b44ae447aaf587fcf4bf8f4362aa86dd3..ca6dcf17bcbbb5565476c63f14b30e8fe3c8f2a2 100644 (file)
procedure e_TextureFontBuild(Tex: DWORD; var FontID: DWORD; XCount, YCount: Word;
Space: ShortInt=0);
var
+{$IF not DEFINED(USE_NANOGL) and not DEFINED(USE_NOGL)}
loop1 : GLuint;
cx, cy : real;
+{$ENDIF}
i, id: DWORD;
begin
if e_NoGraphics then Exit;
diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index 6a6df2af907e9a4c3f4d83943bb6ac24013ecc87..0269a4c9315d2d700320061cd60f4b02774c4354 100644 (file)
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
charbuff: packed array [0..15] of AnsiChar;
procedure Main();
-var
- sdlflags: LongWord;
-{$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)}
- flexloaded: Boolean;
+{$IFDEF ENABLE_HOLMES}
+ var flexloaded: Boolean;
{$ENDIF}
begin
e_InitWritelnDriver();
diff --git a/src/game/g_options.pas b/src/game/g_options.pas
index f889ea36e6e63f42154783ab7de5d3ae21145ad4..116e6474fd136810e16de5b09963901a06c7b65b 100644 (file)
--- a/src/game/g_options.pas
+++ b/src/game/g_options.pas
{$ELSE}
procedure g_Options_SetDefaultVideo;
begin
- {$WARNING stub}
gScreenWidth := 640;
gScreenHeight := 480;
gBPP := 32;
diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index 002e51aa92284fa9db8cdaf39da94dcc8174dc71..3ea192bd998ede79b04215dec5bb09251afb2ab4 100644 (file)
--- a/src/game/g_window.pas
+++ b/src/game/g_window.pas
flag: Boolean;
wNeedTimeReset: Boolean = false;
wMinimized: Boolean = false;
- wMaximized: Boolean = false;
- wLoadingProgress: Boolean = false;
wLoadingQuit: Boolean = false;
procedure ResetTimer ();
{$ENDIF}
procedure ProcessLoading (forceUpdate: Boolean=false);
-var
{$IFNDEF HEADLESS}
-// ev: TSDL_Event;
+var
stt: UInt64;
{$ENDIF}
begin
-// FillChar(ev, sizeof(ev), 0);
- wLoadingProgress := true;
-
-// while (SDL_PollEvent(@ev) > 0) do
-// begin
-// EventHandler(ev);
-// if (ev.type_ = SDL_QUITEV) then break;
-// end;
- //e_PollJoysticks();
-
-// if (ev.type_ = SDL_QUITEV) or (gExit = EXIT_QUIT) then
-// begin
-// wLoadingProgress := false;
-// exit;
-// end;
+ if sys_HandleInput() = True then
+ Exit;
{$IFNDEF HEADLESS}
if not wMinimized then
begin
if (NetMode = NET_CLIENT) and (NetState <> NET_STATE_AUTH) then g_Net_Client_UpdateWhileLoading();
end;
-
- wLoadingProgress := false;
end;
function SDLMain (): Integer;
var
idx: Integer;
- {$IF not DEFINED(HEADLESS)}
- ltmp: Integer;
- {$ENDIF}
arg: AnsiString;
mdfo: TStream;
{$IFDEF ENABLE_HOLMES}
end;
end;
+{$IFDEF USE_SYSSTUB}
PrintGLSupportedExtensions;
glLegacyNPOT := GLExtensionSupported('GL_ARB_texture_non_power_of_two') or GLExtensionSupported('GL_OES_texture_npot');
+{$ELSE}
+ glLegacyNPOT := False;
+{$ENDIF}
e_logWritefln('NPOT textures: %s', [glLegacyNPOT]);
gwin_dump_extensions := false;
index 4a4a3cb34c92799203e3db627d004a33d2d7769a..3e78fadcfdc997d324162bb67f1e47560c8f4ad4 100644 (file)
f.BitsPerPixel := bpp;
f.BytesPerPixel := (bpp + 7) div 8;
m := SDL_ListModes(@f, SDL_OPENGL or SDL_FULLSCREEN);
- if (m <> NIL) and (IntPtr(m) <> -1) then
+ if (m <> NIL) and (UIntPtr(m) <> UIntPtr(-1)) then
begin
count := 0;
while m[count] <> nil do inc(count);
index 4e9fcedc40989b2414655f8572f1881a5daeacbf..4b6201d7c649424198b718a8449b6a15a70e10fb 100644 (file)
implementation
+ uses SysUtils;
+
(* --------- Utils --------- *)
function sys_GetTicks (): Int64;
begin
- Result := 0
+ Result := Round(TimeStampToMSecs(DateTimeToTimeStamp(Now())))
end;
procedure sys_Delay (ms: Integer);
begin
+ Sleep(ms)
end;
(* --------- Graphics --------- *)
diff --git a/src/nogl/noGLES1.inc b/src/nogl/noGLES1.inc
index a4c6589293b5299caae67450658a663e3330134c..1f4f67aa7b58fc728d56ebb52d293a4100c05905 100644 (file)
--- a/src/nogl/noGLES1.inc
+++ b/src/nogl/noGLES1.inc
es_glEnableClientState: procedure (arr: GLenum); cdecl;
es_glDisableClientState: procedure (arr: GLenum); cdecl;
es_glDrawArrays: procedure (mode: GLenum; first: GLint; count: GLsizei); cdecl;
- es_glActiveTexture: procedure(texture: GLenum); cdecl;
- es_glClientActiveTexture: procedure(texture: GLenum); cdecl;
+// es_glActiveTexture: procedure(texture: GLenum); cdecl;
+// es_glClientActiveTexture: procedure(texture: GLenum); cdecl;
es_glColor4f: procedure(red, green, blue, alpha: GLfloat); cdecl;
es_glEnable: procedure (cap: GLenum); cdecl;
end;
procedure glEnd;
- var count: Integer;
begin
assert(cmds.mode <> GL_INVALID_ENUM);
assert(Length(cmds.v) mod ValPerVertex = 0);
es_glEnableClientState := SDL_GL_GetProcAddress('glEnableClientState');
es_glDisableClientState := SDL_GL_GetProcAddress('glDisableClientState');
es_glDrawArrays := SDL_GL_GetProcAddress('glDrawArrays');
- es_glActiveTexture := SDL_GL_GetProcAddress('glActiveTexture');
- es_glClientActiveTexture := SDL_GL_GetProcAddress('glClientActiveTexture');
+// es_glActiveTexture := SDL_GL_GetProcAddress('glActiveTexture');
+// es_glClientActiveTexture := SDL_GL_GetProcAddress('glClientActiveTexture');
es_glColor4f := SDL_GL_GetProcAddress('glColor4f');
es_glEnable := SDL_GL_GetProcAddress('glEnable');
es_glEnableClientState := nil;
es_glDisableClientState := nil;
es_glDrawArrays := nil;
- es_glActiveTexture := nil;
- es_glClientActiveTexture := nil;
+// es_glActiveTexture := nil;
+// es_glClientActiveTexture := nil;
es_glColor4f := nil;
es_glEnable := nil;
index 5e6212b921b5b7ddc04784ad9d601503b3d93483..9e25bdb2122426820aa98270b41032a38f4601ff 100644 (file)
--- a/src/shared/xprofiler.pas
+++ b/src/shared/xprofiler.pas
result := UInt64(r)*1000000 div mFrequency;
{$ENDIF}
end;
-(* !!!
-{$ELSEIF DEFINED(USE_SDL)}
-function getTimeMicro: UInt64; inline;
-begin
- {$WARNING use inaccurate profiling timer}
- result := SDL_GetTicks() * 1000
-end;
-*)
{$ELSEIF DEFINED(USE_SDL2)}
function getTimeMicro (): UInt64; inline;
begin
{$ELSE}
function getTimeMicro: UInt64; inline;
begin
- {$WARNING use stub profiling timer}
+ result := Round(TimeStampToMSecs(DateTimeToTimeStamp(Now())) * 1000);
end;
{$ENDIF}