Commit graph

87 commits

Author SHA1 Message Date
Andrei Alexeyev
be7905d6a3
src: run upkeep 2024-05-17 04:58:47 +02:00
Andrei Alexeyev
cc01be15fe
all: use the clamp() macro 2023-09-28 17:43:14 +02:00
Andrei Alexeyev
8f8ca2beca
all: use min/max macros; avoid some unnecessary conversions 2023-09-28 17:43:14 +02:00
Andrei Alexeyev
7e1ea18969
item: cache sprite pointers 2023-09-28 17:43:14 +02:00
Andrei Alexeyev
c2810e228d
all: use re()/im() macros 2023-09-28 17:43:14 +02:00
Andrei Alexeyev
bd361067df
headers: isolate endings, remove stage.h inc. from plrmodes.h, fix resulting mess 2023-07-30 06:16:17 +02:00
Andrei Alexeyev
115948857e
item: always collect at full value during power surge 2023-07-11 16:50:05 +02:00
Andrei Alexeyev
9dade8ad33
resource: lifetime management redesign (WIP) 2023-04-29 20:01:50 +02:00
Andrei Alexeyev
ad295005db
resource: more consistent API function names 2023-04-29 20:01:50 +02:00
Andrei Alexeyev
df6b97caf7
stageobjects,objectpool: simplify and reimplement on top of arenas
All pools now allocate from the same arena that is initialized once with
8MB of initial space and never deallocated, only reset between stages.
2023-04-07 16:08:49 +02:00
Andrei Alexeyev
3c7283f1c7
player: refactor power handling
Separate concepts of "stored" and "effective" power.
2022-10-03 20:53:22 +02:00
Andrei Alexeyev
55e103be1e
item: optimize collision 2022-01-12 14:58:39 +02:00
Andrei Alexeyev
8480d41b7b
Audio rewrite (#236)
This replaces SDL_mixer with an internal streaming and mixing system,
relying only on basic SDL audio support. It's also a partial refactor of
the audio API, most notably BGM-related. The BGM metadata resource type
is gone, as well as the `.bgm` files. The metadata is now stored inside
the `.opus` files directly, using standard Opus tags.
2020-06-22 17:41:03 +03:00
Andrei Alexeyev
89ecc0c55e
Establish more-or-less consistent resource getter functions
Deprecate old ad-hoc stuff like get_sprite, r_texture_get, etc.
2020-06-09 04:33:22 +03:00
Andrei Alexeyev
f5f8f9fb49
Get rid of custom min() and max() functions
Use the standard fmin() and fmax() for floating point values, and ours
imin(), imax(), umin(), umax() for integers.
2020-05-09 09:16:07 +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
be5ee1900d
replace remaining Fade usage in non-stage code 2020-03-04 22:26:46 +02:00
Andrei Alexeyev
dc8ecc0dc7
use new RNG api in boss.c, enemy.c, item.c 2020-03-04 22:26:43 +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
5a23fb95fc
make upkeep script preserve existing copyrights 2019-08-03 20:44:22 +03:00
Andrei Alexeyev
3055901998
update my email 2019-07-03 21:00:56 +03:00
laochailan
5f6ada9e7e Item indicators (#172)
* indicators indicate indication

* optimize

* preload the right resource

* integrate point indicators into atlas
2019-06-25 07:27:57 +03:00
Andrei Alexeyev
36c5d6974b
optimize and simplify object pools 2019-04-12 11:36:40 +03:00
Andrei Alexeyev
488ff43f85
add optional floating scoring text 2019-04-07 01:55:13 +03:00
Andrei Alexeyev
c8e281bc02
fix all items being autocollected immediately 2019-03-09 18:25:34 +02:00
Andrei Alexeyev
f87ac189ef
replace item spawning functions with type-safe versions 2019-03-03 13:53:45 +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
795668be87
fix delete_items not properly unregistering entities 2018-08-31 06:20:47 +03:00
laochailan
a9048d22b1
relayer the particle clearing lasagna 2018-08-07 18:42:41 +02:00
Andrei Alexeyev
12a9acbc71
Add more functions to query player state properly (is alive, is vulnerable, is bombing)
There are some minor changes to the logic to keep things consistent.
2018-07-31 10:07:34 +03:00
Andrei Alexeyev
8490576810
Premultiplied alpha (#133)
* WIP premultiplied alpha

* WIP color API rework (doesn't build yet; lots of things left to convert)

* convert everything remaining to new Color api except stage*_event.c files

* convert the stages to new Color api. builds & runs now; still many rendering errors

* fix the bullet shader for premultiplied alpha

* fix masterspark, graphs and stage 1 fog clouds

* fix marisa_b and most of spellcards

* Add deprecation warnings for BLEND_ADD and PFLAG_DRAWADD

* fix a segfault in stage 6

undo accidental earlier change

* fix text_hud.frag.glsl

* fix scuttle bg and remaining stage3 BLEND_ADDs

* fix marisa laser opacity

* hacky fix for myon

The old implementation relied on alpha being stored inside p->color. In
premul alpha this doesn’t work and functions like color_set_opacity
can’t solve this i think.

So I tried messing around with it until it looked somewhat similar.

* fix marisa_b stars

* remove color_set_opacity i overlooked

* more plrmode blending changes

* fixup additive blending in stage 1

* various premultiplied alpha fixups for bosses and enemies

* stage 2 premul alpha fixups

* stage 4 premul alpha fixups

* stage 5 premul alpha fixups

* stage 6 premul alpha fixups

* make lasers also use the PMA blend mode

* remove PFLAG_DRAWADD and PFLAG_DRAWSUB

* fix remaining PMA issues in menus

* lame extraspell bg workaround

* fix item alpha

* make marisaA lasers look somewhat like in master

* fix marisaA bomb background fadeout

* fixup various r_color4 calls

* fix myon

* remove dead code

* fix use of BLEND_ADD in player death effect

* fix myon shot trails (broken on master as well)

* fix myon shot fade-in

* extend the sprite shaders custom parameter to a vec4

* fix youmuB stuff and make it look somewhat better.

the code looks even worse though.
2018-07-23 20:07:59 +03:00
Andrei Alexeyev
83a8961df6
use "anchored" lists for most game objects
these have a pointer to the last element, thus appending is fast
2018-06-01 21:40:18 +03:00
Andrei Alexeyev
c967fafa96
give items slightly more upwards velocity on spawn 2018-05-16 21:08:21 +03:00
Andrei Alexeyev
ebd751b25f
fix power items dropped on death instantly disappearing under some conditions 2018-05-16 20:55:03 +03:00
Andrei Alexeyev
45da133768
player property system; adjust character speeds and PoC 2018-05-02 09:08:32 +03:00
Andrei Alexeyev
f67396423e
Projectile prototypes system (#118)
* wip projectile prototypes

* Partial fix for replay desyncs

* some YoumuA fixes

* fix various ToE problems

* fix MarisaB

* fix master spark

* fix iku slave particle position

* this timeout was somehow halved during the changes

* remove some v1.2 compat hacks
2018-05-02 07:46:48 +03:00
Andrei Alexeyev
8ef5ffd32c
Flexible draw order; entity "base class" for all game objects 2018-04-15 09:43:11 +03:00
Andrei Alexeyev
59cf8f6300
Rendering system rewrite, tons of refactoring, optimizations, and other cool stuff (#116) 2018-04-12 17:08:48 +03:00
Andrei Alexeyev
a9561d7baf
Sprites and texture atlases; upgrade most graphics to a higher resolution (optimized for 1600x1200) (#113) 2018-02-06 08:19:25 +02:00
Andrei Alexeyev
513d613387
Consistent indentation: indent with tabs, align with spaces (#104)
I would've preferred to just go with 4-spaces for indent and no tabs,
but lao is a bit conservative about it. :^)

Still, this is a ton better than mixing different styles all over the
place, especially within the same file.
2018-01-12 20:26:07 +02:00
Andrei Alexeyev
d73f8d28a3
add head version of list_insert_at_priority, use it for proj_insert_colorprio (slightly faster) 2018-01-09 21:54:03 +02:00
Andrei Alexeyev
485c9a8ed6
Happy New Year! 2018-01-04 19:14:31 +02:00
Andrei Alexeyev
e355e57fb5
make the list api require less insane casts all over the place
by sealing the spirit of insanity in its header file, that is
2017-12-24 08:16:25 +02:00
Andrei Alexeyev
29acd5f58a meson: intel intrinsics, various improvements 2017-12-21 03:58:54 +01:00
Andrei Alexeyev
abbc62b49c
object pools 2017-12-13 21:08:23 +02:00
Andrei Alexeyev
7b53d9e731
redesign list api 2017-11-21 16:45:01 +02:00
Andrei Alexeyev
b61ef0bffc
more strict warnings; fixed some subtle bugs 2017-11-11 19:33:44 +02:00
Andrei Alexeyev
586af9a6b0
huge projectile API changes and optimizations (#93) 2017-11-10 22:49:16 +02:00