Commit graph

845 commits

Author SHA1 Message Date
Andrei "Akari" Alexeyev
985b6d1dd6 Block iddqd inputs correctly in release builds 2017-02-11 03:56:34 +02:00
Andrei "Akari" Alexeyev
ebb0acdd43 Fixed having 0 lifes being a gameover condition
Only dying with 0 lifes left should cause a gameover.
That behaviour has unintentionally changed with this commit: 14ef066d14
Beware of prefix/postfix operators, @makise-homura!
2017-02-11 03:47:36 +02:00
Andrei "Akari" Alexeyev
c03011ca69 God mode improvements
Removed the compile-time option. Instead, added a new keybinding that toggles god mode (default: q), only usable if built with DEBUG. This makes toggling god mode much more convenient and makes replays consistent between release and debug builds
2017-02-11 03:24:47 +02:00
Andrei "Akari" Alexeyev
e8f52f1b49 Scoring changes
* Score is now preserved between stages in story mode as it was intended
    * Score given for shooting enemies is now based on the projectile damage
    * Some score is also given for shooting the boss, also based on the projectile damage
    * Score given for grazing has been increased substantially
    * Grazing range has been increased
    * The graze counter is now reset between stages
2017-02-11 00:05:22 +02:00
Andrei "Akari" Alexeyev
808258ad68 Fixed a replay segfault after using a continue 2017-02-10 23:07:57 +02:00
Andrei Alexeyev
c8f3b58ee5 Merge pull request #50 from laochailan/replaysagain
Replays II: The Movie: The Game
2017-02-10 13:35:34 +02:00
Andrei "Akari" Alexeyev
ed1ac94de2 Don't restart video after exiting video options if user didn't change the resolution 2017-02-10 03:18:09 +02:00
Andrei "Akari" Alexeyev
eb9bb2b1d0 Made vsync a config option instead of env variable 2017-02-10 03:11:45 +02:00
Andrei "Akari" Alexeyev
29b21981ae Prefer vsync=off in frameskip mode, otherwise vsync=on
Late swap tearing is prefered, normal vsync is used if that is not supported. See https://wiki.libsdl.org/SDL_GL_SetSwapInterval
Use TAISEI_NO_VSYNC to disable vsync
2017-02-10 02:07:19 +02:00
Andrei "Akari" Alexeyev
0bbf1a619e Further refinements to replay API and structures
Compatibility preserved.

The replay API functions are now completely independent of the global state.
2017-02-10 01:24:19 +02:00
Andrei "Akari" Alexeyev
4246ed2cfa Fixed/finished the prev. commit and refactored the replay menu to use it 2017-02-09 08:01:38 +02:00
Andrei "Akari" Alexeyev
31ac12f6e7 Improved replay structure and API
All events are now stored at the end of the file, after the metadata of all stages.
It's now possible to load a replay partially to examine the metadata, and optionally load the input events later if needed.
This is not used yet. The replay menu code will be updated to make use of this feature soon.
2017-02-09 06:06:46 +02:00
Andrei "Akari" Alexeyev
b0da5a407c Added a simple checksum for stage metadata to fail quickly if garbage is detected 2017-02-09 02:55:01 +02:00
Andrei "Akari" Alexeyev
f2386657f5 Updated replay structure, added checks to load routine to make sure that corrupted or garbage data in the replay won't crash the game 2017-02-09 02:13:06 +02:00
Andrei "Akari" Alexeyev
d0377bd537 Eliminated floating point values from replays for portability
Player power is now internally an integer. There is no good reason to use floating point math there. Stored as an uint16 in replays.
Player coordinates are now floored when a stage starts. This is unnoticable to the player. Stored as a pair of uint16s in replays.
2017-02-08 21:59:43 +02:00
Andrei "Akari" Alexeyev
488c1d1665 Check for posix instead of windows where it makes sense 2017-02-08 04:36:09 +02:00
Andrei "Akari" Alexeyev
8ee40e2059 Re-introduced TAISEI_WIN32_CONSOLE, "properly" this time 2017-02-08 02:52:17 +02:00
Andrei "Akari" Alexeyev
6aaecd3333 Forgot to remove an endif() 2017-02-08 02:06:26 +02:00
Andrei "Akari" Alexeyev
4170e62010 Removed TAISEI_WIN32_CONSOLE. Details below.
Looks like some sdl2main magic is overriding this, so we don't get a console window anyway.
Still, I made the effect of that option the default: the WIN32 flag is no longer passed to add_executable()
This means -mwindows won't be passed to the compiler when linking. That option is effectively useless in our case, and some compilers/linkers do not support it.
For example wclang, a clang wrapper that can be used as a drop-in replacement for mingw64's gcc, will try to fallback to gcc for linking when it encounters that option.
2017-02-08 01:54:58 +02:00
Andrei "Akari" Alexeyev
c0f32fa33d Added a TAISEI_WIN32_CONSOLE cmake variable to build a win32 console application 2017-02-08 01:38:51 +02:00
Andrei "Akari" Alexeyev
3027921705 Use SDL_platform.h for more reliable and portable platform detection 2017-02-08 01:32:14 +02:00
Andrei "Akari" Alexeyev
8566c65f4b Fixed clang warnings 2017-02-07 20:34:55 +02:00
Andrei "Akari" Alexeyev
22f51b9652 Merge branch 'master' into replaysagain 2017-02-07 06:26:51 +02:00
Andrei "Akari" Alexeyev
dcfec0ffad Use scancodes instead of keycodes for keyboard input
See https://wiki.libsdl.org/CategoryKeyboard for the implications of this
2017-02-07 06:26:04 +02:00
Andrei "Akari" Alexeyev
3cae3e77a5 Fixed volume defaults 2017-02-07 06:05:32 +02:00
Andrei "Akari" Alexeyev
6c1bb1a079 Options menu: don't allow mapping multiple controls to the same key
When this is attempted, the keys are swapped
2017-02-07 05:59:11 +02:00
Andrei "Akari" Alexeyev
6cd72ab170 Fixed Elly's Scythe not spinning the first time it appears
May desync existing replays, but doesn't appear to so far
2017-02-07 04:39:14 +02:00
Andrei "Akari" Alexeyev
659979d893 Workaround to make logs accessible on windows 2017-02-07 00:54:15 +02:00
Andrei "Akari" Alexeyev
a87169bcd6 Replaced uint with unsigned int for portability
uint is non-standard and my win64 crosscompiler doesn't recognize it
2017-02-07 00:37:42 +02:00
laochailan
26143e6f36 Added random generator testing script 2017-02-06 07:59:39 +01:00
Andrei "Akari" Alexeyev
0af7aad20a typo 2017-02-06 02:10:45 +02:00
Andrei "Akari" Alexeyev
187919cb7c Turn power items into point items when their logic is processed, not when they are drawn.
See previous commit as for why. Note that this slightly changes the processing order, unlike the previous change, so any replays recorded prior to this commit will desync. The new behaviour, however, should be slightly more correct.
2017-02-06 01:18:34 +02:00
Andrei "Akari" Alexeyev
125f2441e7 Fixed a replay desync related to the stage 6 boss
There was a piece of code in the Scythe drawing function that altered the game state. I hope I don't have to explain why that is a vector for bugs in general, but in particular, this always breaks replays in frameskip mode.

