style cleanup: tabs & whitespace
This commit is contained in:
8
intern/bsp/extern/CSG_BooleanOps.h
vendored
8
intern/bsp/extern/CSG_BooleanOps.h
vendored
@@ -61,9 +61,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int vertex_index[4];
|
||||
int vertex_number;
|
||||
int orig_face;
|
||||
int vertex_index[4];
|
||||
int vertex_number;
|
||||
int orig_face;
|
||||
} CSG_IFace;
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ typedef struct {
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
float position[3];
|
||||
float position[3];
|
||||
} CSG_IVertex;
|
||||
|
||||
/**
|
||||
|
||||
@@ -135,10 +135,10 @@ static bool Carve_checkEdgeFaceIntersections(carve::csg::Intersections &intersec
|
||||
|
||||
static inline bool Carve_facesAreCoplanar(const MeshSet<3>::face_t *a, const MeshSet<3>::face_t *b)
|
||||
{
|
||||
carve::geom3d::Ray temp;
|
||||
// XXX: Find a better definition. This may be a source of problems
|
||||
// if floating point inaccuracies cause an incorrect answer.
|
||||
return !carve::geom3d::planeIntersection(a->plane, b->plane, temp);
|
||||
carve::geom3d::Ray temp;
|
||||
// XXX: Find a better definition. This may be a source of problems
|
||||
// if floating point inaccuracies cause an incorrect answer.
|
||||
return !carve::geom3d::planeIntersection(a->plane, b->plane, temp);
|
||||
}
|
||||
|
||||
static bool Carve_checkMeshSetInterseciton_do(carve::csg::Intersections &intersections,
|
||||
|
||||
@@ -110,7 +110,7 @@ void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp)
|
||||
#endif
|
||||
|
||||
/* there are some version inbetween, which have avio_... functions but no
|
||||
AVIO_FLAG_... */
|
||||
* AVIO_FLAG_... */
|
||||
#ifndef AVIO_FLAG_WRITE
|
||||
#define AVIO_FLAG_WRITE URL_WRONLY
|
||||
#endif
|
||||
|
||||
@@ -95,7 +95,7 @@ wchar_t *alloc_utf16_from_8(const char *in8, size_t add);
|
||||
wchar_t *in8str ## _16 = alloc_utf16_from_8((char *)in8str, 0)
|
||||
|
||||
#define UTF16_UN_ENCODE(in8str) \
|
||||
free(in8str ## _16); } (void)0
|
||||
free(in8str ## _16); } (void)0
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ typedef enum {
|
||||
} SubsurfFlags;
|
||||
|
||||
struct DerivedMesh *subsurf_make_derived_from_derived(
|
||||
struct DerivedMesh *dm,
|
||||
struct SubsurfModifierData *smd,
|
||||
float (*vertCos)[3],
|
||||
SubsurfFlags flags);
|
||||
struct DerivedMesh *dm,
|
||||
struct SubsurfModifierData *smd,
|
||||
float (*vertCos)[3],
|
||||
SubsurfFlags flags);
|
||||
|
||||
void subsurf_calculate_limit_positions(struct Mesh *me, float (*positions_r)[3]);
|
||||
|
||||
|
||||
@@ -2823,7 +2823,7 @@ PointCache *BKE_ptcache_copy_list(ListBase *ptcaches_new, ListBase *ptcaches_old
|
||||
}
|
||||
|
||||
/* Disabled this code; this is being called on scene_update_tagged, and that in turn gets called on
|
||||
every user action changing stuff, and then it runs a complete bake??? (ton) */
|
||||
* every user action changing stuff, and then it runs a complete bake??? (ton) */
|
||||
|
||||
/* Baking */
|
||||
void BKE_ptcache_quick_cache_all(Main *bmain, Scene *scene)
|
||||
|
||||
@@ -157,14 +157,14 @@ int BLI_utf8_invalid_strip(char *str, int length)
|
||||
* note: this looks to be at odd's with 'trailingBytesForUTF8',
|
||||
* need to find out what gives here! - campbell */
|
||||
static const size_t utf8_skip_data[256] = {
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1
|
||||
};
|
||||
|
||||
#define BLI_STR_UTF8_CPY(dst, src, maxncpy) \
|
||||
|
||||
@@ -94,8 +94,8 @@ static void write_buffer_rect(rcti *rect, const bNodeTree *tree,
|
||||
|
||||
|
||||
OutputSingleLayerOperation::OutputSingleLayerOperation(
|
||||
const RenderData *rd, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path,
|
||||
const ColorManagedViewSettings *viewSettings, const ColorManagedDisplaySettings *displaySettings)
|
||||
const RenderData *rd, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path,
|
||||
const ColorManagedViewSettings *viewSettings, const ColorManagedDisplaySettings *displaySettings)
|
||||
{
|
||||
this->m_rd = rd;
|
||||
this->m_tree = tree;
|
||||
|
||||
@@ -88,8 +88,8 @@ void free_gpcopybuf(void);
|
||||
void copy_gpdata(void);
|
||||
void paste_gpdata(void);
|
||||
|
||||
void snap_masklayer_frames(struct MaskLayer *masklay, short mode);
|
||||
void mirror_masklayer_frames(struct MaskLayer *masklay, short mode);
|
||||
void snap_masklayer_frames(struct MaskLayer *masklay, short mode);
|
||||
void mirror_masklayer_frames(struct MaskLayer *masklay, short mode);
|
||||
#endif
|
||||
|
||||
#endif /* __ED_MASK_H__ */
|
||||
|
||||
@@ -74,7 +74,7 @@ if(WITH_INTERNATIONAL)
|
||||
endif()
|
||||
|
||||
if(WITH_BULLET)
|
||||
add_definitions(-DWITH_BULLET)
|
||||
add_definitions(-DWITH_BULLET)
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_editor_mesh "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -1393,10 +1393,10 @@ static void node_shader_buts_script(uiLayout *layout, bContext *UNUSED(C), Point
|
||||
|
||||
row = uiLayoutRow(layout, TRUE);
|
||||
|
||||
if(RNA_enum_get(ptr, "mode") == NODE_SCRIPT_INTERNAL)
|
||||
if (RNA_enum_get(ptr, "mode") == NODE_SCRIPT_INTERNAL)
|
||||
uiItemR(row, ptr, "script", 0, "", ICON_NONE);
|
||||
else
|
||||
uiItemR(row, ptr, "filepath", 0,"", ICON_NONE);
|
||||
uiItemR(row, ptr, "filepath", 0, "", ICON_NONE);
|
||||
|
||||
uiItemO(row, "", ICON_FILE_REFRESH, "node.shader_script_update");
|
||||
}
|
||||
|
||||
@@ -2158,21 +2158,22 @@ static int node_shader_script_update_poll(bContext *C)
|
||||
Text *text;
|
||||
|
||||
/* test if we have a render engine that supports shaders scripts */
|
||||
if(!(type && type->update_script_node))
|
||||
if (!(type && type->update_script_node))
|
||||
return 0;
|
||||
|
||||
/* see if we have a shader script node in context */
|
||||
node = CTX_data_pointer_get_type(C, "node", &RNA_ShaderNodeScript).data;
|
||||
if(node && node->type == SH_NODE_SCRIPT) {
|
||||
if (node && node->type == SH_NODE_SCRIPT) {
|
||||
NodeShaderScript *nss = node->storage;
|
||||
|
||||
if(node->id || nss->filepath[0])
|
||||
if (node->id || nss->filepath[0]) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* see if we have a text datablock in context */
|
||||
text = CTX_data_pointer_get_type(C, "edit_text", &RNA_Text).data;
|
||||
if(text)
|
||||
if (text)
|
||||
return 1;
|
||||
|
||||
/* we don't check if text datablock is actually in use, too slow for poll */
|
||||
@@ -2186,8 +2187,8 @@ static void node_shader_script_update_text(void *data_, ID *UNUSED(id), bNodeTre
|
||||
bNode *node;
|
||||
|
||||
/* update each script that is using this text datablock */
|
||||
for (node=ntree->nodes.first; node; node=node->next) {
|
||||
if (node->type == NODE_GROUP){
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
if (node->type == NODE_GROUP) {
|
||||
node_shader_script_update_text(data_, NULL, (bNodeTree *)node->id);
|
||||
}
|
||||
else if (node->type == SH_NODE_SCRIPT && node->id == &data->text->id) {
|
||||
|
||||
@@ -234,12 +234,13 @@ static int check_alpha_pass(Base *base)
|
||||
}
|
||||
|
||||
/***/
|
||||
static unsigned int colortab[24] =
|
||||
{0x0, 0xFF88FF, 0xFFBBFF,
|
||||
0x403000, 0xFFFF88, 0xFFFFBB,
|
||||
0x104040, 0x66CCCC, 0x77CCCC,
|
||||
0x104010, 0x55BB55, 0x66FF66,
|
||||
0xFFFFFF};
|
||||
static unsigned int colortab[24] = {
|
||||
0x0, 0xFF88FF, 0xFFBBFF,
|
||||
0x403000, 0xFFFF88, 0xFFFFBB,
|
||||
0x104040, 0x66CCCC, 0x77CCCC,
|
||||
0x104010, 0x55BB55, 0x66FF66,
|
||||
0xFFFFFF
|
||||
};
|
||||
|
||||
|
||||
static float cube[8][3] = {
|
||||
|
||||
@@ -1227,11 +1227,11 @@ void GPU_buffer_draw_elements(GPUBuffer *elements, unsigned int mode, int start,
|
||||
* drawing and doesn't interact at all with the buffer code above */
|
||||
|
||||
/* Return false if VBO is either unavailable or disabled by the user,
|
||||
true otherwise */
|
||||
* true otherwise */
|
||||
static int gpu_vbo_enabled(void)
|
||||
{
|
||||
return (GLEW_ARB_vertex_buffer_object &&
|
||||
!(U.gameflags & USER_DISABLE_VBO));
|
||||
!(U.gameflags & USER_DISABLE_VBO));
|
||||
}
|
||||
|
||||
/* Convenience struct for building the VBO. */
|
||||
|
||||
@@ -42,9 +42,9 @@ template<typename T>
|
||||
inline void
|
||||
swap(T & a, T & b)
|
||||
{
|
||||
T tmp = a;
|
||||
a = b;
|
||||
b = tmp;
|
||||
T tmp = a;
|
||||
a = b;
|
||||
b = tmp;
|
||||
}
|
||||
|
||||
typedef unsigned char uint8;
|
||||
|
||||
@@ -280,19 +280,19 @@ static const uint DDPF_SRGB = 0x40000000U;
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM = 87,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM = 88,
|
||||
|
||||
DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
|
||||
DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
|
||||
DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
|
||||
DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
|
||||
DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
|
||||
DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
|
||||
|
||||
DXGI_FORMAT_BC6H_TYPELESS = 94,
|
||||
DXGI_FORMAT_BC6H_UF16 = 95,
|
||||
DXGI_FORMAT_BC6H_SF16 = 96,
|
||||
DXGI_FORMAT_BC6H_TYPELESS = 94,
|
||||
DXGI_FORMAT_BC6H_UF16 = 95,
|
||||
DXGI_FORMAT_BC6H_SF16 = 96,
|
||||
|
||||
DXGI_FORMAT_BC7_TYPELESS = 97,
|
||||
DXGI_FORMAT_BC7_UNORM = 98,
|
||||
DXGI_FORMAT_BC7_UNORM_SRGB = 99,
|
||||
DXGI_FORMAT_BC7_TYPELESS = 97,
|
||||
DXGI_FORMAT_BC7_UNORM = 98,
|
||||
DXGI_FORMAT_BC7_UNORM_SRGB = 99,
|
||||
};
|
||||
|
||||
enum D3D10_RESOURCE_DIMENSION
|
||||
@@ -496,60 +496,60 @@ void mem_read(Stream & mem, DDSHeader & header)
|
||||
|
||||
namespace
|
||||
{
|
||||
struct FormatDescriptor
|
||||
{
|
||||
uint format;
|
||||
uint bitcount;
|
||||
uint rmask;
|
||||
uint gmask;
|
||||
uint bmask;
|
||||
uint amask;
|
||||
};
|
||||
struct FormatDescriptor
|
||||
{
|
||||
uint format;
|
||||
uint bitcount;
|
||||
uint rmask;
|
||||
uint gmask;
|
||||
uint bmask;
|
||||
uint amask;
|
||||
};
|
||||
|
||||
static const FormatDescriptor s_d3dFormats[] =
|
||||
{
|
||||
{ D3DFMT_R8G8B8, 24, 0xFF0000, 0xFF00, 0xFF, 0 },
|
||||
{ D3DFMT_A8R8G8B8, 32, 0xFF0000, 0xFF00, 0xFF, 0xFF000000 }, // DXGI_FORMAT_B8G8R8A8_UNORM
|
||||
{ D3DFMT_X8R8G8B8, 32, 0xFF0000, 0xFF00, 0xFF, 0 }, // DXGI_FORMAT_B8G8R8X8_UNORM
|
||||
{ D3DFMT_R5G6B5, 16, 0xF800, 0x7E0, 0x1F, 0 }, // DXGI_FORMAT_B5G6R5_UNORM
|
||||
{ D3DFMT_X1R5G5B5, 16, 0x7C00, 0x3E0, 0x1F, 0 },
|
||||
{ D3DFMT_A1R5G5B5, 16, 0x7C00, 0x3E0, 0x1F, 0x8000 }, // DXGI_FORMAT_B5G5R5A1_UNORM
|
||||
{ D3DFMT_A4R4G4B4, 16, 0xF00, 0xF0, 0xF, 0xF000 },
|
||||
{ D3DFMT_R3G3B2, 8, 0xE0, 0x1C, 0x3, 0 },
|
||||
{ D3DFMT_A8, 8, 0, 0, 0, 8 }, // DXGI_FORMAT_A8_UNORM
|
||||
{ D3DFMT_A8R3G3B2, 16, 0xE0, 0x1C, 0x3, 0xFF00 },
|
||||
{ D3DFMT_X4R4G4B4, 16, 0xF00, 0xF0, 0xF, 0 },
|
||||
{ D3DFMT_A2B10G10R10, 32, 0x3FF, 0xFFC00, 0x3FF00000, 0xC0000000 }, // DXGI_FORMAT_R10G10B10A2
|
||||
{ D3DFMT_A8B8G8R8, 32, 0xFF, 0xFF00, 0xFF0000, 0xFF000000 }, // DXGI_FORMAT_R8G8B8A8_UNORM
|
||||
{ D3DFMT_X8B8G8R8, 32, 0xFF, 0xFF00, 0xFF0000, 0 },
|
||||
{ D3DFMT_G16R16, 32, 0xFFFF, 0xFFFF0000, 0, 0 }, // DXGI_FORMAT_R16G16_UNORM
|
||||
{ D3DFMT_A2R10G10B10, 32, 0x3FF00000, 0xFFC00, 0x3FF, 0xC0000000 },
|
||||
{ D3DFMT_A2B10G10R10, 32, 0x3FF, 0xFFC00, 0x3FF00000, 0xC0000000 },
|
||||
static const FormatDescriptor s_d3dFormats[] =
|
||||
{
|
||||
{ D3DFMT_R8G8B8, 24, 0xFF0000, 0xFF00, 0xFF, 0 },
|
||||
{ D3DFMT_A8R8G8B8, 32, 0xFF0000, 0xFF00, 0xFF, 0xFF000000 }, /* DXGI_FORMAT_B8G8R8A8_UNORM */
|
||||
{ D3DFMT_X8R8G8B8, 32, 0xFF0000, 0xFF00, 0xFF, 0 }, /* DXGI_FORMAT_B8G8R8X8_UNORM */
|
||||
{ D3DFMT_R5G6B5, 16, 0xF800, 0x7E0, 0x1F, 0 }, /* DXGI_FORMAT_B5G6R5_UNORM */
|
||||
{ D3DFMT_X1R5G5B5, 16, 0x7C00, 0x3E0, 0x1F, 0 },
|
||||
{ D3DFMT_A1R5G5B5, 16, 0x7C00, 0x3E0, 0x1F, 0x8000 }, /* DXGI_FORMAT_B5G5R5A1_UNORM */
|
||||
{ D3DFMT_A4R4G4B4, 16, 0xF00, 0xF0, 0xF, 0xF000 },
|
||||
{ D3DFMT_R3G3B2, 8, 0xE0, 0x1C, 0x3, 0 },
|
||||
{ D3DFMT_A8, 8, 0, 0, 0, 8 }, /* DXGI_FORMAT_A8_UNORM */
|
||||
{ D3DFMT_A8R3G3B2, 16, 0xE0, 0x1C, 0x3, 0xFF00 },
|
||||
{ D3DFMT_X4R4G4B4, 16, 0xF00, 0xF0, 0xF, 0 },
|
||||
{ D3DFMT_A2B10G10R10, 32, 0x3FF, 0xFFC00, 0x3FF00000, 0xC0000000 }, /* DXGI_FORMAT_R10G10B10A2 */
|
||||
{ D3DFMT_A8B8G8R8, 32, 0xFF, 0xFF00, 0xFF0000, 0xFF000000 }, /* DXGI_FORMAT_R8G8B8A8_UNORM */
|
||||
{ D3DFMT_X8B8G8R8, 32, 0xFF, 0xFF00, 0xFF0000, 0 },
|
||||
{ D3DFMT_G16R16, 32, 0xFFFF, 0xFFFF0000, 0, 0 }, /* DXGI_FORMAT_R16G16_UNORM */
|
||||
{ D3DFMT_A2R10G10B10, 32, 0x3FF00000, 0xFFC00, 0x3FF, 0xC0000000 },
|
||||
{ D3DFMT_A2B10G10R10, 32, 0x3FF, 0xFFC00, 0x3FF00000, 0xC0000000 },
|
||||
|
||||
{ D3DFMT_L8, 8, 8, 0, 0, 0 }, // DXGI_FORMAT_R8_UNORM
|
||||
{ D3DFMT_L16, 16, 16, 0, 0, 0 }, // DXGI_FORMAT_R16_UNORM
|
||||
};
|
||||
{ D3DFMT_L8, 8, 8, 0, 0, 0 }, /* DXGI_FORMAT_R8_UNORM */
|
||||
{ D3DFMT_L16, 16, 16, 0, 0, 0 }, /* DXGI_FORMAT_R16_UNORM */
|
||||
};
|
||||
|
||||
static const uint s_d3dFormatCount = sizeof(s_d3dFormats) / sizeof(s_d3dFormats[0]);
|
||||
static const uint s_d3dFormatCount = sizeof(s_d3dFormats) / sizeof(s_d3dFormats[0]);
|
||||
|
||||
} // namespace
|
||||
|
||||
static uint findD3D9Format(uint bitcount, uint rmask, uint gmask, uint bmask, uint amask)
|
||||
{
|
||||
for (int i = 0; i < s_d3dFormatCount; i++)
|
||||
{
|
||||
if (s_d3dFormats[i].bitcount == bitcount &&
|
||||
s_d3dFormats[i].rmask == rmask &&
|
||||
s_d3dFormats[i].gmask == gmask &&
|
||||
s_d3dFormats[i].bmask == bmask &&
|
||||
s_d3dFormats[i].amask == amask)
|
||||
{
|
||||
return s_d3dFormats[i].format;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < s_d3dFormatCount; i++)
|
||||
{
|
||||
if (s_d3dFormats[i].bitcount == bitcount &&
|
||||
s_d3dFormats[i].rmask == rmask &&
|
||||
s_d3dFormats[i].gmask == gmask &&
|
||||
s_d3dFormats[i].bmask == bmask &&
|
||||
s_d3dFormats[i].amask == amask)
|
||||
{
|
||||
return s_d3dFormats[i].format;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -566,7 +566,7 @@ DDSHeader::DDSHeader()
|
||||
for (uint i = 0; i < 11; i++) this->reserved[i] = 0;
|
||||
|
||||
// Store version information on the reserved header attributes.
|
||||
this->reserved[9] = FOURCC_NVTT;
|
||||
this->reserved[9] = FOURCC_NVTT;
|
||||
this->reserved[10] = (2 << 16) | (1 << 8) | (0); // major.minor.revision
|
||||
|
||||
this->pf.size = 32;
|
||||
@@ -613,7 +613,7 @@ void DDSHeader::setMipmapCount(uint count)
|
||||
if (count == 0 || count == 1)
|
||||
{
|
||||
this->flags &= ~DDSD_MIPMAPCOUNT;
|
||||
this->mipmapcount = 1;
|
||||
this->mipmapcount = 1;
|
||||
|
||||
if (this->caps.caps2 == 0) {
|
||||
this->caps.caps1 = DDSCAPS_TEXTURE;
|
||||
@@ -715,14 +715,14 @@ void DDSHeader::setPixelFormat(uint bitcount, uint rmask, uint gmask, uint bmask
|
||||
|
||||
if (rmask != 0 || gmask != 0 || bmask != 0)
|
||||
{
|
||||
if (gmask == 0 && bmask == 0)
|
||||
{
|
||||
this->pf.flags = DDPF_LUMINANCE;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->pf.flags = DDPF_RGB;
|
||||
}
|
||||
if (gmask == 0 && bmask == 0)
|
||||
{
|
||||
this->pf.flags = DDPF_LUMINANCE;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->pf.flags = DDPF_RGB;
|
||||
}
|
||||
|
||||
if (amask != 0) {
|
||||
this->pf.flags |= DDPF_ALPHAPIXELS;
|
||||
@@ -743,11 +743,11 @@ void DDSHeader::setPixelFormat(uint bitcount, uint rmask, uint gmask, uint bmask
|
||||
}
|
||||
}
|
||||
|
||||
// D3DX functions do not like this:
|
||||
// D3DX functions do not like this:
|
||||
this->pf.fourcc = 0; //findD3D9Format(bitcount, rmask, gmask, bmask, amask);
|
||||
/*if (this->pf.fourcc) {
|
||||
this->pf.flags |= DDPF_FOURCC;
|
||||
}*/
|
||||
/*if (this->pf.fourcc) {
|
||||
this->pf.flags |= DDPF_FOURCC;
|
||||
}*/
|
||||
|
||||
if (!(bitcount > 0 && bitcount <= 32)) {
|
||||
printf("DDS: bad bit count, pixel format not set\n");
|
||||
@@ -775,8 +775,8 @@ void DDSHeader::setNormalFlag(bool b)
|
||||
|
||||
void DDSHeader::setSrgbFlag(bool b)
|
||||
{
|
||||
if (b) this->pf.flags |= DDPF_SRGB;
|
||||
else this->pf.flags &= ~DDPF_SRGB;
|
||||
if (b) this->pf.flags |= DDPF_SRGB;
|
||||
else this->pf.flags &= ~DDPF_SRGB;
|
||||
}
|
||||
|
||||
void DDSHeader::setHasAlphaFlag(bool b)
|
||||
@@ -787,8 +787,8 @@ void DDSHeader::setHasAlphaFlag(bool b)
|
||||
|
||||
void DDSHeader::setUserVersion(int version)
|
||||
{
|
||||
this->reserved[7] = FOURCC_UVER;
|
||||
this->reserved[8] = version;
|
||||
this->reserved[7] = FOURCC_UVER;
|
||||
this->reserved[8] = version;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -836,45 +836,45 @@ bool DDSHeader::hasDX10Header() const
|
||||
|
||||
uint DDSHeader::signature() const
|
||||
{
|
||||
return this->reserved[9];
|
||||
return this->reserved[9];
|
||||
}
|
||||
|
||||
uint DDSHeader::toolVersion() const
|
||||
{
|
||||
return this->reserved[10];
|
||||
return this->reserved[10];
|
||||
}
|
||||
|
||||
uint DDSHeader::userVersion() const
|
||||
{
|
||||
if (this->reserved[7] == FOURCC_UVER) {
|
||||
return this->reserved[8];
|
||||
}
|
||||
return 0;
|
||||
if (this->reserved[7] == FOURCC_UVER) {
|
||||
return this->reserved[8];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool DDSHeader::isNormalMap() const
|
||||
{
|
||||
return (pf.flags & DDPF_NORMAL) != 0;
|
||||
return (pf.flags & DDPF_NORMAL) != 0;
|
||||
}
|
||||
|
||||
bool DDSHeader::isSrgb() const
|
||||
{
|
||||
return (pf.flags & DDPF_SRGB) != 0;
|
||||
return (pf.flags & DDPF_SRGB) != 0;
|
||||
}
|
||||
|
||||
bool DDSHeader::hasAlpha() const
|
||||
{
|
||||
return (pf.flags & DDPF_ALPHAPIXELS) != 0;
|
||||
return (pf.flags & DDPF_ALPHAPIXELS) != 0;
|
||||
}
|
||||
|
||||
uint DDSHeader::d3d9Format() const
|
||||
{
|
||||
if (pf.flags & DDPF_FOURCC) {
|
||||
return pf.fourcc;
|
||||
}
|
||||
else {
|
||||
return findD3D9Format(pf.bitcount, pf.rmask, pf.gmask, pf.bmask, pf.amask);
|
||||
}
|
||||
if (pf.flags & DDPF_FOURCC) {
|
||||
return pf.fourcc;
|
||||
}
|
||||
else {
|
||||
return findD3D9Format(pf.bitcount, pf.rmask, pf.gmask, pf.bmask, pf.amask);
|
||||
}
|
||||
}
|
||||
|
||||
DirectDrawSurface::DirectDrawSurface(unsigned char *mem, uint size) : stream(mem, size), header()
|
||||
@@ -949,9 +949,9 @@ bool DirectDrawSurface::isSupported() const
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ((header.pf.flags & DDPF_RGB) || (header.pf.flags & DDPF_LUMINANCE))
|
||||
{
|
||||
// All RGB and luminance formats are supported now.
|
||||
else if ((header.pf.flags & DDPF_RGB) || (header.pf.flags & DDPF_LUMINANCE))
|
||||
{
|
||||
// All RGB and luminance formats are supported now.
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1001,7 +1001,7 @@ bool DirectDrawSurface::hasAlpha() const
|
||||
}
|
||||
else
|
||||
{
|
||||
// @@ Here we could check the ALPHA_PIXELS flag, but nobody sets it. (except us?)
|
||||
// @@ Here we could check the ALPHA_PIXELS flag, but nobody sets it. (except us?)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1089,7 +1089,7 @@ void DirectDrawSurface::setHasAlphaFlag(bool b)
|
||||
|
||||
void DirectDrawSurface::setUserVersion(int version)
|
||||
{
|
||||
header.setUserVersion(version);
|
||||
header.setUserVersion(version);
|
||||
}
|
||||
|
||||
void DirectDrawSurface::mipmap(Image * img, uint face, uint mipmap)
|
||||
@@ -1268,15 +1268,15 @@ void DirectDrawSurface::readBlock(ColorBlock * rgba)
|
||||
block.decodeBlock(rgba);
|
||||
}
|
||||
else if (fourcc == FOURCC_DXT2 ||
|
||||
header.pf.fourcc == FOURCC_DXT3)
|
||||
header.pf.fourcc == FOURCC_DXT3)
|
||||
{
|
||||
BlockDXT3 block;
|
||||
mem_read(stream, block);
|
||||
block.decodeBlock(rgba);
|
||||
}
|
||||
else if (fourcc == FOURCC_DXT4 ||
|
||||
header.pf.fourcc == FOURCC_DXT5 ||
|
||||
header.pf.fourcc == FOURCC_RXGB)
|
||||
header.pf.fourcc == FOURCC_DXT5 ||
|
||||
header.pf.fourcc == FOURCC_RXGB)
|
||||
{
|
||||
BlockDXT5 block;
|
||||
mem_read(stream, block);
|
||||
@@ -1393,7 +1393,7 @@ uint DirectDrawSurface::mipmapSize(uint mipmap) const
|
||||
}
|
||||
else if (header.pf.flags & DDPF_RGB || (header.pf.flags & DDPF_LUMINANCE))
|
||||
{
|
||||
uint pitch = computePitch(w, header.pf.bitcount, 8); // Asuming 8 bit alignment, which is the same D3DX expects.
|
||||
uint pitch = computePitch(w, header.pf.bitcount, 8); // Asuming 8 bit alignment, which is the same D3DX expects.
|
||||
|
||||
return pitch * h * d;
|
||||
}
|
||||
@@ -1461,7 +1461,7 @@ void DirectDrawSurface::printInfo() const
|
||||
printf("Pixel Format:\n");
|
||||
printf("\tFlags: 0x%.8X\n", header.pf.flags);
|
||||
if (header.pf.flags & DDPF_RGB) printf("\t\tDDPF_RGB\n");
|
||||
if (header.pf.flags & DDPF_LUMINANCE) printf("\t\tDDPF_LUMINANCE\n");
|
||||
if (header.pf.flags & DDPF_LUMINANCE) printf("\t\tDDPF_LUMINANCE\n");
|
||||
if (header.pf.flags & DDPF_FOURCC) printf("\t\tDDPF_FOURCC\n");
|
||||
if (header.pf.flags & DDPF_ALPHAPIXELS) printf("\t\tDDPF_ALPHAPIXELS\n");
|
||||
if (header.pf.flags & DDPF_ALPHA) printf("\t\tDDPF_ALPHA\n");
|
||||
@@ -1472,24 +1472,24 @@ void DirectDrawSurface::printInfo() const
|
||||
if (header.pf.flags & DDPF_ALPHAPREMULT) printf("\t\tDDPF_ALPHAPREMULT\n");
|
||||
if (header.pf.flags & DDPF_NORMAL) printf("\t\tDDPF_NORMAL\n");
|
||||
|
||||
if (header.pf.fourcc != 0) {
|
||||
// Display fourcc code even when DDPF_FOURCC flag not set.
|
||||
printf("\tFourCC: '%c%c%c%c' (0x%.8X)\n",
|
||||
((header.pf.fourcc >> 0) & 0xFF),
|
||||
((header.pf.fourcc >> 8) & 0xFF),
|
||||
((header.pf.fourcc >> 16) & 0xFF),
|
||||
((header.pf.fourcc >> 24) & 0xFF),
|
||||
header.pf.fourcc);
|
||||
}
|
||||
if (header.pf.fourcc != 0) {
|
||||
// Display fourcc code even when DDPF_FOURCC flag not set.
|
||||
printf("\tFourCC: '%c%c%c%c' (0x%.8X)\n",
|
||||
((header.pf.fourcc >> 0) & 0xFF),
|
||||
((header.pf.fourcc >> 8) & 0xFF),
|
||||
((header.pf.fourcc >> 16) & 0xFF),
|
||||
((header.pf.fourcc >> 24) & 0xFF),
|
||||
header.pf.fourcc);
|
||||
}
|
||||
|
||||
if ((header.pf.flags & DDPF_FOURCC) && (header.pf.bitcount != 0))
|
||||
if ((header.pf.flags & DDPF_FOURCC) && (header.pf.bitcount != 0))
|
||||
{
|
||||
printf("\tSwizzle: '%c%c%c%c' (0x%.8X)\n",
|
||||
(header.pf.bitcount >> 0) & 0xFF,
|
||||
(header.pf.bitcount >> 8) & 0xFF,
|
||||
(header.pf.bitcount >> 16) & 0xFF,
|
||||
(header.pf.bitcount >> 24) & 0xFF,
|
||||
header.pf.bitcount);
|
||||
printf("\tSwizzle: '%c%c%c%c' (0x%.8X)\n",
|
||||
(header.pf.bitcount >> 0) & 0xFF,
|
||||
(header.pf.bitcount >> 8) & 0xFF,
|
||||
(header.pf.bitcount >> 16) & 0xFF,
|
||||
(header.pf.bitcount >> 24) & 0xFF,
|
||||
header.pf.bitcount);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1535,7 +1535,7 @@ void DirectDrawSurface::printInfo() const
|
||||
printf("\tArray size: %u\n", header.header10.arraySize);
|
||||
}
|
||||
|
||||
if (header.reserved[9] == FOURCC_NVTT)
|
||||
if (header.reserved[9] == FOURCC_NVTT)
|
||||
{
|
||||
int major = (header.reserved[10] >> 16) & 0xFF;
|
||||
int minor = (header.reserved[10] >> 8) & 0xFF;
|
||||
@@ -1545,9 +1545,9 @@ void DirectDrawSurface::printInfo() const
|
||||
printf("\tNVIDIA Texture Tools %d.%d.%d\n", major, minor, revision);
|
||||
}
|
||||
|
||||
if (header.reserved[7] == FOURCC_UVER)
|
||||
{
|
||||
printf("User Version: %u\n", header.reserved[8]);
|
||||
}
|
||||
if (header.reserved[7] == FOURCC_UVER)
|
||||
{
|
||||
printf("User Version: %u\n", header.reserved[8]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
|
||||
void setNormalFlag(bool b);
|
||||
void setHasAlphaFlag(bool b);
|
||||
void setUserVersion(int version);
|
||||
void setUserVersion(int version);
|
||||
|
||||
void mipmap(Image * img, uint f, uint m);
|
||||
void* readData(uint &size);
|
||||
|
||||
@@ -238,19 +238,19 @@ public:
|
||||
Iex::throwErrnoExc();
|
||||
}
|
||||
|
||||
virtual void write(const char c[], int n)
|
||||
virtual void write(const char c[], int n)
|
||||
{
|
||||
errno = 0;
|
||||
ofs.write(c, n);
|
||||
check_error();
|
||||
}
|
||||
|
||||
virtual Int64 tellp()
|
||||
virtual Int64 tellp()
|
||||
{
|
||||
return std::streamoff(ofs.tellp());
|
||||
}
|
||||
|
||||
virtual void seekp(Int64 pos)
|
||||
virtual void seekp(Int64 pos)
|
||||
{
|
||||
ofs.seekp(pos);
|
||||
check_error();
|
||||
|
||||
@@ -1837,10 +1837,10 @@ void RNA_def_material(BlenderRNA *brna)
|
||||
"from other scene lighting");
|
||||
RNA_def_property_update(prop, 0, "rna_Material_update");
|
||||
|
||||
prop = RNA_def_property(srna, "use_light_group_local", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_GROUP_LOCAL);
|
||||
RNA_def_property_ui_text(prop, "Light Group Local", "When linked in, material uses local light group with the same name");
|
||||
RNA_def_property_update(prop, 0, "rna_Material_update");
|
||||
prop = RNA_def_property(srna, "use_light_group_local", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_GROUP_LOCAL);
|
||||
RNA_def_property_ui_text(prop, "Light Group Local", "When linked in, material uses local light group with the same name");
|
||||
RNA_def_property_update(prop, 0, "rna_Material_update");
|
||||
|
||||
prop = RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRACEBLE);
|
||||
|
||||
@@ -1006,14 +1006,18 @@ static bNodeSocket *rna_ShaderNodeScript_find_socket(bNode *node, const char *na
|
||||
bNodeSocket *sock;
|
||||
|
||||
if (is_output) {
|
||||
for (sock = node->outputs.first; sock; sock = sock->next)
|
||||
if (strcmp(sock->name, name)==0)
|
||||
for (sock = node->outputs.first; sock; sock = sock->next) {
|
||||
if (strcmp(sock->name, name) == 0) {
|
||||
return sock;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (sock = node->inputs.first; sock; sock = sock->next)
|
||||
if (strcmp(sock->name, name)==0)
|
||||
for (sock = node->inputs.first; sock; sock = sock->next) {
|
||||
if (strcmp(sock->name, name) == 0) {
|
||||
return sock;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -1052,13 +1056,13 @@ static void rna_ShaderNodeScript_mode_set(PointerRNA *ptr, int value)
|
||||
if (nss->mode != value) {
|
||||
nss->mode = value;
|
||||
nss->filepath[0] = '\0';
|
||||
nss->flag &= ~NODE_SCRIPT_AUTO_UPDATE;
|
||||
nss->flag &= ~NODE_SCRIPT_AUTO_UPDATE;
|
||||
|
||||
/* replace text datablock by filepath */
|
||||
if (node->id) {
|
||||
Text *text = (Text*)node->id;
|
||||
|
||||
if(value == NODE_SCRIPT_EXTERNAL && text->name) {
|
||||
if (value == NODE_SCRIPT_EXTERNAL && text->name) {
|
||||
BLI_strncpy(nss->filepath, text->name, sizeof(nss->filepath));
|
||||
BLI_path_rel(nss->filepath, G.main->name);
|
||||
}
|
||||
@@ -1068,7 +1072,7 @@ static void rna_ShaderNodeScript_mode_set(PointerRNA *ptr, int value)
|
||||
}
|
||||
|
||||
/* remove any bytecode */
|
||||
if(nss->bytecode) {
|
||||
if (nss->bytecode) {
|
||||
MEM_freeN(nss->bytecode);
|
||||
nss->bytecode = NULL;
|
||||
}
|
||||
|
||||
@@ -89,29 +89,29 @@ static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name
|
||||
#include "../../collada/collada.h"
|
||||
|
||||
static void rna_Scene_collada_export(
|
||||
Scene *scene,
|
||||
const char *filepath,
|
||||
int apply_modifiers,
|
||||
int export_mesh_type,
|
||||
Scene *scene,
|
||||
const char *filepath,
|
||||
int apply_modifiers,
|
||||
int export_mesh_type,
|
||||
|
||||
int selected,
|
||||
int include_children,
|
||||
int include_armatures,
|
||||
int deform_bones_only,
|
||||
int selected,
|
||||
int include_children,
|
||||
int include_armatures,
|
||||
int deform_bones_only,
|
||||
|
||||
int active_uv_only,
|
||||
int include_uv_textures,
|
||||
int include_material_textures,
|
||||
int use_texture_copies,
|
||||
int active_uv_only,
|
||||
int include_uv_textures,
|
||||
int include_material_textures,
|
||||
int use_texture_copies,
|
||||
|
||||
int use_object_instantiation,
|
||||
int sort_by_name,
|
||||
int second_life)
|
||||
int use_object_instantiation,
|
||||
int sort_by_name,
|
||||
int second_life)
|
||||
{
|
||||
collada_export(scene, filepath, apply_modifiers, export_mesh_type, selected,
|
||||
include_children, include_armatures, deform_bones_only,
|
||||
active_uv_only, include_uv_textures, include_material_textures,
|
||||
use_texture_copies, use_object_instantiation, sort_by_name, second_life);
|
||||
active_uv_only, include_uv_textures, include_material_textures,
|
||||
use_texture_copies, use_object_instantiation, sort_by_name, second_life);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -552,8 +552,8 @@ static void validate_solution(LaplacianSystem *sys, short flag)
|
||||
}
|
||||
|
||||
static void laplaciansmoothModifier_do(
|
||||
LaplacianSmoothModifierData *smd, Object *ob, DerivedMesh *dm,
|
||||
float (*vertexCos)[3], int numVerts)
|
||||
LaplacianSmoothModifierData *smd, Object *ob, DerivedMesh *dm,
|
||||
float (*vertexCos)[3], int numVerts)
|
||||
{
|
||||
LaplacianSystem *sys;
|
||||
MDeformVert *dvert = NULL;
|
||||
|
||||
@@ -1430,15 +1430,15 @@ void IDProp_Init_Types(void)
|
||||
/* --- */
|
||||
|
||||
static struct PyModuleDef IDProp_types_module_def = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
"idprop.types", /* m_name */
|
||||
NULL, /* m_doc */
|
||||
0, /* m_size */
|
||||
NULL, /* m_methods */
|
||||
NULL, /* m_reload */
|
||||
NULL, /* m_traverse */
|
||||
NULL, /* m_clear */
|
||||
NULL, /* m_free */
|
||||
PyModuleDef_HEAD_INIT,
|
||||
"idprop.types", /* m_name */
|
||||
NULL, /* m_doc */
|
||||
0, /* m_size */
|
||||
NULL, /* m_methods */
|
||||
NULL, /* m_reload */
|
||||
NULL, /* m_traverse */
|
||||
NULL, /* m_clear */
|
||||
NULL, /* m_free */
|
||||
};
|
||||
|
||||
static PyObject *BPyInit_idprop_types(void)
|
||||
|
||||
@@ -6951,7 +6951,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
|
||||
|
||||
#ifdef USE_PEDANTIC_WRITE
|
||||
const int is_operator = RNA_struct_is_a(ptr->type, &RNA_Operator);
|
||||
const char *func_id = RNA_function_identifier(func);
|
||||
// const char *func_id = RNA_function_identifier(func); /* UNUSED */
|
||||
/* testing, for correctness, not operator and not draw function */
|
||||
const short is_readonly = !(RNA_function_flag(func) & FUNC_ALLOW_WRITE);
|
||||
#endif
|
||||
|
||||
@@ -764,39 +764,39 @@ static void area_sample(TexResult *texr, ImBuf *ibuf, float fx, float fy, afdata
|
||||
/* table of (exp(ar) - exp(a)) / (1 - exp(a)) for r in range [0, 1] and a = -2
|
||||
* used instead of actual gaussian, otherwise at high texture magnifications circular artifacts are visible */
|
||||
#define EWA_MAXIDX 255
|
||||
static float EWA_WTS[EWA_MAXIDX + 1] =
|
||||
{ 1.f, 0.990965f, 0.982f, 0.973105f, 0.96428f, 0.955524f, 0.946836f, 0.938216f, 0.929664f,
|
||||
0.921178f, 0.912759f, 0.904405f, 0.896117f, 0.887893f, 0.879734f, 0.871638f, 0.863605f,
|
||||
0.855636f, 0.847728f, 0.839883f, 0.832098f, 0.824375f, 0.816712f, 0.809108f, 0.801564f,
|
||||
0.794079f, 0.786653f, 0.779284f, 0.771974f, 0.76472f, 0.757523f, 0.750382f, 0.743297f,
|
||||
0.736267f, 0.729292f, 0.722372f, 0.715505f, 0.708693f, 0.701933f, 0.695227f, 0.688572f,
|
||||
0.68197f, 0.67542f, 0.66892f, 0.662471f, 0.656073f, 0.649725f, 0.643426f, 0.637176f,
|
||||
0.630976f, 0.624824f, 0.618719f, 0.612663f, 0.606654f, 0.600691f, 0.594776f, 0.588906f,
|
||||
0.583083f, 0.577305f, 0.571572f, 0.565883f, 0.56024f, 0.55464f, 0.549084f, 0.543572f,
|
||||
0.538102f, 0.532676f, 0.527291f, 0.521949f, 0.516649f, 0.511389f, 0.506171f, 0.500994f,
|
||||
0.495857f, 0.490761f, 0.485704f, 0.480687f, 0.475709f, 0.470769f, 0.465869f, 0.461006f,
|
||||
0.456182f, 0.451395f, 0.446646f, 0.441934f, 0.437258f, 0.432619f, 0.428017f, 0.42345f,
|
||||
0.418919f, 0.414424f, 0.409963f, 0.405538f, 0.401147f, 0.39679f, 0.392467f, 0.388178f,
|
||||
0.383923f, 0.379701f, 0.375511f, 0.371355f, 0.367231f, 0.363139f, 0.359079f, 0.355051f,
|
||||
0.351055f, 0.347089f, 0.343155f, 0.339251f, 0.335378f, 0.331535f, 0.327722f, 0.323939f,
|
||||
0.320186f, 0.316461f, 0.312766f, 0.3091f, 0.305462f, 0.301853f, 0.298272f, 0.294719f,
|
||||
0.291194f, 0.287696f, 0.284226f, 0.280782f, 0.277366f, 0.273976f, 0.270613f, 0.267276f,
|
||||
0.263965f, 0.26068f, 0.257421f, 0.254187f, 0.250979f, 0.247795f, 0.244636f, 0.241502f,
|
||||
0.238393f, 0.235308f, 0.232246f, 0.229209f, 0.226196f, 0.223206f, 0.220239f, 0.217296f,
|
||||
0.214375f, 0.211478f, 0.208603f, 0.20575f, 0.20292f, 0.200112f, 0.197326f, 0.194562f,
|
||||
0.191819f, 0.189097f, 0.186397f, 0.183718f, 0.18106f, 0.178423f, 0.175806f, 0.17321f,
|
||||
0.170634f, 0.168078f, 0.165542f, 0.163026f, 0.16053f, 0.158053f, 0.155595f, 0.153157f,
|
||||
0.150738f, 0.148337f, 0.145955f, 0.143592f, 0.141248f, 0.138921f, 0.136613f, 0.134323f,
|
||||
0.132051f, 0.129797f, 0.12756f, 0.125341f, 0.123139f, 0.120954f, 0.118786f, 0.116635f,
|
||||
0.114501f, 0.112384f, 0.110283f, 0.108199f, 0.106131f, 0.104079f, 0.102043f, 0.100023f,
|
||||
0.0980186f, 0.09603f, 0.094057f, 0.0920994f, 0.0901571f, 0.08823f, 0.0863179f, 0.0844208f,
|
||||
0.0825384f, 0.0806708f, 0.0788178f, 0.0769792f, 0.0751551f, 0.0733451f, 0.0715493f, 0.0697676f,
|
||||
0.0679997f, 0.0662457f, 0.0645054f, 0.0627786f, 0.0610654f, 0.0593655f, 0.0576789f, 0.0560055f,
|
||||
0.0543452f, 0.0526979f, 0.0510634f, 0.0494416f, 0.0478326f, 0.0462361f, 0.0446521f, 0.0430805f,
|
||||
0.0415211f, 0.039974f, 0.0384389f, 0.0369158f, 0.0354046f, 0.0339052f, 0.0324175f, 0.0309415f,
|
||||
0.029477f, 0.0280239f, 0.0265822f, 0.0251517f, 0.0237324f, 0.0223242f, 0.020927f, 0.0195408f,
|
||||
0.0181653f, 0.0168006f, 0.0154466f, 0.0141031f, 0.0127701f, 0.0114476f, 0.0101354f, 0.00883339f,
|
||||
0.00754159f, 0.00625989f, 0.00498819f, 0.00372644f, 0.00247454f, 0.00123242f, 0.f
|
||||
static float EWA_WTS[EWA_MAXIDX + 1] = {
|
||||
1.f, 0.990965f, 0.982f, 0.973105f, 0.96428f, 0.955524f, 0.946836f, 0.938216f, 0.929664f,
|
||||
0.921178f, 0.912759f, 0.904405f, 0.896117f, 0.887893f, 0.879734f, 0.871638f, 0.863605f,
|
||||
0.855636f, 0.847728f, 0.839883f, 0.832098f, 0.824375f, 0.816712f, 0.809108f, 0.801564f,
|
||||
0.794079f, 0.786653f, 0.779284f, 0.771974f, 0.76472f, 0.757523f, 0.750382f, 0.743297f,
|
||||
0.736267f, 0.729292f, 0.722372f, 0.715505f, 0.708693f, 0.701933f, 0.695227f, 0.688572f,
|
||||
0.68197f, 0.67542f, 0.66892f, 0.662471f, 0.656073f, 0.649725f, 0.643426f, 0.637176f,
|
||||
0.630976f, 0.624824f, 0.618719f, 0.612663f, 0.606654f, 0.600691f, 0.594776f, 0.588906f,
|
||||
0.583083f, 0.577305f, 0.571572f, 0.565883f, 0.56024f, 0.55464f, 0.549084f, 0.543572f,
|
||||
0.538102f, 0.532676f, 0.527291f, 0.521949f, 0.516649f, 0.511389f, 0.506171f, 0.500994f,
|
||||
0.495857f, 0.490761f, 0.485704f, 0.480687f, 0.475709f, 0.470769f, 0.465869f, 0.461006f,
|
||||
0.456182f, 0.451395f, 0.446646f, 0.441934f, 0.437258f, 0.432619f, 0.428017f, 0.42345f,
|
||||
0.418919f, 0.414424f, 0.409963f, 0.405538f, 0.401147f, 0.39679f, 0.392467f, 0.388178f,
|
||||
0.383923f, 0.379701f, 0.375511f, 0.371355f, 0.367231f, 0.363139f, 0.359079f, 0.355051f,
|
||||
0.351055f, 0.347089f, 0.343155f, 0.339251f, 0.335378f, 0.331535f, 0.327722f, 0.323939f,
|
||||
0.320186f, 0.316461f, 0.312766f, 0.3091f, 0.305462f, 0.301853f, 0.298272f, 0.294719f,
|
||||
0.291194f, 0.287696f, 0.284226f, 0.280782f, 0.277366f, 0.273976f, 0.270613f, 0.267276f,
|
||||
0.263965f, 0.26068f, 0.257421f, 0.254187f, 0.250979f, 0.247795f, 0.244636f, 0.241502f,
|
||||
0.238393f, 0.235308f, 0.232246f, 0.229209f, 0.226196f, 0.223206f, 0.220239f, 0.217296f,
|
||||
0.214375f, 0.211478f, 0.208603f, 0.20575f, 0.20292f, 0.200112f, 0.197326f, 0.194562f,
|
||||
0.191819f, 0.189097f, 0.186397f, 0.183718f, 0.18106f, 0.178423f, 0.175806f, 0.17321f,
|
||||
0.170634f, 0.168078f, 0.165542f, 0.163026f, 0.16053f, 0.158053f, 0.155595f, 0.153157f,
|
||||
0.150738f, 0.148337f, 0.145955f, 0.143592f, 0.141248f, 0.138921f, 0.136613f, 0.134323f,
|
||||
0.132051f, 0.129797f, 0.12756f, 0.125341f, 0.123139f, 0.120954f, 0.118786f, 0.116635f,
|
||||
0.114501f, 0.112384f, 0.110283f, 0.108199f, 0.106131f, 0.104079f, 0.102043f, 0.100023f,
|
||||
0.0980186f, 0.09603f, 0.094057f, 0.0920994f, 0.0901571f, 0.08823f, 0.0863179f, 0.0844208f,
|
||||
0.0825384f, 0.0806708f, 0.0788178f, 0.0769792f, 0.0751551f, 0.0733451f, 0.0715493f, 0.0697676f,
|
||||
0.0679997f, 0.0662457f, 0.0645054f, 0.0627786f, 0.0610654f, 0.0593655f, 0.0576789f, 0.0560055f,
|
||||
0.0543452f, 0.0526979f, 0.0510634f, 0.0494416f, 0.0478326f, 0.0462361f, 0.0446521f, 0.0430805f,
|
||||
0.0415211f, 0.039974f, 0.0384389f, 0.0369158f, 0.0354046f, 0.0339052f, 0.0324175f, 0.0309415f,
|
||||
0.029477f, 0.0280239f, 0.0265822f, 0.0251517f, 0.0237324f, 0.0223242f, 0.020927f, 0.0195408f,
|
||||
0.0181653f, 0.0168006f, 0.0154466f, 0.0141031f, 0.0127701f, 0.0114476f, 0.0101354f, 0.00883339f,
|
||||
0.00754159f, 0.00625989f, 0.00498819f, 0.00372644f, 0.00247454f, 0.00123242f, 0.f
|
||||
};
|
||||
|
||||
/* test if a float value is 'nan'
|
||||
|
||||
@@ -48,8 +48,9 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
Base Class for Blender specific inputdevices. Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode.
|
||||
*/
|
||||
* Base Class for Blender specific inputdevices.
|
||||
* Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode.
|
||||
*/
|
||||
class BL_BlenderInputDevice : public SCA_IInputDevice
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -119,11 +119,11 @@ static void mem_error_cb(const char *errorStr)
|
||||
|
||||
#ifdef WIN32
|
||||
typedef enum {
|
||||
SCREEN_SAVER_MODE_NONE = 0,
|
||||
SCREEN_SAVER_MODE_PREVIEW,
|
||||
SCREEN_SAVER_MODE_SAVER,
|
||||
SCREEN_SAVER_MODE_CONFIGURATION,
|
||||
SCREEN_SAVER_MODE_PASSWORD,
|
||||
SCREEN_SAVER_MODE_NONE = 0,
|
||||
SCREEN_SAVER_MODE_PREVIEW,
|
||||
SCREEN_SAVER_MODE_SAVER,
|
||||
SCREEN_SAVER_MODE_CONFIGURATION,
|
||||
SCREEN_SAVER_MODE_PASSWORD,
|
||||
} ScreenSaverMode;
|
||||
|
||||
static ScreenSaverMode scr_saver_mode = SCREEN_SAVER_MODE_NONE;
|
||||
|
||||
@@ -1311,48 +1311,47 @@ static PyObject *gPySetWindowSize(PyObject *, PyObject *args)
|
||||
}
|
||||
|
||||
static struct PyMethodDef rasterizer_methods[] = {
|
||||
{"getWindowWidth",(PyCFunction) gPyGetWindowWidth,
|
||||
METH_VARARGS, "getWindowWidth doc"},
|
||||
{"getWindowHeight",(PyCFunction) gPyGetWindowHeight,
|
||||
METH_VARARGS, "getWindowHeight doc"},
|
||||
{"makeScreenshot",(PyCFunction)gPyMakeScreenshot,
|
||||
METH_VARARGS, "make Screenshot doc"},
|
||||
{"enableVisibility",(PyCFunction) gPyEnableVisibility,
|
||||
METH_VARARGS, "enableVisibility doc"},
|
||||
{"getWindowWidth",(PyCFunction) gPyGetWindowWidth,
|
||||
METH_VARARGS, "getWindowWidth doc"},
|
||||
{"getWindowHeight",(PyCFunction) gPyGetWindowHeight,
|
||||
METH_VARARGS, "getWindowHeight doc"},
|
||||
{"makeScreenshot",(PyCFunction)gPyMakeScreenshot,
|
||||
METH_VARARGS, "make Screenshot doc"},
|
||||
{"enableVisibility",(PyCFunction) gPyEnableVisibility,
|
||||
METH_VARARGS, "enableVisibility doc"},
|
||||
{"showMouse",(PyCFunction) gPyShowMouse,
|
||||
METH_VARARGS, "showMouse(bool visible)"},
|
||||
{"setMousePosition",(PyCFunction) gPySetMousePosition,
|
||||
METH_VARARGS, "setMousePosition(int x,int y)"},
|
||||
{"setBackgroundColor",(PyCFunction)gPySetBackgroundColor,METH_O,"set Background Color (rgb)"},
|
||||
METH_VARARGS, "showMouse(bool visible)"},
|
||||
{"setMousePosition",(PyCFunction) gPySetMousePosition,
|
||||
METH_VARARGS, "setMousePosition(int x,int y)"},
|
||||
{"setBackgroundColor",(PyCFunction)gPySetBackgroundColor,METH_O,"set Background Color (rgb)"},
|
||||
{"setAmbientColor",(PyCFunction)gPySetAmbientColor,METH_O,"set Ambient Color (rgb)"},
|
||||
{"disableMist",(PyCFunction)gPyDisableMist,METH_NOARGS,"turn off mist"},
|
||||
{"setMistColor",(PyCFunction)gPySetMistColor,METH_O,"set Mist Color (rgb)"},
|
||||
{"setMistStart",(PyCFunction)gPySetMistStart,METH_VARARGS,"set Mist Start(rgb)"},
|
||||
{"setMistEnd",(PyCFunction)gPySetMistEnd,METH_VARARGS,"set Mist End(rgb)"},
|
||||
{"enableMotionBlur",(PyCFunction)gPyEnableMotionBlur,METH_VARARGS,"enable motion blur"},
|
||||
{"disableMotionBlur",(PyCFunction)gPyDisableMotionBlur,METH_NOARGS,"disable motion blur"},
|
||||
{"disableMist",(PyCFunction)gPyDisableMist,METH_NOARGS,"turn off mist"},
|
||||
{"setMistColor",(PyCFunction)gPySetMistColor,METH_O,"set Mist Color (rgb)"},
|
||||
{"setMistStart",(PyCFunction)gPySetMistStart,METH_VARARGS,"set Mist Start(rgb)"},
|
||||
{"setMistEnd",(PyCFunction)gPySetMistEnd,METH_VARARGS,"set Mist End(rgb)"},
|
||||
{"enableMotionBlur",(PyCFunction)gPyEnableMotionBlur,METH_VARARGS,"enable motion blur"},
|
||||
{"disableMotionBlur",(PyCFunction)gPyDisableMotionBlur,METH_NOARGS,"disable motion blur"},
|
||||
|
||||
|
||||
{"setEyeSeparation", (PyCFunction) gPySetEyeSeparation, METH_VARARGS, "set the eye separation for stereo mode"},
|
||||
{"getEyeSeparation", (PyCFunction) gPyGetEyeSeparation, METH_NOARGS, "get the eye separation for stereo mode"},
|
||||
{"setFocalLength", (PyCFunction) gPySetFocalLength, METH_VARARGS, "set the focal length for stereo mode"},
|
||||
{"getFocalLength", (PyCFunction) gPyGetFocalLength, METH_VARARGS, "get the focal length for stereo mode"},
|
||||
{"setMaterialMode",(PyCFunction) gPySetMaterialType,
|
||||
METH_VARARGS, "set the material mode to use for OpenGL rendering"},
|
||||
{"getMaterialMode",(PyCFunction) gPyGetMaterialType,
|
||||
METH_NOARGS, "get the material mode being used for OpenGL rendering"},
|
||||
{"setGLSLMaterialSetting",(PyCFunction) gPySetGLSLMaterialSetting,
|
||||
METH_VARARGS, "set the state of a GLSL material setting"},
|
||||
{"getGLSLMaterialSetting",(PyCFunction) gPyGetGLSLMaterialSetting,
|
||||
METH_VARARGS, "get the state of a GLSL material setting"},
|
||||
{"setAnisotropicFiltering", (PyCFunction) gPySetAnisotropicFiltering,
|
||||
METH_VARARGS, "set the anisotropic filtering level (must be one of 1, 2, 4, 8, 16)"},
|
||||
{"getAnisotropicFiltering", (PyCFunction) gPyGetAnisotropicFiltering,
|
||||
METH_VARARGS, "get the anisotropic filtering level"},
|
||||
{"drawLine", (PyCFunction) gPyDrawLine,
|
||||
METH_VARARGS, "draw a line on the screen"},
|
||||
{"setWindowSize", (PyCFunction) gPySetWindowSize, METH_VARARGS, ""},
|
||||
{ NULL, (PyCFunction) NULL, 0, NULL }
|
||||
{"setEyeSeparation", (PyCFunction) gPySetEyeSeparation, METH_VARARGS, "set the eye separation for stereo mode"},
|
||||
{"getEyeSeparation", (PyCFunction) gPyGetEyeSeparation, METH_NOARGS, "get the eye separation for stereo mode"},
|
||||
{"setFocalLength", (PyCFunction) gPySetFocalLength, METH_VARARGS, "set the focal length for stereo mode"},
|
||||
{"getFocalLength", (PyCFunction) gPyGetFocalLength, METH_VARARGS, "get the focal length for stereo mode"},
|
||||
{"setMaterialMode",(PyCFunction) gPySetMaterialType,
|
||||
METH_VARARGS, "set the material mode to use for OpenGL rendering"},
|
||||
{"getMaterialMode",(PyCFunction) gPyGetMaterialType,
|
||||
METH_NOARGS, "get the material mode being used for OpenGL rendering"},
|
||||
{"setGLSLMaterialSetting",(PyCFunction) gPySetGLSLMaterialSetting,
|
||||
METH_VARARGS, "set the state of a GLSL material setting"},
|
||||
{"getGLSLMaterialSetting",(PyCFunction) gPyGetGLSLMaterialSetting,
|
||||
METH_VARARGS, "get the state of a GLSL material setting"},
|
||||
{"setAnisotropicFiltering", (PyCFunction) gPySetAnisotropicFiltering,
|
||||
METH_VARARGS, "set the anisotropic filtering level (must be one of 1, 2, 4, 8, 16)"},
|
||||
{"getAnisotropicFiltering", (PyCFunction) gPyGetAnisotropicFiltering,
|
||||
METH_VARARGS, "get the anisotropic filtering level"},
|
||||
{"drawLine", (PyCFunction) gPyDrawLine,
|
||||
METH_VARARGS, "draw a line on the screen"},
|
||||
{"setWindowSize", (PyCFunction) gPySetWindowSize, METH_VARARGS, ""},
|
||||
{ NULL, (PyCFunction) NULL, 0, NULL }
|
||||
};
|
||||
|
||||
// Initialization function for the module (*must* be called initGameLogic)
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#ifndef __RAS_EROSION2DFILTER_H__
|
||||
#define __RAS_EROSION2DFILTER_H__
|
||||
|
||||
const char * ErosionFragmentShader=STRINGIFY(
|
||||
const char * ErosionFragmentShader = STRINGIFY(
|
||||
uniform sampler2D bgl_RenderedTexture;
|
||||
uniform vec2 bgl_TextureCoordinateOffset[9];
|
||||
|
||||
|
||||
@@ -142,12 +142,12 @@ public:
|
||||
protected:
|
||||
/// filter pixel, source float buffer
|
||||
virtual unsigned int filter (float * src, short x, short y,
|
||||
short * size, unsigned int pixSize, unsigned int val)
|
||||
short * size, unsigned int pixSize, unsigned int val)
|
||||
{
|
||||
// Copy the float value straight away
|
||||
// The user can retrieve the original float value by using
|
||||
// 'F' mode in BGL buffer
|
||||
memcpy(&val, src, sizeof (unsigned int));
|
||||
/* Copy the float value straight away
|
||||
* The user can retrieve the original float value by using
|
||||
* 'F' mode in BGL buffer */
|
||||
memcpy(&val, src, sizeof (unsigned int));
|
||||
return val;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ ImageViewport::ImageViewport (void) : m_alpha(false), m_texInit(false)
|
||||
// destructor
|
||||
ImageViewport::~ImageViewport (void)
|
||||
{
|
||||
delete [] m_viewportImage;
|
||||
delete [] m_viewportImage;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,15 +127,14 @@ void ImageViewport::calcImage (unsigned int texId, double ts)
|
||||
// reset image
|
||||
init(m_capSize[0], m_capSize[1]);
|
||||
// if texture wasn't initialized
|
||||
if (!m_texInit)
|
||||
{
|
||||
if (!m_texInit) {
|
||||
// initialize it
|
||||
loadTexture(texId, m_image, m_size);
|
||||
m_texInit = true;
|
||||
}
|
||||
// if texture can be directly created
|
||||
if (texId != 0 && m_pyfilter == NULL && m_capSize[0] == calcSize(m_capSize[0])
|
||||
&& m_capSize[1] == calcSize(m_capSize[1]) && !m_flip && !m_zbuff && !m_depth)
|
||||
&& m_capSize[1] == calcSize(m_capSize[1]) && !m_flip && !m_zbuff && !m_depth)
|
||||
{
|
||||
// just copy current viewport to texture
|
||||
glBindTexture(GL_TEXTURE_2D, texId);
|
||||
@@ -144,50 +143,47 @@ void ImageViewport::calcImage (unsigned int texId, double ts)
|
||||
m_avail = false;
|
||||
}
|
||||
// otherwise copy viewport to buffer, if image is not available
|
||||
else if (!m_avail)
|
||||
{
|
||||
if (m_zbuff)
|
||||
{
|
||||
// Use read pixels with the depth buffer
|
||||
else if (!m_avail) {
|
||||
if (m_zbuff) {
|
||||
// Use read pixels with the depth buffer
|
||||
// *** misusing m_viewportImage here, but since it has the correct size
|
||||
// (4 bytes per pixel = size of float) and we just need it to apply
|
||||
// the filter, it's ok
|
||||
glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1],
|
||||
GL_DEPTH_COMPONENT, GL_FLOAT, m_viewportImage);
|
||||
// filter loaded data
|
||||
FilterZZZA filt;
|
||||
filterImage(filt, (float *)m_viewportImage, m_capSize);
|
||||
}
|
||||
else
|
||||
|
||||
if (m_depth)
|
||||
{
|
||||
// Use read pixels with the depth buffer
|
||||
// See warning above about m_viewportImage.
|
||||
glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1],
|
||||
GL_DEPTH_COMPONENT, GL_FLOAT, m_viewportImage);
|
||||
// filter loaded data
|
||||
FilterDEPTH filt;
|
||||
filterImage(filt, (float *)m_viewportImage, m_capSize);
|
||||
}
|
||||
else
|
||||
|
||||
// get frame buffer data
|
||||
if (m_alpha)
|
||||
{
|
||||
glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGBA,
|
||||
GL_UNSIGNED_BYTE, m_viewportImage);
|
||||
glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1],
|
||||
GL_DEPTH_COMPONENT, GL_FLOAT, m_viewportImage);
|
||||
// filter loaded data
|
||||
FilterRGBA32 filt;
|
||||
filterImage(filt, m_viewportImage, m_capSize);
|
||||
FilterZZZA filt;
|
||||
filterImage(filt, (float *)m_viewportImage, m_capSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGB,
|
||||
GL_UNSIGNED_BYTE, m_viewportImage);
|
||||
// filter loaded data
|
||||
FilterRGB24 filt;
|
||||
filterImage(filt, m_viewportImage, m_capSize);
|
||||
else {
|
||||
|
||||
if (m_depth) {
|
||||
// Use read pixels with the depth buffer
|
||||
// See warning above about m_viewportImage.
|
||||
glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1],
|
||||
GL_DEPTH_COMPONENT, GL_FLOAT, m_viewportImage);
|
||||
// filter loaded data
|
||||
FilterDEPTH filt;
|
||||
filterImage(filt, (float *)m_viewportImage, m_capSize);
|
||||
}
|
||||
else {
|
||||
|
||||
// get frame buffer data
|
||||
if (m_alpha) {
|
||||
glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGBA,
|
||||
GL_UNSIGNED_BYTE, m_viewportImage);
|
||||
// filter loaded data
|
||||
FilterRGBA32 filt;
|
||||
filterImage(filt, m_viewportImage, m_capSize);
|
||||
}
|
||||
else {
|
||||
glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGB,
|
||||
GL_UNSIGNED_BYTE, m_viewportImage);
|
||||
// filter loaded data
|
||||
FilterRGB24 filt;
|
||||
filterImage(filt, m_viewportImage, m_capSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user