Commit graph

116 commits

Author SHA1 Message Date
Andrei "Akari" Alexeyev
09876291fc fixed macro redefinition warnings on osx 2017-02-25 23:55:53 +02:00
Andrei "Akari" Alexeyev
0091c7aca7 Refactored the gl loader into a polyglot macro monstrosity
We no longer link to libGL by default. All GL functions are loaded
dynamically through SDL apis. Use -DLINK_TO_LIBGL to enable linking, in
which case Taisei won't try to dynamically load any of the gl functions.

Previously we used a strange inconsistent setup where some functions
were loaded dynamically and others pulled from the linked library.

We also no longer link to libGLU even if LINK_TO_LIBGL is set. The only
function we used from that library was gluPerspective. taiseigl now
provides a simple substitute via glFrustum.

The SDL2 gl headers are now used instead of the system ones, this should
be more portable. The taiseigl.h header contains generated code
partially based on content from those headers. It also doubles as a
python3 script that actually generates that code and inserts it into
itself. It scans the Taisei source tree for gl* calls and generates code
only for the functions we use, and a few manually specified ones that
are called indirectly.

Assumptions such as "linux = glx" are no longer made. SDL takes care of
platform specifics, as it should.

The GL_EXT_draw_instanced/GL_ARB_draw_instanced extension detection has
been improved. Taisei should be able to figure out which one to use
without a compile-time check, and support for the ARB version has been
actually implemented for the laser snippet loader. I've tested it on
Windows 8 with Intel drivers that don't support the EXT version but do
support the ARB one, instanced drawing works and the lasers don't lag!
OSX should benefit from this change as well, although I've not yet
tested the OSX build, beyond simply compiling it.
2017-02-25 15:24:54 +02:00
Andrei "Akari" Alexeyev
397719a2a2 Switched from GNU C99 to Standard C11. Enabled pedantic warnings.
Fixed all warnings and compile errors.
Confirmed successful compilation without warnings for linux (gcc,
clang), windows (gcc-mingw), osx (clang-osxcross).
2017-02-23 13:16:52 +02:00
Andrei "Akari" Alexeyev
db0cfa43bc "straightforward" my ass 2017-02-22 22:52:25 +02:00
Andrei "Akari" Alexeyev
30db5c8fd6 Support for viewing replays specified on the command line
$ taisei replay /path/to/replay.tsr
$ curl http://example.com/replay.tsr | taisei replay /dev/stdin
2017-02-21 22:31:46 +02:00
Andrei "Akari" Alexeyev
347f143a54 Unlock spellcards on story mode encounter
But only when not using continues!
2017-02-19 03:28:00 +01:00
Andrei "Akari" Alexeyev
1e6011433c Initial support for single-spell stages
Adapted all of the current spellcards into spellstages, which will
later be used in a spell practice mode a-la IN.
For now they are only accessible through the stage select menu or
by specifying their ID on the command line; both available only
if you built with -DTAISEI_DEBUG=1
2017-02-19 03:28:00 +01:00
Andrei "Akari" Alexeyev
eff4e311f7 Fallback to ARB_draw_instanced if EXT_draw_instanced is not available
Also fixed some osx and mingw cross-compile warnings
2017-02-18 11:24:45 +02:00
Andrei "Akari" Alexeyev
f92da23638 config: preserve unknown options in the config file 2017-02-18 06:18:13 +02:00
Andrei "Akari" Alexeyev
32f7edd24e Refactored config into a macro hell 2017-02-17 18:03:49 +02:00
Andrei "Akari" Alexeyev
8668021710 Replaced strncat/strncpy with strlcat/strlcpy
The strncat/strncpy functions have dangerously counter-intuitive
semantics. They are meant to be used with fixed-width,
non-null-terminated strings, which is in, 99% cases, not what you want.

