svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17443:HEAD
authorCampbell Barton <ideasman42@gmail.com>
Sat, 15 Nov 2008 16:55:37 +0000 (16:55 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 15 Nov 2008 16:55:37 +0000 (16:55 +0000)
16 files changed:
SConstruct
config/linuxcross-config.py
source/blender/blenlib/SConscript
source/blender/blenlib/intern/threads.c
source/blender/include/BIF_editarmature.h
source/blender/include/transform.h
source/blender/makesdna/intern/SConscript
source/blender/src/SConscript
source/blender/src/editarmature.c
source/blender/src/gpencil.c
source/blender/src/transform_conversions.c
source/blender/src/transform_generics.c
source/blender/src/transform_orientations.c
source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
source/gameengine/Rasterizer/RAS_2DFilterManager.h
tools/crossmingw.py

index a35be70e50d40aecafa2ef4b4e9c93ebe0c2a990..8e3666a78595e4626983276c6842c090bfcd03ad 100644 (file)
@@ -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 = []
index 4c5f4859a6c6fe8c106acef2940f8abe08f67a26..f3ac6d905f7b2c0b3a85baccb789e6fe7f39d59b 100644 (file)
@@ -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'
index 0dc28960492b55ba6423b678120ed64e0cb0c0be..829b39f4a61cd534c066164b8eeb37876c1b2ca7 100644 (file)
@@ -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 )
index 9df8bbc81e3628de740c200463a093e76e8e46f3..07c02b8024f5621a83073e7f62979f30d8fc09c8 100644 (file)
@@ -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>
index 02d736808188b2826ca2103519b3df37126f8ffe..ce275563a873a6eb46713e9f7b0b47ba259d32a1 100644 (file)
@@ -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);
 
index bd91bf8100ad9d74c54982fce0556381c55d68f8..fa7b8fc0a193dfd162af01da0b22b8516841b534 100644 (file)
@@ -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*/
index 0a2afd66dae6510c69304abfc059df51ef251c89..7d4f6d2d76b375358321ff684cde58f933593b79 100644 (file)
@@ -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'
index 2759e8ca7ffc28b01d084e01073e1273c561b068..c5edd711d0a927cbceb443e096d963df78fd4c68 100644 (file)
@@ -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']:
index 5ddf522e4a86aa86e043c2857f0a736ca9ac3b26..ee5d56eaf43f527284944573823484cd44e5a141 100644 (file)
@@ -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
index 497443edffd159c66289adffd40152d3e28adcdc..fd8bd7dc014ac7c9bf7cd181e6f3c7fea1916e3f 100644 (file)
@@ -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 */
index 496d5120bb9c989f2c48ce69d04a6da2e06ec6d4..f58eaefc62853e9808c3f4ab0585bd7c163003e4 100644 (file)
@@ -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++;
                        }
index 2a91b66ad8ecb29d73af2ffb240c65a6440cea3e..229889d15ffd2fd1c07b8becbe2f5e61905ccfa9 100644 (file)
@@ -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);
 }
 
index fc9dfbb902e39b6c91999cb1912d4b0c36888ea7..0bc1ef5ca1fb88aa6f53cf4987c4bcec49af49af 100644 (file)
@@ -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)
                        {
index d2cfa7d07f9612e3c6dba89663f0409216d4c492..8010d24886ed7fde274f6e5e83f57ccfd5d6b2e1 100644 (file)
@@ -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;
index 454643a5077099345ccb0cbc782052c397978e5c..6a420a974d444a904c43aed7a406556acde23c86 100644 (file)
@@ -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];
index 1c8924ca7f653e7c07c908c45c9f41aaca0e795d..299bfca929d23910f8385a23023a5b2c8f685a49 100755 (executable)
@@ -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')