Commit graph

83 commits

Author SHA1 Message Date
Juan Lopez
83a0992081 reseting the ship exhaust plumes when going back to main menu. 2023-09-08 23:15:20 +02:00
Dominic Szablewski
a6784cc19f
Merge pull request #72 from gh-fork-dump/cmake-fixups
CMake build fixes/improvements
2023-09-07 20:02:25 +02:00
Stephen Gregoratto
aeafcc92c2 Update Readme with new build options. 2023-09-07 18:38:23 +10:00
Stephen Gregoratto
e6238b97fc CMake build fixes/improvements
- Add options for PATH_(ASSETS/USERDATA).
- Introduce the concept of a "dev" build, which sets the assets/userdata
  path to the source directory.
- Error early for in-tree builds to avoid clobbering the Makefile.
- Enhance GLVND detection to allow use on FreeBSD.
- Only link Sokol-specific libraries on Linux if building for Unix.
- Fix GLES2 support not being picked up.
2023-09-07 18:22:01 +10:00
Dominic Szablewski
0594285013 Whitespace: change line endings to LF everywhere 2023-09-04 17:34:29 +02:00
Dominic Szablewski
a829166082 typo; remove cd command from wasm build instruction 2023-09-04 17:09:16 +02:00
Dominic Szablewski
650572bdd2 Use float abs to calculate bounding radius 2023-09-04 16:53:01 +02:00
Dominic Szablewski
de13e2af82 Fix sokol build on linux 2023-09-04 16:48:53 +02:00
Dominic Szablewski
b23efa3a52 Fix case of defines 2023-09-04 16:36:58 +02:00
Dominic Szablewski
64b67fc3a2 Move build instructions back to readme 2023-09-04 16:35:45 +02:00
Dominic Szablewski
64a492f992 Add src/libs/ as additional include dir as it is now specified as system headers 2023-09-04 16:30:42 +02:00
Dominic Szablewski
3b97df8f0a Mention Makefile build; formatting 2023-09-04 16:27:42 +02:00
Dominic Szablewski
8670d6bb54 Merge branch 'cmake' 2023-09-04 15:50:11 +02:00
Dominic Szablewski
701e2d55e6 Fix 8 byte alignment in temp allocator; close #68 2023-09-04 13:58:43 +02:00
Stephen Gregoratto
b7c4c9bff3 Add a CMake build guide 2023-09-04 01:12:09 +10:00
Stephen Gregoratto
65d9494cfb Add CMakeSettings.json for easier Visual Studio building 2023-09-04 01:12:08 +10:00
Stephen Gregoratto
a9b9e35266 Add vcpkg.json 2023-09-04 01:12:08 +10:00
Stephen Gregoratto
9f046ea0a4 Fixes for -Wstrict-prototype 2023-09-04 01:12:08 +10:00
Stephen Gregoratto
2b3fcaaf0b Include 3rd-party libs as system headers
Now, the compiler will only report errors in our code and not in any of
these headers.
2023-09-04 01:12:05 +10:00
Stephen Gregoratto
53d260d632 fixup 2023-09-04 01:11:21 +10:00
Stephen Gregoratto
98ad9b0679 Build with CMake.
Tested building with SDL2 + Sokol on:

- Windows with clang-cl 16
	- GLEW/SDL2 built using vcpkg.
- Arch Linux with the `sdl2`/`glew` packages.
- macOS 13.5 with SDL2 via homebrew.
- Emscripten using the Arch Linux `emscripten` package.
- Mingw toolchain with the GLEW/SDL2 packages installed:
	- On Arch Linux with the mingw packages.
	- On Windows using MSYS2 with the ucrt packages.
2023-09-02 23:15:07 +10:00
Stephen Gregoratto
90b9cffc60 Update sokol headers to fix a build issue on Windows
For some reason, the private method `_sapp_win32_init_console` used
`freopens` instead of `freopen_s`. Instead of fixing that, just upgrade
all the Sokol headers instead.

Also, the GLES2 renderer is no longer available for Emscripten, so bump
it up to GLES3.
2023-09-02 22:40:41 +10:00
Stephen Gregoratto
9207839c80 Fix building on Windows
- Drop linking opengl32/glew32.libs using `#pragma`s in favour of
  specifing the libraries at build time.
