Commit graph

16 commits

Author SHA1 Message Date
Andrei Alexeyev
fda8556a39
src: deprecate strdup(), use mem_strdup() explicitly
This fixes a nasty bug that manifests on windows when building without
precompiled headers. util/stringops.h used to silently replace strdup
with a macro that's compatible with mem_free(). This header would
typically be included everywhere due to PCH, but without it the strdup
from libc would sometimes be in scope. On most platforms mem_free() is
equivalent to free(), but not on windows, because we have to use
_aligned_free() there. Attempting to mem_free() the result of a libc
strdup() would segfault in such a configuration.

Avoid the footgun by banning strdup() entirely. Maybe redefining libc
names isn't such a great idea, who knew?
2024-09-10 14:31:55 +02:00
Andrei Alexeyev
be7905d6a3
src: run upkeep 2024-05-17 04:58:47 +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
laochailan
6bacf32c51
stageinfo: rename stages 1 to 3 2023-06-13 04:11:09 +02:00
Andrei Alexeyev
830cc7d5c4
stages/corotest: remove 2023-02-24 05:37:58 +01:00
Andrei Alexeyev
558541e2cc
stage3: Major redesign of the stage (WIP)
Still needs work, but good enough for now.

Merges #203

Squashed commit of the following:

commit 7f30ef2393
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Fri Jan 27 23:50:42 2023 +0100

    stageinfo: finally rename stage3

commit 53ca691e68
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Fri Jan 27 23:38:36 2023 +0100

    stage3: telegraph moonlight rockets

commit 4d247877e7
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Wed Jan 18 15:54:44 2023 +0100

    stage3: moonlight rocket fixes

commit 684a167611
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Wed Jan 18 14:50:48 2023 +0100

    stage3: update background

commit bed836f56c
Author: laochailan <laochailan@web.de>
Date:   Sat Jan 7 19:52:51 2023 -0500

    stage3: make easy mode easier

commit bec659a6eb
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Wed Dec 7 20:20:18 2022 +0100

    stage3: sprinkle some random difficulty_value() calls

commit 2090821188
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sun Nov 20 07:57:33 2022 +0100

    stage3: refactor and fix deadly dance (no design update yet)

commit 5dbdeae1dd
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sun Nov 20 07:17:05 2022 +0100

    stage3: redesign scuttle nonspell

commit 70666a4074
Author: Andrei Alexeyev <0x416b617269@gmail.com>
Date:   Mon Nov 14 01:32:11 2022 +0100

    stage3: last pre-boss section draft

commit 42bb538ff5
Author: Andrei Alexeyev <0x416b617269@gmail.com>
Date:   Mon Nov 14 01:28:32 2022 +0100

    stage3: bunch of swarm-trail fairy fixes

commit 5938783591
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sat Nov 12 01:40:23 2022 +0100

    stage3: more misery

commit 84342f1973
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Tue Nov 8 16:35:11 2022 +0100

    stage3: post-midboss up to climax

commit b40f71bbc6
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Wed Nov 2 18:43:54 2022 +0100

    stage3: experimental post-midboss pattern

commit b5710faa04
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Wed Nov 2 18:12:49 2022 +0100

    stage3: deadly dance fixes

commit f85aa25c00
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Wed Nov 2 18:08:02 2022 +0100

    stage3: first sparks of difficulty balance

commit 33b65b7fbe
Author: laochailan <laochailan@web.de>
Date:   Sun Oct 16 10:27:24 2022 -0400

    stage3: align swarm fairies

commit 2556a0de9e
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Sep 26 05:35:53 2022 +0200

    stage3: more progress on the first half

commit 86fc38255b
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sat Sep 24 04:10:57 2022 +0200

    stage3: add some swirls after superfairy

commit b0134e82c7
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sat Sep 24 04:10:11 2022 +0200

    stage3: experimental laserball fairy

commit 88d7646927
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sat Sep 24 04:09:14 2022 +0200

    stage3: tweak horde fairies

commit b97da7a9e9
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Tue Sep 13 17:08:12 2022 +0200

    stage3: wip circletwist fairy tweaks

commit ee9234a72b
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Sep 5 04:41:55 2022 +0200

    wip swirls

commit 26c7a35e04
Author: laochailan <laochailan@web.de>
Date:   Sun Jan 2 11:29:41 2022 +0100

    stage3 wip

commit d1a263223f
Author: laochailan <laochailan@web.de>
Date:   Fri Nov 12 05:57:07 2021 +0100

    wip wip wip

commit c2527b05cf
Author: laochailan <laochailan@web.de>
Date:   Thu Sep 30 20:38:38 2021 +0200

    stage3 redesign: some first prototypes

commit 0c2855e3ca
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Thu May 6 21:59:48 2021 +0300

    stage3: some preliminary fixes

commit fddf314db9
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sun Feb 28 07:36:04 2021 +0200

    stage3: port rest of night ignite

commit 1cd84d7834
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sat Feb 27 04:50:46 2021 +0200

    stage3: port night ignite slaves

commit cb991be703
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Sat Feb 27 04:26:26 2021 +0200

    stage3: finish porting firefly storm

commit 0fb9733829
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Wed Jun 23 02:44:14 2021 +0300

    stage3: partial firefly storm port

commit ba174893a0
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Tue Feb 23 02:28:13 2021 +0200

    stage3: enable all wriggle attacks

