Commit graph

3152 commits

Author SHA1 Message Date
Andrei Alexeyev
7e61f5dbb9
resources: Convert most textures into Basis Universal format
Some textures that have been replaced in the pbr_bg branch are untouched
for now.
2020-11-01 01:40:57 +02:00
Andrei Alexeyev
627afee6b9
Update koishi 2020-10-19 13:58:34 +03:00
Andrei Alexeyev
6415217a25
Improve coroutine scheduler shutdown sequence
Before canceling tasks, find all events with subscribers and cancel
them. This wakes the subscribers, allowing them to run additional
cleanup code if necessary.

Coroutines are also taken down earlier in the stage shutdown sequence,
before removing any entities. This avoids the problem of entity removal
code waking up coroutines by cancelling events, which in turn may spawn
more entities. This issue sometimes caused the elusive "%i entities were
not properly unregistered" bug.
2020-10-10 09:41:44 +03:00
Andrei Alexeyev
e95964754d
update dpstest stages 2020-10-10 05:55:42 +03:00
Andrei Alexeyev
f5da2cc976
Stage 1 balance pass (#254)
* stage1: attempt to make Easy easier; misc tweaks

* stage1: buff health of boss nons

* stage1: use new enemy spawners

* stage1: Normal balance; some Easy tweaks

* stage1: tweak Hard version of Perfect Freeze

* stage1: simplify a common_charge
2020-10-10 05:00:50 +03:00
Alice D
d8d03a5699
More minor dialogue edits (#255)
* more small edits for flow, punctuation, etc

* missing quote

* fix commit

* marisa dialogue changes

* reimu dialog changes

* youmu dialogue improvements

* smartquotes

* code-review changes

* final PR review
2020-10-09 01:11:13 +03:00
Andrei Alexeyev
afdc640663
Update mailmap 2020-10-08 08:52:29 +03:00
Andrei Alexeyev
51cdbc6987
Update .gitattributes
Inform github about generated files, hopefully avoiding annoying PR
diffs. Also use the C/C++ diff pattern for C sources.
2020-10-08 08:52:29 +03:00
Andrei Alexeyev
40425c346b
Enemy system extensions (#256)
* Add red fairies; tweaks to blue fairies and circles

* Add more fairies and a simple enemy archetype system

Note that existing stages not utilizing the new enemy spawning system
will have a visual regression - fairies will not have their magic
circles and particle effects visible. These are no longer implemented by
the enemy visual rules and require additional setup from the new spawner
wrappers. All stages should be converted to the new system.

Also improved old fairy sprites

* enemy_classes: rebalance HP

* enemy_classes: add EnemySpawner typedef

* items: add ITEMS() shortcut macro for use with enemy spawners
2020-10-08 05:00:52 +03:00
Andrei Alexeyev
738e1cb437
scripts/gen-atlas: parallelize pack algo bruteforcer 2020-10-06 03:58:42 +03:00
Andrei Alexeyev
f60b49a628
miscmath: add cabs2() and cabs2f()
Returns the squared absolute value of a complex number
2020-10-01 02:31:52 +03:00
Andrei Alexeyev
2bc7d52369
Add a simpler synchronous interface to common_charge 2020-09-30 03:44:58 +03:00
Andrei Alexeyev
6ed03317b6
stage: delay BGM start up by 1 frame
This workaround is needed to avoid music synchronization issues due to
loading times. BGMs are typically started on the very first frame of the
stage, which often has to wait for resources to finish loading.
2020-09-29 20:56:59 +03:00
Andrei Alexeyev
3e7282460e
audio: move static globals into static struct 2020-09-29 20:53:07 +03:00
Andrei Alexeyev
fdc00bb906
Improve charge effect appearance 2020-09-29 20:45:11 +03:00
Andrei Alexeyev
6671aa6ecd
Add ENT_ARRAY_COMPACT(array_ptr) macro
Removes all dead references from the array. This operation may move
elements around.
2020-09-29 20:11:36 +03:00
Andrei Alexeyev
31ce18129a
Icicle Cascade tweaks
Make it shoot roughly from Cirno's hands, and change color of turned
icicles.
2020-09-29 19:34:16 +03:00
Andrei Alexeyev
173f64b330
YoumuB: fix incorrect myon dir and motion initialization
If entering a new stage while holding the shot button, myon never moves
away from the player until the player itself moves, and therefore never
initializes its .dir property. The initial value of .dir is 0.
All shots fired in this state have zero velocity, since .dir is supposed
to be a direction unit vector for them.

This patch initializes .dir to a sane value right away, and prevents
myon from getting stuck to the player in the first place.

Note that the original bug did not trigger when starting a new game,
only after a stage transition. The reason for that is currently unknown.
This does not seem to cause any replay inconsistencies, so the quirk is
probably on the user input layer.

fixes #252
2020-09-28 23:19:51 +03:00
Andrei Alexeyev
0e25c3a06b
Fix some #ifs that should be #ifdefs 2020-09-12 21:19:49 +03:00
Samuel P
5238f4080d
Switch port fixes (#251)
* switch: fix es-shaders being packed before transpilation

* switch: build fixes and glsl debug logs

* switch: fix crash on shutdown

shutdown is now done before __libc_fini_array is called, which avoids
freeing the gl context resources twice (in __libc_fini_array, and in SDL_GL_DeleteContext)
2020-09-01 16:31:35 +03:00
Andrei Alexeyev
4326d6a6f1
Fix laser collision
The last tested segment was not properly intitialized, which sometimes
resulted in unfair and very unexpected deaths to "nothing".

Fixes #234
2020-08-31 15:22:57 +03:00
Andrei Alexeyev
2ae5e25b00
Workaround a visual glitch in boss_zoom.frag on some systems
Fixes #239
2020-08-31 13:18:00 +03:00
Andrei Alexeyev
25c2576149
run upkeep 2020-08-31 12:55:36 +03:00
Alice D
8f515e0f38
Stage 5 Restructure (#247)
* initial commit (basic structure, does not compile)

* it compiles now

* moving some stuff around

* move spells/nonspells over to their own files, and retab the whole directory

* retab meson file (oops)

* newline shuffling

* clean up some imports, move functions to spellcards

* Update src/stages/stage5/background_anim.c

Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>

* Apply suggestions from code review

Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>

* code review changes

* change cloud_common to spawn_cloud

* move explosion survival to spells

* add missing timeline imports (oops)

* add missing comma

Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>
2020-08-29 02:09:10 +03:00
Alice D
8f3b3fa0bc
Stage 6 Restructure (#248)
* basic stage 6 structure (nothing here yet)

* it compiles and runs (needs testing)

* reindent

* missing import

* fix baryons

* import cleanups

* moving spells from elly.c to their spellcard sources

* code review changes, and some additional cleanup

* more PR changes, removing more dead code

* clean up some imports, move functions to spellcards

* remove dual initalization
2020-08-28 09:08:30 +03:00
Andrei Alexeyev
f899370fa6
Restructure stage 2 into multiple files
Cherry-pick from #229 (ba2187f54fdb1fb43846f85c8cddcf920932e3c7)
2020-08-25 05:03:00 +03:00
Andrei Alexeyev
4c38f1b0ba
Hide coroutine stats when no coroutines are active 2020-08-25 04:56:22 +03:00
Andrei Alexeyev
52baad241a
Disable CO_TASK_STATS_STACK by default 2020-08-25 04:56:22 +03:00
Andrei Alexeyev
4ac5f346ca
Disable SPRITE_BATCH_STATS by default 2020-08-25 04:56:22 +03:00
Alice D
93741f5c18 fixing typo 2020-08-22 13:06:07 -04:00
Andrei Alexeyev
db792ebdc0
prune dead spritedef 2020-08-22 10:03:02 +03:00
Alice D
bf3c7fef05
Backport dialogue edits from yumemi branch
This is a partial cherry-pick of commits:
	eccec37982009f7196c6aeec9bd0ac94d4b8e1fd (#222)
	415c263592e9ce23fbc5080f15fde19ebec5702a (#223)

With extra stage related stuff removed
2020-08-22 09:36:25 +03:00
Samuel P
0600ebaea6
video: don't create windowed-mode windows under fullscreen-only drivers (#246) 2020-08-16 21:16:01 +03:00
Andrei Alexeyev
51a8340efd
update koishi 2020-08-16 14:12:34 +03:00
Andrei Alexeyev
9f050bf9b6
coroutine: increase stack size for non-emscripten builds
Fixes #243
2020-08-16 14:11:09 +03:00
Andrei Alexeyev
f9a186455f
Fix float zero division in video init 2020-08-15 18:42:18 +03:00
Andrei Alexeyev
a5fd6fe5d9
Texturing overhaul: GPU compression, sRGB sampling, swizzles, etc. (#240)
* WIP compressed textures, swizzles, sRGB sampling, ...

* refactor texture type info & fix random bugs

* fix preprocessing of sRGB textures

* handle y-flipped basis textures

* glcommon: better WebGL compat for compressed format detection

* missed WEBGL_compressed_texture_pvrtc

* implement compressed texture xcoding and uploading

* Add basis_universal submodule

* Reorganize texture loader code

Clean up some code
Isolate Basis Universal loader into a separate module

* Add wrapper script for encoding .basis textures

* basisu: honor custom metadata written by the mkbasis.py script

* mkbasis.py: add --incredibly-slow and --dry-run

* Move pixmap code from util/ to pixmap/

* Add an on-disk transcode cache for basis textures to speed up loads

* Compress texture cache with zlib

* Use readable format names for basisu cache filenames

* basisu: mip bias test code

* basisu: small caching cleanup

* add TAISEI_BASISU_MIP_BIAS env variable

* Improve OpenGL format matching heuristics

* Document considerations for compressed format priority

* Remove dead code

* Enable two forgotten formats, BC3_RGBA and ATC_RGBA

Also prefer BC7 over BC1/BC3

* Recognize GL_ANGLE_compressed_texture_etc for ETC2 textures

* Default depth buffers to 24-bit; remove ANGLE hack

* Fix glcommon_check_extension for GLES2/legacy gl

* Add renderer feature bit for texture swizzle masks

* glcommon: Fixup internal formats for GLES2

Sized internal formats are not allowed in GLES2

* Fix emscripten compile errors

* Update basis_universal

* remove more dead code

* revert irrelevant stage4 change

* shut up UBSan

* basisu: shut up some debug spam

* Add normalmap sampling helper to util.glslh

* basisu: add a gray-alpha mode

* mkbasis.py: Abort if image dimansions aren't multiples of 4

* Add basic Basis Universal encoding documentation (WIP)

* doc/basisu: Add paragraph about modes; minor tweaks

* basisu: workarounds for GL texture size requirements

* gles20: fix uncompressed sRGB formats

* Partial workaround for missing swizzles in gles2 and webgl

* remove invalid assertion

* New renderer API to expose glDrawBuffers-like functionality

* stagedraw: disable all color outputs for copy_depth pass

required for WebGL compatibility

* support GL_ANGLE_request_extension

* emscripten: include *.basis in gfx package

Also fix a potential problem when more than one .pkgdir is used to
construct emscripten packages

* Don't rely on emscripten runtime to enable webgl extensions
2020-08-15 14:51:12 +03:00
Andrei Alexeyev
324dccb79a
emscripten build fixes 2020-08-11 13:22:36 +03:00
Andrei Alexeyev
2e9b3f67c5
remove idiotic abort() from audio_sdl.c 2020-08-11 13:22:05 +03:00
Andrei Alexeyev
1edc1fa8de
Remove dead code 2020-08-05 05:07:55 +03:00
Andrei Alexeyev
3edab92ede
oops typo 2020-08-05 04:34:19 +03:00
Andrei Alexeyev
059f9f4991
Expose transpiling info to shaders via macros
Fixes legacy GLSL compatibility code
2020-08-04 02:46:15 +03:00
Andrei Alexeyev
4e98dcc030
lasers: dedicated fragment shader, simplify vertex shader 2020-08-01 19:02:05 +03:00
Andrei Alexeyev
28c4f345c3
Make laser shaders use a separate interface header 2020-08-01 18:42:33 +03:00
Andrei Alexeyev
55d8fa7fbc
Disable coroutine stack usage tracking on windows
It crashes there
2020-07-31 17:23:48 +03:00
Andrei Alexeyev
46bd7244a9
Remove glDrawElementsInstancedBaseInstance support
This extension is unimportant, and actually severely degrades ANGLE
performance over Direct3D to unacceptable levels. This also removes the
alternative sprite batching codepath making use of this functionality.
The renderer API hasn't changed yet; attempting to use the extension
will trigger an assertion failure.

This commit also regenerates glad with a new version. Apparently the old
one had a bug and ended up pulling a lot of unrequested functionality,
which is now removed.
2020-07-31 17:19:39 +03:00
Andrei Alexeyev
bdd713297e
audio: fix theoretical sfx load failure in resample case
If resampling to a higher frequency, we must provide a larger buffer
than the original pcm size.
2020-07-13 01:29:21 +03:00
Andrei Alexeyev
f329a9f016
Extended enemy properties
ENEMY_IMMUNE is now deprecated. Spawning an enemy with ENEMY_IMMUNE hp
sets up the new flags field to match old behavior. The hp value itself
has (almost) no special meaning anymore.
2020-07-09 15:25:57 +03:00
Andrei Alexeyev
b3d3e76d6a
Fix player_add_lives and player_add_bombs
The bug never manifested because these functions are only called with 1
as the argument
2020-07-02 06:09:01 +03:00
Andrei Alexeyev
41c310d886
Fix compat with older SDL 2020-06-24 21:04:48 +03:00