Skip to content

Commit

Permalink
started a soup game for simplejam 2016
Browse files Browse the repository at this point in the history
  • Loading branch information
joeld42 committed Jun 11, 2016
1 parent c61400f commit 2318b17
Show file tree
Hide file tree
Showing 38 changed files with 1,091 additions and 0 deletions.
58 changes: 58 additions & 0 deletions simplejam_safetynet/simplejam2016_soup/.fips-gen.py
@@ -0,0 +1,58 @@
"""
Code generator template file. This is called from a cmake
code generator build target with the full path to a
yaml file which contains detailed code gen params.
"""
import sys
import os
import imp

# template variable will be replaced with
# imported generator paths
gen_paths = [ "/Users/joeld/Stuff/oryol-test/fips","/Users/joeld/Stuff/oryol-test/fips/generators",
"/Users/joeld/Stuff/oryol-test/oryol/fips-generators",
]

# make imported generator modules visible to python module system
for path in gen_paths :
sys.path.insert(0, path)

# yaml module is under the fips directory
import yaml
from mod import log
import genutil

def processFile(attrs) :
# dynamically load (and execute) the generator module
absPyPath = attrs['generator']
input = attrs['in']
out_src = attrs['out_src']
out_hdr = attrs['out_hdr']
if 'args' in attrs :
args = attrs['args']
else :
args = None
if 'env' in attrs :
env = attrs['env']
else :
env = None
genutil.setEnv(env)
path, script = os.path.split(absPyPath)
sys.path.insert(0, path)
moduleName, ext = os.path.splitext(script)
fp, pathname, description = imp.find_module(moduleName)
module = imp.load_module(moduleName, fp, pathname, description)
if args :
module.generate(input, out_src, out_hdr, args)
else :
module.generate(input, out_src, out_hdr)

