Commit graph

2359 commits

Author SHA1 Message Date
Andrei Alexeyev
fa802dbd94
Some refactoring
* Added (and fixed) a few useful warnings
    * Removed some dead code
    * Cleaned up the build system files a bit
    * Once again separated ZIP support from data packaging
    * Converted macOS cross-compilation options into cross-file properties
2019-01-24 22:24:43 +02:00
Andrei Alexeyev
4159ea1249
'upkeep' target for maintenance tasks; back to include guards; happy new year! 2019-01-23 22:10:43 +02:00
Andrei Alexeyev
f2e8607efe
fixup cglm subproject 2019-01-23 16:32:00 +02:00
Andrei Alexeyev
f8a2d3c112
very important optimization 2019-01-23 16:02:51 +02:00
Andrei Alexeyev
e628301f48
fix --frameskip 2019-01-22 06:06:41 +02:00
Andrei Alexeyev
44a2f849ff
ReimuB bomb tweaks 2019-01-10 02:40:45 +02:00
Andrei Alexeyev
88931ab316
YoumuA bomb tweaks 2019-01-10 01:56:33 +02:00
Andrei Alexeyev
69079f245a
dubious timing optimizations; try to sleep between frames; skip at constant speed 2019-01-09 05:25:10 +02:00
laochailan
64878d5c67
new youmu a bomb
pool myon billards

tweak youmuA bomb (new movement + larger radius)

