Commit 3c537e12 authored by Jakob Weiss's avatar Jakob Weiss
Browse files

Minor updates

* Added .editorconfig
* cgt::Texture::downloadTextureToBuffer now does a glFlush() before downloading
* ColorPropertyWidget now supports transparent colors properly
parent c0fe9f70
Loading
Loading
Loading
Loading

.editorconfig

0 → 100644
+12 −0
Original line number Diff line number Diff line
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Windows-style newlines with a newline ending every file
[*]
end_of_line = crlf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ namespace campvis {
        ++_ignorePropertyUpdates;
        ColorProperty* prop = static_cast<ColorProperty*>(_property);
        cgt::vec4 val = QtColorTools::toTgtColor(_colorPicker->color());
        prop->setValue(cgt::vec4(val.x/val.w, val.y/val.w, val.z/val.w, 1));
        prop->setValue(cgt::vec4(val.x/255.f, val.y/255.f, val.z/255.f, val.w/255.f));
        --_ignorePropertyUpdates;
    }

+3 −0
Original line number Diff line number Diff line
@@ -405,6 +405,9 @@ namespace campvis {
        std::vector<cgt::vec3> vertices;
        std::vector<cgt::vec3> normals;

        vertices.reserve(4 * numSlices + 2);
        normals.reserve(4 * numSlices + 2);

        // add bottom vertex
        vertices.push_back(cgt::vec3(0.f, 0.f, 0.f));
        normals.push_back(cgt::vec3(0.f, 0.f, -1.f));
+2 −1
Original line number Diff line number Diff line
@@ -26,13 +26,14 @@
#define ALLPROPERTIES_H__

#include "core/properties/buttonproperty.h"
#include "core/properties/colorproperty.h"
#include "core/properties/datanameproperty.h"
#include "core/properties/floatingpointproperty.h"
#include "core/properties/metaproperty.h"
#include "core/properties/numericproperty.h"
#include "core/properties/optionproperty.h"
#include "core/properties/statusproperty.h"
#include "core/properties/stringproperty.h"
#include "core/properties/transferfunctionproperty.h"
#include "core/properties/statusproperty.h"

#endif // ALLPROPERTIES_H__
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -248,6 +248,8 @@ GLubyte* Texture::downloadTextureToBuffer(GLint format, GLenum dataType) const {
    int arraySize = hmul(dimensions_) * calcBpp(format, dataType);
    GLubyte* pixels = new GLubyte[arraySize];

    glFlush(); // better to use a barrier here but too lazy to figure out which one would be correct

    glPixelStorei(GL_PACK_ALIGNMENT, 1);
    glGetTexImage(type_, 0, format, dataType, pixels);
    return pixels;