'upkeep' target for maintenance tasks; back to include guards; happy new year!

This commit is contained in:
Andrei Alexeyev 2019-01-23 22:10:43 +02:00
parent f2e8607efe
commit 4159ea1249
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4
343 changed files with 1699 additions and 862 deletions

View file

@ -2,7 +2,7 @@
# @begin header
#
# Text inside @begin/@end blocks is autogenerated by scripts/update-glsl-sources.py.
# Text inside @begin/@end blocks is autogenerated by scripts/upkeep/update-glsl-sources.py.
# If this file starts with an @overwrite directive, then its entire contents are managed by the script.
#
# @end header

View file

@ -1,7 +1,7 @@
# @begin header
#
# Text inside @begin/@end blocks is autogenerated by scripts/update-glsl-sources.py.
# Text inside @begin/@end blocks is autogenerated by scripts/upkeep/update-glsl-sources.py.
# If this file starts with an @overwrite directive, then its entire contents are managed by the script.
#
# @end header

View file

@ -21,7 +21,6 @@ from contextlib import (
from concurrent.futures import (
ThreadPoolExecutor,
as_completed,
)
from PIL import (
@ -32,6 +31,7 @@ from taiseilib.common import (
run_main,
update_text_file,
TaiseiError,
wait_for_futures,
)
@ -321,10 +321,7 @@ def gen_atlas(overrides, src, dst, binsize, atlasname, tex_format=texture_format
futures.append(process)
# Wait for subprocesses to complete.
# The loop is needed in order to present exceptions.
for future in as_completed(futures):
future.result()
wait_for_futures(futures)
executor.shutdown(wait=True)
# Only now, if everything is ok so far, copy everything to the destination, possibly overwriting previous results

View file

@ -3,6 +3,7 @@
from taiseilib.common import (
ninja,
run_main,
wait_for_futures,
)
from concurrent.futures import (
@ -11,7 +12,8 @@ from concurrent.futures import (
from pathlib import Path
import os, sys, pprint
import os
import sys
def main(args):
@ -23,8 +25,13 @@ def main(args):
exit(1)
with ThreadPoolExecutor() as ex:
futures = []
for target in args[1:]:
ex.submit(lambda: ninja('-vC', build_dir, target))
futures.append(ex.submit(lambda: ninja('-vC', build_dir, target)))
wait_for_futures(futures)
if __name__ == '__main__':
run_main(main)

View file

@ -58,3 +58,9 @@ zip_target = run_target('zip',
gen_atlas_command = find_program('./gen-atlas.py')
gen_atlases_command = find_program('./gen-atlases.py')
upkeep_command = find_program('./upkeep.py')
upkeep_target = run_target('upkeep',
command: [upkeep_command, common_taiseilib_args],
)

View file

@ -2,7 +2,9 @@
from contextlib import contextmanager
from pathlib import Path
import os
import subprocess
import concurrent.futures
class TaiseiError(RuntimeError):
@ -39,7 +41,18 @@ def add_common_args(parser, *, depfile=False):
)
def inject_taiseilib_path():
tl = str(Path(__file__).parent.resolve())
pp = os.environ.get('PYTHONPATH', '').split(os.pathsep)
if tl not in pp:
pp.insert(0, tl)
os.environ['PYTHONPATH'] = os.pathsep.join(pp)
def run_main(func, args=None):
inject_taiseilib_path()
if args is None:
import sys
args = sys.argv
@ -98,3 +111,12 @@ def in_dir(dir):
yield
finally:
os.chdir(str(old))
def wait_for_futures(futures):
results = []
for future in concurrent.futures.as_completed(futures):
results.append(future.result())
return results

View file

@ -1,25 +0,0 @@
#!/usr/bin/env python3
import pathlib, sys, re, itertools, contextlib
header = r"""\1/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
*/
\2\4\3
#include "taisei.h"
"""
header_regex = re.compile(r'^(#if 0.*?\s#endif\s*)?(?:\s*?/\*.*?\*/)?(?:\s*?(\n#pragma once))?(?:\s*?(\n// begin before-taisei-h\s*.*?\n.*?// end before-taisei-h\n?))?(?:\s*?#include "taisei.h")?(?:\s*?(\n#pragma once))?\s*', re.MULTILINE | re.DOTALL)
if __name__ == '__main__':
for path in itertools.chain(*((pathlib.Path(__file__).parent.parent / 'src').glob(p) for p in ('**/*.[ch]', '**/*.[ch].in'))):
with contextlib.suppress(IndexError):
if path.suffixes[-2] == '.inc':
continue
path.write_text(header_regex.sub(header, path.read_text(), 1))

38
scripts/upkeep.py Executable file
View file

@ -0,0 +1,38 @@
#!/usr/bin/env python3
from taiseilib.common import (
ninja,
run_main,
add_common_args,
)
from concurrent.futures import (
ThreadPoolExecutor,
)
from pathlib import Path
import os
import sys
import subprocess
def main(args):
import argparse
parser = argparse.ArgumentParser(description='Perform all automated routine maintenance tasks.', prog=args[0])
add_common_args(parser)
pargs = parser.parse_args(args[1:])
scripts = pargs.rootdir / 'scripts' / 'upkeep'
tasks = (
'fixup-source-files',
'update-glsl-sources',
)
with ThreadPoolExecutor() as ex:
tuple(ex.map(lambda task: subprocess.check_call([scripts / f'{task}.py'] + args[1:]), tasks))
if __name__ == '__main__':
run_main(main)

View file

@ -0,0 +1,135 @@
#!/usr/bin/env python3
from taiseilib.common import (
add_common_args,
run_main,
update_text_file,
TaiseiError,
)
from concurrent.futures import (
ThreadPoolExecutor,
)
import sys
import re
import itertools
import contextlib
from pathlib import Path
# The maintenance script is actually a pile of unmaintainable regular expressions!
# What a shocking twist!
copyright_comment = r"""/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
"""
guard_prefix = 'IGUARD_'
guard_chars = 'A-Za-z0-9_'
guard_pattern = rf'{guard_prefix}[{guard_chars}]+'
comment_pattern = rf'(?:[ \t]*?//[^\n]*)?'
hash_pattern = rf'\s*?#[ \t]*'
pragma_once_pattern = rf'{hash_pattern}pragma[ \t]+once{comment_pattern}'
guard_header_pattern = rf'{hash_pattern}ifndef[ \t]+{guard_pattern}{comment_pattern}\s*?\n{hash_pattern}define\s+{guard_pattern}{comment_pattern}'
pragma_once_or_guard_header_pattern = rf'(?:\s*?(\n{pragma_once_pattern}|\n{guard_header_pattern}))?'
pre_taiseih_block_pattern = rf'// BEGIN before-taisei-h\s*.*?\n.*?// END before-taisei-h\n'
include_taiseih_pattern = rf'{hash_pattern}include[ \t]+"taisei.h"'
pragma_regex = re.compile(rf'{pragma_once_pattern}\s*?\n+(.*)\n+$', re.DOTALL)
guard_regex = re.compile(rf'\s*?\n{guard_header_pattern}\s*?\n+(.*?)\n{hash_pattern}endif{comment_pattern}\s*$', re.DOTALL)
header_regex = re.compile(rf'^(?:\s*?/\*.*?\*/)?{pragma_once_or_guard_header_pattern}(?:\s*?(\n{pre_taiseih_block_pattern}))?{pragma_once_or_guard_header_pattern}(?:\s*?{include_taiseih_pattern})?\s*', re.DOTALL)
badchar_regex = re.compile(rf'[^{guard_chars}]')
missing_guard_test_regex = re.compile(rf'^(?:\s*?/\*.*?\*/)\n(?:\n{pre_taiseih_block_pattern})?\n{include_taiseih_pattern}\n', re.DOTALL)
header_template = (
f'{copyright_comment}'
r'\1\3\2' '\n'
'#include "taisei.h"\n\n'
)
class Janitor:
def __init__(self, root):
self.root = root
self.used_guards = set()
def get_guard_name(self, path):
relpath = path.relative_to(self.root)
return f'{guard_prefix}{badchar_regex.sub("_", str(relpath))}'
def get_guard_template(self, guard):
return (
r'\n\n'
rf'#ifndef {guard}\n'
rf'#define {guard}\n\n'
r'\1\n\n'
rf'#endif // {guard}\n'
)
def transform_include_guards(self, text, path):
guard = self.get_guard_name(path)
template = self.get_guard_template(guard)
# replace #pragma once
text = pragma_regex.sub(template, text, 1)
# replace outdated guards, if any
text = guard_regex.sub(template, text, 1)
return text
def update_header(self, text):
text = header_regex.sub(header_template, text, 1)
return text
def do_maintenance(self, path):
guard = self.get_guard_name(path)
if guard in self.used_guards:
raise TaiseiError('Guard name conflict ({guard}), please fix the naming scheme')
self.used_guards.add(guard)
text = path.read_text()
text = self.update_header(text)
text = self.transform_include_guards(text, path)
if path.suffixes[-1] == '.h':
if missing_guard_test_regex.match(text):
print(f"W: {path}: header missing include guard, fixing!", file=sys.stderr)
text = text.replace('#include "taisei.h"', '#pragma once\n#include "taisei.h"')
text = self.update_header(text)
text = self.transform_include_guards(text, path)
update_text_file(path, text)
def iter_files(self):
for path in itertools.chain(*(self.root.glob(p) for p in ('**/*.[ch]', '**/*.[ch].in'))):
with contextlib.suppress(IndexError):
if path.suffixes[-2] == '.inc':
continue
yield path
def main(args):
import argparse
parser = argparse.ArgumentParser(description='Fix-up all C sources and headers - add/update copyright header, include guards, etc.', prog=args[0])
add_common_args(parser)
pargs = parser.parse_args(args[1:])
j = Janitor(pargs.rootdir / 'src')
with ThreadPoolExecutor() as ex:
tuple(ex.map(j.do_maintenance, j.iter_files()))
if __name__ == '__main__':
run_main(main)

View file

@ -33,7 +33,7 @@ endforeach
'''
header = '''#
# Text inside @begin/@end blocks is autogenerated by scripts/update-glsl-sources.py.
# Text inside @begin/@end blocks is autogenerated by scripts/upkeep/update-glsl-sources.py.
# If this file starts with an @overwrite directive, then its entire contents are managed by the script.
#'''
@ -56,17 +56,20 @@ validation_code = '''if validate_glsl
endforeach
endif'''
def make_re(token):
return re.compile(
r'(.*?# @begin {0}\s*?\n)(.*?)(# @end {0}\s*?\n.*)'.format(token),
re.DOTALL | re.MULTILINE
)
re_glsl = make_re('glsl')
re_subdirs = make_re('subdirs')
re_validate = make_re('validate')
re_header = make_re('header')
def update(args):
shaders_root = args.rootdir / 'resources' / 'shader'
subdir_map = {}

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_aniplayer_h
#define IGUARD_aniplayer_h
#include "taisei.h"
// In principle, playing an animation does not require any state, just a call to
@ -106,3 +108,5 @@ AniQueueEntry *aniplayer_queue_frames(AniPlayer *plr, const char *seqname, int m
// the rest of the game which just uses global.frames as a counter). So you
// need to call this function once per frame to make an animation move.
void aniplayer_update(AniPlayer *plr) attr_nonnull(1);
#endif // IGUARD_aniplayer_h

View file

@ -2,12 +2,16 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_assert_h
#define IGUARD_assert_h
#include "taisei.h"
// WARNING: This file intentionally shadows the standard header!
#include "util/assert.h"
#endif // IGUARD_assert_h

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_audio_h
#define IGUARD_audio_h
#include "taisei.h"
#include "resource/sfx.h"
@ -79,3 +81,5 @@ void fade_bgm(double fadetime);
void resume_bgm(void);
void save_bgm(void); // XXX: this is broken
void restore_bgm(void); // XXX: this is broken
#endif // IGUARD_audio_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_audio_mixer_h
#define IGUARD_audio_mixer_h
#include "taisei.h"
#include <SDL_mixer.h>
@ -28,3 +30,5 @@ typedef struct MixerInternalMusic {
char* audio_mixer_sound_path(const char *prefix, const char *name, bool isbgm);
bool audio_mixer_check_sound_path(const char *path, bool isbgm);
#endif // IGUARD_audio_mixer_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_boss_h
#define IGUARD_boss_h
#include "taisei.h"
#include "util.h"
@ -171,3 +173,5 @@ void boss_preload(void);
#define BOSS_DEFAULT_SPAWN_POS (VIEWPORT_W * 0.5 - I * VIEWPORT_H * 0.5)
#define BOSS_DEFAULT_GO_POS (VIEWPORT_W * 0.5 + 200.0*I)
#define BOSS_NOMOVE (-3142-39942.0*I)
#endif // IGUARD_boss_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_cli_h
#define IGUARD_cli_h
#include "taisei.h"
#include "plrmodes.h"
@ -34,3 +36,5 @@ struct CLIAction {
int cli_args(int argc, char **argv, CLIAction *a);
void free_cli_action(CLIAction *a);
#endif // IGUARD_cli_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_color_h
#define IGUARD_color_h
#include "taisei.h"
#include "util.h"
@ -85,3 +87,5 @@ bool color_equals(const Color *clr, const Color *clr2)
char* color_str(const Color *clr)
attr_nonnull(1) attr_returns_nonnull attr_nodiscard;
#endif // IGUARD_color_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_config_h
#define IGUARD_config_h
#include "taisei.h"
#include <SDL_keycode.h>
@ -222,3 +224,5 @@ void config_save(void);
int config_set_int(ConfigIndex idx, int val);
double config_set_float(ConfigIndex idx, double val);
char* config_set_str(ConfigIndex idx, const char *val) attr_nonnull(2) attr_returns_nonnull;
#endif // IGUARD_config_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,12 +2,16 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_credits_h
#define IGUARD_credits_h
#include "taisei.h"
void credits_loop(void);
void credits_preload(void);
#endif // IGUARD_credits_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_dialog_h
#define IGUARD_dialog_h
#include "taisei.h"
#include "resource/sprite.h"
@ -72,3 +74,5 @@ typedef struct PlayerDialogProcs {
void (*stage6_pre_boss)(Dialog *d);
void (*stage6_pre_final)(Dialog *d);
} PlayerDialogProcs;
#endif // IGUARD_dialog_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,13 +2,17 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_dialog_marisa_h
#define IGUARD_dialog_marisa_h
#include "taisei.h"
#include "dialog.h"
extern PlayerDialogProcs dialog_marisa;
#endif // IGUARD_dialog_marisa_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,13 +2,17 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_dialog_reimu_h
#define IGUARD_dialog_reimu_h
#include "taisei.h"
#include "dialog.h"
extern PlayerDialogProcs dialog_reimu;
#endif // IGUARD_dialog_reimu_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,13 +2,17 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_dialog_youmu_h
#define IGUARD_dialog_youmu_h
#include "taisei.h"
#include "dialog.h"
extern PlayerDialogProcs dialog_youmu;
#endif // IGUARD_dialog_youmu_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_difficulty_h
#define IGUARD_difficulty_h
#include "taisei.h"
#include "color.h"
@ -32,3 +34,5 @@ const Color* difficulty_color(Difficulty diff)
attr_pure attr_returns_nonnull;
void difficulty_preload(void);
#endif // IGUARD_difficulty_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_ending_h
#define IGUARD_ending_h
#include "taisei.h"
#include "resource/texture.h"
@ -69,3 +71,5 @@ void bad_ending_reimu(Ending *e);
void good_ending_marisa(Ending *e);
void good_ending_youmu(Ending *e);
void good_ending_reimu(Ending *e);
#endif // IGUARD_ending_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_enemy_h
#define IGUARD_enemy_h
#include "taisei.h"
#include "util.h"
@ -86,3 +88,5 @@ void BigFairy(Enemy*, int t, bool render);
int enemy_flare(Projectile *p, int t);
void enemies_preload(void);
#endif // IGUARD_enemy_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_entity_h
#define IGUARD_entity_h
#include "taisei.h"
#include "objectpool.h"
@ -141,3 +143,5 @@ void ent_hook_pre_draw(EntityDrawHookCallback callback, void *arg);
void ent_unhook_pre_draw(EntityDrawHookCallback callback);
void ent_hook_post_draw(EntityDrawHookCallback callback, void *arg);
void ent_unhook_post_draw(EntityDrawHookCallback callback);
#endif // IGUARD_entity_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_events_h
#define IGUARD_events_h
#include "taisei.h"
#include "util.h"
@ -109,3 +111,5 @@ void events_register_handler(EventHandler *handler);
void events_unregister_handler(EventHandlerProc proc);
void events_poll(EventHandler *handlers, EventFlags flags);
void events_emit(TaiseiEvent type, int32_t code, void *data1, void *data2);
#endif // IGUARD_events_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_framerate_h
#define IGUARD_framerate_h
#include "taisei.h"
#include "hirestime.h"
@ -34,3 +36,5 @@ uint32_t get_effective_frameskip(void);
void loop_at_fps(LogicFrameFunc logic_frame, RenderFrameFunc render_frame, void *arg, uint32_t fps);
void fpscounter_reset(FPSCounter *fps);
void fpscounter_update(FPSCounter *fps);
#endif // IGUARD_framerate_h

View file

@ -2,8 +2,8 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"

View file

@ -2,11 +2,13 @@
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#ifndef IGUARD_gamepad_h
#define IGUARD_gamepad_h
#include "taisei.h"