Commit graph

44 commits

Author SHA1 Message Date
Andrei Alexeyev
a8322f5e1d
util/rectpack: refactor to use standard mempools 2024-06-05 23:53:30 +02:00
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
13ace0e5c0
memory/mempool: refactor to avoid storing object size and alignment in struct
Works similarly to DYNAMMIC_ARRAY(type)
2024-06-05 21:16:02 +02:00
Andrei Alexeyev
05168ac2d7
memory/mempool: rename from objectpool 2024-06-05 18:35:08 +02:00
Andrei Alexeyev
149a261389
lasers: handle lasers that only have a single point 2024-05-22 16:25:19 +02:00
Andrei Alexeyev
8189f8daa6
lasers: improve degenerate sample rejection during quantization
Fixes some issues with curves that have degenerate samples at the start,
and is more efficient for curves with lots of degenerate samples in
general.
2024-05-19 06:54:30 +02:00
Andrei Alexeyev
8b37d1cbf2
src: the great #include massacre of 2024 2024-05-17 14:11:48 +02:00
Andrei Alexeyev
be7905d6a3
src: run upkeep 2024-05-17 04:58:47 +02:00
Andrei Alexeyev
84a909bc8c
lasers: remove legacy compat glue 2024-05-15 21:55:42 +02:00
Andrei Alexeyev
4072d31ffa
lasers/rules: make create_dynamic_laser return MoveParams* in an out-parameter
No need to mess with LaserRuleDynamicData and LaserRuleDynamicTaskData
2024-05-10 01:31:39 +02:00
Andrei Alexeyev
07a0bdf558
lasers: compute segment visibility correctly
The previous naive check had some false negatives
2024-05-09 05:11:17 +02:00
Andrei Alexeyev
e518c7a87d
lasers: support lasers with abrupt angle changes
This requires some look-ahead, so quantize_lasers will now compute all
samples ahead of time before starting to build segments. The samples are
held in a global dynamic array to minimize reallocations.
2024-05-09 05:11:17 +02:00
Andrei Alexeyev
92183e7655
lasers: try to change the quantization sampling step as little as possible 2024-05-08 23:10:23 +02:00
Andrei Alexeyev
be7ccec5c9
lasers: add an experimental "dynamic" laser rule 2024-04-23 17:38:21 +02:00
Andrei Alexeyev
daa1b38987
lasers: prototype a better interface for position rules 2024-04-23 17:38:21 +02:00
Andrei Alexeyev
94e4d041d4
lasers: fix time values written by quantize_laser() 2024-04-11 17:38:31 +02:00
Andrei Alexeyev
f3cea8b614
lasers: greatly reduce number of quantization samples for simple laserlines 2024-04-04 04:45:33 +02:00
Andrei Alexeyev
b19054f3f3
lasers: fix off-by-one errors in quantization; adjust width calculation
The width is now calculated relative to the maximum laser timespan
instead of the number of considered samples. This makes collapsing
lasers look a bit nicer.
2024-04-04 04:45:33 +02:00
Andrei Alexeyev
e7dfffa3a8
lasers/draw: sort before packing and allow rotation in sdf texture
Slightly improves packing efficiency
2024-03-21 23:33:57 +01: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
ef92ee12fc
laser,move,projectile: annotate hot paths 2023-09-28 17:43:14 +02:00
Andrei Alexeyev
b2df4e34db
lasers: irrelevant quantize_laser optimizations 2023-09-28 17:43:14 +02:00
Andrei Alexeyev
c15934f666
dynarray: get rid of memset and add optional initializer arg to dynarray_append 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
d84771dc03
laser: prevent potential replay desync 2023-06-20 05:27:12 +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
ef762dc48b
lasers: fancier clear effects 2023-04-28 22:48:41 +02:00
Andrei Alexeyev
b264e5aa91
lasers: add laser_trace() function
Walks the visible laser segments with a fixed distance step, calling the
trace callback function for each step.
2023-04-28 22:48:41 +02:00
Andrei Alexeyev
58ee2cbf6f
lasers: s/double/real and use cdir in shape functions 2023-04-12 06:58:55 +02:00
Andrei Alexeyev
7d8e16037f
lasers: remove las_weird_sine 2023-04-12 06:58:55 +02:00
Andrei Alexeyev
3dc0faec9e
renderer/api: rename ClearBufferFlags to BufferKindFlags 2023-04-10 06:47:55 +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
66e5a886f0
lasers: implement rect packing for SDF texture 2023-04-03 01:53:36 +02:00
Andrei Alexeyev
b33bc192bf
lasers: optimize and simplify draw code (WIP)
There's an issue where partially out of bounds lasers will step over
neighbouring tiles, causing artifacts. Should be solved with a packing
algorithm.
2023-04-03 01:53:36 +02:00
Andrei Alexeyev
ff4212e72a
lasers: remove logic rules 2023-02-26 15:40:41 +01:00
Andrei Alexeyev
3171a674e6
laser: add helper functions for setting linear laser params 2023-02-20 23:03:55 +01:00
Andrei Alexeyev
085d7d7c8d
laser: fix -Wconversion warnings 2023-02-16 17:38:47 +01:00
Andrei Alexeyev
228b782d00
laser: remove unused shader field 2023-02-07 12:21:33 +01:00
Lukas Weber
efa8e0b126
stage6: port to coroutine system (WIP)
Closes #323