fix preload
2019-01-08 04:54:43 +02:00
Andrei Alexeyev
9844f5dd9b
fix broken laser collision after merging #151
also add a parameter to rect_rect_intersect{,ion} to specify whether to
register shader corners/vertices as intersections. previously these
would be unconditionally discarded.
2019-01-06 02:02:44 +02:00
holycleugh
0dcdfcb101
Quick return no collision if projectile and player are far apart. 2019-01-06 01:47:11 +02:00
Andrei Alexeyev
06900313af
allow endings to be skipped 2019-01-05 23:48:42 +02:00
Andrei Alexeyev
235e2e0783
allow to skip credits if the game has been cleared at least once
closes #154
2019-01-05 23:40:50 +02:00
Andrei Alexeyev
57420060ca
fix unused variable warninr 2019-01-05 02:06:26 +02:00
Andrei Alexeyev
49d0d54a2e
Lots of disorganized (mostly) visual overhaul (#156)
* WIP some projectile effects

* fix segfault

* Laser smoothing and glow via post-processing blur magic

TODO: make it optional

* fix memory corruption

* fix memory corruption for realsies now

* fix color_get_hsl for out-of-range colors

* some more bullet flare tweaks

* some lame clear effect workarounds

* spawn bullet flares after frame 0; looks better and fixes some problems

* New baryon explosion; fix petal_explosion; leanify everything

* Add missing bullet flare sprite, rebuild main atlas

* improve batching efficiency with bullet spawn flares

* forgot git add

* Group projectiles/particles by shader where possible

* Another take on baryon explosion; make fg framebuffers 16bit

* WIP some settings for toasters

* remove stupid debug log

* microoptimization that probably does nothing anyway

* somewhat more intuitive quality settings

* Whitelist more particles (MarisaB is on hold)

* Whitelist (and fix) some more stage6 particles (mostly ToE)

* Add a spell name background

* Experimental radial healthbar for bosses

* healthbar tweaks

* thiccer healthbars in response to feedback

* remove healthbar survival timer; just fade out on survivals

* Add linear healthbars option; WIP other boss HUD tweaks

* Use the proper spell card name format

* New font and some random garbage to go along with it

* Generate static font outlines for use in text shaders

* Use outlines in overlay text shader

* Complete boss HUD/healthbar fading logic

* fix boss timer limit

* stage5 bombs explosion effect

* split PFLAG_NOSPAWNZOOM into PFLAG_NOSPAWNFLARE and PFLAG_NOSPAWNFADE;

introduce PFLAG_NOSPAWNEFFECTS which disables both (it's just the two
values OR'd together)

simplify vampiric vapor bullet spawning effect

* Remove spawn fade-in from super-fast stage5 fairy projectiles (limiters)

* lower particle density in v.vapor in minimal mode

* graze effect tweaks

* fix text shortening, tweak replay menu layout

* stupid debug spam

* revisit grazing effects again

* dumb debug spam again

* improve boss attack timer

* overlay effect for boss deaths (similar to the player one)

* spice up spellcard declaration (HUD)

* don't spawn boss death overlay if fleed

* modify Exo2 font to use tabular figures

* adjust replay menu for the font change

* draw timer & power with standard font (phasing out the numbers font)

* WIP new HUD; random fixes/tweaks

* hud: move difficulty indicator

* hud: move debug stuff around

* preloads, mostly

* fix youmuA batching conflict

* shitty workaround for the shitty screenshake shit

* remove extraspell lag by stopping to draw stagebg sooner

which is possible because extra spells have a different spellcard_intro timing. Fun fact of the day: the duration of spellcard_intro is always ATTACK_START_DELAY_EXTRA even for normal spells!

* new stain particle

*  i disabled background rendering…

* "batch" marisa_b masterspark draws

* remove these once a new atlas is generated

* make toe quick again

* hopefully fix all occurences of changed stain and ScaleFade behavior

* tweaking reimu_a and toe boson launch effects

* make lhc fast again

* softer involnerability effect

* fix stage 1 snow on the water bug (and improve performance)

translated the time to the future a bit because it only seemed to be an issue for small time values

* remove unnecessary spawnflare from toe

* tone down extra spell start effect

* experimental ReimuB gap shader optimization

* fix python3 shebangs

* generate simple blur shaders w/ hardcoded kernels

* New loading screen

* lasers: fix incorrect draw hook registration

* add webp support for atlas generator

* Use ImageMagick for atlas composition (adds 16-bit support)

* Atlas maintenance

* make the vampiric vapor bullets less prone to invisibility

* Revert a few particles to the quadratic fade curve

* experimental baryon effect

* improve baryon sprites

* disable the baryon effect on minimal postprocessing setting
2019-01-05 00:59:39 +02:00
Andrei Alexeyev
b2fcbee7ea
fix python3 shebangs 2019-01-01 22:15:14 +02:00
Andrei Alexeyev
ab860f56d3
fix windows build 2018-11-16 01:50:28 +02:00
Andrei Alexeyev
1a0751cafd
fix memory leak in gamepad code 2018-11-10 03:02:02 +02:00
Andrei Alexeyev
ebd8344382
workaround to allow safely unregistering event handlers from within event handlers
fixes #153
2018-11-10 02:58:37 +02:00
Andrei Alexeyev
49b2a7c93d
shut up a warning 2018-11-03 17:43:12 +02:00
Andrei Alexeyev
cb79cbfb57
fix a terrifying credits bug 2018-11-03 00:27:51 +02:00
Andrei Alexeyev
b4f94e7371
Some minor text revisions 2018-11-03 00:26:12 +02:00
Andrei Alexeyev
1365293334
Some gles20 progress; minor gl refactor and fixes 2018-10-23 10:51:56 +03:00
Andrei Alexeyev
923f158ff3
*actually* fix player init 2018-10-23 06:49:19 +03:00
Andrei Alexeyev
e78f1484c1
Unlock stages and spells for practice even if continues were used 2018-10-23 06:33:16 +03:00
Andrei Alexeyev
364a92eb4a
Finally fix skip_background_anim and player init in spellstages 2018-10-23 06:26:22 +03:00
Andrei Alexeyev
1fd1b6671d
Conditional support for more texture formats in GLES 2018-10-22 10:21:17 +03:00
Andrei Alexeyev
a7dc4dce1e
fix build (broken by previous cherry-pick) 2018-10-22 07:21:25 +03:00
Andrei Alexeyev
0e4527be7d
Optimize reimu_gap shader
There's certainly more to be done, though
2018-10-22 05:31:22 +03:00
Andrei Alexeyev
da2811d322
Fix GLES 2018-10-22 05:09:57 +03:00
Andrei Alexeyev
b13f98c681
Support 16-bit uint and 32-bit float textures
When textures are loaded as resources, the best available format is now
picked by default. That means that if your source image is 16-bit RGB,
you will get a 16-bit RGB texture (the alpha channel is added only if
necessary). However, grayscale images currently get expanded into RGB(A)
by the loaders automatically, so you will never get less than 3 channels
by default. This is good, because you most often expect grayscale images
to stay gray, and not red.

This behavior can be overriden with the new 'format' key in .tex files.
For example, if you only care about one channel in a gray image, you can
do this to save some VRAM:

    format = R16

The following is equivalent:

    format = R16U

And so is this:

    format = r 16 uint

The general syntax is:

    format = <channels><depth>[datatype]

    Where:
        * Channels is one of: R, RG, RGB, RGBA;
        * Depth is one of: 8, 16, 32;
        * Datatype is one of: uint (or just u), float (or just f)

    All fields are case-insensitive and may be separated by whitespace.

Note that the rendering backend may not support all of these formats,
and fallback to an inferior or a redundant one. The gl33 backend should
support all of them. The gles30 backend only supports 8-bit uint
textures for now.
2018-10-19 05:27:54 +03:00
Andrei Alexeyev
56e94dbff6
packaging woes (fuck debian) 2018-10-19 02:51:59 +03:00
Andrei Alexeyev
3937618c84
Kick SDL_image's ass out and replace JPEG with WebP 2018-10-19 00:16:06 +03:00
Andrei Alexeyev
56049991ac
VFS: support virtual packages. Dirs with .pkgdir extension act like .zip files 2018-10-16 17:10:15 +03:00
Andrei Alexeyev
5138e0d8a5
Various VFS improvements and fixes; mount /res read-only 2018-10-16 16:43:46 +03:00
Andrei Alexeyev
63c5a321f3
i'm a fucking moron 2018-10-04 07:35:10 +03:00
Andrei Alexeyev
146b751054
Fix stage1_water shader not compiling on some windows AMD drivers 2018-10-03 05:25:41 +03:00
Andrei Alexeyev
a6d0ab565f
Implement hardware index buffers; some renderer refactoring
Too lazy for detailed comments, read the code
2018-10-03 03:46:55 +03:00
Andrei Alexeyev
5548b6d65a
Don't emit TE_MENU_ACCEPT events from repeated inputs
Fixes #150 and potentially other input issues
2018-10-02 04:44:33 +03:00
Andrei Alexeyev
1b06a20122
Fix #149 and some other spell bg issues 2018-10-02 04:09:37 +03:00
Andrei Alexeyev
30f5df4ae0
Fix #145 2018-10-02 03:03:51 +03:00
Andrei Alexeyev
04ae457689
git subrepo pull external/gamecontrollerdb
subrepo:
  subdir:   "external/gamecontrollerdb"
  merged:   "2c1b295e"
upstream:
  origin:   "https://github.com/taisei-project/SDL_GameControllerDB"
  branch:   "master"
  commit:   "2c1b295e"
git-subrepo:
  version:  "0.3.1"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "a7ee886"
2018-10-02 01:44:25 +03:00
Andrei Alexeyev
2414474c89
OpenGL ES 3.0 rendering backend (#148)
* First steps towards shader transpilation

Needs to be manually enabled via -Dshader_transpiler=true.

Requires shaderc. https://github.com/google/shaderc

Not yet functional due to missing SPIRV-Cross integration. SPIRV-Cross
currently does not have an official C API, and crossc is too minimal to
be useful. The current plan is to extend crossc and vendor it, while
also sending PRs upstream.

* Integrate crossc; shader transpilation for GLES now works

* fix leak

* gles30 backend now playable on Mesa with 3.2 context

Some rendering issues are present. Identified so far:
    - Marisa's lasers are invisible
    - Death effect looks wrong

Also, a small pixmap manipulation library has been written, and the
texture uploading API redesigned around it.

* fix marisa lasers in GLES (uniform name clashed with builtin)

* fix player death effect in GLES (another name clash)

* Dump ANGLE's translated shader code in debug log

* fix screenshots

* Drop support for triangle fans, switch to strips

Fans offer no advantage over strips, and they've been removed in D3D10+,
so ANGLE has to emulate them.

* crude workaround for an ANGLE bug

* Re-enable GL debug labels, fix an issue with them that affected ANGLE (but was always technically a bug)

* fix race condition in shaderc initialization

* New SDL_RWops interface for vertex buffers

* Optimize VBO streaming via buffering updates

Measurable performance improvement even with the main gl33 renderer,
drastic improvement with ANGLE.

* Fix the depth texture binding problem under ANGLE

Apparently it hates GL_DEPTH_COMPONENT16 for some reason. Sized internal
formats are not supported in GLES 2.0 anyway, so not using them is
probably a good idea.

* fix GLES2.0 segfault (the backend still doesn't work, though)

* dump GL extensions at info log level, not debug

* get around a Mesa bug; more correct texture format table for GLES2

* Correct GLES3 texture format table according to the spec

Not a Mesa bug after all

* require crossc>=1.5.0, fallback to subproject

* Request at least 8bit per color channel in GL backends

* Forbid lto for static windows builds with shader_transpiler=true

* fix edge case segfault

* Add basic ANGLE bundling support to the build system

Windows only, and no NSIS support yet

* Fix various windows-related build system and installer brokenness

* Disable gles backends by default

* update documentation
2018-10-02 01:36:10 +03:00
holycleugh
10046ff9c7 Add option and keybinding to toggle audio mute. (#147) 2018-09-15 18:48:03 +03:00
Andrei Alexeyev
9b3779ebb4
Some renderer refactoring (mostly API and GLES preparations) (#144)
* Refacor uniforms API:

    - More complete and consistent
    - Type-safety
    - Usage correctess assertions missing for now, planned

* Redesign texturing API: texunits gone, assign textures to sampler uniforms directly

r_texture_create now allocates memory and returns an opaque Texture
pointer; similar changes to the other renderer APIs will follow.

* Framebuffers: make _create return an opaque pointer, add debug label APIs (unused for now)

* opaque pointers and debug label APIs for vertex arrays and buffers

* fix null renderer

* Refactor glsl preprocessing into an independent module

* Separate shader resource management from renderer backend

This makes it possible to add more shading languages and/or include a
transpiler, which will be useful for the GLES backend.

* refactor r_clear into a stateless API

* add r_texture_clear API; fix gl33_framebuffer_clear

* Replace deprecated glsl_objects with objects in all *.prog files

* fix missing texture_clear implementation in null renderer

* remove some dead code in null renderer

* fix GLES segfault

* GLES 3.0 actually has glVertexAttribDivisor

* Query GL for supported GLSL versions (preparing to add shader transcompilation)
2018-09-14 10:37:20 +03:00
Andrei Alexeyev
3cd4ecfceb
Remove the obsolete objpool_release_[a]list functions 2018-08-31 06:23:29 +03:00
Andrei Alexeyev
795668be87
fix delete_items not properly unregistering entities 2018-08-31 06:20:47 +03:00
Andrei Alexeyev
01795250bb
Add build option to disable object pools (for debugging) 2018-08-31 05:59:47 +03:00
Andrei Alexeyev
721bed1a8c
draw boss overlay on top of everything else 2018-08-31 05:46:37 +03:00
Andrei Alexeyev
e4bab8d924
fix #136 2018-08-31 05:34:44 +03:00