#=== entry point
if len(sys.argv) == 2 :
with open(sys.argv[1], 'r') as f :
items = yaml.load(f)
for attrs in items :
processFile(attrs)
else :
print('Needs full path to a generator .yml file!')
exit(10)
177 changes: 177 additions & 0 deletions simplejam_safetynet/simplejam2016_soup/.fips-imports.cmake
@@ -0,0 +1,177 @@
#
# generated by 'fips gen', don't edit, don't add to version control!
#
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-libcurl/fips-include.cmake")
include("/Users/joeld/Stuff/oryol-test/fips-libcurl/fips-include.cmake")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-libcurl/lib/${FIPS_PLATFORM_NAME}")
link_directories("/Users/joeld/Stuff/oryol-test/fips-libcurl/lib/${FIPS_PLATFORM_NAME}")
endif()
include_directories("/Users/joeld/Stuff/oryol-test/fips-libcurl/.")
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-vld/fips-include.cmake")
include("/Users/joeld/Stuff/oryol-test/fips-vld/fips-include.cmake")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-vld/lib/${FIPS_PLATFORM_NAME}")
link_directories("/Users/joeld/Stuff/oryol-test/fips-vld/lib/${FIPS_PLATFORM_NAME}")
endif()
include_directories("/Users/joeld/Stuff/oryol-test/fips-vld/.")
macro(fips_import_fips_vld_vld)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/fips-vld/." "fips-vld_vld")
set(FIPS_IMPORT)
endmacro()
if (FIPS_AUTO_IMPORT)
fips_ide_group("Imports")
fips_import_fips_vld_vld()
fips_ide_group("")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-zlib/fips-include.cmake")
include("/Users/joeld/Stuff/oryol-test/fips-zlib/fips-include.cmake")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-zlib/lib/${FIPS_PLATFORM_NAME}")
link_directories("/Users/joeld/Stuff/oryol-test/fips-zlib/lib/${FIPS_PLATFORM_NAME}")
endif()
include_directories("/Users/joeld/Stuff/oryol-test/fips-zlib/.")
include_directories("/Users/joeld/Stuff/oryol-test/fips-zlib/zlib")
macro(fips_import_fips_zlib_zlib)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/fips-zlib/zlib" "fips-zlib_zlib")
set(FIPS_IMPORT)
endmacro()
if (FIPS_AUTO_IMPORT)
fips_ide_group("Imports")
fips_import_fips_zlib_zlib()
fips_ide_group("")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/gliml/fips-include.cmake")
include("/Users/joeld/Stuff/oryol-test/gliml/fips-include.cmake")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/gliml/lib/${FIPS_PLATFORM_NAME}")
link_directories("/Users/joeld/Stuff/oryol-test/gliml/lib/${FIPS_PLATFORM_NAME}")
endif()
include_directories("/Users/joeld/Stuff/oryol-test/gliml/.")
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-glfw/fips-include.cmake")
include("/Users/joeld/Stuff/oryol-test/fips-glfw/fips-include.cmake")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-glfw/lib/${FIPS_PLATFORM_NAME}")
link_directories("/Users/joeld/Stuff/oryol-test/fips-glfw/lib/${FIPS_PLATFORM_NAME}")
endif()
include_directories("/Users/joeld/Stuff/oryol-test/fips-glfw/glfw/include")
macro(fips_import_fips_glfw_glfw3)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/fips-glfw/." "fips-glfw_glfw3")
set(FIPS_IMPORT)
endmacro()
if (FIPS_AUTO_IMPORT)
fips_ide_group("Imports")
fips_import_fips_glfw_glfw3()
fips_ide_group("")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-glm/fips-include.cmake")
include("/Users/joeld/Stuff/oryol-test/fips-glm/fips-include.cmake")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-glm/lib/${FIPS_PLATFORM_NAME}")
link_directories("/Users/joeld/Stuff/oryol-test/fips-glm/lib/${FIPS_PLATFORM_NAME}")
endif()
include_directories("/Users/joeld/Stuff/oryol-test/fips-glm/glm")
add_definitions(-DGLM_FORCE_RADIANS=1)
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-remotery/fips-include.cmake")
include("/Users/joeld/Stuff/oryol-test/fips-remotery/fips-include.cmake")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-remotery/lib/${FIPS_PLATFORM_NAME}")
link_directories("/Users/joeld/Stuff/oryol-test/fips-remotery/lib/${FIPS_PLATFORM_NAME}")
endif()
include_directories("/Users/joeld/Stuff/oryol-test/fips-remotery/Remotery/lib")
macro(fips_import_fips_remotery_Remotery)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/fips-remotery/." "fips-remotery_Remotery")
set(FIPS_IMPORT)
endmacro()
if (FIPS_AUTO_IMPORT)
fips_ide_group("Imports")
fips_import_fips_remotery_Remotery()
fips_ide_group("")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-unittestpp/fips-include.cmake")
include("/Users/joeld/Stuff/oryol-test/fips-unittestpp/fips-include.cmake")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/fips-unittestpp/lib/${FIPS_PLATFORM_NAME}")
link_directories("/Users/joeld/Stuff/oryol-test/fips-unittestpp/lib/${FIPS_PLATFORM_NAME}")
endif()
include_directories("/Users/joeld/Stuff/oryol-test/fips-unittestpp/.")
macro(fips_import_fips_unittestpp_unittestpp)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/fips-unittestpp/UnitTest++" "fips-unittestpp_unittestpp")
set(FIPS_IMPORT)
endmacro()
if (FIPS_AUTO_IMPORT)
fips_ide_group("Imports")
fips_import_fips_unittestpp_unittestpp()
fips_ide_group("")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/oryol/fips-include.cmake")
include("/Users/joeld/Stuff/oryol-test/oryol/fips-include.cmake")
endif()
if (EXISTS "/Users/joeld/Stuff/oryol-test/oryol/lib/${FIPS_PLATFORM_NAME}")
link_directories("/Users/joeld/Stuff/oryol-test/oryol/lib/${FIPS_PLATFORM_NAME}")
endif()
include_directories("/Users/joeld/Stuff/oryol-test/oryol/code")
include_directories("/Users/joeld/Stuff/oryol-test/oryol/code/Modules")
macro(fips_import_oryol_Core)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/oryol/code/Modules/Core" "oryol_Core")
set(FIPS_IMPORT)
endmacro()
macro(fips_import_oryol_Gfx)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/oryol/code/Modules/Gfx" "oryol_Gfx")
set(FIPS_IMPORT)
endmacro()
macro(fips_import_oryol_Resource)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/oryol/code/Modules/Resource" "oryol_Resource")
set(FIPS_IMPORT)
endmacro()
macro(fips_import_oryol_Assets)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/oryol/code/Modules/Assets" "oryol_Assets")
set(FIPS_IMPORT)
endmacro()
macro(fips_import_oryol_Dbg)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/oryol/code/Modules/Dbg" "oryol_Dbg")
set(FIPS_IMPORT)
endmacro()
macro(fips_import_oryol_LocalFS)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/oryol/code/Modules/LocalFS" "oryol_LocalFS")
set(FIPS_IMPORT)
endmacro()
macro(fips_import_oryol_IO)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/oryol/code/Modules/IO" "oryol_IO")
set(FIPS_IMPORT)
endmacro()
macro(fips_import_oryol_Input)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/oryol/code/Modules/Input" "oryol_Input")
set(FIPS_IMPORT)
endmacro()
macro(fips_import_oryol_HTTP)
set(FIPS_IMPORT 1)
add_subdirectory("/Users/joeld/Stuff/oryol-test/oryol/code/Modules/HTTP" "oryol_HTTP")
set(FIPS_IMPORT)
endmacro()
if (FIPS_AUTO_IMPORT)
fips_ide_group("Imports")
fips_import_oryol_Core()
fips_import_oryol_Gfx()
fips_import_oryol_Resource()
fips_import_oryol_Assets()
fips_import_oryol_Dbg()
fips_import_oryol_LocalFS()
fips_import_oryol_IO()
fips_import_oryol_Input()
fips_import_oryol_HTTP()
fips_ide_group("")
endif()
33 changes: 33 additions & 0 deletions simplejam_safetynet/simplejam2016_soup/CMakeLists.txt
@@ -0,0 +1,33 @@
#
# project: oryol-hello
#
cmake_minimum_required(VERSION 2.8)