Mostly faithful to the original with a few changes. Needs a design
iteration.

Squashed commit of the following:

commit 17232ad797
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 6 07:14:12 2023 +0100

    stage6: fix uninitialized variable

commit 46f7345d00
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 6 06:57:10 2023 +0100

    stage6: fix warnings

commit 2c5ebc1f6c
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 6 06:49:07 2023 +0100

    stage6: fix ricci grace period

commit f43e1069d5
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 6 06:48:56 2023 +0100

    stage6: formatting (ricci)

commit d6c21a7e45
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 6 06:38:41 2023 +0100

    stage6: remove dead code

commit 8cc8bc3358
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 6 06:38:27 2023 +0100

    stage6: fix spell practice background

commit 555feafccf
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 6 01:59:43 2023 +0100

    stage6: adjust elly's pre-ToE movement

commit c0e71ccf92
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 6 01:55:58 2023 +0100

    stage6: enable pre-ToE dialogue

commit 0902897b5a
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 6 01:24:49 2023 +0100

    stage6: fix spell practice

commit b4bd0c5902
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 6 01:24:33 2023 +0100

    stage6: fix broglie issues

commit 115c90273f
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sun Feb 5 03:49:00 2023 +0100

    stage6: formatting

commit f0b564a290
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sun Feb 5 03:47:16 2023 +0100

    stage6: fix a bunch of scythe-related issues

commit 8fcfb57080
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sun Feb 5 03:47:46 2023 +0100

    stage6: define MAX_BARYON_PARTICLES

commit ff68532f9f
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sat Feb 4 07:00:50 2023 +0100

    stage6: reset baryon target pos after attack

commit bb49d60a79
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sat Feb 4 06:32:55 2023 +0100

    stage6: more optimal draw order for baryon effect

commit 3230d378c1
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sat Feb 4 06:19:00 2023 +0100

    stage6: port baryon background effect

commit bf3df74eda
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sat Feb 4 04:35:49 2023 +0100

    stage6: fix scythe and baryon visuals not spinning

commit 2492711a00
Author: Alice D <alice@starwitch.productions>
Date:   Sat Feb 12 18:38:55 2022 -0500

    fix merge and compile issues, make stage end correctly

commit 4b04855932
Author: laochailan <laochailan@web.de>
Date:   Sat Sep 25 08:40:47 2021 +0200

    kepler: remove shadowing

commit 657345cce6
Author: laochailan <laochailan@web.de>
Date:   Sat Sep 25 08:39:24 2021 +0200

    move and rename scythe_nonspell_common task

commit 6a58fea718
Author: laochailan <laochailan@web.de>
Date:   Sat Sep 25 08:34:33 2021 +0200

    solve strange bug

commit 54df567170
Author: laochailan <laochailan@web.de>
Date:   Sat Sep 25 08:21:36 2021 +0200

    trigger weird bug in collision code by accident

commit 0bd3ceb9ac
Author: laochailan <laochailan@web.de>
Date:   Sat Sep 25 08:06:08 2021 +0200

    scythe and baryon logic loose ends

commit b4596a773e
Author: laochailan <laochailan@web.de>
Date:   Fri Sep 24 18:01:45 2021 +0200

    toe port

commit bc9137393c
Author: laochailan <laochailan@web.de>
Date:   Fri Sep 24 16:23:29 2021 +0200

    wip toe port: pretty much all but the lasers

commit 60fd678d63
Author: laochailan <laochailan@web.de>
Date:   Thu Sep 23 20:37:32 2021 +0200

    wip toe port (only top level)

commit e14a35ed05
Author: laochailan <laochailan@web.de>
Date:   Thu Sep 23 17:04:18 2021 +0200

    forgotten port

commit 0cb56aee4c
Author: laochailan <laochailan@web.de>
Date:   Thu Sep 23 14:34:51 2021 +0200

    baryons_explode port

commit c589a79bbf
Author: laochailan <laochailan@web.de>
Date:   Thu Sep 23 09:04:01 2021 +0200

    nonspell 5 port

commit aac688112f
Author: laochailan <laochailan@web.de>
Date:   Thu Sep 23 08:46:27 2021 +0200

    ricci: remove obsolete commandments

commit 146d591b4c
Author: laochailan <laochailan@web.de>
Date:   Thu Sep 23 08:43:29 2021 +0200

    lhc port

commit 2146ca342d
Author: laochailan <laochailan@web.de>
Date:   Wed Sep 22 22:00:39 2021 +0200

    broglie: implement Akari comments

