forked from Astrabit-ST/ModShot-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matthew Lyons
committed
Apr 27, 2022
1 parent
303f257
commit f04d583
Showing
12 changed files
with
330 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
embedded_assets = [ | ||
'icon.png', | ||
'gamecontrollerdb.txt' | ||
] | ||
|
||
embedded_assets_f = files(embedded_assets) | ||
|
||
count = 0 | ||
foreach file : embedded_assets_f | ||
global_sources += custom_target(embedded_assets[count], | ||
input: file, | ||
output: '@[email protected]'.format(embedded_assets[count]), | ||
command: [ | ||
xxd, '-i', '@INPUT@' | ||
], | ||
capture: true, | ||
depend_files: embedded_assets_f[count] | ||
) | ||
count += 1 | ||
endforeach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
if get_option('mri_includes') == '' | ||
ver = get_option('mri_version') | ||
if ver.version_compare('>=3.0') and compilers['cpp'].get_id() == 'clang' | ||
global_args += '-fdeclspec' | ||
endif | ||
global_dependencies += dependency('ruby-' + ver) | ||
else | ||
global_args += ('-I' + get_option('mri_includes')) | ||
global_dependencies += compilers['cpp'].find_library(get_option('mri_library'), dirs: get_option('mri_libpath')) | ||
endif | ||
|
||
global_include_dirs += include_directories('.') | ||
|
||
binding_source = [files( | ||
'aleffect-binding.cpp', | ||
'audio-binding.cpp', | ||
'binding-mri.cpp', | ||
'binding-util.cpp', | ||
'bitmap-binding.cpp', | ||
'etc-binding.cpp', | ||
'filesystem-binding.cpp', | ||
'font-binding.cpp', | ||
'graphics-binding.cpp', | ||
'input-binding.cpp', | ||
'journal-binding.cpp', | ||
'modshot-window-binding.cpp', | ||
'module_rpg.cpp', | ||
'niko-binding.cpp', | ||
'oneshot-binding.cpp', | ||
'plane-binding.cpp', | ||
'screen-binding.cpp', | ||
'sprite-binding.cpp', | ||
'steam-binding.cpp', | ||
'table-binding.cpp', | ||
'tilemap-binding.cpp', | ||
'viewport-binding.cpp', | ||
'wallpaper-binding.cpp', | ||
'window-binding.cpp', | ||
'otherview-binding.cpp', | ||
)] | ||
|
||
global_sources += binding_source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
project('modshot', 'c', 'cpp', version: '1.0.0', meson_version: '>=0.56.0', default_options: ['cpp_std=c++14', 'buildtype=release']) | ||
|
||
host_system = host_machine.system() | ||
|
||
xxd = find_program('xxd', native: true) | ||
|
||
compilers = {'cpp': meson.get_compiler('cpp')} | ||
|
||
global_sources = [] | ||
global_dependencies = [] | ||
global_include_dirs = [] | ||
global_args = [] | ||
global_link_args = [] | ||
|
||
sizeof = {'void*': compilers['cpp'].sizeof('void*'), | ||
'long': compilers['cpp'].sizeof('long') | ||
} | ||
win64 = (sizeof['void*'] != sizeof['long']) | ||
|
||
global_args += '-DHAVE_NANOSLEEP' | ||
|
||
gfx_backend = get_option('gfx_backend') | ||
if gfx_backend == 'gles' | ||
global_args += '-DGLES2_HEADER' | ||
elif gfx_backend == 'gl' | ||
global_dependencies += dependency('gl') | ||
endif | ||
|
||
# ==================== | ||
# Main source | ||
# ==================== | ||
|
||
# Suppress warnings | ||
global_args += ['-Wno-non-virtual-dtor', '-Wno-reorder', '-Wno-uninitialized', '-Wno-unknown-pragmas', '-Wno-stringop-truncation', '-Wno-parentheses', '-Wno-sign-compare', '-Wno-misleading-indentation'] | ||
if compilers['cpp'].get_id() == 'clang' | ||
global_args += ['-Wno-undefined-var-template', '-Wno-delete-non-abstract-non-virtual-dtor'] | ||
endif | ||
if host_system == 'windows' | ||
if compilers['cpp'].get_id() != 'clang' | ||
global_args += '-masm=intel' | ||
endif | ||
endif | ||
|
||
# Defines | ||
if get_option('workdir_current') | ||
global_args += '-DWORKDIR_CURRENT' | ||
endif | ||
|
||
steam = false | ||
if get_option('steam') == true | ||
steam = true | ||
endif | ||
|
||
subdir('src') | ||
subdir('binding-mri') | ||
subdir('shader') | ||
subdir('assets') | ||
|
||
global_include_dirs += include_directories('src', 'binding-mri') | ||
|
||
rpath = '$ORIGIN/lib' | ||
|
||
exe_name = meson.project_name() | ||
|
||
executable(exe_name, | ||
sources: global_sources, | ||
dependencies: global_dependencies, | ||
include_directories: global_include_dirs, | ||
install_rpath: rpath, | ||
link_args: global_link_args, | ||
cpp_args: global_args, | ||
objc_args: global_args, | ||
objcpp_args: global_args, | ||
win_subsystem: 'windows', | ||
install: (host_system != 'windows') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
option('mri_version', type: 'string', value: '3.0', description: 'Version of MRI to link with') | ||
option('mri_includes', type: 'string', value: '', description: 'Ruby manual include path') | ||
option('mri_libpath', type: 'string', value: '', description: 'Ruby manual lib path') | ||
option('mri_library', type: 'string', value: '', description: 'Ruby manual link name') | ||
|
||
option('workdir_current', type: 'boolean', value: false, description: 'Keep current directory on startup') | ||
|
||
option('steam', type: 'boolean', value: false, description: 'Add steamworks support') | ||
|
||
option('gfx_backend', type: 'combo', value: 'gl', choices: ['gl', 'gles'], description: 'Graphics rendering API to use.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
embedded_shaders = [ | ||
'binary_glitch.frag', | ||
'bitmapBlit.frag', | ||
'blur.frag', | ||
'blurH.vert', | ||
'blurV.vert', | ||
'chronos.frag', | ||
'common.h', | ||
'crt_sprite.frag', | ||
'crt.frag', | ||
'cubic_lens.frag', | ||
'flashMap.frag', | ||
'flatColor.frag', | ||
'gray.frag', | ||
'hue.frag', | ||
'mask.frag', | ||
'mask.vert', | ||
'minimal.vert', | ||
'obscured.frag', | ||
'plane.frag', | ||
'simple.frag', | ||
'simple.vert', | ||
'simpleAlpha.frag', | ||
'simpleAlphaUni.frag', | ||
'simpleColor.frag', | ||
'simpleColor.vert', | ||
'simpleMatrix.vert', | ||
'sprite.frag', | ||
'sprite.vert', | ||
'tilemap.vert', | ||
'trans.frag', | ||
'transSimple.frag', | ||
'water.frag', | ||
'zoom.vert' | ||
] | ||
|
||
embedded_shaders_f = files(embedded_shaders) | ||
|
||
count = 0 | ||
foreach file : embedded_shaders_f | ||
global_sources += custom_target(embedded_shaders[count], | ||
input: file, | ||
output: '@[email protected]'.format(embedded_shaders[count]), | ||
command: [ | ||
xxd, '-i', '@INPUT@' | ||
], | ||
capture: true, | ||
depend_files: embedded_shaders_f[count] | ||
) | ||
count += 1 | ||
endforeach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
boost = dependency('boost', version: '>=1.49', modules: ['program_options']) | ||
physfs = dependency('physfs', version: '>=2.1') | ||
openal = dependency('openal') | ||
vorbisfile = dependency('vorbisfile') | ||
vorbis = dependency('vorbis') | ||
ogg = dependency('ogg') | ||
sdl2 = dependency('SDL2') | ||
sdl_sound = compilers['cpp'].find_library('SDL2_sound') | ||
sdl2_ttf = dependency('SDL2_ttf') | ||
sdl2_image = dependency('SDL2_image') | ||
sigcxx = dependency('sigc++-2.0') | ||
pixman = dependency('pixman-1') | ||
png = dependency('libpng') | ||
jpeg = dependency('libjpeg') | ||
zlib = dependency('zlib') | ||
zmqpp = dependency('libzmqpp') | ||
|
||
if host_system == 'windows' | ||
bz2 = dependency('bzip2') | ||
else | ||
bz2 = compilers['cpp'].find_library('bz2') | ||
gtk = dependency('gtk+-2.0') | ||
xfconf = dependency('libxfconf-0') | ||
endif | ||
|
||
# Windows needs to be treated like a special needs child here | ||
explicit_libs = '' | ||
if host_system == 'windows' | ||
# Newer versions of Ruby will refuse to link without these | ||
explicit_libs += 'libmsvcrt;libgcc;libmingwex;libgmp;' | ||
endif | ||
|
||
foreach l : explicit_libs.split(';') | ||
if l != '' | ||
global_link_args += '-l:' + l + '.a' | ||
endif | ||
endforeach | ||
|
||
global_include_dirs += include_directories('.', | ||
'audio/headers', | ||
'filesystem/headers', | ||
'graphics/headers', | ||
'input/headers', | ||
'opengl/headers' | ||
) | ||
|
||
global_dependencies += [boost, bz2, openal, zlib, sdl2, sdl_sound, pixman, physfs, vorbisfile, vorbis, ogg, sdl2_ttf, sigcxx, sdl2_image, png, jpeg, zmqpp, gtk, xfconf] | ||
if host_system == 'windows' | ||
global_dependencies += compilers['cpp'].find_library('wsock32') | ||
global_dependencies += compilers['cpp'].find_library('winmm.lib') | ||
global_dependencies += compilers['cpp'].find_library('Secur32') | ||
global_dependencies += compilers['cpp'].find_library('Shlwapi') | ||
endif | ||
|
||
main_source = files( | ||
'audio/source/alstream.cpp', | ||
'audio/source/audiostream.cpp', | ||
'audio/source/audiochannels.cpp', | ||
'audio/source/audio.cpp', | ||
'audio/source/soundemitter.cpp', | ||
'audio/source/sdlsoundsource.cpp', | ||
'audio/source/vorbissource.cpp', | ||
'graphics/source/autotiles.cpp', | ||
'graphics/source/bitmap.cpp', | ||
'graphics/source/graphics.cpp', | ||
'graphics/source/font.cpp', | ||
'graphics/source/sprite.cpp', | ||
'graphics/source/scene.cpp', | ||
'graphics/source/tilemap.cpp', | ||
'graphics/source/tileatlas.cpp', | ||
'opengl/source/glstate.cpp', | ||
'opengl/source/gl-debug.cpp', | ||
'opengl/source/gl-fun.cpp', | ||
'opengl/source/gl-meta.cpp', | ||
'opengl/source/plane.cpp', | ||
'opengl/source/shader.cpp', | ||
'opengl/source/texpool.cpp', | ||
'opengl/source/vertex.cpp', | ||
'opengl/source/tilequad.cpp', | ||
'opengl/source/window.cpp', | ||
'opengl/source/screen.cpp', | ||
'opengl/source/viewport.cpp', | ||
'opengl/source/table.cpp', | ||
'input/source/input.cpp', | ||
'input/source/keybindings.cpp', | ||
'filesystem/source/filesystem.cpp', | ||
'filesystem/source/rgssad.cpp', | ||
'main.cpp', | ||
'eventthread.cpp', | ||
'etc.cpp', | ||
'config.cpp', | ||
'settingsmenu.cpp', | ||
'sharedstate.cpp', | ||
'oneshot.cpp', | ||
'i18n.cpp', | ||
'otherview-message.cpp', | ||
'crash-handler.cpp' | ||
) | ||
|
||
global_sources += main_source | ||
|
||
if steam == true | ||
global_sources += files( | ||
'steam/steam.cpp', | ||
'../steamshim/steamshim_child.c' | ||
) | ||
global_include_dirs += include_directories( | ||
'steam', | ||
'../steamshim' | ||
) | ||
|
||
global_args += '-DSTEAM' | ||
endif | ||
|
||
if host_system == 'windows' | ||
else | ||
global_sources += files('xdg-user-dir-lookup.c') | ||
endif |
Oops, something went wrong.