Commit graph

257 commits

Author SHA1 Message Date
Andrei Alexeyev
b81f338d2d
stageobjects: add type-based macros for acquiring from/releasing into the correct pool 2024-06-05 21:58:58 +02:00
Andrei Alexeyev
05168ac2d7
memory/mempool: rename from objectpool 2024-06-05 18:35:08 +02:00
Andrei Alexeyev
be7905d6a3
src: run upkeep 2024-05-17 04:58:47 +02:00
Andrei Alexeyev
8f8ca2beca
all: use min/max macros; avoid some unnecessary conversions 2023-09-28 17:43:14 +02:00
Andrei Alexeyev
a464aa8837
projectile: cache auto-angle of constant-velocity projectiles 2023-09-28 17:43:14 +02:00
Andrei Alexeyev
1d04428bbb
projectile: optimize projectile_size, projectile_graze_size, projectile_in_viewport 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
bc1267f0e8
projectile: fix .prevpos being set incorrectly
This broke collision lerping, and automatic angle calculation in cases
where position is influenced by external tasks. A stage 2 pattern seems
to have relied on this broken behavior, and was also fixed.
2023-08-17 01:28:29 +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
laochailan
a6e29bdc56 preload: update all preloads
endings and extra spells are not completely tested yet.
2023-06-16 22:19:11 -04:00
Andrei Alexeyev
6a6a736e74
projectile: fix bullet spawn effects
Broken by 0d77416e3b
2023-05-28 02:08:19 +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
eb75d272c0
projectile: don't use ACTION constants 2023-02-24 05:37:58 +01:00
Andrei Alexeyev
837d3bff39
projectile: remove old rule handling 2023-02-24 05:37:58 +01:00
Andrei Alexeyev
20db33b37a
projectile: remove deprecated fields from ProjArgs 2023-02-24 05:37:58 +01:00
Andrei Alexeyev
14c33cfff6
projectile: remove old rule and drawrule functions 2023-02-24 05:37:58 +01:00
Andrei Alexeyev
7f2b76ceb0
projectile: remove ProjDrawCore and supporting code
Reimplement deprecated draw funcs as wrappers over their pdraw_
replaceements
2023-02-09 08:05:22 +01:00
Andrei Alexeyev
c9f52dc46c
projectile: initialize angle to be aligned with velocity
To accomodate new scheduling behavior
2023-01-06 04:11:13 +01:00
Andrei Alexeyev
8550018f2c
projectile: pdraw_timeout_*: don't try to draw at 0 scale or opacity
Calling r_draw_sprite() with zero scale in particular can lead to
unintended flickering due to an API limitation: it interprets 0 as
"default scale" (which is 1). This was exposed in 8c804397 making the
charge animations flicker due to changes in how entity processing is
scheduled.
2023-01-06 03:19:54 +01:00
Andrei Alexeyev
8411e96d4a
projectile: optimize collision 2022-01-12 14:59:00 +02:00
Andrei Alexeyev
142b4f25d4
Remove some trivial dead code 2021-08-31 23:34:48 +03:00
Andrei Alexeyev
9666bae1bc
Fix gcc11 warnings 2021-07-18 19:09:12 +03:00
Andrei Alexeyev
659ed15e43
Fix some issues found by clang static analysis 2021-06-18 16:11:00 +03:00
Andrei Alexeyev
2957647c5f
MarisaA: fix deprecations 2021-02-22 01:03:37 +02:00
Andrei Alexeyev
5ea73999ef
projectile: deprecate .rule and .args in ProjArgs 2021-02-20 01:47:20 +02:00
Andrei Alexeyev
929987da41
reduce out-of-bounds lifetime of player bullets 2021-02-18 20:13:06 +02:00
Andrei Alexeyev
f25c88942a
projectile: add collision info interception via events
See comment in projectile.h for details
2021-02-18 20:07:52 +02:00
Andrei Alexeyev
3f550e75c5
Sexier bullet flares 2020-11-05 10:18:19 +02: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
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
54ca97587c
Rename cmplx32 into cmplxf for better consistency 2020-05-09 09:31:20 +03:00
Andrei Alexeyev
bd5082c0f0
Get rid of float32 and float64 typedefs
Use plain float and double when precision matters. There's no way to
consistently enforce usage of the typedefs now.
2020-05-09 09:25:38 +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
eceecaf0c3
"fix" projectile collision effect 2020-04-17 19:31:37 +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
e9085a7a4d
add PFLAG_INDESTRUCTIBLE and PFLAG_NOAUTOREMOVE 2020-04-08 08:39:45 +03:00
Andrei Alexeyev
0d08042c39
Add angle_delta projectile property
for spinning in PFLAG_MANUALANGLE mode, or angle offset in auto-angle mode
2020-03-08 17:13:09 +02:00
Andrei Alexeyev
a9604b1109
some sprite batching optimizations 2020-03-05 21:14:31 +02:00
Andrei Alexeyev
ebb509d80d
fix petal_explosion 2020-03-04 22:26:55 +02:00
Andrei Alexeyev
62e39e7a40
add "cleared" event to projectiles 2020-03-04 22:26:52 +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
a1177bb817
remove DeathShrink 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
be5ee1900d
replace remaining Fade usage in non-stage code 2020-03-04 22:26:46 +02:00
Andrei Alexeyev
3259a844fa
new bullet clear effect 2020-03-04 22:26:45 +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
5c6b7671ef
fixup some post-rebase chaos 2020-03-04 22:26:45 +02:00