2017-11-12 01:28:30 +01:00
|
|
|
|
2017-12-31 00:34:02 +01:00
|
|
|
version_deps += custom_target('version information',
|
|
|
|
command : [preprocess_command, '@INPUT@', '@OUTPUT@'],
|
2018-07-01 10:48:54 +02:00
|
|
|
build_always : true,
|
2017-12-31 00:34:02 +01:00
|
|
|
input : 'version_auto.c.in',
|
|
|
|
output : 'version_auto.c',
|
|
|
|
)
|
2017-11-12 01:28:30 +01:00
|
|
|
|
|
|
|
if host_machine.system() == 'windows'
|
|
|
|
winmod = import('windows')
|
2017-12-20 13:33:20 +01:00
|
|
|
|
2017-11-12 01:28:30 +01:00
|
|
|
rcpath = join_paths(meson.current_build_dir(), 'taisei.rc')
|
2017-12-20 13:33:20 +01:00
|
|
|
rcdefs = [
|
|
|
|
'-DICONS_DIR=@0@'.format(join_paths(meson.source_root(), 'misc', 'icons'))
|
|
|
|
]
|
|
|
|
|
|
|
|
if get_option('buildtype').startswith('debug')
|
|
|
|
rcdefs += ['-DBUILDTYPE_DEFINE=#define DEBUG_BUILD']
|
|
|
|
else
|
|
|
|
rcdefs += ['-DBUILDTYPE_DEFINE=#define RELEASE_BUILD']
|
|
|
|
endif
|
|
|
|
|
OpenGL ES 3.0 rendering backend (#148)
* First steps towards shader transpilation
Needs to be manually enabled via -Dshader_transpiler=true.
Requires shaderc. https://github.com/google/shaderc
Not yet functional due to missing SPIRV-Cross integration. SPIRV-Cross
currently does not have an official C API, and crossc is too minimal to
be useful. The current plan is to extend crossc and vendor it, while
also sending PRs upstream.
* Integrate crossc; shader transpilation for GLES now works
* fix leak
* gles30 backend now playable on Mesa with 3.2 context
Some rendering issues are present. Identified so far:
- Marisa's lasers are invisible
- Death effect looks wrong
Also, a small pixmap manipulation library has been written, and the
texture uploading API redesigned around it.
* fix marisa lasers in GLES (uniform name clashed with builtin)
* fix player death effect in GLES (another name clash)
* Dump ANGLE's translated shader code in debug log
* fix screenshots
* Drop support for triangle fans, switch to strips
Fans offer no advantage over strips, and they've been removed in D3D10+,
so ANGLE has to emulate them.
* crude workaround for an ANGLE bug
* Re-enable GL debug labels, fix an issue with them that affected ANGLE (but was always technically a bug)
* fix race condition in shaderc initialization
* New SDL_RWops interface for vertex buffers
* Optimize VBO streaming via buffering updates
Measurable performance improvement even with the main gl33 renderer,
drastic improvement with ANGLE.
* Fix the depth texture binding problem under ANGLE
Apparently it hates GL_DEPTH_COMPONENT16 for some reason. Sized internal
formats are not supported in GLES 2.0 anyway, so not using them is
probably a good idea.
* fix GLES2.0 segfault (the backend still doesn't work, though)
* dump GL extensions at info log level, not debug
* get around a Mesa bug; more correct texture format table for GLES2
* Correct GLES3 texture format table according to the spec
Not a Mesa bug after all
* require crossc>=1.5.0, fallback to subproject
* Request at least 8bit per color channel in GL backends
* Forbid lto for static windows builds with shader_transpiler=true
* fix edge case segfault
* Add basic ANGLE bundling support to the build system
Windows only, and no NSIS support yet
* Fix various windows-related build system and installer brokenness
* Disable gles backends by default
* update documentation
2018-10-02 00:36:10 +02:00
|
|
|
# https://github.com/mesonbuild/meson/issues/4301
|
|
|
|
rc_target = custom_target('windows-resource',
|
2017-12-20 13:33:20 +01:00
|
|
|
command : [preprocess_command, rcdefs, '@INPUT@', '@OUTPUT@'],
|
2018-07-01 10:48:54 +02:00
|
|
|
build_always : true,
|
2017-12-20 13:33:20 +01:00
|
|
|
input : 'taisei.rc.in',
|
|
|
|
output : 'taisei.rc',
|
|
|
|
)
|
|
|
|
|
2018-01-12 23:05:46 +01:00
|
|
|
version_deps += winmod.compile_resources(rc_target)
|
2017-12-21 23:38:32 +01:00
|
|
|
|
|
|
|
# msvcrt is dumb and only supports up to c89.
|
|
|
|
# with this defined, alternative implementations from mingw for e.g. the
|
|
|
|
# printf family of functions will be used, which conform to c11.
|
|
|
|
config.set('__USE_MINGW_ANSI_STDIO', 1)
|
2017-11-12 01:28:30 +01:00
|
|
|
endif
|
|
|
|
|
2017-11-25 20:45:11 +01:00
|
|
|
use_intel_intrin = get_option('intel_intrin') and cc.links('''
|
|
|
|
#include <immintrin.h>
|
|
|
|
__attribute__((target("sse4.2")))
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
return _mm_crc32_u8(argc, 42);
|
|
|
|
}
|
2017-11-27 14:27:32 +01:00
|
|
|
''', name : 'SSE 4.2 intrinsics test')
|
2017-11-25 20:45:11 +01:00
|
|
|
|
2018-04-12 16:08:48 +02:00
|
|
|
taisei_src = files(
|
2017-11-25 20:45:11 +01:00
|
|
|
'aniplayer.c',
|
|
|
|
'audio_common.c',
|
|
|
|
'boss.c',
|
2017-11-12 01:28:30 +01:00
|
|
|
'cli.c',
|
|
|
|
'color.c',
|
2017-11-25 20:45:11 +01:00
|
|
|
'color.c',
|
|
|
|
'config.c',
|
|
|
|
'credits.c',
|
|
|
|
'dialog.c',
|
|
|
|
'difficulty.c',
|
|
|
|
'ending.c',
|
|
|
|
'enemy.c',
|
2018-04-13 21:13:48 +02:00
|
|
|
'entity.c',
|
2017-11-25 20:45:11 +01:00
|
|
|
'events.c',
|
2018-01-20 15:15:15 +01:00
|
|
|
'framerate.c',
|
2017-11-12 01:28:30 +01:00
|
|
|
'gamepad.c',
|
|
|
|
'global.c',
|
|
|
|
'hashtable.c',
|
2017-11-25 20:45:11 +01:00
|
|
|
'hirestime.c',
|
|
|
|
'item.c',
|
2017-11-12 01:28:30 +01:00
|
|
|
'laser.c',
|
2017-11-25 20:45:11 +01:00
|
|
|
'list.c',
|
|
|
|
'log.c',
|
|
|
|
'main.c',
|
2017-12-18 21:25:06 +01:00
|
|
|
'objectpool_util.c',
|
2017-11-25 20:45:11 +01:00
|
|
|
'player.c',
|
|
|
|
'plrmodes.c',
|
|
|
|
'progress.c',
|
|
|
|
'projectile.c',
|
2018-05-02 06:46:48 +02:00
|
|
|
'projectile_prototypes.c',
|
2017-11-25 20:45:11 +01:00
|
|
|
'random.c',
|
|
|
|
'refs.c',
|
|
|
|
'replay.c',
|
|
|
|
'stage.c',
|
|
|
|
'stagedraw.c',
|
2017-12-18 21:25:06 +01:00
|
|
|
'stageobjects.c',
|
2017-11-25 20:45:11 +01:00
|
|
|
'stagetext.c',
|
|
|
|
'stageutils.c',
|
2018-05-25 08:01:07 +02:00
|
|
|
'taskmanager.c',
|
2017-11-25 20:45:11 +01:00
|
|
|
'transition.c',
|
|
|
|
'version.c',
|
|
|
|
'video.c',
|
2018-04-12 16:08:48 +02:00
|
|
|
)
|
|
|
|
|
2018-08-31 04:58:37 +02:00
|
|
|
if get_option('objpools')
|
|
|
|
taisei_src += files(
|
|
|
|
'objectpool.c',
|
|
|
|
)
|
|
|
|
else
|
|
|
|
taisei_src += files(
|
|
|
|
'objectpool_fake.c',
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2018-05-15 02:27:25 +02:00
|
|
|
sse42_src = []
|
|
|
|
|
2018-04-12 16:08:48 +02:00
|
|
|
subdir('menu')
|
|
|
|
subdir('plrmodes')
|
|
|
|
subdir('renderer')
|
|
|
|
subdir('resource')
|
|
|
|
subdir('rwops')
|
|
|
|
subdir('stages')
|
2018-04-29 10:28:21 +02:00
|
|
|
subdir('dialog')
|
2018-04-12 16:08:48 +02:00
|
|
|
subdir('vfs')
|
2018-05-15 02:27:25 +02:00
|
|
|
subdir('util')
|
|
|
|
|
|
|
|
if use_intel_intrin
|
|
|
|
sse42_lib = static_library(
|
|
|
|
'taisei_sse42',
|
|
|
|
sse42_src,
|
|
|
|
c_args : taisei_c_args + ['-msse4.2'],
|
|
|
|
install : false
|
|
|
|
)
|
|
|
|
sse42_dep = declare_dependency(link_with: sse42_lib)
|
|
|
|
taisei_deps += sse42_dep
|
|
|
|
config.set('TAISEI_BUILDCONF_USE_SSE42', true)
|
|
|
|
message('SSE 4.2 intrinsics will be used')
|
|
|
|
elif get_option('intel_intrin')
|
|
|
|
config.set('TAISEI_BUILDCONF_USE_SSE42', false)
|
|
|
|
warning('SSE 4.2 intrinsics can not be used')
|
|
|
|
endif
|
2018-04-12 16:08:48 +02:00
|
|
|
|
|
|
|
configure_file(configuration : config, output : 'build_config.h')
|
|
|
|
|
|
|
|
taisei_src += [
|
|
|
|
menu_src,
|
|
|
|
plrmodes_src,
|
|
|
|
renderer_src,
|
|
|
|
resource_src,
|
|
|
|
rwops_src,
|
|
|
|
stages_src,
|
|
|
|
vfs_src,
|
2018-04-29 10:28:21 +02:00
|
|
|
dialog_src,
|
2018-05-15 02:27:25 +02:00
|
|
|
util_src,
|
2017-11-12 01:28:30 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
if taisei_deps.contains(dep_sdl2_mixer)
|
2018-04-12 16:08:48 +02:00
|
|
|
taisei_src += files(
|
2017-11-12 01:28:30 +01:00
|
|
|
'audio_mixer.c',
|
2018-04-12 16:08:48 +02:00
|
|
|
)
|
2017-11-12 01:28:30 +01:00
|
|
|
else
|
2018-04-12 16:08:48 +02:00
|
|
|
taisei_src += files(
|
2017-11-12 01:28:30 +01:00
|
|
|
'audio_null.c',
|
2018-04-12 16:08:48 +02:00
|
|
|
)
|
2017-11-12 01:28:30 +01:00
|
|
|
endif
|
|
|
|
|
2018-06-30 22:11:54 +02:00
|
|
|
taisei_deps += renderer_deps
|
|
|
|
|
2017-11-27 14:27:32 +01:00
|
|
|
if macos_app_bundle
|
|
|
|
taisei_exe_name = 'Taisei'
|
|
|
|
else
|
|
|
|
taisei_exe_name = 'taisei'
|
|
|
|
endif
|
|
|
|
|
2018-04-12 16:08:48 +02:00
|
|
|
taisei_exe = executable(taisei_exe_name, taisei_src, version_deps,
|
2017-11-27 14:27:32 +01:00
|
|
|
dependencies : taisei_deps,
|
|
|
|
c_args : taisei_c_args,
|
|
|
|
gui_app : not get_option('win_console'),
|
|
|
|
install : true,
|
|
|
|
install_dir : bindir,
|
|
|
|
)
|