- Use check for the `WIN32` macro when including Windows specific
  headers in `src/render_gl.c`.
- Undefine the `min`, `max`, `near`, and `far` macros when building on
  Windows.
2023-09-02 22:40:41 +10:00
Dominic Szablewski
ecf1e63508 Do some culling based on camera direction 2023-09-01 19:04:27 +02:00
Dominic Szablewski
9e90c4768f
Merge pull request #63 from BeWorld2018/fix
Fix memory leak on exit
2023-09-01 14:11:44 +02:00
BeWorld
aa06570a05 Move SDL_DestroyWindow in main() 2023-09-01 14:10:24 +02:00
BeWorld
07d8a37afd Destroy Window and Renderer 2023-09-01 10:26:56 +02:00
BeWorld
c8bf7c82f7 Add SDL_GameContrllerClose
Fix memory leak
2023-08-31 12:57:31 +02:00
Dominic Szablewski
cf68eab8b2
Merge pull request #60 from tjrileywisc/change-app-name
Rename sokol app window for consistency
2023-08-31 12:12:26 +02:00
Timothy Riley
61ffe2f410 Rename sokol app window for consistency 2023-08-31 00:07:49 -04:00
Dominic Szablewski
98bd55a342 WASM: add touch controls 2023-08-30 17:40:50 +02:00
Dominic Szablewski
a84982b31e Shutdown sokol audio on exit 2023-08-30 17:24:26 +02:00
Dominic Szablewski
a3b156ef30 Properly free sdl paths on exit 2023-08-30 17:23:59 +02:00
Dominic Szablewski
2c5c3d3f13 Use US spelling of "color" everywhere 2023-08-30 12:38:34 +02:00
Dominic Szablewski
69122122f0 Remove unused color union fields 2023-08-30 12:34:52 +02:00
Dominic Szablewski
530fb40fb7 Remove obsolete TRACK_*_MAX defines and struct fields 2023-08-30 12:25:17 +02:00
Dominic Szablewski
2430297998 Make track vertex color loading endian agnostic; see #56 2023-08-30 12:21:10 +02:00
Dominic Szablewski
4b1fa81f30 Make image loading a bit faster by doing the color conversion for each palette entry just once 2023-08-28 18:09:34 +02:00
Dominic Szablewski
97a1073946 Fix TIM palette loading; see #56 2023-08-28 18:02:03 +02:00
Dominic Szablewski
4c76aadf80 Fix audio on big endian machines; see #56 2023-08-28 17:22:48 +02:00
Dominic Szablewski
78f452decf Add USER_CFLAGS to allow specifying additional defines; see #53 2023-08-28 16:48:47 +02:00
Dominic Szablewski
108cfac9dc Use Use appropriate platform-specific paths for assets and userdata; close #10, #53, #47
This commit also allows overriding these path at build time through
-DPATH_ASSETS=.. and -DPATH_USERDATA=..
2023-08-28 16:39:51 +02:00
Dominic Szablewski
18ebcc7457 Make loading palette colors in TIM images endian agnostic; see #56 2023-08-28 14:29:39 +02:00
Dominic Szablewski
209c1fd627 Add ALT+Enter hotkey to toggle fullscreen; close #45 2023-08-27 12:52:58 +02:00
Dominic Szablewski
da4d3b5c0c Prevent int overflow when projecting target reticle on screen; close #48 2023-08-26 17:49:42 +02:00
Dominic Szablewski
41399234f6
Merge pull request #37 from jantlo/avoid_draw_sections_more_than_once
Avoid rendering more than once those track sections in tracks with alternative paths.
2023-08-23 23:31:43 +02:00
Juan Lopez
6170976e6a Avoid rendering more than once those track sections in tracks with alternative paths. 2023-08-23 23:08:23 +02:00
Dominic Szablewski
e9f91c57f0 Remove obsolete -rdynamic flag 2023-08-23 18:26:23 +02:00
Juan Lopez
6fcd669733 Added support build on Windows under the MSYS2 enviroment. 2023-08-21 22:14:59 +02:00
Dominic Szablewski
9f0e6454bf Remove implemented things from todo list; fix wording for required files (#34) 2023-08-21 20:40:34 +02:00