style cleanup: tabs & whitespace
This commit is contained in:
@@ -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
|
||||
|
@@ -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)
|
||||
|
@@ -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__ */
|
||||
|
@@ -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,
|
||||
static unsigned int colortab[24] = {
|
||||
0x0, 0xFF88FF, 0xFFBBFF,
|
||||
0x403000, 0xFFFF88, 0xFFFFBB,
|
||||
0x104040, 0x66CCCC, 0x77CCCC,
|
||||
0x104010, 0x55BB55, 0x66FF66,
|
||||
0xFFFFFF};
|
||||
0xFFFFFF
|
||||
};
|
||||
|
||||
|
||||
static float cube[8][3] = {
|
||||
|
@@ -1227,7 +1227,7 @@ 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 &&
|
||||
|
@@ -496,41 +496,41 @@ void mem_read(Stream & mem, DDSHeader & header)
|
||||
|
||||
namespace
|
||||
{
|
||||
struct FormatDescriptor
|
||||
{
|
||||
struct FormatDescriptor
|
||||
{
|
||||
uint format;
|
||||
uint bitcount;
|
||||
uint rmask;
|
||||
uint gmask;
|
||||
uint bmask;
|
||||
uint amask;
|
||||
};
|
||||
};
|
||||
|
||||
static const FormatDescriptor s_d3dFormats[] =
|
||||
{
|
||||
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_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_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_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_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_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
|
||||
|
||||
@@ -549,7 +549,7 @@ static uint findD3D9Format(uint bitcount, uint rmask, uint gmask, uint bmask, ui
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -1006,15 +1006,19 @@ 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;
|
||||
}
|
||||
@@ -1058,7 +1062,7 @@ static void rna_ShaderNodeScript_mode_set(PointerRNA *ptr, int value)
|
||||
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;
|
||||
}
|
||||
|
@@ -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,8 +764,8 @@ 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,
|
||||
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,
|
||||
|
@@ -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:
|
||||
|
@@ -1332,7 +1332,6 @@ static struct PyMethodDef rasterizer_methods[] = {
|
||||
{"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"},
|
||||
|
@@ -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];
|
||||
|
||||
|
@@ -144,9 +144,9 @@ protected:
|
||||
virtual unsigned int filter (float * src, short x, short y,
|
||||
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
|
||||
/* 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;
|
||||
}
|
||||
|
@@ -127,8 +127,7 @@ 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;
|
||||
@@ -144,10 +143,8 @@ 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)
|
||||
{
|
||||
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
|
||||
@@ -158,10 +155,9 @@ void ImageViewport::calcImage (unsigned int texId, double ts)
|
||||
FilterZZZA filt;
|
||||
filterImage(filt, (float *)m_viewportImage, m_capSize);
|
||||
}
|
||||
else
|
||||
else {
|
||||
|
||||
if (m_depth)
|
||||
{
|
||||
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],
|
||||
@@ -170,19 +166,17 @@ void ImageViewport::calcImage (unsigned int texId, double ts)
|
||||
FilterDEPTH filt;
|
||||
filterImage(filt, (float *)m_viewportImage, m_capSize);
|
||||
}
|
||||
else
|
||||
else {
|
||||
|
||||
// get frame buffer data
|
||||
if (m_alpha)
|
||||
{
|
||||
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
|
||||
{
|
||||
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
|
||||
@@ -190,6 +184,8 @@ void ImageViewport::calcImage (unsigned int texId, double ts)
|
||||
filterImage(filt, m_viewportImage, m_capSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user