Commit graph

1020 commits

Author SHA1 Message Date
Sally Coolatta
80cb9994d5 Move I_FinishUpdate to D_SRB2Loop to sync screen updates with FPS cap, use timestamps in I_FrameCapSleep to simplify the code 2022-04-26 20:56:33 -05:00
Sally Coolatta
f482218913 I_GetFrameTime to try and improve frame pace
(It doesn't feel that much better though.)
2022-04-26 20:56:33 -05:00
Sally Coolatta
b18e53417a Handle the sleep at the end of D_SRB2Loop instead of the start
Simplifies logic in the other parts of the loop, and fixes problems with it frequently waiting too long.
2022-04-26 20:56:33 -05:00
Sally Coolatta
685190fe40 Improve the framerate limiter's timing for extreme stable FPS 2022-04-26 20:56:32 -05:00
Sally Coolatta
c186d6402b Lots of FPS stuff
- Disabled VSync, due to the numerous problems it has.
- Instead, added an FPS cap.
- Frame interpolation is now tied to fpscap != 35.
- By default, the FPS cap is set to the monitor's refresh rate.
- Rewrote the FPS counter.

(This also consolidates several more commits ahead of this
fixing various issues. -eid)
2022-04-26 20:56:32 -05:00
Sally Coolatta
41997c4549 Keep rect in memory
Feel better about this than creating one all da time
2022-04-26 20:56:32 -05:00
Sally Coolatta
40b021d6e4 Calculate FPS stuff even if frame is skipped
I decided ultimately to actually keep the frame skip optimization disabled, because I think it is actually a little bit helpful that you can still get accurate rendering perfstats while paused, however if we decide otherwise then we can have this optimization back without making the game act like it's lagging.
2022-04-26 20:56:32 -05:00
James R
1b49a96eed Interpolate from time of previous tic
Previously interpolated from last 35th of a second, which
may be offset from game time due to connection lag.

Consider this the proper fix to 54148a0dd0 too.
2022-04-26 20:56:31 -05:00
Eidolon
b625076c87 Implement interpolation at the renderer level
Instead of interpolating thinkers, we interpolate mobjs inside the
renderer. Further interpolation is TBI.
2022-04-26 20:31:37 -05:00
spherallic
14295ac7de 2022 2022-03-03 20:24:46 +01:00
GoldenTails
c49dd5f535 Make dedicated servers not pop up that annoying SDL error window
So they don't mess with shell scripts that expect SRB2 to exit when it crashes (like most other programs)
2022-02-05 18:19:00 -06:00
sphere
0ca74432f9 Merge branch 'ogl-better-gpu-error' into 'next'
Improve OpenGL GDI Generic error message

See merge request STJr/SRB2!1673
2022-01-11 21:16:32 +00:00
MascaraSnake
5149699def Update VS project files 2022-01-07 18:00:56 +01:00
GoldenTails
9282a18d82 oops forgot to remove the old hardcoded defines 2021-12-11 20:11:46 -06:00
GoldenTails
20987eba92 Use lookup tables, macros, and for loops to shorten up the wad search code.
The old inline mess needed to go badly.
2021-12-11 20:00:00 -06:00
Hannu Hanhi
f3c5addab7 Improve OpenGL GDI Generic error message 2021-12-07 22:35:04 +02:00
Hannu Hanhi
270c7701b4 Timestamp function for Lua 2021-11-08 01:17:30 +02:00
Hannu Hanhi
91aeba6c66 Request 24-bit depth buffer from SDL
Should fix problems caused by 16-bit depth buffer usage
2021-10-08 22:47:22 +03:00
SteelT
0f4074f22d Remove unused I_GetMouseGrab function 2021-09-23 13:46:26 -04:00
James R
fec5f2778e Fix compiler warnings 2021-09-12 19:03:39 -07:00
SteelT
e2ea480af9 Merge branch 'master' into next 2021-09-12 15:46:32 -04:00
LJ Sonic
9b7263855e Prevent input.setMouseGrab from interfering with window focus 2021-08-18 20:58:13 +02:00
LJ Sonic
5bc0ce7a62 Give fields in event_t better names 2021-08-14 23:42:39 +02:00
LJ Sonic
38e82e55fc Add a "repeated" field to event_t 2021-08-14 20:33:20 +02:00
SteelT
71f905f95b Fix gme support being effectively disabled
I found this easier than trying to adjust the makefile, as it uses the same thing to automatically generate the various NO* compile options.
2021-07-16 15:26:09 -04:00
LJ Sonic
c319f46462 Merge branch 'hooklib-refactor' into 'next'
Hooklib refactor

See merge request STJr/SRB2!1307
2021-06-22 09:52:12 -04:00
James R
fa7a674113 Merge remote-tracking branch 'origin/master' into next 2021-06-19 19:39:15 -07:00
James R
c1aca51fc3 Fix basic warnings 2021-06-19 18:32:56 -07:00
LJ Sonic
e3a5da3f6f Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2.git into HEAD
# Conflicts:
#	src/lua_hook.h
#	src/lua_hooklib.c
2021-06-19 20:49:12 +02:00
LJ Sonic
cfa48574be Merge branch 'next' into 'lua-inputs'
# Conflicts:
#   src/lua_script.c
2021-06-19 10:34:48 -04:00
James R
c325306ddf Merge remote-tracking branch 'origin/master' into makefile-revision-final 2021-06-07 18:36:01 -07:00
James R
4d22b9f17f Merge remote-tracking branch 'origin/next' into hooklib-refactor 2021-06-07 18:12:52 -07:00
sphere
8cfe7cd971 Merge branch 'unix-rdynamic' into 'next'
Compile with -rdynamic for UNIXCOMMON platforms

See merge request STJr/SRB2!1481
2021-06-02 06:31:14 -04:00
Nev3r
b978bc4507 Merge branch 'sw-tilted-npo2-span-opt' into 'next'
NPO2 slope span optimization

See merge request STJr/SRB2!1216
2021-05-29 09:30:58 -04:00
Steel Titanium
a2667f4dc9 Merge branch 'master' into next 2021-05-11 20:08:44 -04:00
James R
87afa7655a CMake: fix ASM compile
- target_sources from correct directory
- enable_language must be used in add_executable directory
2021-05-07 18:59:51 -07:00
James R
ee72312dea Merge remote-tracking branch 'origin/master' into makefile-revision-final 2021-05-07 13:32:19 -07:00
LJ Sonic
07e69c5eb3 Add copyright date ranges for files created in 2020 2021-05-07 18:04:30 +02:00
LJ Sonic
d325c7e6d3 The year is 2021 2021-05-07 17:45:56 +02:00
James R
f9813844e7 Update CMakeLists.txt to use Sourcefiles
This establishes (near) parity of source code file lists
between the Makefile and CMakeLists.txt

To make that change I messed around CMakeLists.txt a bit.
It now uses target_sources and target_compile_definitions.
I also removed some MSVC stuff since we don't actually
care about MSVC--it made things easier.

CMake minimum version 3.0 -> 3.13 for target_sources.
2021-05-05 04:00:44 -07:00
James R
b31056c7d9 Rewrite Makefile to be modular as well as more automated
Some key points for programmers:
- Source code files are mostly listed in a 'Sourcefile'.
  So you no longer directly edit the object list. There
  can be multiple Sourcefiles and they can even live in
  subdirectories--the directory name will be prepended to
  every filename in the list. Of course, the Makefile
  still needs to be edited to read from each Sourcefile.
- Different rules are no longer required for source code
  files that live in subdirectories (such as sdl/ or
  hardware/). Subdirectories Just Work so go ham!

In addition to those points, another important change is
that the bin directory is no longer divided into platform
subdirectories (Linux64, Mingw, etc). Executables now go
directly into bin. If you use DEBUGMODE or target 64-bit,
then subdirectories for 'debug' and '64' will be made
though.

Oh by the way, I don't think make clean actually removed
files before on Windows. It should now. I also fixed as
many little inconsistencies like that as I noticed.

And now just an overview of the technical aspects that
shouldn't affect anyone who doesn't REALLY care about the
Makefile...

objs and dep directories have been moved to a make
directory. Makefile.cfg and its variants have been moved
out of their various subdirectories to src/Makefile.d
make distclean removes the bin and make directories
entirely, but make clean and cleandep still only affect
the current build target.

When I say automation, I mean that a lot of copy pasting
in the Makefile has been reduced.
2021-05-04 04:22:37 -07:00
James R
44d217807f Collect makefiles 2021-05-03 23:07:44 -07:00
Steel Titanium
7cd41a8eb7 Compile with -rdynamic on UNIXCOMMON platforms 2021-04-26 03:48:38 -04:00
SwitchKaze
eb2dc9e99b Mouse improvements 2021-04-02 15:46:08 -05:00
SwitchKaze
3faa98cf4a Expose inputs to Lua 2021-04-02 15:45:59 -05:00
Monster Iestyn
0d5284c36c Murder MSDOS, another of the remaining DOS port related macros
I also put in a missing `defined (__APPLE__)` in d_netcmd.h related to cv_mouse2opt

Also removed a redundant `!defined (__APPLE__)` in d_main.c
2021-03-30 19:27:10 +01:00
lachablock
36c2be283c Disallow write_backtrace on Windows entirely 2021-03-15 15:17:55 +11:00
LJ Sonic
0765004188 Merge branch 'print-backtrace' into 'next'
Print a backtrace when SRB2 crashes in a Unix-like environment.

See merge request STJr/SRB2!1288
2021-03-07 08:26:44 -05:00
Lachlan Wright
e03700fc2a Merge branch 'nogmever' into 'next'
Check if GME_VERSION is defined.

See merge request STJr/SRB2!1372
2021-03-01 17:50:48 -05:00
GoldenTails
a0396d5e43 Make it more async-signal-safe 2021-02-27 18:07:47 -06:00
GoldenTails
bdb28a06f4 Print the backtrace before showing the signal handler popup. 2021-02-27 18:07:47 -06:00
GoldenTails
5108f1f57b Use file descriptors and ditch file streams, for now. 2021-02-27 18:07:47 -06:00
GoldenTails
4016a2e062 Crash backtrace logging for NEWSIGNALHANDLER. 2021-02-27 18:07:47 -06:00
Jaime Ita Passos
2ca8efd7ee Revert accidental push 2021-02-25 20:17:27 -03:00
Jaime Ita Passos
5b1dc6ba33 [Meta] Change branding 2021-02-25 19:49:34 -03:00
Jaime Ita Passos
5501d495c7 OpenGL backend: Manage uploaded GPU textures with an internal list
Indirectly fixes the game doing whatever after freeing a patch.
This commit implements a FTextureInfo struct type, instead of it being a typedef to the GLMipmap_s struct type.
2021-01-27 17:48:57 -03:00
Steel Titanium
c8627464c9 Check if GME_VERSION is defined.
I made the assumption it would always be defined, which won't always be the case.
2021-01-06 19:40:30 -05:00
James R
353692fa79 Merge remote-tracking branch 'origin/next' into hooklib-refactor 2020-12-16 08:43:49 -08:00
James R
503364f5f8 Merge branch 'gme-spc-fix' into 'next'
Fix SPC looping on libgme versions >= 0.6.3

See merge request STJr/SRB2!1302
2020-12-15 20:40:10 -05:00
James R
93e4f43e4b Hooklib macros names -> uppercase + documentation 2020-12-12 03:16:30 -08:00
James R
9ddeb5f589 Resolve GameQuit hook conflicts 2020-12-12 02:05:21 -08:00
James R
9ea969b62d Merge branch 'gamequit-argument' into 'next'
Send a `quitting` argument to the GameQuit Lua hook.

See merge request STJr/SRB2!1276
2020-12-10 15:25:52 -05:00
James R
2ab71571aa Merge branch 'high-resolution-timer-2' into next 2020-12-10 02:55:02 -08:00
Steel Titanium
11bbad9be8 Tab fix 2020-12-06 22:58:17 -05:00
Steel Titanium
c3a560f51d Let's check for looping first 2020-12-06 22:30:50 -05:00
Steel Titanium
284205baac Fix SPC looping on libgme versions >= 0.6.3 2020-12-06 22:20:06 -05:00
GoldenTails
119d2e9e37 Remove the rest of the Playing() checks for GameQuit hook 2020-11-29 16:53:29 -06:00
GoldenTails
59d2646593 Send a quitting argument to the GameQuit Lua hook 2020-11-29 08:30:50 -06:00
Nev3r
bcf6823cbf Merge branch 'dehacked-hell' into 'next'
Split dehacked.c into multiple files.

See merge request STJr/SRB2!1222
2020-11-29 05:18:45 -05:00
GoldenTails
8fef61aa29 Split dehacked.c into multiple files. 2020-11-23 21:42:26 -06:00
Jaime Ita Passos
0645c642d2 Improve GPU texture management. 2020-11-22 18:18:26 -03:00
Jaime Ita Passos
abe35fd008 Some interface fixes 2020-11-22 17:22:18 -03:00
Jaime Ita Passos
9ab3acae2d Change how texture deletion works in OpenGL 2020-11-22 17:03:04 -03:00
Jaime Ita Passos
5e890ee6f8 Merge branch 'next' into spritestuff2 2020-11-19 00:52:43 -03:00
James R
85c5fa9527 Merge branch 'unfuck-icon-mac' into 'next'
Use SDL version of executable icon at runtime on macOS

See merge request STJr/SRB2!1250
2020-11-17 20:24:42 -05:00
lachwright
26b6b33220 Add parentheses 2020-11-15 15:52:55 +11:00
lachwright
8f570eaa97 Use SDL version of executable icon at runtime on macOS 2020-11-15 01:13:41 +11:00
James R
876aeb6a31 Merge branch 'allowshaders' into 'next'
Let the server or an admin toggle clients' custom shaders

See merge request STJr/SRB2!1181
2020-11-08 21:09:56 -05:00
James R
c0dbc562bb Fix floating point math 2020-11-07 13:48:37 -08:00
James R
515d7eeb9e Let's try an experiment: move the epoch forward as I_GetTime is called
This will make it even longer until time wraps around. Have you ever run a
srb2 server for 4 years straight?
2020-11-07 01:57:09 -08:00
James R
84ce53db60 Use high precision timer, replace I_GetTimeMicros with I_GetPreciseTime and I_PreciseToMicros 2020-11-07 01:31:24 -08:00
James R
425b56c288 Remove win32 specific timer 2020-11-06 14:14:12 -08:00
James R
998a10e8ad Merge remote-tracking branch 'origin/master' into next 2020-11-01 20:01:22 -08:00
Steel Titanium
62b5b86ed4 CMake: Fix fullscreen toggle not working
All because of a typo
2020-10-31 00:59:51 -04:00
Hannu Hanhi
86ad187f05 NPO2 slope span optimization 2020-10-26 00:26:15 +02:00
James R
e9fce20071 Merge remote-tracking branch 'origin/master' into next 2020-10-23 14:57:13 -07:00
GoldenTails
1e0beab254 Add i_threads.h too 2020-10-20 15:58:34 -05:00
GoldenTails
31c410656c Add multithreading option for CMake 2020-10-20 15:44:01 -05:00
James R
d279489753 Merge branch 'perfstats' into 'next'
Performance stats

See merge request STJr/SRB2!1186
2020-10-18 15:33:20 -04:00
James R
bd9fda8ceb Merge branch 'lua-polyobjects' into 'next'
Lua polyobjects

Closes #19

See merge request STJr/SRB2!1140
2020-10-15 19:08:54 -04:00
Jaime Passos
8294479a5f Merge branch 'next' into allowshaders 2020-10-15 01:25:11 -03:00
James R
d73fbd8616 Merge branch 'slight-shader-cleanup' into 'next'
Shader code cleanup

See merge request STJr/SRB2!1103
2020-10-12 18:22:08 -04:00
Jaime Passos
6e5f71dd45 Refactor patch rotation 2020-10-10 18:43:26 -03:00
Jaime Passos
b15bbd505c Merge branch 'next' into patch-stuff-again-2 2020-10-10 17:01:10 -03:00
Hannu Hanhi
4f20a20165 Performance stats 2020-10-10 22:12:34 +03:00
Jaime Passos
0811f60b2a Let the server or an admin toggle clients' custom shaders 2020-10-09 02:06:13 -03:00
James R
15008f31a7 Merge branch 'sanity-meter-empty' into 'next'
Replace cvar initializers with a macro

See merge request STJr/SRB2!1178
2020-10-08 22:02:25 -04:00
James R
45b9e23895 Merge branch 'ogl-driver-error' into 'next'
Add error message when the GDI Generic OpenGL renderer is encountered in Windows

See merge request STJr/SRB2!1172
2020-10-08 22:00:43 -04:00
Jaime Passos
63d4c1dffc Merge remote-tracking branch 'origin' into slight-shader-cleanup 2020-10-08 22:45:39 -03:00
James R
dbd79a29a4 Replace C90's junk with a modest macro 2020-10-06 23:04:23 -07:00