]> git.tdb.fi Git - libs/gl.git/commitdiff
An assortment of minor fixes
authorMikko Rasa <tdb@tdb.fi>
Sun, 25 Sep 2022 17:21:19 +0000 (20:21 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 25 Sep 2022 17:21:57 +0000 (20:21 +0300)
Mostly formatting, with a few cleanups of unnecessary things.

blender/io_mspgl/export.py
blender/io_mspgl/export_material.py
demos/desertpillars/source/desertpillars.h
source/backends/opengl/datatype_backend.cpp
source/core/batch.cpp
source/core/batch.h
source/glsl/resolve.cpp
source/render/renderer.cpp
source/render/renderer.h
tests/glsl/ignore_array_in_geometry_passthrough.glsl
tests/glsl/keep_spec_constants_in_module.glsl

index 9e60f28487f0ccd8b7b42aaad14484b2e72d530f..b724eddd4f8c071953cad9dc1c7c9cb38a24cc59 100644 (file)
@@ -93,9 +93,6 @@ class ProjectExporter:
                sequences = []
                for s in ctx.context.blend_data.scenes:
                        subtask = task.next_slice(s)
-                       if s.export_disposition=='IGNORE':
-                               continue
-
                        if s.export_disposition=='SEQUENCE':
                                scene = create_scene_chain(s, scenes)
                                sequences.append(scene)
@@ -141,6 +138,7 @@ class ProjectExporter:
                                resources[scene_name] = scene_res
                                dummy_res.create_reference_statement("ref", scene_res)
 
+               task = ctx.task("Exporting sequences", 1.0)
                for s in sequences:
                        subtask = task.task(s, 0.5)
                        seq_name = s.name+".seq"
index 4c40757f395421608ea13079d1b68fcae57c9c6c..a0c0432e993e2b37f1077036bfbc8dbbdc3613d5 100644 (file)
@@ -153,7 +153,6 @@ class MaterialExporter:
 
                spec_values = {}
 
-               color_prop = material.properties[0]
                if material.cast_shadows and material.alpha_cutoff>0.0:
                        spec_values["use_alpha_cutoff"] = True
                        variant += "_masked"
index 7aae1c2d903dbc52e0593950861b14152a5f94e0..3171da8efb6e7288c9aa7e139b5d0c5894f70d67 100644 (file)
@@ -35,7 +35,6 @@ private:
        {
        private:
                Msp::DataFile::DirectorySource source;
-               Msp::GL::ResourceManager res_mgr;
 
        public:
                Resources(Msp::GL::ResourceManager *);
index 15709693ae19d63f1f96a2e3e3b4da5b36b2a78d..da97010fae0ccdb99cf4ac29ca6035f1cea1abd7 100644 (file)
@@ -94,7 +94,7 @@ namespace GL {
 unsigned get_gl_type(DataType type)
 {
        const MappedType *end = type_map+type_map_size;
-       const MappedType *ptr = lower_bound(type_map, end, type, type_compare);
+       const MappedType *ptr = std::lower_bound(type_map, end, type, type_compare);
        if(ptr==end || ptr->type!=type)
                throw invalid_argument("get_gl_type");
        return ptr->gl_type;
index 83b7d49b53b69885799a03bfea9e9f33cbb7b4f4..56c25efb592e990e7438eae5932c53b4b9af7b72 100644 (file)
@@ -47,8 +47,7 @@ namespace GL {
 Batch::Batch(PrimitiveType t):
        BatchBackend(t),
        prim_type(t),
-       index_type(VOID),
-       max_index(0)
+       index_type(VOID)
 {
        set_index_type(UNSIGNED_SHORT);
 }
index f3495860e4b4297d072869f73082ce6f4e6a7c7b..2ac2c43c17f1eeb26c75626c2efd4064bf3d4880 100644 (file)
@@ -37,7 +37,7 @@ private:
        PrimitiveType prim_type;
        DataType index_type;
        std::vector<std::uint8_t> data;
-       unsigned max_index;
+       unsigned max_index = 0;
        unsigned patch_size = 3;
 
 public:
index aeccd1bf05ad18debdc3717264b4e58bfdf25493..1d165b7e119178a46ea5011ec4e426b21a7c64f5 100644 (file)
@@ -96,7 +96,7 @@ void TypeResolver::resolve_type(TypeDeclaration *&type, const string &name, bool
        }
 
        r_any_resolved |= (resolved!=type);
-       type=resolved;
+       type = resolved;
 }
 
 void TypeResolver::visit(Block &block)
index 352cf4201f17a372e044532f395069483eb14975..7e010b3f917b0a22a34d5bf1de66a7408e29259e 100644 (file)
@@ -71,7 +71,7 @@ void Renderer::push_state()
 
 void Renderer::pop_state()
 {
-       if(state_stack.size()==1)
+       if(state_stack.size()<=1)
                throw stack_underflow("Renderer::pop_state");
 
        uintptr_t old_pipeline = current_state->pipeline_key;
index da2cf8bac866d8284a2fe4c6395a935f8eba5258..0fa19346042ea1f5980c478e5dabd305bf66ab6a 100644 (file)
@@ -152,7 +152,7 @@ public:
        void push_state();
 
        /** Restores a previously saved state.  Must be matched with an earlier
-       push_state call. */
+       push_state() call. */
        void pop_state();
 
 private:
@@ -228,7 +228,8 @@ public:
        /** Draws a batch of primitives.  A shader must be active. */
        void draw(const Batch &);
 
-       /** Draws multiple instances of a batch of primitives.  A shader must be active. */
+       /** Draws multiple instances of a batch of primitives.  A shader must be
+       active. */
        void draw_instanced(const Batch &, unsigned);
 
 private:
index f491ea34ff674da83b6fc519deb499989e4d4a98..b616096827cc0f452332aef3bf2b75f31bd37fd9 100644 (file)
@@ -47,8 +47,8 @@ layout(location=2) in vec4 instance_transform[3];
 layout(location=0) out vec2 _vs_out_texcoord;
 void main()
 {
-  _vs_out_texcoord = texcoord;
-  gl_Position = vp_matrix*transpose(mat4(instance_transform[0], instance_transform[1], instance_transform[2], vec4(0.0, 0.0, 0.0, 1.0)))*position;
+       _vs_out_texcoord = texcoord;
+       gl_Position = vp_matrix*transpose(mat4(instance_transform[0], instance_transform[1], instance_transform[2], vec4(0.0, 0.0, 0.0, 1.0)))*position;
 }
 */
 
index 7b9f98c8f690277e889f2a2e2a4dab50c483d807..2a6b446e1ffc85be78c249db365cb2831c8c88b7 100644 (file)
@@ -57,10 +57,10 @@ layout(location=1) in vec2 _vs_out_texcoord;
 layout(location=0) in vec4 _vs_out_color;
 void main()
 {
-  frag_color = vec4(1.0);
-  if(use_texture)
-    frag_color *= texture(tex, _vs_out_texcoord);
-  if(use_vertex_color)
-    frag_color *= _vs_out_color;
+       frag_color = vec4(1.0);
+       if(use_texture)
+               frag_color *= texture(tex, _vs_out_texcoord);
+       if(use_vertex_color)
+               frag_color *= _vs_out_color;
 }
 */