Commit graph

48 commits

Author SHA1 Message Date
50b8efe9c6 implement spawn_doom() for windows 2024-12-18 19:00:58 +01:00
3f29bbc973 fixes for nng-1.8.0 2024-12-18 18:43:06 +01:00
a900be463b make it build under msys2. no doom spawning yet 2024-12-17 01:48:12 +01:00
7774e7149b Merge #eh20 stuff 2023-04-22 09:47:49 +02:00
a20a59a33a remove buggy DoomBytesPerPixel == 3 code 2023-04-22 09:47:45 +02:00
e159f62260 ctrl: also listen on tcp 2023-04-11 01:22:00 +02:00
eace519ea1 broken SDL input handling (WIP) 2023-03-11 12:44:36 +01:00
af1ef76c70 build fixes for FreeBSD-13.1 2023-03-11 12:44:27 +01:00
062980d465 implement input publishing and receiving
Input publishing is currently toggled via Ctrl-A. This needs to be changed
because pressing Ctrl makes doomguy attack. So every time input publishing
is disabled the guy continues attacking. Use one of the unused F keys if
there is one.
2023-02-23 22:00:24 +01:00
6d03cf86f9 ctrl: fix bogus elapsed time calculation. doh! 2023-02-23 21:55:19 +01:00
663be5c54b prep for input publishing to dooms 2023-02-23 07:12:18 +01:00
9ef9e71a46 ctrl: add menu entries to show dear imgui userguide and about window 2023-02-22 22:35:51 +01:00
407dded717 cleanup and revive the debug drawing code 2023-02-22 21:23:31 +01:00
abb563440d add comment about DoomFrames from unregistered dooms 2023-02-22 21:15:22 +01:00
ff89a984fb set ui log level from trace to debug 2023-02-22 21:15:03 +01:00
348bcc9997 use the included SDL if not appropriate system-wide SDL was found 2023-02-22 20:29:41 +01:00
98c44f66df preparations for also using nng_tcp as a transport 2023-02-22 19:17:06 +01:00
8b5231a782 ctrl: reenable the waitpid() code to catch crashing/killed dooms
TODO: implement DoomState::tLastActive timeout logic
2023-02-21 23:05:53 +01:00
eea3377406 finally fix dooms not being able to output sound
It was just the empty environment after posix_spawn() that caused
SDL_INIT_AUDIO to fail. __environ fixes that.
2023-02-21 23:03:39 +01:00
fb3441f5d3 toggle fullscreen, toggle ui, invert mouse panning 2023-02-20 22:50:17 +01:00
4a0117af36 fix crash due to logging during shutdown from class based DoomState
Crash was double free in ImGui::AppendLog() during shutdown. Will have to
disable the logging callback if logging should happen at that point.
2023-02-20 00:06:28 +01:00
e7c98a490e disable texture info debug 2023-02-20 00:01:29 +01:00
284e5d1b0e ctrl: fix rendering, erase Endooms, implement zooming and panning 2023-02-19 23:52:54 +01:00
3c5b3ae4e9 it's alive! not pretty but alive! also remove the fork() spawner 2023-02-19 16:33:23 +01:00
df9cf1c14a intermittent ctrl commit: fork() based spawn code which makes nng panic 2023-02-19 16:23:29 +01:00
e53023079e ctrl: register externally started dooms that introduce themselves
TODO: Check on those via kill(pid, 0) or store the last activity time in
DoomState and let dooms time out if they don't send more updates.
2023-02-19 12:46:17 +01:00
366bf9b75c ctrl: better networking, can render received frames, still a broken mess 2023-02-19 10:44:57 +01:00
dfbfb4b08c and back to spawning doomsims 2023-02-19 01:46:31 +01:00
773ea7341c intermittent commit: do not spawn doomsim instances to test rendering
Without spawning doomsims the SDL_UpdateTexture()+SDL_RenderCopy() way does
scale well: with 1024 non-spawned dooms I'm at 19.4 fps, 51.5 ms/frame.
A single core is maxed out all the time and it's nicely jumping between
cores.
2023-02-19 01:45:51 +01:00
feb0bc995c work on rendering - can draw rectangles into buffers and display those
Approach is to have one SDL_Texture per doom and use SDL_RenderCopy() with
different destination rectangles to compose the layout. Apart from
SDL_UpdateTexture() and SDL_RenderCopy() no work is done per doom.

This scales up to ~200 doomsim instances. After that the frametime
increases rapidly and all my cores are maxed out.

TODO: test without spawning doomsim processes!
2023-02-19 01:24:52 +01:00
9dab0ccf70 rename QuitDoom -> Endoom :) 2023-02-18 23:04:34 +01:00
e590bed17a slight render call rearrangement 2023-02-18 22:41:05 +01:00
86dcd6f92d get rid of the doomId concept, use the pid instead
The internal unique id should not be needed, the pid is unique enough :)

Also this can allow starting dooms externally without having to pass an id
parameter that's not already in use. The externally started doom sends its
pid with the DoomReady message and the controller can add a new entry if it
needs to. Of course the controller will not be able to kill() these
externally started dooms.
2023-02-18 22:28:15 +01:00
42a2d01f2a build tiny messaging infrastructure, refactor, hack till it sort of works
When usleep()'ing in doomsim it misses most of the quit messages. I think
it's because the controller spams RunDoom all the time and the quit
messages get discarded while doomsim is sleeping.
2023-02-18 22:08:12 +01:00
e26e406f29 caturday work: leak fixes, can now tell dooms to quit, nng util functions 2023-02-18 12:30:53 +01:00
823932af16 posix_spawn() doomsims
The doomsim startup routine or the controller startup publish are broken.
The doomsims never transition from DP_DS_Ready state.
2023-02-18 12:30:53 +01:00
17f4b34ea3 add comment to ExampleAppLog and mini refactoring 2023-02-18 12:30:53 +01:00
a75ffa940d fix build under msys2 2023-02-18 12:30:40 +01:00
61a3d20dad add first ui input elements and in-game logging 2023-02-12 22:21:06 +01:00
3dbf4f2255 custom imgui window title! 2023-02-12 16:12:01 +01:00
e4cf3deecc First steps with Dear ImGui. It's awesome! 2023-02-12 15:48:15 +01:00
07033c9d13 mini refactoring and cleanup 2023-02-12 13:40:41 +01:00
31aa3f049e build and use imgui from externals, make the imgui demo work 2023-02-12 04:47:48 +01:00
d6829aa9cd ctrl: write some broken sdl and imgui code 2023-02-12 03:32:02 +01:00
cd99af391f doomsim updates: state machine, nng_recvmsg/nng_sendmsg, first actual logic 2023-02-11 23:52:20 +01:00
a7b31a6f49 refactoring all the things
- Move from spdlog to log.c by rxi
- Create dp_common c library
- Create empty doomsim executable
2023-02-08 06:39:23 +01:00
5ca8329db1 buggy pub sub code 2023-02-04 01:56:30 +01:00
6c33ce8deb create cmake project structure and c++ test app 2023-02-03 23:33:37 +01:00