From 53953f28255e782ed640a9e8d2d42c9b218943ad Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 25 Apr 2018 14:36:52 +0300 Subject: [PATCH] Cosmetic changes and TODOs --- blender/io_mspgl/properties.py | 2 +- source/animationplayer.cpp | 7 +++---- source/buffer.cpp | 1 + source/datatype.h | 4 ++-- source/object.cpp | 2 ++ source/pipeline.cpp | 2 +- source/programcompiler.cpp | 2 ++ source/programdata.cpp | 2 ++ source/programsyntax.h | 1 + 9 files changed, 15 insertions(+), 8 deletions(-) diff --git a/blender/io_mspgl/properties.py b/blender/io_mspgl/properties.py index f5a57cb7..9f9d56c0 100644 --- a/blender/io_mspgl/properties.py +++ b/blender/io_mspgl/properties.py @@ -59,7 +59,7 @@ def register_properties(): bpy.types.Mesh.winding_test = bpy.props.BoolProperty(name="Winding test", description="Perform winding test to skip back faces") bpy.types.Object.technique = bpy.props.StringProperty(name="Technique", description="Name of the technique to use for rendering") bpy.types.Object.inherit_tech = bpy.props.BoolProperty(name="Inherit technique", description="Inherit from the technique to customize textures") - bpy.types.Object.override_material = bpy.props.BoolProperty(name="Override material", description="Override material in the inherited texture as well", default=True) + bpy.types.Object.override_material = bpy.props.BoolProperty(name="Override material", description="Override material in the inherited technique as well", default=True) bpy.types.Object.compound = bpy.props.BoolProperty(name="Compound with parent", description="Join this object to its parent when exporting") bpy.types.Object.lod_for_parent = bpy.props.BoolProperty(name="LoD for parent", description="This object is a level of detail for its parent") bpy.types.Object.lod_index = bpy.props.IntProperty(name="LoD index", description="Index of the level of detail", min=1, default=1) diff --git a/source/animationplayer.cpp b/source/animationplayer.cpp index 0c001052..e73d1113 100644 --- a/source/animationplayer.cpp +++ b/source/animationplayer.cpp @@ -85,20 +85,19 @@ void AnimationPlayer::tick(const Time::TimeDelta &dt) bool AnimationPlayer::tick_single(ObjectSlot &slot, const Time::TimeDelta &dt) { - AnimatedObject &obj = slot.object; AnimationSlot &anim = slot.animations.front(); anim.iterator += dt; - obj.set_matrix(anim.iterator.get_matrix()); + slot.object.set_matrix(anim.iterator.get_matrix()); unsigned n_uniforms = anim.animation.get_n_uniforms(); for(unsigned i=0; iget_max_link_index(); for(unsigned i=0; i<=max_index; ++i) - obj.set_pose_matrix(i, anim.iterator.get_pose_matrix(i)); + slot.object.set_pose_matrix(i, anim.iterator.get_pose_matrix(i)); } return !anim.iterator.is_end(); diff --git a/source/buffer.cpp b/source/buffer.cpp index 38a69028..040ae8df 100644 --- a/source/buffer.cpp +++ b/source/buffer.cpp @@ -46,6 +46,7 @@ void Buffer::require_buffer_type(BufferType type) void Buffer::set_usage(BufferUsage u) { + // TODO OpenGL ES 2.0 doesn't support read or copy usages usage = u; } diff --git a/source/datatype.h b/source/datatype.h index 76c87bc8..0d52408a 100644 --- a/source/datatype.h +++ b/source/datatype.h @@ -1,5 +1,5 @@ -#ifndef MSP_GL_TYPES_H_ -#define MSP_GL_TYPES_H_ +#ifndef MSP_GL_DATATYPE_H_ +#define MSP_GL_DATATYPE_H_ #include "gl.h" diff --git a/source/object.cpp b/source/object.cpp index 4a2e5df1..bdb292bb 100644 --- a/source/object.cpp +++ b/source/object.cpp @@ -30,6 +30,8 @@ Object::Object(const Mesh *m, const Technique *t): set_technique(t); } +// TODO should have copy-c'tor to set watch on lod0 mesh if necessary + Object::~Object() { if(lods[0].mesh && lod0_watched) diff --git a/source/pipeline.cpp b/source/pipeline.cpp index 037741d2..27cc3e3c 100644 --- a/source/pipeline.cpp +++ b/source/pipeline.cpp @@ -192,7 +192,7 @@ void Pipeline::render(Renderer &renderer, const Tag &tag) const return; const Framebuffer *out_fbo = Framebuffer::current(); - // These is a no-ops but will ensure the related state gets restored + // These are no-ops but will ensure the related state gets restored BindRestore restore_fbo(out_fbo); BindRestore restore_depth_test(DepthTest::current()); BindRestore restore_blend(Blend::current()); diff --git a/source/programcompiler.cpp b/source/programcompiler.cpp index 9761177a..cafedc8f 100644 --- a/source/programcompiler.cpp +++ b/source/programcompiler.cpp @@ -35,6 +35,8 @@ namespace GL { using namespace ProgramSyntax; +// XXX For some reason global declarations are emitted for otherwise undeclared local variables + ProgramCompiler::ProgramCompiler(): resources(0), module(0) diff --git a/source/programdata.cpp b/source/programdata.cpp index b69d7b06..ca6ae5ba 100644 --- a/source/programdata.cpp +++ b/source/programdata.cpp @@ -295,6 +295,8 @@ unsigned ProgramData::compute_slot_mask(const Program::UniformBlockInfo &block) for(vector::const_iterator i=block.uniforms.begin(); i!=block.uniforms.end(); ++i) { SlotMap::const_iterator j = uniform_slots.find((*i)->name); + /* TODO issue a warning (or even error?) either here or in update_block + if all uniforms for a buffer-backed block are not found */ if(j!=uniform_slots.end() && j->secondsecond; } diff --git a/source/programsyntax.h b/source/programsyntax.h index 9e64c4c7..b0ad02b3 100644 --- a/source/programsyntax.h +++ b/source/programsyntax.h @@ -191,6 +191,7 @@ struct Layout: Node { struct Qualifier { + // TODO the standard calls this name, not identifier std::string identifier; std::string value; }; -- 2.45.2