Commit graph

272 commits

Author SHA1 Message Date
Andrei Alexeyev
83d4197e86
Remove Player.lastmovedir
This is only relevant for YoumuA, so track it there
2020-04-23 00:35:06 +03:00
Andrei Alexeyev
d4fb6ab5bd
player: remove "focus" property and "focus_circle"
focus_circle is replaced with a custom PlayerIndicators entity
(responsible for drawing the focus hitbox/cross and powersurge bar)
2020-04-23 00:17:40 +03:00
Andrei Alexeyev
42956c2ace
Remove Player.slaves 2020-04-22 22:37:04 +03:00
Andrei Alexeyev
e16e2184a3
Refactor entity system (#214)
* Smarter generic entity macros

The list of "core" entities is now defined in one macro, and hardcoded
_Generic dispatch tables are eliminated

* Get rid of "custom" entities

All entities are now "first-class". The list of known entity types has
been moved to known_entities.h. The system no longer needs to know the
definition of all entity structs.

* Refactor guts of ENT_BOX/ENT_UNBOX

Made the functions inline, Box::ent is now a proper pointer type (but
please don't use it directly), ENT_UNBOX returns NULL if the box is
"empty" (references NULL entity)

* Merge TASK_BIND_UNBOXED with TASK_BIND

* s/YoumuMyon/YoumuAMyon for consistency
2020-04-17 10:18:53 +03:00
Andrei Alexeyev
45a4283225
use custom ents for Reimu; cleanup Marisa; etc. 2020-04-06 04:34:55 +03:00
Andrei Alexeyev
431237f0f2
Coroutinize MarisaA (#206) 2020-04-01 23:08:40 +03:00
Andrei Alexeyev
b6a6496c39
Coroutinize ReimuB (#205) 2020-03-25 08:52:18 +02:00
Andrei Alexeyev
01e7ea8a33
Coroutinize ReimuA (#199) 2020-03-13 22:54:07 +02:00
Andrei Alexeyev
a9604b1109
some sprite batching optimizations 2020-03-05 21:14:31 +02:00
Andrei Alexeyev
fb19028ed5
New dialogue system powered by coroutines 2020-03-04 22:26:50 +02:00
Andrei Alexeyev
77a65432d6
fix remaining deprecations (except in legacy stages) 2020-03-04 22:26:48 +02:00
Andrei Alexeyev
9fd9dfcf94
fix some trivial deprecations 2020-03-04 22:26:48 +02:00
Andrei Alexeyev
2647c25c4a
fix and tweak player death effect 2020-03-04 22:26:47 +02:00
Andrei Alexeyev
17f6f159c1
replace remaining GrowFade usage in non-stage code 2020-03-04 22:26:47 +02:00
Andrei Alexeyev
c73b05bdd1
Make animation_get_frame never return transient sprites
Animations now store flipped copies of frames as needed.
2020-03-04 22:26:47 +02:00
Andrei Alexeyev
cfbc697936
replace remaining Shrink usage in non-stage code 2020-03-04 22:26:46 +02:00
Andrei Alexeyev
3d1c0eee4e
WIP proj draw rule revamp; YoumuB revamp; misc changes; giant mess
cursed commit
2020-03-04 22:26:45 +02:00
Andrei Alexeyev
d7579606a3
use new RNG api in player.c 2020-03-04 22:26:43 +02:00
Andrei Alexeyev
7474ff3a25
OpenGL ES 2.0 support (#187)
* WIP gles2 compat

* More gles2 compat. Playable with ANGLE now, with some rendering bugs.

* fix matrix mult. order in generic laser shader

* gles20: fix indexed rendering

* Update docs about gles20 status

* fix formatting
2020-02-15 19:45:09 +02:00
Andrei Alexeyev
80b1026d08
Don't redefine standard complex macro; use a new cmplx typedef
This also introduces `float32`, `float64`, and `real` typedefs to be
used in place of `float` and `double` later. `real` is for game code and
other places where we don't particularly care about the precision and
format of the underlying type, and is currently defined to `double`.
`float32` and `float64` should replace `float` and `double` respectively
2019-11-22 05:38:48 +02:00
Andrei Alexeyev
9d3bf87559
Refactor matrix stack API to get rid of matrix mode (#177)
This replaces the r_mat_foo functions with specialized r_mat_{mv,tex,proj}_foo counterparts that operate explicitly on the modelview, texture, and projection matrix stacks respectively.
2019-10-12 15:02:15 +03:00
Andrei Alexeyev
5a23fb95fc
make upkeep script preserve existing copyrights 2019-08-03 20:44:22 +03:00
Andrei Alexeyev
cf1ab225cb
basic support for portrait faces; make charselect menu more fun 2019-07-08 03:51:15 +03:00
Andrei Alexeyev
3055901998
update my email 2019-07-03 21:00:56 +03:00
Andrei Alexeyev
c2cd91463c
New character art by Afensorm + other visual tweaks (#170)
* implement player spellcard declarations on bomb

* stagedraw: move "bottom text" to a separate (higher) layer

* update boss spell declaration effect

* import afensorm's character portrait art

* improve dialog visuals

* acknowledge afensorm in credits and COPYING

* 'alphamap' functionality; effects for wriggle and youmu portraits

* update afens art

* add cirno alphamap

* dialog: draw active speaker above other other

* charselect: use r_draw_sprite
2019-07-03 20:50:43 +03:00
Andrei Alexeyev
5c404d0547
remove references to "full_power" sfx, we don't have it 2019-04-25 02:43:50 +03:00
laochailan
5b389336f7
add power surge sfx 2019-04-16 21:06:10 +02:00
Andrei Alexeyev
f554768cfc
fix rendering of lasers and a few effects during view shake
this is a regression introduced in eea6aa09
2019-04-14 16:15:40 +03:00
Andrei Alexeyev
48b0e31b2e
Enhance ScoreText™ with the SmartCombineⓡ technology 2019-04-14 07:16:10 +03:00
Andrei Alexeyev
28bf0fc0f4
stagetext: separate custom updates from drawing 2019-04-11 12:23:24 +03:00
Andrei Alexeyev
fd09bf02c8
Enforce explicit form and .proto usage for PROJECTILE/PARTICLE calls
Remove kludge code converting sprite names to prototypes
2019-04-11 07:12:17 +03:00
Andrei Alexeyev
ce1eecaf49
add distortion effect for powersurge discharge 2019-04-08 19:57:41 +03:00
Andrei Alexeyev
f14d229244
powersurge: apply hazard-clear on discharge over 10 frames 2019-04-08 07:34:52 +03:00
Andrei Alexeyev
50bcafacda
delay gameover slightly 2019-04-08 06:19:42 +03:00
Andrei Alexeyev
5f940e31fa
autistic optimization 2019-04-07 01:57:28 +03:00
Andrei Alexeyev
488ff43f85
add optional floating scoring text 2019-04-07 01:55:13 +03:00
Andrei Alexeyev
bfea580ce1
fix player being able to get lives/bombs in spellstages 2019-04-03 21:48:25 +03:00
Andrei Alexeyev
ebee4eb00f
Remove the bomb cancellation system
Bombs may now persist into a boss spellcard without failing it, if they
were used before the spellcard was declared.
2019-04-01 00:12:45 +03:00
Andrei Alexeyev
df3427d09a
powersurge: rebalance charge/bonus gain in favor of neg. charge maintenance 2019-03-28 17:56:06 +02:00
Andrei Alexeyev
dc88572167
YoumuB bomb tweaks, some laser fixups 2019-03-26 17:58:38 +02:00
Andrei Alexeyev
68111e6ccb
improve the Post Death Experience (and code) 2019-03-05 13:50:29 +02:00
Andrei Alexeyev
f87ac189ef
replace item spawning functions with type-safe versions 2019-03-03 13:53:45 +02:00
Andrei Alexeyev
f8cd9a119a
fix infinite recursion 2019-02-28 12:10:03 +02:00
Andrei Alexeyev
c5936a0bfd
pause powersurge during dialogs; fix double-cancel at end of stage 2019-02-28 12:00:35 +02:00
Andrei Alexeyev
8fc5abb78a
The Powersurge game mechanic and scoring system (#159) 2019-02-22 01:56:03 +02:00
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
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
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
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