diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-11-15 19:55:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-11-15 19:55:37 +0300 |
commit | 63d38291440bf40771ca405638f9bfc6981e5e1a (patch) | |
tree | b1c62545c5436afe387a3b92936f1dba5e18cffa | |
parent | db434c3434806024e56e9b573adfbfcee3bd3304 (diff) | |
parent | da1738377ff78b49f6ea1eaee7055bba0e4ef913 (diff) |
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17443:HEAD
-rw-r--r-- | SConstruct | 7 | ||||
-rw-r--r-- | config/linuxcross-config.py | 5 | ||||
-rw-r--r-- | source/blender/blenlib/SConscript | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/threads.c | 2 | ||||
-rw-r--r-- | source/blender/include/BIF_editarmature.h | 2 | ||||
-rw-r--r-- | source/blender/include/transform.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/intern/SConscript | 17 | ||||
-rw-r--r-- | source/blender/src/SConscript | 2 | ||||
-rw-r--r-- | source/blender/src/editarmature.c | 25 | ||||
-rw-r--r-- | source/blender/src/gpencil.c | 8 | ||||
-rw-r--r-- | source/blender/src/transform_conversions.c | 17 | ||||
-rw-r--r-- | source/blender/src/transform_generics.c | 41 | ||||
-rw-r--r-- | source/blender/src/transform_orientations.c | 12 | ||||
-rw-r--r-- | source/gameengine/Rasterizer/RAS_2DFilterManager.cpp | 136 | ||||
-rw-r--r-- | source/gameengine/Rasterizer/RAS_2DFilterManager.h | 5 | ||||
-rwxr-xr-x | tools/crossmingw.py | 2 |
16 files changed, 205 insertions, 80 deletions
diff --git a/SConstruct b/SConstruct index a35be70e50d..8e3666a7859 100644 --- a/SConstruct +++ b/SConstruct @@ -472,6 +472,13 @@ if env['OURPLATFORM']=='linux2': td, tf = os.path.split(targetdir) iconinstall.append(env.Install(dir=td, source=srcfile)) +# dlls for linuxcross +# TODO - add more libs, for now this lets blenderlite run +if env['OURPLATFORM']=='linuxcross': + dir=env['BF_INSTALLDIR'] + source = ['../lib/windows/pthreads/lib/pthreadGC2.dll'] + scriptinstall.append(env.Install(dir=dir, source=source)) + #-- plugins pluglist = [] plugtargetlist = [] diff --git a/config/linuxcross-config.py b/config/linuxcross-config.py index 4c5f4859a6c..f3ac6d905f7 100644 --- a/config/linuxcross-config.py +++ b/config/linuxcross-config.py @@ -1,4 +1,4 @@ -LCGDIR = '../lib/windows' +LCGDIR = '#../lib/windows' LIBDIR = '${LCGDIR}' WITH_BF_VERSE = False @@ -101,6 +101,9 @@ BF_SOLID = '#extern/solid' BF_SOLID_INC = '${BF_SOLID}' BF_SOLID_LIB = 'extern_solid' +BF_WINTAB = LIBDIR + '/wintab' +BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE' + # enable freetype2 support for text objects BF_FREETYPE = LIBDIR + '/gcc/freetype' BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2' diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript index 0dc28960492..829b39f4a61 100644 --- a/source/blender/blenlib/SConscript +++ b/source/blender/blenlib/SConscript @@ -23,7 +23,7 @@ if env['OURPLATFORM'] == 'linux2': cflags='-pthread' incs += ' ../../../extern/binreloc/include' -if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'): +if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'): incs += ' ' + env['BF_PTHREADS_INC'] env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core', 'intern', 'player'], priority = [85,150,195], compileflags =cflags ) diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 9df8bbc81e3..07c02b8024f 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -42,7 +42,7 @@ /* for checking system threads - BLI_system_thread_count */ #ifdef WIN32 -#include "Windows.h" +#include "windows.h" #elif defined(__APPLE__) #include <sys/types.h> #include <sys/sysctl.h> diff --git a/source/blender/include/BIF_editarmature.h b/source/blender/include/BIF_editarmature.h index 02d73680818..ce275563a87 100644 --- a/source/blender/include/BIF_editarmature.h +++ b/source/blender/include/BIF_editarmature.h @@ -68,6 +68,8 @@ typedef struct EditBone } EditBone; +float rollBoneToVector(EditBone *bone, float new_up_axis[3]); + void make_boneList(struct ListBase *list, struct ListBase *bones, EditBone *parent); void editbones_to_armature (struct ListBase *list, struct Object *ob); diff --git a/source/blender/include/transform.h b/source/blender/include/transform.h index bd91bf8100a..fa7b8fc0a19 100644 --- a/source/blender/include/transform.h +++ b/source/blender/include/transform.h @@ -160,7 +160,7 @@ typedef struct TransData { TransDataExtension *ext; /* for objects, poses. 1 single malloc per TransInfo! */ TransDataIpokey *tdi; /* for objects, ipo keys. per transdata a malloc */ TransDataCurveHandleFlags *hdata; /* for curves, stores handle flags for modification/cancel */ - void *tdmir; /* mirrored element pointer, in editmode mesh to EditVert */ + void *extra; /* extra data (mirrored element pointer, in editmode mesh to EditVert) (editbone for roll fixing) (...) */ short flag; /* Various flags */ short protectflag; /* If set, copy of Object or PoseChannel protection */ /*#ifdef WITH_VERSE*/ diff --git a/source/blender/makesdna/intern/SConscript b/source/blender/makesdna/intern/SConscript index 0a2afd66dae..7d4f6d2d76b 100644 --- a/source/blender/makesdna/intern/SConscript +++ b/source/blender/makesdna/intern/SConscript @@ -18,9 +18,15 @@ makesdna_tool.Append (CPPPATH = ['#/intern/guardedalloc', '../../makesdna']) if env['OURPLATFORM'] == 'linuxcross': - makesdna_tool.Replace(CC='gcc') - makesdna_tool.Replace(AR='ar') - makesdna_tool.Replace(LINK='gcc') + USE_WINE = True # when cross compiling on linux 64bit this is useful +else: + USE_WINE = False + +if not USE_WINE: + if env['OURPLATFORM'] == 'linuxcross': + makesdna_tool.Replace(CC='gcc') + makesdna_tool.Replace(AR='ar') + makesdna_tool.Replace(LINK='gcc') if sys.platform != 'cygwin': makesdna_tool.Append (CCFLAGS = cflags) @@ -43,7 +49,10 @@ dna_dict = dna.Dictionary() dna.Depends ('dna.c', makesdna) dna.Depends ('dna.c', header_files) if env['OURPLATFORM'] != 'linuxcross': - dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna $TARGET") + if USE_WINE: + dna.Command ('dna.c', '', 'wine ' + root_build_dir+os.sep+"makesdna $TARGET") + else: + dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna $TARGET") else: dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna.exe $TARGET") obj = 'intern/dna.c' diff --git a/source/blender/src/SConscript b/source/blender/src/SConscript index 2759e8ca7ff..c5edd711d0a 100644 --- a/source/blender/src/SConscript +++ b/source/blender/src/SConscript @@ -75,7 +75,7 @@ if env['WITH_BF_FFMPEG']: if env['WITH_BF_OGG']: defs.append('WITH_OGG') -if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'): +if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'): incs += ' ' + env['BF_PTHREADS_INC'] if env['WITH_BF_VERSE']: diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index 5ddf522e4a8..ee5d56eaf43 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -1817,6 +1817,31 @@ void deselectall_armature(int toggle, int doundo) } } +/* adjust bone roll to align Z axis with vector + * vec is in local space and is normalized + */ +float rollBoneToVector(EditBone *bone, float new_up_axis[3]) +{ + float mat[3][3], nor[3], up_axis[3], vec[3]; + float roll; + + VecSubf(nor, bone->tail, bone->head); + + vec_roll_to_mat3(nor, 0, mat); + VECCOPY(up_axis, mat[2]); + + roll = NormalizedVecAngle2(new_up_axis, up_axis); + + Crossf(vec, up_axis, new_up_axis); + + if (Inpf(vec, nor) < 0) + { + roll = -roll; + } + + return roll; +} + /* Sets the roll value of selected bones, depending on the mode * mode == 0: their z-axes point upwards * mode == 1: their z-axes point towards 3d-cursor diff --git a/source/blender/src/gpencil.c b/source/blender/src/gpencil.c index 497443edffd..fd8bd7dc014 100644 --- a/source/blender/src/gpencil.c +++ b/source/blender/src/gpencil.c @@ -267,6 +267,7 @@ bGPDframe *gpencil_frame_duplicate (bGPDframe *src) /* make a copy of the source frame */ dst= MEM_dupallocN(src); + dst->prev= dst->next= NULL; /* copy strokes */ dst->strokes.first = dst->strokes.last= NULL; @@ -294,13 +295,18 @@ bGPDlayer *gpencil_layer_duplicate (bGPDlayer *src) /* make a copy of source layer */ dst= MEM_dupallocN(src); + dst->prev= dst->next= NULL; /* copy frames */ dst->frames.first= dst->frames.last= NULL; for (gpf= src->frames.first; gpf; gpf= gpf->next) { - /* make a copy of source stroke */ + /* make a copy of source frame */ gpfd= gpencil_frame_duplicate(gpf); BLI_addtail(&dst->frames, gpfd); + + /* if source frame was the current layer's 'active' frame, reassign that too */ + if (gpf == dst->actframe) + dst->actframe= gpfd; } /* return new layer */ diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 496d5120bb9..f58eaefc628 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -1133,6 +1133,14 @@ static void createTransArmatureVerts(TransInfo *t) Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); + VecSubf(delta, ebo->tail, ebo->head); + vec_roll_to_mat3(delta, ebo->roll, td->axismtx); + + if ((ebo->flag & BONE_ROOTSEL) == 0) + { + td->extra = ebo; + } + td->ext = NULL; td->tdi = NULL; td->val = NULL; @@ -1150,6 +1158,11 @@ static void createTransArmatureVerts(TransInfo *t) Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); + VecSubf(delta, ebo->tail, ebo->head); + vec_roll_to_mat3(delta, ebo->roll, td->axismtx); + + td->extra = ebo; /* to fix roll */ + td->ext = NULL; td->tdi = NULL; td->val = NULL; @@ -1863,7 +1876,7 @@ static void VertsToTransData(TransData *td, EditVert *eve) td->ext = NULL; td->tdi = NULL; td->val = NULL; - td->tdmir = NULL; + td->extra = NULL; if (BIF_GetTransInfo()->mode == TFM_BWEIGHT) { td->val = &(eve->bweight); td->ival = eve->bweight; @@ -2216,7 +2229,7 @@ static void createTransEditVerts(TransInfo *t) /* Mirror? */ if( (mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) { EditVert *vmir= editmesh_get_x_mirror_vert(G.obedit, tob->iloc); /* initializes octree on first call */ - if(vmir != eve) tob->tdmir = vmir; + if(vmir != eve) tob->extra = vmir; } tob++; } diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c index 2a91b66ad8e..229889d15ff 100644 --- a/source/blender/src/transform_generics.c +++ b/source/blender/src/transform_generics.c @@ -254,7 +254,7 @@ static void editmesh_apply_to_mirror(TransInfo *t) if (td->flag & TD_SKIP) continue; - eve = td->tdmir; + eve = td->extra; if(eve) { eve->co[0]= -td->loc[0]; eve->co[1]= td->loc[1]; @@ -470,6 +470,8 @@ void recalcData(TransInfo *t) else if(G.obedit->type==OB_ARMATURE){ /* no recalc flag, does pose */ bArmature *arm= G.obedit->data; EditBone *ebo; + TransData *td = t->data; + int i; /* Ensure all bones are correctly adjusted */ for (ebo=G.edbo.first; ebo; ebo=ebo->next){ @@ -506,6 +508,38 @@ void recalcData(TransInfo *t) ebo->oldlength= ebo->length; } } + + + if (t->mode != TFM_BONE_ROLL) + { + /* fix roll */ + for(i = 0; i < t->total; i++, td++) + { + if (td->extra) + { + float vec[3], up_axis[3]; + float qrot[4]; + + ebo = td->extra; + VECCOPY(up_axis, td->axismtx[2]); + + if (t->mode != TFM_ROTATION) + { + VecSubf(vec, ebo->tail, ebo->head); + Normalize(vec); + RotationBetweenVectorsToQuat(qrot, td->axismtx[1], vec); + QuatMulVecf(qrot, up_axis); + } + else + { + Mat3MulVecfl(t->mat, up_axis); + } + + ebo->roll = rollBoneToVector(ebo, up_axis); + } + } + } + if(arm->flag & ARM_MIRROR_EDIT) transform_armature_mirror_update(); @@ -820,7 +854,10 @@ void restoreTransObjects(TransInfo *t) ((VObjectData*)vnode->data)->flag |= SCALE_SEND_READY; } #endif - } + } + + Mat3One(t->mat); + recalcData(t); } diff --git a/source/blender/src/transform_orientations.c b/source/blender/src/transform_orientations.c index fc9dfbb902e..0bc1ef5ca1f 100644 --- a/source/blender/src/transform_orientations.c +++ b/source/blender/src/transform_orientations.c @@ -40,6 +40,7 @@ #include "BKE_global.h" #include "BKE_utildefines.h" +#include "BKE_armature.h" #include "BLI_arithb.h" #include "BLI_blenlib.h" @@ -680,21 +681,20 @@ int getTransformOrientation(float normal[3], float plane[3], int activeOnly) { if (ebone->flag & BONE_SELECTED) { + float mat[3][3]; float vec[3]; VecSubf(vec, ebone->tail, ebone->head); Normalize(vec); VecAddf(normal, normal, vec); + + vec_roll_to_mat3(vec, ebone->roll, mat); + VecAddf(plane, plane, mat[2]); } } } Normalize(normal); - Crossf(plane, G.obedit->obmat[0], normal); - - if (Inpf(plane, plane) < FLT_EPSILON) - { - Crossf(plane, G.obedit->obmat[1], normal); - } + Normalize(plane); if (plane[0] != 0 || plane[1] != 0 || plane[2] != 0) { diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index d2cfa7d07f9..8010d24886e 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp @@ -58,7 +58,7 @@ RAS_2DFilterManager::RAS_2DFilterManager(): texturewidth(-1), textureheight(-1), canvaswidth(-1), canvasheight(-1), -numberoffilters(0) +numberoffilters(0), need_tex_update(true) { isshadersupported = GLEW_ARB_shader_objects && GLEW_ARB_fragment_shader && GLEW_ARB_multitexture; @@ -217,50 +217,50 @@ void RAS_2DFilterManager::StartShaderProgram(int passindex) glActiveTextureARB(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texname[0]); - if (uniformLoc != -1) - { + if (uniformLoc != -1) + { glUniform1iARB(uniformLoc, 0); - } + } - /* send depth texture to glsl program if it needs */ + /* send depth texture to glsl program if it needs */ if(texflag[passindex] & 0x1){ - uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_DepthTexture"); - glActiveTextureARB(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, texname[1]); + uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_DepthTexture"); + glActiveTextureARB(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, texname[1]); - if (uniformLoc != -1) - { - glUniform1iARB(uniformLoc, 1); - } - } + if (uniformLoc != -1) + { + glUniform1iARB(uniformLoc, 1); + } + } - /* send luminance texture to glsl program if it needs */ + /* send luminance texture to glsl program if it needs */ if(texflag[passindex] & 0x2){ - uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_LuminanceTexture"); - glActiveTextureARB(GL_TEXTURE2); - glBindTexture(GL_TEXTURE_2D, texname[2]); - - if (uniformLoc != -1) - { - glUniform1iARB(uniformLoc, 2); - } + uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_LuminanceTexture"); + glActiveTextureARB(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D, texname[2]); + + if (uniformLoc != -1) + { + glUniform1iARB(uniformLoc, 2); + } } uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_TextureCoordinateOffset"); - if (uniformLoc != -1) - { - glUniform2fvARB(uniformLoc, 9, textureoffsets); - } + if (uniformLoc != -1) + { + glUniform2fvARB(uniformLoc, 9, textureoffsets); + } uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_RenderedTextureWidth"); - if (uniformLoc != -1) - { + if (uniformLoc != -1) + { glUniform1fARB(uniformLoc,texturewidth); - } + } uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_RenderedTextureHeight"); - if (uniformLoc != -1) - { + if (uniformLoc != -1) + { glUniform1fARB(uniformLoc,textureheight); - } + } int i, objProperties = m_properties[passindex].size(); for(i=0; i<objProperties; i++) @@ -332,20 +332,20 @@ void RAS_2DFilterManager::UpdateOffsetMatrix(RAS_ICanvas* canvas) RAS_Rect canvas_rect = canvas->GetWindowArea(); canvaswidth = canvas->GetWidth(); canvasheight = canvas->GetHeight(); - texturewidth = canvaswidth; - textureheight = canvasheight; + texturewidth = canvaswidth + canvas_rect.GetLeft(); + textureheight = canvasheight + canvas_rect.GetBottom(); GLint i,j; i = 0; - while ((1 << i) <= texturewidth) - i++; - texturewidth = (1 << (i)); + while ((1 << i) <= texturewidth) + i++; + texturewidth = (1 << (i)); - // Now for height - i = 0; - while ((1 << i) <= textureheight) - i++; - textureheight = (1 << (i)); + // Now for height + i = 0; + while ((1 << i) <= textureheight) + i++; + textureheight = (1 << (i)); GLfloat xInc = 1.0f / (GLfloat)texturewidth; GLfloat yInc = 1.0f / (GLfloat)textureheight; @@ -360,6 +360,23 @@ void RAS_2DFilterManager::UpdateOffsetMatrix(RAS_ICanvas* canvas) } } +void RAS_2DFilterManager::UpdateCanvasTextureCoord(unsigned int * viewport) +{ + /* + This function update canvascoord[]. + These parameters are used to create texcoord[1] + That way we can access the texcoord relative to the canvas: + (0.0,0.0) bottom left, (1.0,1.0) top right, (0.5,0.5) center + */ + canvascoord[0] = (GLfloat) viewport[0] / viewport[2]; + canvascoord[0] *= -1; + canvascoord[1] = (GLfloat) (texturewidth - viewport[0]) / viewport[2]; + + canvascoord[2] = (GLfloat) viewport[1] / viewport[3]; + canvascoord[2] *= -1; + canvascoord[3] = (GLfloat)(textureheight - viewport[1]) / viewport[3]; +} + void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) { bool need_depth=false; @@ -387,27 +404,35 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) if(num_filters <= 0) return; + GLuint viewport[4]={0}; + glGetIntegerv(GL_VIEWPORT,(GLint *)viewport); + if(canvaswidth != canvas->GetWidth() || canvasheight != canvas->GetHeight()) { UpdateOffsetMatrix(canvas); + UpdateCanvasTextureCoord(viewport); + need_tex_update = true; + } + + if(need_tex_update) + { SetupTextures(need_depth, need_luminance); + need_tex_update = false; } - GLuint viewport[4]={0}; if(need_depth){ glActiveTextureARB(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, texname[1]); - glCopyTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT, viewport[0], viewport[1], texturewidth,textureheight, 0); + glCopyTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT, 0, 0, texturewidth,textureheight, 0); } if(need_luminance){ glActiveTextureARB(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, texname[2]); - glCopyTexImage2D(GL_TEXTURE_2D,0,GL_LUMINANCE16, viewport[0], viewport[1] , texturewidth,textureheight, 0); + glCopyTexImage2D(GL_TEXTURE_2D,0,GL_LUMINANCE16, 0, 0, texturewidth,textureheight, 0); } - glGetIntegerv(GL_VIEWPORT,(GLint *)viewport); - glViewport(viewport[0],viewport[1], texturewidth, textureheight); + glViewport(0,0, texturewidth, textureheight); glDisable(GL_DEPTH_TEST); glMatrixMode(GL_TEXTURE); @@ -425,20 +450,15 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) glActiveTextureARB(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texname[0]); - glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, viewport[0], viewport[1], texturewidth, textureheight, 0); + glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 0, 0, texturewidth, textureheight, 0); glClear(GL_COLOR_BUFFER_BIT); - float canvascoordx, canvascoordy; - - canvascoordx = (GLfloat) texturewidth / canvaswidth; - canvascoordy = (GLfloat) textureheight / canvasheight; - glBegin(GL_QUADS); glColor4f(1.f, 1.f, 1.f, 1.f); - glTexCoord2f(1.0, 1.0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, canvascoordx, canvascoordy); glVertex2f(1,1); - glTexCoord2f(0.0, 1.0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, canvascoordy); glVertex2f(-1,1); - glTexCoord2f(0.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 0.0); glVertex2f(-1,-1); - glTexCoord2f(1.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, canvascoordx, 0.0); glVertex2f(1,-1); + glTexCoord2f(1.0, 1.0); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[1], canvascoord[3]); glVertex2f(1,1); + glTexCoord2f(0.0, 1.0); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[0], canvascoord[3]); glVertex2f(-1,1); + glTexCoord2f(0.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[0], canvascoord[2]); glVertex2f(-1,-1); + glTexCoord2f(1.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[1], canvascoord[2]); glVertex2f(1,-1); glEnd(); } } @@ -454,7 +474,7 @@ void RAS_2DFilterManager::EnableFilter(vector<STR_String>& propNames, void* game return; if(pass<0 || pass>=MAX_RENDER_PASS) return; - + need_tex_update = true; if(mode == RAS_2DFILTER_DISABLED) { m_enabled[pass] = 0; diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.h b/source/gameengine/Rasterizer/RAS_2DFilterManager.h index 454643a5077..6a420a974d4 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.h +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.h @@ -44,7 +44,9 @@ private: void FreeTextures(); void UpdateOffsetMatrix(RAS_ICanvas* canvas); - + void UpdateCanvasTextureCoord(unsigned int * viewport); + + float canvascoord[4]; float textureoffsets[18]; float view[4]; /* texname[0] contains render to texture, texname[1] contains depth texture, texname[2] contains luminance texture*/ @@ -60,6 +62,7 @@ private: bool isshadersupported; bool errorprinted; + bool need_tex_update; unsigned int m_filters[MAX_RENDER_PASS]; short m_enabled[MAX_RENDER_PASS]; diff --git a/tools/crossmingw.py b/tools/crossmingw.py index 1c8924ca7f6..299bfca929d 100755 --- a/tools/crossmingw.py +++ b/tools/crossmingw.py @@ -109,7 +109,7 @@ def shlib_emitter(target, source, env): #JB """ I'm blindly susbstuting lines from the mingw.py #JB file becase these lines cause python errors here. """ #JB shlib_action = SCons.Action.Action(shlib_generator,generator=1) -shlib_action = SCons.Action.CommandGenerator(shlib_generator) +shlib_action = SCons.Action.CommandGeneratorAction(shlib_generator) res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR') |