Merging r37863 through r3789 form trunk1 into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 28 Jun 2011 10:06:06 +0000 (10:06 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 28 Jun 2011 10:06:06 +0000 (10:06 +0000)
CMakeLists.txt
build_files/cmake/macros.cmake
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
release/scripts/startup/bl_operators/uvcalc_smart_project.py
release/scripts/startup/bl_ui/space_image.py
source/blender/editors/uvedit/uvedit_draw.c
source/blender/gpu/intern/gpu_buffers.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesrna/intern/rna_space.c
source/gameengine/GamePlayer/ghost/GPG_Application.cpp

index fda6459efbb23954601d5da12c2b0778cfacf035..cc8f97ceb40fd00cb0441e4a50b1919a84e4b1a3 100644 (file)
@@ -246,11 +246,24 @@ TEST_SSE_SUPPORT()
 set(WITH_BINRELOC OFF)
 
 # MAXOSX only, set to avoid uninitialized 
-set(EXETYPE "")
+set(EXETYPE)
+
+# C/C++ flags
+set(PLATFORM_CFLAGS)
 
 # these are added to later on.
-set(C_WARNINGS "")
-set(CXX_WARNINGS "")
+set(C_WARNINGS)
+set(CXX_WARNINGS)
+
+# libraries to link the binary with passed to target_link_libraries()
+# known as LLIBS to scons
+set(PLATFORM_LINKLIBS)
+
+# Added to linker flags in setup_liblinks
+# - CMAKE_EXE_LINKER_FLAGS
+# - CMAKE_EXE_LINKER_FLAGS_DEBUG
+set(PLATFORM_LINKFLAGS)
+set(PLATFORM_LINKFLAGS_DEBUG)
 
 
 # disabled for now, not supported
@@ -422,24 +435,24 @@ if(UNIX AND NOT APPLE)
        endif()
 
        # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
-       set(LLIBS "-lutil -lc -lm -lpthread -lstdc++")
+       set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++")
 
        if(NOT WITH_HEADLESS)
                find_package(X11 REQUIRED)
                find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
                mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
 
-               list(APPEND LLIBS ${X11_X11_LIB})
+               list(APPEND PLATFORM_LINKLIBS ${X11_X11_LIB})
 
                if(WITH_X11_XINPUT)
-                       list(APPEND LLIBS ${X11_Xinput_LIB})
+                       list(APPEND PLATFORM_LINKLIBS ${X11_Xinput_LIB})
                endif()
        endif()
 
        if(CMAKE_SYSTEM_NAME MATCHES "Linux")
                if(NOT WITH_PYTHON_MODULE)
                        # BSD's dont use libdl.so
-                       list(APPEND LLIBS -ldl)
+                       list(APPEND PLATFORM_LINKLIBS -ldl)
                        # binreloc is linux only
                        set(BINRELOC_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/binreloc/include)
                        set(WITH_BINRELOC ON)
@@ -550,13 +563,15 @@ elseif(WIN32)
 
        if(MSVC)
                if(CMAKE_CL_64)
-                       set(LLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
+                       set(PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
                else()
-                       set(LLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
+                       set(PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
                endif()
-               
-               set(CMAKE_CXX_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB /nologo /Ob1 /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013" CACHE STRING "MSVC MT C++ flags " FORCE)
-               set(CMAKE_C_FLAGS   "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB /nologo /Ob1 /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /EHsc" CACHE STRING "MSVC MT C++ flags " FORCE)
+
+               add_definitions(/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB)
+
+               set(CMAKE_CXX_FLAGS "/nologo /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013" CACHE STRING "MSVC MT C++ flags " FORCE)
+               set(CMAKE_C_FLAGS   "/nologo /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /EHsc" CACHE STRING "MSVC MT C++ flags " FORCE)
 
                if(CMAKE_CL_64)
                        set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
@@ -593,24 +608,21 @@ elseif(WIN32)
                endif()
                set(JPEG_LIBRARIES libjpeg)
 
-               set(ZLIB ${LIBDIR}/zlib)
-               set(ZLIB_INCLUDE_DIRS ${ZLIB}/include)
-               set(ZLIB_LIBPATH ${ZLIB}/lib)
+               set(ZLIB_INCLUDE_DIRS ${LIBDIR}/zlib/include)
                if(CMAKE_CL_64)
-                       set(ZLIB_LIBRARIES libz)
+                       set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/libz.lib)
                else()
-                       set(ZLIB_LIBRARIES zlib)
+                       set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/zlib.lib)
                endif()
 
-               set(PTHREADS ${LIBDIR}/pthreads)
-               set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
-               set(PTHREADS_LIBPATH ${PTHREADS}/lib)
-               set(PTHREADS_LIBRARIES pthreadVC2)
-               
-               set(FREETYPE ${LIBDIR}/freetype)
-               set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
-               set(FREETYPE_LIBPATH ${FREETYPE}/lib)
-               set(FREETYPE_LIBRARY freetype2ST)
+               set(PTHREADS_INCLUDE_DIRS ${LIBDIR}/pthreads/include)
+               set(PTHREADS_LIBRARIES ${LIBDIR}/pthreads/lib/pthreadVC2.lib)
+
+               set(FREETYPE_INCLUDE_DIRS
+                       ${FREETYPE}/include
+                       ${FREETYPE}/include/freetype2
+               )
+               set(FREETYPE_LIBRARY ${LIBDIR}/freetype/lib/freetype2ST.lib)
 
                if(WITH_FFTW3)
                        set(FFTW3 ${LIBDIR}/fftw3)
@@ -641,10 +653,17 @@ elseif(WIN32)
                endif()
 
                if(WITH_CODEC_FFMPEG)
-                       set(FFMPEG ${LIBDIR}/ffmpeg)
-                       set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include/msvc)
-                       set(FFMPEG_LIBRARIES avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
-                       set(FFMPEG_LIBPATH ${FFMPEG}/lib)
+                       set(FFMPEG_INCLUDE_DIRS
+                               ${LIBDIR}/ffmpeg/include
+                               ${LIBDIR}/ffmpeg/include/msvc
+                       )
+                       set(FFMPEG_LIBRARIES
+                               ${LIBDIR}/ffmpeg/lib/avcodec-52.lib
+                               ${LIBDIR}/ffmpeg/lib/avformat-52.lib
+                               ${LIBDIR}/ffmpeg/lib/avdevice-52.lib
+                               ${LIBDIR}/ffmpeg/lib/avutil-50.lib
+                               ${LIBDIR}/ffmpeg/lib/swscale-0.lib
+                       )
                endif()
 
                if(WITH_IMAGE_OPENEXR)
@@ -679,17 +698,16 @@ elseif(WIN32)
                endif()
 
                if(WITH_IMAGE_TIFF)
-                       set(TIFF ${LIBDIR}/tiff)
-                       set(TIFF_LIBRARY libtiff)
-                       set(TIFF_INCLUDE_DIR ${TIFF}/include)
-                       set(TIFF_LIBPATH ${TIFF}/lib)
+                       set(TIFF_LIBRARY ${LIBDIR}/tiff/lib/libtiff.lib)
+                       set(TIFF_INCLUDE_DIR ${LIBDIR}/tiff/include)
                endif()
 
                if(WITH_JACK)
-                       set(JACK ${LIBDIR}/jack)
-                       set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include)
-                       set(JACK_LIBRARIES libjack)
-                       set(JACK_LIBPATH ${JACK}/lib)
+                       set(JACK_INCLUDE_DIRS
+                               ${LIBDIR}/jack/include/jack
+                               ${LIBDIR}/jack/include
+                       )
+                       set(JACK_LIBRARIES ${LIBDIR}/jack/lib/libjack.lib)
                endif()
 
                if(WITH_PYTHON)
@@ -699,23 +717,24 @@ elseif(WIN32)
                        set(PYTHON_LIBRARIES ${LIBDIR}/python/lib/python32.lib)
                endif()
 
+               set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO  /NODEFAULTLIB:msvcrt.lib\;msvcmrt.lib\;msvcurt.lib\;msvcrtd.lib ")
+
                # MSVC only, Mingw doesnt need
                if(CMAKE_CL_64)
-                       set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /MACHINE:X64 /STACK:2097152 /OPT:NOREF /INCREMENTAL:NO /NODEFAULTLIB:\"msvcrt.lib\" /NODEFAULTLIB:\"msvcmrt.lib\" /NODEFAULTLIB:\"msvcurt.lib\" /NODEFAULTLIB:\"msvcrtd.lib\" ")
+                       set(PLATFORM_LINKFLAGS "/MACHINE:X64 /OPT:NOREF ${PLATFORM_LINKFLAGS}")
                else()
-                       set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /MACHINE:IX86 /STACK:2097152 /INCREMENTAL:NO /LARGEADDRESSAWARE /NODEFAULTLIB:\"msvcrt.lib\" /NODEFAULTLIB:\"msvcmrt.lib\" /NODEFAULTLIB:\"msvcurt.lib\" /NODEFAULTLIB:\"msvcrtd.lib\" ")
+                       set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
                endif()
 
-               set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
+               set(PLATFORM_LINKFLAGS_DEBUG "/NODEFAULTLIB:libcmt.lib\;libc.lib")
 
        else()
                # keep GCC spesific stuff here
                if(CMAKE_COMPILER_IS_GNUCC)
-                       set(LLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid")
+                       set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid")
                        set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
 
-                       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE")
-                       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE")
+                       add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
                endif()
 
                add_definitions(-DFREE_WINDOWS)
@@ -925,7 +944,7 @@ elseif(APPLE)
                set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib)
        endif()
 
-       set(LLIBS stdc++ SystemStubs)
+       set(PLATFORM_LINKLIBS stdc++ SystemStubs)
 
        if(WITH_COCOA)
                set(PLATFORM_CFLAGS "-pipe -funsigned-char -DGHOST_COCOA")
@@ -1149,6 +1168,18 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
 
 endif()
 
+# MSVC2010 fails to links C++ libs right
+if(MSVC10)
+       if(WITH_IMAGE_OPENEXR)
+               message(WARNING "MSVC 2010 does not support OpenEXR, disabling WITH_IMAGE_OPENEXR. To enable support use Use MSVC 2008")
+               set(WITH_IMAGE_OPENEXR OFF)
+       endif()
+       if(WITH_OPENCOLLADA)
+               message(WARNING "MSVC 2010 does not support OpenCollada, disabling WITH_OPENCOLLADA. To enable support use Use MSVC 2008")
+               set(WITH_OPENCOLLADA OFF)
+       endif()
+endif()
+
 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
        if(WITH_IK_ITASC OR WITH_MOD_FLUID)
                message(WARNING "Using Clang as CXX compiler: disabling WITH_IK_ITASC and WITH_MOD_FLUID, these features will be missing.")
index 8ae73451e318dd1a8cab02c18dc6567257fc403a..34301458a0654361a962b22e91e4e07f3a9a8263 100644 (file)
@@ -201,7 +201,9 @@ endmacro()
 
 macro(setup_liblinks
        target)
-       set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
+
+       set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
+       set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
 
        target_link_libraries(${target}
                        ${OPENGL_gl_LIBRARY}
@@ -209,7 +211,7 @@ macro(setup_liblinks
                        ${JPEG_LIBRARIES}
                        ${PNG_LIBRARIES}
                        ${ZLIB_LIBRARIES}
-                       ${LLIBS})
+                       ${PLATFORM_LINKLIBS})
 
        # since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
        if(WITH_PYTHON)  # AND NOT WITH_PYTHON_MODULE  # WIN32 needs
index ab7b5ce7d1488b84a06a9458ac048bca9c27d311..1654947885e92ef6d6a88391cf7059cd9d0766d4 100644 (file)
@@ -181,7 +181,7 @@ CXX_WARN = []
 
 LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid']
 
-PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:"msvcrt.lib"', '/NODEFAULTLIB:"msvcmrt.lib"', '/NODEFAULTLIB:"msvcurt.lib"', '/NODEFAULTLIB:"msvcrtd.lib"']
+PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib;msvcmrt.lib;msvcurt.lib;msvcrtd.lib']
 
 # # Todo
 # BF_PROFILE_CCFLAGS = ['-pg', '-g ']
index 3abc466d33dbfbbb3220b9128a3bd87ae3013e77..34fa27dc98d1de22cadc05779894ed319e16d38f 100644 (file)
@@ -50,6 +50,8 @@ BF_SDL_INC = '${BF_SDL}/include'
 BF_SDL_LIB = 'SDL.lib'
 BF_SDL_LIBPATH = '${BF_SDL}/lib'
 
+WITH_BF_JACK = False
+
 BF_PTHREADS = LIBDIR + '/pthreads'
 BF_PTHREADS_INC = '${BF_PTHREADS}/include'
 BF_PTHREADS_LIB = 'pthreadVC2'
@@ -188,7 +190,7 @@ if BF_DEBUG:
 else:
        BF_NUMJOBS=6
 
-PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:"msvcrt.lib"', '/NODEFAULTLIB:"msvcmrt.lib"', '/NODEFAULTLIB:"msvcurt.lib"', '/NODEFAULTLIB:"msvcrtd.lib"']
+PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib;msvcmrt.lib;msvcurt.lib;msvcrtd.lib']
 
 BF_BUILDDIR = '..\\build\\blender25-win64-vc'
 BF_INSTALLDIR='..\\install\\blender25-win64-vc'
index 3e1ce621ec25c5a04c595eb5d9c3db800e593bf5..7ea89cfa47923145c1a087a44ee14fd3f0c181ec 100644 (file)
@@ -746,13 +746,15 @@ def packIslands(islandList):
                 uv.y= (uv.y+yoffset) * yfactor
 
 
-
 def VectoQuat(vec):
-    vec = vec.normalized()
-    if abs(vec.x) > 0.5:
-        return vec.to_track_quat('Z', 'X')
-    else:
-        return vec.to_track_quat('Z', 'Y')
+    a3 = vec.normalized()
+    up = Vector((0.0, 0.0, 1.0))
+    if abs(a3.dot(up)) == 1.0:
+        up = Vector((0.0, 1.0, 0.0))
+
+    a1 = a3.cross(up).normalized()
+    a2 = a3.cross(a1)
+    return Matrix((a1, a2, a3)).to_quaternion()
 
 
 class thickface(object):
@@ -791,7 +793,11 @@ def main_consts():
 
 global ob
 ob = None
-def main(context, island_margin, projection_limit):
+def main(context,
+         island_margin,
+         projection_limit,
+         user_area_weight,
+         ):
     global USER_FILL_HOLES
     global USER_FILL_HOLES_QUALITY
     global USER_STRETCH_ASPECT
@@ -844,7 +850,6 @@ def main(context, island_margin, projection_limit):
     USER_FILL_HOLES = (0)
     USER_FILL_HOLES_QUALITY = (50) # Only for hole filling.
     USER_VIEW_INIT = (0) # Only for hole filling.
-    USER_AREA_WEIGHT = (1) # Only for hole filling.
 
     # Reuse variable
     if len(obList) == 1:
@@ -970,12 +975,15 @@ def main(context, island_margin, projection_limit):
 
             # Add the average of all these faces normals as a projectionVec
             averageVec = Vector((0.0, 0.0, 0.0))
-            if USER_AREA_WEIGHT:
+            if user_area_weight == 0.0:
+                for fprop in newProjectMeshFaces:
+                    averageVec += fprop.no
+            elif user_area_weight == 1.0:
                 for fprop in newProjectMeshFaces:
-                    averageVec += (fprop.no * fprop.area)
+                    averageVec += fprop.no * fprop.area
             else:
                 for fprop in newProjectMeshFaces:
-                    averageVec += fprop.no
+                    averageVec += fprop.no * ((fprop.area * user_area_weight) + (1.0 - user_area_weight))
 
             if averageVec.x != 0 or averageVec.y != 0 or averageVec.z != 0: # Avoid NAN
                 projectVecs.append(averageVec.normalized())
@@ -1062,7 +1070,7 @@ def main(context, island_margin, projection_limit):
                 f_uv = f.uv
                 for j, v in enumerate(f.v):
                     # XXX - note, between mathutils in 2.4 and 2.5 the order changed.
-                    f_uv[j][:] = (v.co * MatQuat)[:2]
+                    f_uv[j][:] = (v.co * MatQuat).xy
 
 
         if USER_SHARE_SPACE:
@@ -1098,12 +1106,8 @@ def main(context, island_margin, projection_limit):
 """
     pup_block = [\
     'Projection',\
-*      ('Angle Limit:', USER_PROJECTION_LIMIT, 1, 89, ''),\
     ('Selected Faces Only', USER_ONLY_SELECTED_FACES, 'Use only selected faces from all selected meshes.'),\
     ('Init from view', USER_VIEW_INIT, 'The first projection will be from the view vector.'),\
-    ('Area Weight', USER_AREA_WEIGHT, 'Weight projections vector by face area.'),\
-    '',\
-    '',\
     '',\
     'UV Layout',\
     ('Share Tex Space', USER_SHARE_SPACE, 'Objects Share texture space, map all objects into 1 uvmap.'),\
@@ -1125,11 +1129,15 @@ class SmartProject(bpy.types.Operator):
     bl_options = {'REGISTER', 'UNDO'}
 
     angle_limit = FloatProperty(name="Angle Limit",
-            description="lower for more projection groups, higher for less distortion.",
+            description="lower for more projection groups, higher for less distortion",
             default=66.0, min=1.0, max=89.0)
 
     island_margin = FloatProperty(name="Island Margin",
-            description="Margin to reduce bleed from adjacent islands.",
+            description="Margin to reduce bleed from adjacent islands",
+            default=0.0, min=0.0, max=1.0)
+
+    user_area_weight = FloatProperty(name="Area Weight",
+            description="Weight projections vector by faces with larger areas",
             default=0.0, min=0.0, max=1.0)
 
     @classmethod
@@ -1137,7 +1145,11 @@ class SmartProject(bpy.types.Operator):
         return context.active_object != None
 
     def execute(self, context):
-        main(context, self.island_margin, self.angle_limit)
+        main(context,
+             self.island_margin,
+             self.angle_limit,
+             self.user_area_weight,
+             )
         return {'FINISHED'}
 
     def invoke(self, context, event):
index 9f69ca170764e90bf4a0f429879e5721d1c79d58..b1322d453fce37a68d744202e0ae02df6aba8593 100644 (file)
@@ -616,10 +616,9 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
 
             split = layout.split()
             col = split.column()
+            col.prop(uvedit, "show_faces")
             col.prop(uvedit, "show_smooth_edges", text="Smooth")
             col.prop(uvedit, "show_modified_edges", text="Modified")
-            #col.prop(uvedit, "show_edges")
-            #col.prop(uvedit, "show_faces")
 
             col = split.column()
             col.prop(uvedit, "show_stretch", text="Stretch")
index 8d73da0063c8821d505503910c320fa7b836fb14..453bea0969b8e74ff79e2e526ec8020dc48e3103 100644 (file)
@@ -474,7 +474,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
        if(sima->flag & SI_DRAW_STRETCH) {
                draw_uvs_stretch(sima, scene, em, activetf);
        }
-       else if(me->drawflag & ME_DRAWFACES) {
+       else if(!(sima->flag & SI_NO_DRAWFACES)) {
                /* draw transparent faces */
                UI_GetThemeColor4ubv(TH_FACE, col1);
                UI_GetThemeColor4ubv(TH_FACE_SELECT, col2);
index 0d843dedbaa9e4abbdb5fb5aa997ead93dd054bf..3715dbe192c097a27d7f5bac1a15ca1e5858eb8e 100644 (file)
@@ -80,7 +80,7 @@ GPUBufferPool *GPU_buffer_pool_new(void)
        DEBUG_VBO("GPU_buffer_pool_new\n");
 
        if( useVBOs < 0 ) {
-               if( GL_ARB_vertex_buffer_object ) {
+               if( GLEW_ARB_vertex_buffer_object ) {
                        DEBUG_VBO( "Vertex Buffer Objects supported.\n" );
                        useVBOs = 1;
                }
@@ -484,7 +484,7 @@ void *GPU_build_mesh_buffers(GHash *map, MVert *mvert, MFace *mface,
        for(i = 0, tottri = 0; i < totface; ++i)
                tottri += mface[face_indices[i]].v4 ? 2 : 1;
        
-       if(GL_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO))
+       if(GLEW_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO))
                glGenBuffersARB(1, &buffers->index_buf);
 
        if(buffers->index_buf) {
@@ -615,7 +615,7 @@ void *GPU_build_grid_buffers(DMGridData **UNUSED(grids), int *UNUSED(grid_indice
        totquad= (gridsize-1)*(gridsize-1)*totgrid;
 
        /* Generate index buffer object */
-       if(GL_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO))
+       if(GLEW_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO))
                glGenBuffersARB(1, &buffers->index_buf);
 
        if(buffers->index_buf) {
index 4844ded574330703b10d1302c1bb57f89ef6e38b..e5b9c3f374b72d1fb4666bc7c99ac38e6ab7258a 100644 (file)
@@ -780,7 +780,7 @@ enum FileSortTypeE {
 #define SI_EDITTILE            (1<<1)
 #define SI_CLIP_UV             (1<<2)
 #define SI_DRAWTOOL            (1<<3)
-#define SI_DEPRECATED1  (1<<4) /* stick UVs to others in the same location */
+#define SI_NO_DRAWFACES        (1<<4)
 #define SI_DRAWSHADOW   (1<<5)
 #define SI_SELACTFACE   (1<<6) /* deprecated */
 #define SI_DEPRECATED2 (1<<7)
index 139d2ec3168a008904caca455edbead0d4132b11..b2c6c873885f75064fbd2fd07c6481eb93e5dd1a 100644 (file)
@@ -1001,7 +1001,12 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS);
        RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels");
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
-       
+
+       prop= RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SI_NO_DRAWFACES);
+       RNA_def_property_ui_text(prop, "Draw Faces", "Draw faces over the image");
+       RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
+
        prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
        RNA_def_property_array(prop, 2);
        RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get", "rna_SpaceImageEditor_cursor_location_set", NULL);
index 6487d0298c7518e7add7df295851e04b12c6e7e9..f2b322084ed6a305e343b4176995e23164608995 100644 (file)
@@ -448,6 +448,7 @@ bool GPG_Application::processEvent(GHOST_IEvent* event)
 
 
                case GHOST_kEventWindowClose:
+               case GHOST_kEventQuit:
                        m_exitRequested = KX_EXIT_REQUEST_OUTSIDE;
                        break;