commit 03e1dd8078
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Tue Feb 23 02:22:35 2021 +0200

    stage3: port wriggle nons

commit 3308255579
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 22 16:27:50 2021 +0200

    stage3: fix some indent issues

commit b1c1115d7f
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 22 16:23:07 2021 +0200

    stage3: fix deprecations in moonlight rocket

commit 990489e960
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Thu Feb 4 08:53:00 2021 +0200

    stage3: port moonlight rocket

commit 859592a89b
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Thu Feb 4 07:31:58 2021 +0200

    stage3: basic port of wriggle slaves

commit b88b4f5249
Author: Andrei Alexeyev <akari@taisei-project.org>
Date:   Mon Feb 1 06:28:30 2021 +0200

    stage3: port Light Singularity

commit db6bb13326
Author: Alice D <34408664+StarWitch@users.noreply.github.com>
Date:   Wed Mar 18 23:25:25 2020 -0400

    stage3: preliminary coroutinization (#197)

    * first enemy of Stage 3 converted

    * review suggestions

    * add interval for burst_swirls

    * mid-commit

    * fairy group (second spawned enemies)

    * forgot to use my own variable

    * comment changes

    * better understanding of second arg of create_enemy*

    * fix subtasks (wasn't using them the correct way)

    * swirls that go from one side to the other

    * burst fairies complete

    * all complete up until midboss (stage 3 coroutines)

    * remove sub-rule for projectiles in charge_fairy

    * entire stage on coroutines now (boss spellcards missing)

    * rip out more old/dead code, make file better organized

    * timing changes

    * remove old background (looks jank now with new timing)

    * PR review changes

    * slight readability changes

    * Scuttle lethal_bite implemented

    * PR changes (ignore wriggle, she's still a WIP)

    * revert Info.plist entry (for separate PR)

    * finish(?) Scuttle's deadly dance, plus some PR changes

Co-authored-by: Alice D <34408664+StarWitch@users.noreply.github.com>
Co-authored-by: Lukas Weber <laochailan@web.de>
2023-01-27 23:57:12 +01:00
Andrei Alexeyev
b6978178b1
memory: use custom memory allocation wrappers
Introduces wrappers around memory allocation functions in `memory.h`
that should be used instead of the standard C ones.

These never return NULL and, with the exception of `mem_realloc()`,
zero-initialize the allocated memory like `calloc()` does.

All allocations made with the memory.h API must be deallocated with
`mem_free()`. Although standard `free()` will work on some platforms,
it's not portable (currently it won't work on Windows). Likewise,
`mem_free()` must not be used to free foreign allocations.

The standard C allocation functions are now diagnosed as deprecated.
They are, however, available with the `libc_` prefix in case interfacing
with foreign APIs is required. So far they are only used to implement
`memory.h`.

Perhaps the most important change is the introduction of the `ALLOC()`,
`ALLOC_ARRAY()`, and `ALLOC_FLEX()` macros. They take a type as a
parameter, and allocate enough memory with the correct alignment for
that type. That includes overaligned types as well. In most
circumstances you should prefer to use these macros. See the `memory.h`
header for some usage examples.
2023-01-18 13:23:22 +01:00
Andrei Alexeyev
dcb630b37d
stageinfo,stage: implement stage hot-reloading
POSIX platforms only. Must be enabled via -Dstages_live_reload=true.
2022-02-05 17:58:42 +02:00
Andrei Alexeyev
ad9228e0a0
stage3: restructure into a folder-based layout
It's an absolute mess, but should make integrating stage3_revamp easier…
2021-07-10 03:24:07 +03:00
Lukas Weber
b4a870e660
stage4: new PBR background, modernize structure 2020-12-26 02:18:19 +02:00
Alice D
8f515e0f38
Stage 5 Restructure (#247)
* initial commit (basic structure, does not compile)

* it compiles now

* moving some stuff around

* move spells/nonspells over to their own files, and retab the whole directory

* retab meson file (oops)

* newline shuffling

* clean up some imports, move functions to spellcards

* Update src/stages/stage5/background_anim.c

Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>

* Apply suggestions from code review

Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>

* code review changes

* change cloud_common to spawn_cloud

* move explosion survival to spells

* add missing timeline imports (oops)

* add missing comma

Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>
2020-08-29 02:09:10 +03:00
Alice D
8f3b3fa0bc
Stage 6 Restructure (#248)
* basic stage 6 structure (nothing here yet)

* it compiles and runs (needs testing)

* reindent

* missing import

* fix baryons

* import cleanups

* moving spells from elly.c to their spellcard sources

* code review changes, and some additional cleanup

* more PR changes, removing more dead code

* clean up some imports, move functions to spellcards

* remove dual initalization
2020-08-28 09:08:30 +03:00
Andrei Alexeyev
f899370fa6
Restructure stage 2 into multiple files
Cherry-pick from #229 (ba2187f54fdb1fb43846f85c8cddcf920932e3c7)
2020-08-25 05:03:00 +03:00
Andrei Alexeyev
db9cb15d21
Split stage1 into multiple files (#228) 2020-05-18 22:44:11 +03:00
Andrei Alexeyev
bd7bb3a351
fix segfault 2020-05-17 19:19:55 +03:00
Andrei Alexeyev
00e4837827
Separate StageInfo-related APIs from game-stage code (#227) 2020-05-16 23:41:54 +03:00