49d0d54a2e
* 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
220 lines
6.1 KiB
C
220 lines
6.1 KiB
C
|
|
// Sets up the predefined hashtable types.
|
|
// Add more as necessary.
|
|
|
|
#ifdef HT_IMPL
|
|
#define _HT_IMPL
|
|
#endif
|
|
|
|
#ifdef HT_DECL
|
|
#define _HT_DECL
|
|
#endif
|
|
|
|
/*
|
|
* str2ptr
|
|
*
|
|
* Maps strings to void pointers.
|
|
*/
|
|
#define HT_SUFFIX str2ptr
|
|
#define HT_KEY_TYPE char*
|
|
#define HT_VALUE_TYPE void*
|
|
#define HT_FUNC_FREE_KEY(key) free(key)
|
|
#define HT_FUNC_KEYS_EQUAL(key1, key2) (!strcmp(key1, key2))
|
|
#define HT_FUNC_HASH_KEY(key) htutil_hashfunc_string(0, key)
|
|
#define HT_FUNC_COPY_KEY(dst, src) (*(dst) = strdup(src))
|
|
#define HT_KEY_CONST
|
|
#define HT_VALUE_CONST
|
|
#include "hashtable_incproxy.inc.h"
|
|
|
|
/*
|
|
* str2ptr_ts
|
|
*
|
|
* Maps strings to void pointers (thread-safe).
|
|
*/
|
|
#define HT_SUFFIX str2ptr_ts
|
|
#define HT_KEY_TYPE char*
|
|
#define HT_VALUE_TYPE void*
|
|
#define HT_FUNC_FREE_KEY(key) free(key)
|
|
#define HT_FUNC_KEYS_EQUAL(key1, key2) (!strcmp(key1, key2))
|
|
#define HT_FUNC_HASH_KEY(key) htutil_hashfunc_string(0, key)
|
|
#define HT_FUNC_COPY_KEY(dst, src) (*(dst) = strdup(src))
|
|
#define HT_KEY_CONST
|
|
#define HT_VALUE_CONST
|
|
#define HT_THREAD_SAFE
|
|
#include "hashtable_incproxy.inc.h"
|
|
|
|
/*
|
|
* str2int
|
|
*
|
|
* Maps strings to 64-bit integers.
|
|
*/
|
|
#define HT_SUFFIX str2int
|
|
#define HT_KEY_TYPE char*
|
|
#define HT_VALUE_TYPE int64_t
|
|
#define HT_FUNC_FREE_KEY(key) free(key)
|
|
#define HT_FUNC_KEYS_EQUAL(key1, key2) (!strcmp(key1, key2))
|
|
#define HT_FUNC_HASH_KEY(key) htutil_hashfunc_string(0, key)
|
|
#define HT_FUNC_COPY_KEY(dst, src) (*(dst) = strdup(src))
|
|
#define HT_KEY_CONST
|
|
#include "hashtable_incproxy.inc.h"
|
|
|
|
/*
|
|
* str2int_ts
|
|
*
|
|
* Maps strings to 64-bit integers.
|
|
*/
|
|
#define HT_SUFFIX str2int_ts
|
|
#define HT_KEY_TYPE char*
|
|
#define HT_VALUE_TYPE int64_t
|
|
#define HT_FUNC_FREE_KEY(key) free(key)
|
|
#define HT_FUNC_KEYS_EQUAL(key1, key2) (!strcmp(key1, key2))
|
|
#define HT_FUNC_HASH_KEY(key) htutil_hashfunc_string(0, key)
|
|
#define HT_FUNC_COPY_KEY(dst, src) (*(dst) = strdup(src))
|
|
#define HT_KEY_CONST
|
|
#define HT_THREAD_SAFE
|
|
#include "hashtable_incproxy.inc.h"
|
|
|
|
/*
|
|
* int2int
|
|
*
|
|
* Maps 64-bit integers to 64-bit integers.
|
|
*/
|
|
#define HT_SUFFIX int2int
|
|
#define HT_KEY_TYPE int64_t
|
|
#define HT_VALUE_TYPE int64_t
|
|
#define HT_FUNC_HASH_KEY(key) htutil_hashfunc_uint64((uint64_t)(key))
|
|
#include "hashtable_incproxy.inc.h"
|
|
|
|
/*
|
|
* int2int_ts
|
|
*
|
|
* Maps 64-bit integers to 64-bit integers (thread-safe).
|
|
*/
|
|
#define HT_SUFFIX int2int_ts
|
|
#define HT_KEY_TYPE int64_t
|
|
#define HT_VALUE_TYPE int64_t
|
|
#define HT_FUNC_HASH_KEY(key) htutil_hashfunc_uint64((uint64_t)(key))
|
|
#define HT_THREAD_SAFE
|
|
#include "hashtable_incproxy.inc.h"
|
|
|
|
/*
|
|
* ptr2int
|
|
*
|
|
* Maps pointers to 64-bit integers.
|
|
*/
|
|
#define HT_SUFFIX ptr2int
|
|
#define HT_KEY_TYPE void*
|
|
#define HT_VALUE_TYPE int64_t
|
|
#define HT_FUNC_HASH_KEY(key) htutil_hashfunc_uint64((uintptr_t)(key))
|
|
#define HT_FUNC_COPY_KEY(dst, src) (*(dst) = (void*)(src))
|
|
#define HT_KEY_CONST
|
|
#include "hashtable_incproxy.inc.h"
|
|
|
|
/*
|
|
* ptr2int_ts
|
|
*
|
|
* Maps pointers to 64-bit integers (thread-safe).
|
|
*/
|
|
#define HT_SUFFIX ptr2int_ts
|
|
#define HT_KEY_TYPE void*
|
|
#define HT_VALUE_TYPE int64_t
|
|
#define HT_FUNC_HASH_KEY(key) htutil_hashfunc_uint64((uintptr_t)(key))
|
|
#define HT_FUNC_COPY_KEY(dst, src) (*(dst) = (void*)(src))
|
|
#define HT_KEY_CONST
|
|
#define HT_THREAD_SAFE
|
|
#include "hashtable_incproxy.inc.h"
|
|
|
|
/*
|
|
* C11 generic selection witchcraft.
|
|
*/
|
|
|
|
#define _HT_GENERIC_MAP(suffix, name) ht_##suffix##_t : ht_##suffix##_##name
|
|
|
|
// Add all the non-thread-safe types here.
|
|
#define _HT_GENERICLIST_NONTS(name) \
|
|
_HT_GENERIC_MAP(str2ptr, name), \
|
|
_HT_GENERIC_MAP(str2int, name), \
|
|
_HT_GENERIC_MAP(int2int, name), \
|
|
_HT_GENERIC_MAP(ptr2int, name)
|
|
|
|
// Add all the thread-safe types here.
|
|
#define _HT_GENERICLIST_TS(name) \
|
|
_HT_GENERIC_MAP(str2ptr_ts, name), \
|
|
_HT_GENERIC_MAP(str2int_ts, name), \
|
|
_HT_GENERIC_MAP(int2int_ts, name), \
|
|
_HT_GENERIC_MAP(ptr2int_ts, name)
|
|
|
|
#define _HT_GENERIC(ht_expr, name) (_Generic((ht_expr), \
|
|
_HT_GENERICLIST_NONTS(name), \
|
|
_HT_GENERICLIST_TS(name) \
|
|
))
|
|
|
|
#define _HT_GENERIC_TS(ht_expr, name) (_Generic((ht_expr), \
|
|
_HT_GENERICLIST_TS(name) \
|
|
))
|
|
|
|
/*
|
|
* Type-generic wrappers around the core API.
|
|
*
|
|
* For the core API documentation, see hashtable.inc.h
|
|
*
|
|
* To find documentation about a macro called "ht_foo", search hashtable.inc.h
|
|
* for "ht_XXX_foo" (the XXX is literal).
|
|
*/
|
|
|
|
#define ht_create(ht) \
|
|
_HT_GENERIC(*(ht), create) (ht)
|
|
|
|
#define ht_destroy(ht) \
|
|
_HT_GENERIC(*(ht), destroy) (ht)
|
|
|
|
#define ht_lock(ht) \
|
|
_HT_GENERIC_TS(*(ht), lock) (ht)
|
|
|
|
#define ht_unlock(ht) \
|
|
_HT_GENERIC(*(ht), unlock) (ht)
|
|
|
|
#define ht_get(ht, key, default) \
|
|
_HT_GENERIC(*(ht), get) (ht, key, default)
|
|
|
|
#define ht_get_unsafe(ht, key, default) \
|
|
_HT_GENERIC_TS(*(ht), get_unsafe) (ht, key, default)
|
|
|
|
#define ht_lookup(ht, key, out_value) \
|
|
_HT_GENERIC(*(ht), lookup) (ht, key, out_value)
|
|
|
|
#define ht_lookup_unsafe(ht, key, out_value) \
|
|
_HT_GENERIC_TS(*(ht), lookup_unsafe) (ht, key, out_value)
|
|
|
|
#define ht_set(ht, key, value) \
|
|
_HT_GENERIC(*(ht), set) (ht, key, value)
|
|
|
|
#define ht_try_set(ht, key, value, value_transform, out_value) \
|
|
_HT_GENERIC(*(ht), try_set) (ht, key, value, value_transform, out_value)
|
|
|
|
#define ht_unset(ht, key) \
|
|
_HT_GENERIC(*(ht), unset) (ht, key)
|
|
|
|
#define ht_unset_list(ht, keylist) \
|
|
_HT_GENERIC(*(ht), unset_list) (ht, keylist)
|
|
|
|
#define ht_unset_all(ht) \
|
|
_HT_GENERIC(*(ht), unset_all) (ht)
|
|
|
|
#define ht_foreach(ht, callback, arg) \
|
|
_HT_GENERIC(*(ht), foreach) (ht, callback, arg)
|
|
|
|
#define ht_iter_begin(ht, iter) \
|
|
_HT_GENERIC(*(ht), iter_begin) (ht, iter)
|
|
|
|
#define ht_iter_next(iter) \
|
|
_HT_GENERIC(*((iter)->hashtable), iter_next) (iter)
|
|
|
|
#define ht_iter_end(iter) \
|
|
_HT_GENERIC(*((iter)->hashtable), iter_end) (iter)
|
|
|
|
/*
|
|
* Cleanup
|
|
*/
|
|
#undef _HT_IMPL
|
|
#undef _HT_DECL
|