The strlcat/strlcpy ones are non-standard, however SDL provides its own
implementations on platforms that do not have them.
2017-02-16 08:29:18 +02:00
Andrei "Akari" Alexeyev
7e531092db moved getenvint into the ifndef guard 2017-02-16 08:00:28 +02:00
Andrei "Akari" Alexeyev
0be20dab0d Improved replay consistency 2017-02-15 19:34:47 +02:00
Andrei "Akari" Alexeyev
9a7a874783 Use the standard bool type instead of that stupid enum
Also removed all of the annoying trailing tabs/whitespaces
2017-02-11 05:56:47 +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
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
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
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
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
167e9e12f1 Initial migration to SDL2 (WIP) 2017-02-04 04:56:40 +02:00
makise-homura
815ae7b23b Added background music subsystem. 2017-01-24 16:40:57 +03:00
Andrew "Akari" Alexeyew
536b5b7f09 "Fixed" a stupid input workaround. It doesn't depend on keyboard anymore. 2012-08-17 21:58:23 +03:00
Andrew "Akari" Alexeyew
98225b78fd Merge branch 'master' into gamepad 2012-08-16 16:54:40 +03:00
Andrew "Akari" Alexeyew
1b4be54b20 restart option for ingame menus 2012-08-16 16:50:28 +03:00
Andrew "Akari" Alexeyew
4754e6c76e Optional free axis mode 2012-08-15 17:36:39 +03:00
Andrew "Akari" Alexeyew
4a8ef08639 Merge branch 'newmenu' into events
Conflicts:
	src/credits.c
2012-08-14 19:05:28 +03:00
laochailan
106034ecbb Merge branch 'master' into newmenu 2012-08-14 17:59:26 +02:00
Andrew "Akari" Alexeyew
1d687bc30a increased afterbomb recovery time a bit 2012-08-14 18:44:02 +03:00
Andrew "Akari" Alexeyew
cf72d8dee3 event abstraction layer 2012-08-13 18:50:28 +03:00
laochailan
c4e0298922 blocked ingame menu, instantselect flag 2012-08-12 20:16:40 +02:00
laochailan
d3bea2f52b revisited menus 2012-08-12 16:54:48 +02:00
Andrew "Akari" Alexeyew
779ff58684 Fixed all the () prototypes, changed to (void) 2012-08-10 23:08:51 +03:00
Andrew "Akari" Alexeyew
4eebea67e0 gameover improvements 2012-08-08 20:09:04 +03:00
laochailan
74c87da58b added debug checksum logging 2012-08-07 21:27:32 +02:00
Andrew "Akari" Alexeyew
7776443935 multistage replays 2012-08-07 06:28:41 +03:00
Andrew "Akari" Alexeyew
31690ef3dc fade from/to white; yukkuri image; added missing glColor calls 2012-08-06 07:17:51 +03:00
Andrew "Akari" Alexeyew
e2b8163447 Basic credits 2012-08-05 04:36:55 +03:00
Andrew "Akari" Alexeyew
a94479cecf replayover menu 2012-08-04 07:37:59 +03:00
laochailan
72d789ab5a Merge branch 'master' into stage6 2012-08-03 17:07:07 +02:00
laochailan
62621ae345 removed some ancient comments 2012-08-03 17:06:25 +02:00
laochailan
fe7cd62545 min/max #undef for mingw compatibility 2012-08-03 16:57:29 +02:00
laochailan
a8251b1966 Merge branch 'master' into stage6
Conflicts:
	shader/laser_snippets
	src/CMakeLists.txt
	src/global.h
	src/projectile.c
	src/stage.c
	src/stage.h
	src/stages/stage3.c
	src/stages/stage3_events.c
	src/stages/stage4_events.c
2012-08-03 16:55:10 +02:00
laochailan
9ee9a294e7 eigenstate test 2012-08-01 17:32:11 +02:00
laochailan
426ca79d50 Merge branch 'master' into stage6 2012-07-31 14:35:36 +02:00
laochailan
f9fc667823 elly first spell unbalanced 2012-07-31 14:34:20 +02:00
Andrew "Akari" Alexeyew
fe4baa3b14 Merge remote-tracking branch 'upstream/master' into stage3 2012-07-30 19:23:43 +03:00
Andrew "Akari" Alexeyew
ddb6879892 Merge remote-tracking branch 'upstream/master' into stage3
Conflicts:
	src/global.h
2012-07-30 17:38:40 +03:00