commit 0222c67f60
Author: laochailan <laochailan@web.de>
Date:   Wed Sep 22 20:24:58 2021 +0200

    make ricci thicc

commit a04f122e99
Author: laochailan <laochailan@web.de>
Date:   Wed Sep 22 20:12:13 2021 +0200

    fix ricci timing and improve laser looks

commit d3330ecd21
Author: laochailan <laochailan@web.de>
Date:   Wed Sep 22 18:19:29 2021 +0200

    wip: ricci but timing still wrong

commit 6c2129607a
Author: laochailan <laochailan@web.de>
Date:   Wed Sep 22 16:53:42 2021 +0200

    wip: ricci

commit 96d6e4499c
Author: laochailan <laochailan@web.de>
Date:   Wed Sep 22 16:53:09 2021 +0200

    make circle laser turn speed rad/frame

commit d943e7ab88
Author: laochailan <laochailan@web.de>
Date:   Wed Sep 22 16:52:27 2021 +0200

    remove smoothreclamp

commit 7fbcd8fb43
Author: laochailan <laochailan@web.de>
Date:   Wed Sep 22 12:17:36 2021 +0200

    remove unused code

commit a6c8979107
Author: laochailan <laochailan@web.de>
Date:   Wed Sep 22 12:16:06 2021 +0200

    modernize broglie sign

commit 278bd104d3
Author: laochailan <laochailan@web.de>
Date:   Wed Sep 1 19:54:00 2021 +0200

    first baryon non

commit 20a7193de3
Author: laochailan <laochailan@web.de>
Date:   Tue Aug 31 22:03:54 2021 +0200

    elly eigenstate

commit c64ae7c792
Author: laochailan <laochailan@web.de>
Date:   Sat Aug 28 21:52:09 2021 +0200

    elly until baryons spawn

commit 3d1a1eae9c
Author: laochailan <laochailan@web.de>
Date:   Sun Aug 22 14:54:02 2021 +0200

    add double version of common_easing_animate

commit 16e6d51851
Author: laochailan <laochailan@web.de>
Date:   Sat Aug 7 21:52:58 2021 +0200

    kepler sign + tweaks

commit c460627e41
Author: laochailan <laochailan@web.de>
Date:   Thu Aug 5 20:31:15 2021 +0200

    newton difficulty scaling

commit be97924a53
Author: laochailan <laochailan@web.de>
Date:   Wed Aug 4 22:06:30 2021 +0200

    newton sign redesign

commit 20a4f3b4c7
Author: laochailan <laochailan@web.de>
Date:   Mon Aug 2 08:51:36 2021 +0200

    first elly non wip

commit a2a5fb6ada
Author: laochailan <laochailan@web.de>
Date:   Mon Jul 26 20:23:09 2021 +0200

    scythe wip

commit ae0eeec1ad
Author: laochailan <laochailan@web.de>
Date:   Mon Jul 26 18:16:59 2021 +0200

    scythe wip

commit f215d330d9
Author: laochailan <laochailan@web.de>
Date:   Fri Jul 23 22:18:51 2021 +0200

    wip entity scythe

commit 66ccf18c63
Author: laochailan <laochailan@web.de>
Date:   Sun May 9 14:33:02 2021 +0200

    wip spawn elly

commit c947f0c3f9
Author: laochailan <laochailan@web.de>
Date:   Thu May 6 07:30:53 2021 +0200

    modernize scythe mid

commit bfae46ed24
Author: laochailan <laochailan@web.de>
Date:   Sun May 2 18:15:45 2021 +0200

    more or less port flowermine fairy

commit 98370ed44b
Author: laochailan <laochailan@web.de>
Date:   Sun May 2 15:42:49 2021 +0200

    modernized side fairy

commit ece28c70f0
Author: laochailan <laochailan@web.de>
Date:   Sun May 2 15:14:08 2021 +0200

    modernize hacker fairy

Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>
Co-authored-by: Alice D <alice@starwitch.productions>
2023-02-06 07:41:10 +01:00
Andrei Alexeyev
c668e2e48c
lasers: process_lasers() loop fixes
Split the loop in two parts: first delete expired lasers, quantize, and
force-clear if the stage is over. Then apply either clear effects or
collision and the deprecated logic rule function.

The split is necessary because ent_damage() may wake up arbitrary
coroutines which may try to poke at laser segment data. We must ensure
all lasers have it initialized at this point.

Fixes #334
2022-01-27 09:00:10 +02:00
Andrei Alexeyev
8d2ee76710
replace include guards with #pragma once 2021-08-31 23:34:46 +03:00
Andrei Alexeyev
1ae8811bc4
lasers: improve collision; move to lasers/
Moved quantization out of the draw code. The laser is now quantized once
per frame, and the segment data is used for both collisions and
rendering. Player motion is now accounted for as well, preventing
phasing through thin lasers. The overall result is more precise *and*
faster collision detection.
2021-08-25 11:58:08 +03:00