Cosmetic changes and TODOs
authorMikko Rasa <tdb@tdb.fi>
Wed, 25 Apr 2018 11:36:52 +0000 (14:36 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 25 Apr 2018 11:36:52 +0000 (14:36 +0300)
blender/io_mspgl/properties.py
source/animationplayer.cpp
source/buffer.cpp
source/datatype.h
source/object.cpp
source/pipeline.cpp
source/programcompiler.cpp
source/programdata.cpp
source/programsyntax.h

index f5a57cb7e7aa64e6f6e217d1089ba7502587166d..9f9d56c0eed8d1d2c6dd0a481fb310b658fb3d12 100644 (file)
@@ -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)
index 0c00105276309f711569a0ae65a29347c0879b2a..e73d1113f2a1443948e082d44258f2f39208bc8a 100644 (file)
@@ -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; i<n_uniforms; ++i)
-               set_object_uniform(obj, anim.animation.get_uniform_name(i), anim.iterator.get_uniform(i));
+               set_object_uniform(slot.object, anim.animation.get_uniform_name(i), anim.iterator.get_uniform(i));
 
        if(slot.armature)
        {
                unsigned max_index = slot.armature->get_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();
index 38a690287b96d3bcc506b81bc184700fa9b35521..040ae8df1eca040f55798222257121faf2efef49 100644 (file)
@@ -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;
 }
 
index 76c87bc8d8fe7627e2ed7c3bf60e4f9db65d2228..0d52408a6b21764fbfad86eaccc26a47c89ac678 100644 (file)
@@ -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"
 
index 4a2e5df13f745c82092feb4869eefeb828d4cdba..bdb292bb64e4721208c7bed12dca73bb30d03433 100644 (file)
@@ -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)
index 037741d24e4e1bfa0372c09943c1509cfad5b115..27cc3e3c63cc9d274e3573c7da915b21b846899d 100644 (file)
@@ -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());
index 9761177a8086be6ac0e16f69fa29974398548e57..cafedc8f03180d9be4285d7e189d7a9a1e4de975 100644 (file)
@@ -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)
index b69d7b062dd61af65164f94b65fc6fc41cceb90b..ca6ae5ba44dbae3ee8b5ee992b6c85ff785fde5f 100644 (file)
@@ -295,6 +295,8 @@ unsigned ProgramData::compute_slot_mask(const Program::UniformBlockInfo &block)
        for(vector<const Program::UniformInfo *>::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->second<MASK_BITS)
                        mask |= 1<<j->second;
        }
index 9e64c4c7e86896192748cefb24e29b2333ca1787..b0ad02b394c480708d1b871173b37cff3c3df6fd 100644 (file)
@@ -191,6 +191,7 @@ struct Layout: Node
 {
        struct Qualifier
        {
+               // TODO the standard calls this name, not identifier
                std::string identifier;
                std::string value;
        };