diff options
author | Treeki <treeki@gmail.com> | 2011-06-15 04:24:48 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-06-15 04:24:48 +0200 |
commit | a36737f8a870182a69b67282a4a41ea5e056c8dd (patch) | |
tree | 7519166c3a232e5a5438105c660229e1a1f2e402 /make_map_model.rb | |
parent | ba9d9bf56844028cbb227a8d1985a11446a022de (diff) | |
download | kamek-a36737f8a870182a69b67282a4a41ea5e056c8dd.tar.gz kamek-a36737f8a870182a69b67282a4a41ea5e056c8dd.zip |
also, I still don't know how to use git
Diffstat (limited to '')
-rwxr-xr-x | make_map_model.rb | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/make_map_model.rb b/make_map_model.rb index bae1cd0..55560ff 100755 --- a/make_map_model.rb +++ b/make_map_model.rb @@ -27,11 +27,34 @@ brres.get_texture_group.add 'alphaBlender', alpha_tex # yay #model.shapes["World2_PathsPlumbing__World2_PathsPlumbing"].clr_data[0].raw_data = System::Array[Byte].new([255, 255, 255, 128]) +# move paths into DrawXlu +opa = model.bytecode["DrawOpa"] +if model.bytecode.contains_key("DrawXlu") + xlu = model.bytecode["DrawXlu"] +else + xlu = ByteCode.new + xlu.instructions = System::Collections::Generic::List[ByteCode::Instruction].new + xlu.instructions << ByteCode::DoneInstruction.new + model.bytecode["DrawXlu"] = xlu +end + +shape_array = model.shapes.to_a + +to_be_moved = opa.instructions.select do |insn| + insn.is_a?(ByteCode::DrawShapeInstruction) and + shape_array[insn.shape_i_d].key =~ /path/i +end + +to_be_moved.each do |insn| + opa.instructions.remove insn + xlu.instructions.insert 0, insn +end + # how's this for hackiness? model.materials.each do |kvp| next unless kvp.key =~ /path/i - if true + if false mat = kvp.value # update the material @@ -135,9 +158,9 @@ model.materials.each do |kvp| sh.pad_to_size 0x1E0 sh.end shad.display_list = sh.get_buffer - end - next + next + end if false mat = kvp.value @@ -203,6 +226,8 @@ model.materials.each do |kvp| dl.pad_to_size 0x1E0 dl.end shad.display_list = dl.get_buffer + + next end |