# include the fips main cmake file
get_filename_component( FIPS_ROOT_DIR "/Users/joeld/Stuff/oryol-test/fips" ABSOLUTE)
MESSAGE( STATUS "Fips root dir: " ${FIPS_ROOT_DIR} )

include ("${FIPS_ROOT_DIR}/cmake/fips.cmake")

fips_setup()
fips_project(simplejam-soup)
fips_add_subdirectory(code)

# manually define imports, don't bring all of Oryol
fips_ide_group("Oryol")
fips_import_oryol_Core()
fips_import_oryol_IO()
fips_import_oryol_LocalFS()
#fips_import_oryol_Messaging()
fips_import_oryol_Gfx()
fips_import_oryol_Assets()
fips_import_oryol_Resource()

fips_ide_group("Libs")
fips_import_fips_glfw_glfw3()
#fips_import_oryol_flextgl()
#fips_import_oryol_ConvertUTF()

fips_ide_group("")

fips_finish()
66 changes: 66 additions & 0 deletions simplejam_safetynet/simplejam2016_soup/asset_export.py
@@ -0,0 +1,66 @@
import os, sys
import string
import subprocess
import shutil

PROJECT_DIR = '/Users/joeld/Projects/ld48jovoc/simplejam_safetynet/simplejam2016_soup'

ORYOL_EXPORT_TOOL = '/Users/joeld/Stuff/oryol-test/fips-deploy/oryol-tools/osx-xcode-debug/oryol-export'
ORYOL_EXPORT_CFG = 'test_config.toml'

CRUNCH_TOOL = '/Users/joeld/Toolkits/crunch-osx/bin_osx/crunch'

ASSET_DIR = "assets"
RUNTIME_DATA_DIR = "gamedata"

MESHES = [
'bowl.fbx',
'table.fbx'
]

TEXTURES = {
# 'wood.png' : 'A8R8G8B8'
'wood.png' : 'DXT5',
'soupbowl.png' : 'DXT5'
}

if __name__=='__main__':

# TODO more targets varients
# target = "web"

# TODO: Export fbx meshes automatically from blender

# -----------------------------------
# Meshes
# -----------------------------------
meshConfig = os.path.join (PROJECT_DIR, ASSET_DIR, ORYOL_EXPORT_CFG )
for mesh in MESHES:
srcFile = os.path.join( PROJECT_DIR, ASSET_DIR, mesh )
destFile = os.path.join( PROJECT_DIR, RUNTIME_DATA_DIR, os.path.splitext( mesh )[0] + ".omsh" )

# TODO: add timestamp checks
cmd = [ ORYOL_EXPORT_TOOL,
'-config', meshConfig,
'-model', srcFile,
'-out', destFile ]
print string.join(cmd, ' ' )
subprocess.call( cmd )

# -----------------------------------
# Textures
# -----------------------------------
for tex, fmt in TEXTURES.iteritems():

srcFile = os.path.join( PROJECT_DIR, ASSET_DIR, tex )
destFile = os.path.join( PROJECT_DIR, RUNTIME_DATA_DIR, os.path.splitext( tex )[0] + ".dds" )
cmd = [ CRUNCH_TOOL,
'-file', srcFile,
'-out', destFile,
'-gamma', '1.0',
'-' + fmt
]

print string.join(cmd, ' ' )
subprocess.call( cmd )

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.

0 comments on commit 2318b17

Please sign in to comment.