I've also moved the BGM handling from stage_draw to stage_logic for similar reasons.
2017-02-06 00:02:29 +02:00
Andrei "Akari" Alexeyev
b38e41e681 Added extra checks to prevent and help debug incorrect usage of some tsrand functions 2017-02-05 22:16:50 +02:00
Andrei "Akari" Alexeyev
0db6a4ca40 Made the skip dialog key function as a fast forward when viewing replays 2017-02-05 20:28:53 +02:00
Andrei "Akari" Alexeyev
3d639aae52 Added a frameskip mode, mainly to debug replays 2017-02-05 20:25:18 +02:00
Andrei "Akari" Alexeyev
cb2cf24233 basic replay desync detection 2017-02-05 04:58:27 +02:00
Andrei "Akari" Alexeyev
3662daaff0 Fixed playback of gamepad events from replays (with hacks) 2017-02-05 04:04:31 +02:00
Andrei "Akari" Alexeyev
ff3986c6cb New binary replay format 2017-02-05 03:25:17 +02:00
Andrei Alexeyev
db37e875d4 Merge pull request #46 from laochailan/sdl2
SDL2 migration (WIP)
2017-02-04 23:50:37 +02:00
Andrei Alexeyev
d994d940ed Fixed readme
No need to escape anything in the code blocks
2017-02-04 21:34:34 +02:00
laochailan
7f2cd4df50 Moved big raw files to a seperate repo
See https://github.com/laochailan/taisei-rawmedia

The files necessary to execute taisei still remain in this repo. This
leads to a significant decrease in repo size.
2017-02-04 18:40:30 +01:00
Andrei "Akari" Alexeyev
5150cb91e3 Don't convert repeated keys to game events 2017-02-04 19:28:59 +02:00
Andrei "Akari" Alexeyev
2a296871e3 Support window resizing and pause on focus loss 2017-02-04 19:17:08 +02:00
Andrei "Akari" Alexeyev
cfd772d75c Clear the color buffer before resizing the viewport 2017-02-04 19:04:04 +02:00
Andrei "Akari" Alexeyev
e9911e6bee Merge branch 'master' into sdl2 2017-02-04 16:04:08 +02:00
Andrei "Akari" Alexeyev
bc52da4bfb Updated the README to clarify that we depend on SDL2, not 1.2 2017-02-04 16:01:30 +02:00
laochailan
250ecce906 correct README syntax 2017-02-04 14:56:58 +01:00
laochailan
88d5a234bb converted README to markdown
so it looks nicer on github.
2017-02-04 14:53:34 +01:00
Andrei "Akari" Alexeyev
71f57bab93 Improved handling of gamepad axis input and sensitivity 2017-02-04 15:41:15 +02:00