Module: Flak::Template::Delight::Settings
- Extended by:
- MergeEngine
- Defined in:
- lib/flak/rake/templates/delight.rb
Class Method Summary collapse
Instance Method Summary collapse
- #delight_clean_cmd ⇒ Object
- #delight_shader_compile_cmd(dest, src) ⇒ Object
-
#shader_file(source) ⇒ Object
path to shader build: e.g.
-
#shader_files ⇒ Object
all shader build files.
- #shader_release_path(file) ⇒ Object
Methods included from MergeEngine
flatten_yaml, flatten_yaml_file, infuse, settings_modifications
Class Method Details
.extended(target) ⇒ Object
9 10 11 |
# File 'lib/flak/rake/templates/delight.rb', line 9 def self.extended target infuse target end |
.settings_modifications(settings) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/flak/rake/templates/delight.rb', line 14 def self.settings_modifications settings mods = Hash.new bind = binding() Flak::Errors.assert("settings[:delight_location]", "String", bind,__FILE__) Flak::Errors.assert("settings[:delight_version]", "String", bind,__FILE__) Flak::Errors.assert("settings[:build_directory]", "String", bind,__FILE__) v_loc = File.join( "#{settings[:delight_location]}-#{settings[:delight_version]}" ) mods[:lib_paths] = [ File.join( v_loc ,"lib") ] mods[:include_paths] = [ File.join( v_loc ,"include")] mods[:shader_compiler] = File.join( v_loc, "bin","shaderdl") mods[:shader_build_directory] = settings[:build_directory] mods[:libs] = ["3delight"] mods[:shader_include_paths] = [ File.join( v_loc, "maya","rsl")] mods end |
Instance Method Details
#delight_clean_cmd ⇒ Object
75 76 77 |
# File 'lib/flak/rake/templates/delight.rb', line 75 def delight_clean_cmd "rm -f #{shader_files}" end |
#delight_shader_compile_cmd(dest, src) ⇒ Object
65 66 67 68 69 70 71 72 |
# File 'lib/flak/rake/templates/delight.rb', line 65 def delight_shader_compile_cmd(dest,src) bind = binding() Flak::Errors.assert("@settings[:shader_compiler]", "String", bind,__FILE__) include_path_string = (@settings[:sl_files].collect {|f| f.pathmap('%d')}.uniq | ( @settings[:shader_include_paths] || [] )).collect { |el| "-I#{el.to_s}" }.join(" ") shader_type_string = "-DSHADER_TYPE_#{src.pathmap('%d').pathmap('%f')}" "#{@settings[:shader_compiler]} #{shader_type_string} #{include_path_string} -d #{dest} #{src}" end |
#shader_file(source) ⇒ Object
path to shader build: e.g. /hq/dev/jtools/build/2009.3/darwin/debug/goosebump.sdl
51 52 53 54 55 56 |
# File 'lib/flak/rake/templates/delight.rb', line 51 def shader_file(source) bind = binding() Flak::Errors.assert("@settings[:shader_build_directory]", "String", bind,__FILE__) File.join(@settings[:shader_build_directory], source.gsub("/src/","/").ext('sdl')) end |
#shader_files ⇒ Object
all shader build files
45 46 47 |
# File 'lib/flak/rake/templates/delight.rb', line 45 def shader_files() @settings[:sl_files].collect { |f| shader_file(f) } end |
#shader_release_path(file) ⇒ Object
58 59 60 61 62 63 |
# File 'lib/flak/rake/templates/delight.rb', line 58 def shader_release_path(file) bind = binding() Flak::Errors.assert("@settings[:revision_directory]", "String", bind,__FILE__) File.join(@settings[:revision_directory] , 'delight','shader', file.pathmap('%f')) end |