summaryrefslogtreecommitdiff
path: root/src/sars.c
AgeCommit message (Collapse)Author
2022-12-13sars: add --delay [seconds] flagVito Caputo
Defaults to 10 seconds when bare --delay is used This is primarily intended for video capture purposes
2022-12-05sars,game: add --cheat flag intended for dev/testingVito Caputo
currently this just overrides teepee quantities to always be 128 128 is used instead of 256 so you can still exercise the teepee boost _without_ winning event, and it doesn't take long to collect two teepee boosts so iteration still isn't bad.
2022-12-03sars: seed rand() with something randomishVito Caputo
it's noticable that every fresh game starts the same
2022-11-30sars: only request a real GLES2 context on emscriptenVito Caputo
On MacOS the window create can't even succeed when requesting the GLES2 context. Seeing as this GLES2 transition was done just to get emscripten support, let's limit requesting an actual GLES2 context to the emscripten builds, and still request the same old GL2.1 context as pre-emscripten for everything else. It's unclear to me if this will actually work on win/macos, since the code is still all targeting the GLES2 API - even the glad abstraction is the GLES2 variant. But the thing is, GLES2 API is largely just a subset of GL2.1, in some ways it's a cleanup of GL2.1 like removing a bunch of the fixed function stuff I never used anyways. The main annoyance with GLES2 is the shader language version is older than GL2.1 supports. But if I can live with constraining my API/shader usage to GLES2 land, it might just work on GL2.1 contexts without modifications.
2022-11-29sars: default emscripten builds to fullscreenVito Caputo
Since emscripten builds are often run under a browser window, putting ourselves into fullscreen mode is most likely to get a filled-out canvas within the window we find ourselves in. It's really up to the emscripten runtime environment to deal with windowing vs. fullscreen handling in an appropriate manner. We can't really be bothered with that from the nested environment we find ourselves in there.
2022-11-29*: pivot everything to OpenGL ES 2.0Vito Caputo
In the interests of keeping things bisectable this is one big commit of everything necessary to go from OpenGL 2.1 to OpenGL ES 2.0 in one fell swoop. There's a handful of annoying mechanical changes necessary in shaders like removing the 'f' suffix on float constants e.g. 1.f becomes 1.0 etc. This is primarily happening to enable emscripten builds
2022-11-29libplay: bump libplay version for play_run_slice()Vito Caputo
Emscripten integration will want this function. A few mechanical changes required to catch up with upstream libplay API changes as well.
2022-11-27sars: chdir() to executable's base pathVito Caputo
On MacOS in particular it seems when executing sars via gui from the downloaded .zip the cwd isn't being set to the containing directory beforehand. This prevents the assets from being found at the correct location. With this commit SDL_GetBasePath() is used to try find the executable's containing directory. When successful, a chdir() is performed to this path in an effort to ensure the assets/ dir is where expected in relative terms. These are all done in a non-fatal best-effort fashion, simply warning when failed. An unfortunate side effect of this is when you're explicitly running sars from somewhere else with a different relative assets/ directory for development/testing purposes, it no longer uses the inherited cwd. Instead it will always move itself to wherever the executable resides. Maybe I'll add a flag for controlling this behavior. It's also unclear to me how safe assuming chdir() works will be vs. platforms supported by SDL2. Sure, chdir() is POSIX, but um, SDL2 speaks to supporting platforms like PSP and Android. I doubt chdir() is available everywhere, and I wonder why there's no SDL_chdir() in SDL_filesystem.h to hide this potential detail alongside the SDL_GetBasePath() abstraction.
2022-10-10sars: add ndc->bpc conversion helpersVito Caputo
bpc = boxed projection coordinates, this basically comes from eon just like the pillar/letter boxing code for fullscreen stuff did. Previously I didn't need this part of that code, but the touch coordinates are in ndc and those need to get transformed by the projection transform's inverse.
2021-12-26sars: collapse FULL+FILL cases in sars_winmode_set()Vito Caputo
Having these distinct is vestigial, they're no longer different so merge them. No functional difference.
2021-12-25*: introduce a projection matrix and winmodesrev3Vito Caputo
The bulk of this is mechanical wiring up of a projection_x to all the nodes. But this also introduces maintenance of the projection_x, with aspect-ratio preservation in two of the modes: WINDOWED and FULLSCREEN, with the previously default stretched-to-fill fullscreen mode now relegated to a third FILLSCREEN winmode. The default at startup is now an aspect ratio-preserving windowed mode. Simply press the 'f' key at any time to cycle through them. This was mostly done in sars to provide a source-available test for reproducing a fullscreen SDL2 bug I filed @ https://github.com/libsdl-org/SDL/issues/5139 Otherwise it's pretty silly to bother with doing anything on sars... but it is a handy little mule for such things.
2020-04-22sars: disable MSAAVito Caputo
This is vestigial from Eon and doesn't benefit sars, and seems to be introducing corruption on the transparent fringes of the sprites.
2020-04-22sars: s/Eon/sars/Vito Caputo
Never updated the window title after ripping this from the Eon initialization boilerplate
2020-04-19src: add a basic OpenGL2.1 foundationVito Caputo
Just a bunch of shit that doesn't really do much more than produce an executable yet.
© All Rights Reserved