[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43291] branches/carve_booleans: Merging r43280 through r43289 from trunk into carve_booleans

Sergey Sharybin sergey.vfx at gmail.com
Wed Jan 11 14:47:40 CET 2012


Revision: 43291
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43291
Author:   nazgul
Date:     2012-01-11 13:47:38 +0000 (Wed, 11 Jan 2012)
Log Message:
-----------
Merging r43280 through r43289 from trunk into carve_booleans

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43280
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43289

Modified Paths:
--------------
    branches/carve_booleans/CMakeLists.txt
    branches/carve_booleans/extern/libmv/CMakeLists.txt
    branches/carve_booleans/extern/libmv/SConscript
    branches/carve_booleans/extern/libmv/bundle.sh
    branches/carve_booleans/intern/cycles/device/device.cpp
    branches/carve_booleans/intern/cycles/device/device_cpu.cpp
    branches/carve_booleans/intern/ghost/intern/GHOST_DisplayManagerSDL.cpp
    branches/carve_booleans/intern/ghost/intern/GHOST_DisplayManagerX11.cpp
    branches/carve_booleans/source/blender/blenfont/BLF_api.h
    branches/carve_booleans/source/blender/blenkernel/BKE_armature.h
    branches/carve_booleans/source/blender/blenkernel/BKE_deform.h
    branches/carve_booleans/source/blender/blenkernel/BKE_node.h
    branches/carve_booleans/source/blender/blenkernel/BKE_sequencer.h
    branches/carve_booleans/source/blender/blenkernel/intern/boids.c
    branches/carve_booleans/source/blender/blenkernel/intern/customdata.c
    branches/carve_booleans/source/blender/blenkernel/intern/deform.c
    branches/carve_booleans/source/blender/blenkernel/intern/dynamicpaint.c
    branches/carve_booleans/source/blender/blenkernel/intern/image.c
    branches/carve_booleans/source/blender/blenkernel/intern/ipo.c
    branches/carve_booleans/source/blender/blenkernel/intern/library.c
    branches/carve_booleans/source/blender/blenkernel/intern/material.c
    branches/carve_booleans/source/blender/blenkernel/intern/mball.c
    branches/carve_booleans/source/blender/blenkernel/intern/object.c
    branches/carve_booleans/source/blender/blenkernel/intern/packedFile.c
    branches/carve_booleans/source/blender/blenkernel/intern/particle.c
    branches/carve_booleans/source/blender/blenkernel/intern/pointcache.c
    branches/carve_booleans/source/blender/blenkernel/intern/property.c
    branches/carve_booleans/source/blender/blenkernel/intern/sca.c
    branches/carve_booleans/source/blender/blenkernel/intern/seqeffects.c
    branches/carve_booleans/source/blender/blenkernel/intern/sequencer.c
    branches/carve_booleans/source/blender/blenkernel/intern/sound.c
    branches/carve_booleans/source/blender/blenkernel/intern/texture.c
    branches/carve_booleans/source/blender/blenkernel/intern/tracking.c
    branches/carve_booleans/source/blender/blenkernel/intern/writeffmpeg.c
    branches/carve_booleans/source/blender/blenlib/intern/path_util.c
    branches/carve_booleans/source/blender/blenlib/intern/storage.c
    branches/carve_booleans/source/blender/blenloader/intern/readfile.c
    branches/carve_booleans/source/blender/editors/animation/anim_draw.c
    branches/carve_booleans/source/blender/editors/animation/anim_ipo_utils.c
    branches/carve_booleans/source/blender/editors/armature/editarmature.c
    branches/carve_booleans/source/blender/editors/armature/editarmature_retarget.c
    branches/carve_booleans/source/blender/editors/armature/meshlaplacian.c
    branches/carve_booleans/source/blender/editors/armature/poseSlide.c
    branches/carve_booleans/source/blender/editors/armature/poselib.c
    branches/carve_booleans/source/blender/editors/armature/poseobject.c
    branches/carve_booleans/source/blender/editors/armature/reeb.c
    branches/carve_booleans/source/blender/editors/curve/editcurve.c
    branches/carve_booleans/source/blender/editors/gpencil/gpencil_buttons.c
    branches/carve_booleans/source/blender/editors/include/ED_armature.h
    branches/carve_booleans/source/blender/editors/interface/interface.c
    branches/carve_booleans/source/blender/editors/interface/interface_layout.c
    branches/carve_booleans/source/blender/editors/interface/interface_regions.c
    branches/carve_booleans/source/blender/editors/interface/interface_style.c
    branches/carve_booleans/source/blender/editors/interface/interface_templates.c
    branches/carve_booleans/source/blender/editors/interface/view2d.c
    branches/carve_booleans/source/blender/editors/mesh/mesh_data.c
    branches/carve_booleans/source/blender/editors/object/object_add.c
    branches/carve_booleans/source/blender/editors/object/object_constraint.c
    branches/carve_booleans/source/blender/editors/object/object_edit.c
    branches/carve_booleans/source/blender/editors/object/object_group.c
    branches/carve_booleans/source/blender/editors/object/object_hook.c
    branches/carve_booleans/source/blender/editors/object/object_modifier.c
    branches/carve_booleans/source/blender/editors/object/object_ops.c
    branches/carve_booleans/source/blender/editors/object/object_relations.c
    branches/carve_booleans/source/blender/editors/object/object_select.c
    branches/carve_booleans/source/blender/editors/physics/physics_fluid.c
    branches/carve_booleans/source/blender/editors/screen/area.c
    branches/carve_booleans/source/blender/editors/sculpt_paint/sculpt.c
    branches/carve_booleans/source/blender/editors/space_action/action_draw.c
    branches/carve_booleans/source/blender/editors/space_buttons/buttons_header.c
    branches/carve_booleans/source/blender/editors/space_clip/clip_draw.c
    branches/carve_booleans/source/blender/editors/space_file/file_draw.c
    branches/carve_booleans/source/blender/editors/space_file/filelist.c
    branches/carve_booleans/source/blender/editors/space_graph/graph_buttons.c
    branches/carve_booleans/source/blender/editors/space_graph/graph_draw.c
    branches/carve_booleans/source/blender/editors/space_image/image_buttons.c
    branches/carve_booleans/source/blender/editors/space_image/image_draw.c
    branches/carve_booleans/source/blender/editors/space_info/info_ops.c
    branches/carve_booleans/source/blender/editors/space_logic/logic_ops.c
    branches/carve_booleans/source/blender/editors/space_logic/logic_window.c
    branches/carve_booleans/source/blender/editors/space_nla/nla_draw.c
    branches/carve_booleans/source/blender/editors/space_node/drawnode.c
    branches/carve_booleans/source/blender/editors/space_node/node_draw.c
    branches/carve_booleans/source/blender/editors/space_node/node_edit.c
    branches/carve_booleans/source/blender/editors/space_outliner/outliner_draw.c
    branches/carve_booleans/source/blender/editors/space_outliner/outliner_edit.c
    branches/carve_booleans/source/blender/editors/space_outliner/outliner_tree.c
    branches/carve_booleans/source/blender/editors/space_sequencer/sequencer_draw.c
    branches/carve_booleans/source/blender/editors/space_text/text_draw.c
    branches/carve_booleans/source/blender/editors/space_view3d/drawanimviz.c
    branches/carve_booleans/source/blender/editors/space_view3d/drawobject.c
    branches/carve_booleans/source/blender/editors/space_view3d/view3d_buttons.c
    branches/carve_booleans/source/blender/editors/space_view3d/view3d_draw.c
    branches/carve_booleans/source/blender/editors/space_view3d/view3d_edit.c
    branches/carve_booleans/source/blender/editors/transform/transform.c
    branches/carve_booleans/source/blender/editors/transform/transform.h
    branches/carve_booleans/source/blender/editors/transform/transform_constraints.c
    branches/carve_booleans/source/blender/editors/transform/transform_ops.c
    branches/carve_booleans/source/blender/editors/transform/transform_orientations.c
    branches/carve_booleans/source/blender/editors/util/ed_util.c
    branches/carve_booleans/source/blender/editors/util/numinput.c
    branches/carve_booleans/source/blender/editors/uvedit/uvedit_unwrap_ops.c
    branches/carve_booleans/source/blender/gpu/GPU_extensions.h
    branches/carve_booleans/source/blender/gpu/intern/gpu_extensions.c
    branches/carve_booleans/source/blender/gpu/intern/gpu_material.c
    branches/carve_booleans/source/blender/imbuf/intern/anim_movie.c
    branches/carve_booleans/source/blender/makesdna/DNA_ID.h
    branches/carve_booleans/source/blender/makesdna/DNA_action_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_actuator_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_armature_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_constraint_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_controller_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_customdata_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_defs.h
    branches/carve_booleans/source/blender/makesdna/DNA_dynamicpaint_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_effect_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_key_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_lattice_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_material_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_modifier_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_node_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_object_force.h
    branches/carve_booleans/source/blender/makesdna/DNA_object_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_particle_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_property_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_scene_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_sensor_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_sequence_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_texture_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_tracking_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_view3d_types.h
    branches/carve_booleans/source/blender/makesdna/DNA_windowmanager_types.h
    branches/carve_booleans/source/blender/makesrna/intern/rna_actuator.c
    branches/carve_booleans/source/blender/makesrna/intern/rna_modifier.c
    branches/carve_booleans/source/blender/makesrna/intern/rna_nodetree.c
    branches/carve_booleans/source/blender/makesrna/intern/rna_tracking.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_armature.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_bevel.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_cast.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_curve.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_displace.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_hook.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_lattice.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_smooth.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_util.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_uvproject.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_wave.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_weightvg_util.c
    branches/carve_booleans/source/blender/modifiers/intern/MOD_weightvg_util.h
    branches/carve_booleans/source/blender/nodes/composite/node_composite_tree.c
    branches/carve_booleans/source/blender/nodes/texture/nodes/node_texture_output.c
    branches/carve_booleans/source/blender/python/generic/bpy_internal_import.c
    branches/carve_booleans/source/blender/python/generic/idprop_py_api.c
    branches/carve_booleans/source/blender/render/intern/include/render_types.h
    branches/carve_booleans/source/blender/windowmanager/intern/wm_operators.c
    branches/carve_booleans/source/blenderplayer/bad_level_call_stubs/stubs.c
    branches/carve_booleans/source/gameengine/Converter/KX_ConvertActuators.cpp
    branches/carve_booleans/source/gameengine/Ketsji/KX_CameraActuator.cpp
    branches/carve_booleans/source/gameengine/Ketsji/KX_CameraActuator.h

Property Changed:
----------------
    branches/carve_booleans/
    branches/carve_booleans/source/blender/editors/space_outliner/


Property changes on: branches/carve_booleans
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-cucumber:37517,38384,38387,38403-38404,38407,42997-42998
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801
/trunk/blender:40001-42622,42663-43279
   + /branches/soc-2011-cucumber:37517,38384,38387,38403-38404,38407,42997-42998
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801
/trunk/blender:40001-42622,42663-43289

Modified: branches/carve_booleans/CMakeLists.txt
===================================================================
--- branches/carve_booleans/CMakeLists.txt	2012-01-11 13:18:24 UTC (rev 43290)
+++ branches/carve_booleans/CMakeLists.txt	2012-01-11 13:47:38 UTC (rev 43291)
@@ -156,7 +156,7 @@
 
 if(UNIX AND NOT APPLE)
 	option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)"	ON)
-	option(WITH_X11_XF86VMODE "Enable X11 video mode switching"	OFF)
+	option(WITH_X11_XF86VMODE "Enable X11 video mode switching"	ON)
 	option(WITH_BUILTIN_GLEW "Use GLEW OpenGL wrapper library bundled with blender" ON)
 	option(WITH_XDG_USER_DIRS    "Build with XDG Base Directory Specification (only config and documents for now)" OFF)
 	mark_as_advanced(WITH_XDG_USER_DIRS)

Modified: branches/carve_booleans/extern/libmv/CMakeLists.txt
===================================================================
--- branches/carve_booleans/extern/libmv/CMakeLists.txt	2012-01-11 13:18:24 UTC (rev 43290)
+++ branches/carve_booleans/extern/libmv/CMakeLists.txt	2012-01-11 13:47:38 UTC (rev 43291)
@@ -22,7 +22,7 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
-# NOTEL This file is automatically generated by bundle.sh script
+# NOTE: This file is automatically generated by bundle.sh script
 #       If you're doing changes in this file, please update template
 #       in that script too
 

Modified: branches/carve_booleans/extern/libmv/SConscript
===================================================================
--- branches/carve_booleans/extern/libmv/SConscript	2012-01-11 13:18:24 UTC (rev 43290)
+++ branches/carve_booleans/extern/libmv/SConscript	2012-01-11 13:47:38 UTC (rev 43291)
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-# NOTEL This file is automatically generated by bundle.sh script
+# NOTE: This file is automatically generated by bundle.sh script
 #       If you're doing changes in this file, please update template
 #       in that script too
 

Modified: branches/carve_booleans/extern/libmv/bundle.sh
===================================================================
--- branches/carve_booleans/extern/libmv/bundle.sh	2012-01-11 13:18:24 UTC (rev 43290)
+++ branches/carve_booleans/extern/libmv/bundle.sh	2012-01-11 13:47:38 UTC (rev 43291)
@@ -113,7 +113,7 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
-# NOTEL This file is automatically generated by bundle.sh script
+# NOTE: This file is automatically generated by bundle.sh script
 #       If you're doing changes in this file, please update template
 #       in that script too
 
@@ -209,7 +209,7 @@
 cat > SConscript << EOF
 #!/usr/bin/python
 
-# NOTEL This file is automatically generated by bundle.sh script
+# NOTE: This file is automatically generated by bundle.sh script
 #       If you're doing changes in this file, please update template
 #       in that script too
 

Modified: branches/carve_booleans/intern/cycles/device/device.cpp
===================================================================
--- branches/carve_booleans/intern/cycles/device/device.cpp	2012-01-11 13:18:24 UTC (rev 43290)
+++ branches/carve_booleans/intern/cycles/device/device.cpp	2012-01-11 13:47:38 UTC (rev 43291)
@@ -255,8 +255,6 @@
 	static bool devices_init = false;
 
 	if(!devices_init) {
-		device_cpu_info(devices);
-
 #ifdef WITH_CUDA
 		if(cuLibraryInit())
 			device_cuda_info(devices);
@@ -271,6 +269,8 @@
 		device_multi_info(devices);
 #endif
 
+		device_cpu_info(devices);
+
 #ifdef WITH_NETWORK
 		device_network_info(devices);
 #endif

Modified: branches/carve_booleans/intern/cycles/device/device_cpu.cpp
===================================================================
--- branches/carve_booleans/intern/cycles/device/device_cpu.cpp	2012-01-11 13:18:24 UTC (rev 43290)
+++ branches/carve_booleans/intern/cycles/device/device_cpu.cpp	2012-01-11 13:47:38 UTC (rev 43291)
@@ -272,7 +272,7 @@
 	info.id = "CPU";
 	info.num = 0;
 
-	devices.push_back(info);
+	devices.insert(devices.begin(), info);
 }
 
 CCL_NAMESPACE_END

Modified: branches/carve_booleans/intern/ghost/intern/GHOST_DisplayManagerSDL.cpp
===================================================================
--- branches/carve_booleans/intern/ghost/intern/GHOST_DisplayManagerSDL.cpp	2012-01-11 13:18:24 UTC (rev 43290)
+++ branches/carve_booleans/intern/ghost/intern/GHOST_DisplayManagerSDL.cpp	2012-01-11 13:47:38 UTC (rev 43291)
@@ -17,6 +17,11 @@
  *
  * Contributor(s): Campbell Barton
  *
+ * Mode switching
+ * Copyright (C) 1997-2001 Id Software, Inc.
+ * Copyright (c) 1993-2011 Tim Riker
+ * Copyright (C) 2012 Alex Fraser
+ *
  * ***** END GPL LICENSE BLOCK *****
  */
 
@@ -47,7 +52,19 @@
                                                               GHOST_TInt32& numSettings) const
 {
 	GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n");
-	numSettings= GHOST_TInt32(1);
+	int i;
+	SDL_Rect **vidmodes;
+
+	vidmodes = SDL_ListModes(NULL, SDL_HWSURFACE | SDL_OPENGL |
+			SDL_FULLSCREEN | SDL_HWPALETTE);
+	if (!vidmodes) {
+		fprintf(stderr, "Could not get available video modes: %s.\n",
+				SDL_GetError());
+		return GHOST_kFailure;
+	}
+	for (i = 0; vidmodes[i]; i++);
+	numSettings = GHOST_TInt32(i);
+
 	return GHOST_kSuccess;
 }
 
@@ -56,19 +73,39 @@
                                            GHOST_TInt32 index,
                                            GHOST_DisplaySetting& setting) const
 {
-
 	GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n");
-	GHOST_ASSERT(index < 1, "Requested setting outside of valid range.\n");
-	SDL_DisplayMode mode;
 
-	SDL_GetDesktopDisplayMode(display, &mode);
+	int i;
+	SDL_Rect **vidmodes;
+	/* NULL is passed in here to get the modes for the current bit depth.
+	 * Other bit depths may be possible; in that case, an SDL_PixelFormat struct
+	 * should be passed in. To get a complete profile, all possible bit depths
+	 * would need to be iterated over. - z0r */
+	vidmodes = SDL_ListModes(NULL, SDL_HWSURFACE | SDL_OPENGL |
+			SDL_FULLSCREEN | SDL_HWPALETTE);
+	if (!vidmodes) {
+		fprintf(stderr, "Could not get available video modes: %s.\n",
+				SDL_GetError());
+		return GHOST_kFailure;
+	}
+	for (i = 0; vidmodes[i]; i++);
+	GHOST_ASSERT(index < i, "Requested setting outside of valid range.\n");
 
-	setting.xPixels= mode.w;
-	setting.yPixels= mode.h;
-	setting.bpp= SDL_BYTESPERPIXEL(mode.format);
-	/* assume 60 when unset */
-	setting.frequency= mode.refresh_rate ? mode.refresh_rate : 60;
+	setting.xPixels = vidmodes[index]->w;
+	setting.yPixels = vidmodes[index]->h;
 
+	SDL_Surface *surf;
+	surf = SDL_GetVideoSurface();
+	if (surf == NULL) {
+		fprintf(stderr, "Getting display setting: %s\n", SDL_GetError());
+		/* Just guess the bit depth */
+		setting.bpp = 32;
+	} else {
+		setting.bpp = surf->format->BitsPerPixel;
+	}
+	/* Just guess the frequency :( */
+	setting.frequency = 60;
+
 	return GHOST_kSuccess;
 }
 
@@ -76,17 +113,100 @@
 GHOST_DisplayManagerSDL::getCurrentDisplaySetting(GHOST_TUns8 display,
                                                   GHOST_DisplaySetting& setting) const
 {
-	return getDisplaySetting(display,GHOST_TInt32(0),setting);
+	SDL_Surface *surf;
+	const SDL_VideoInfo *info;
+
+	/* Note: not using SDL_GetDesktopDisplayMode because that does not return
+	 * the current mode. Try to use GetVideoSurface first, as it seems more
+	 * accurate. If that fails, try other methods. - z0r */
+	surf = SDL_GetVideoSurface();
+
+	if (surf != NULL) {
+		setting.xPixels = surf->w;
+		setting.yPixels = surf->h;
+		setting.bpp = surf->format->BitsPerPixel;
+		/* Just guess the frequency :( */
+		setting.frequency = 60;
+	} else {
+		/* This may happen if the surface hasn't been created yet, e.g. on
+		 * application startup. */
+		info = SDL_GetVideoInfo();
+		setting.xPixels = info->current_w;
+		setting.yPixels = info->current_h;
+		setting.bpp = info->vfmt->BitsPerPixel;
+		/* Just guess the frequency :( */
+		setting.frequency = 60;
+	}
+
+	return GHOST_kSuccess;
 }
 
 GHOST_TSuccess
 GHOST_DisplayManagerSDL:: setCurrentDisplaySetting(GHOST_TUns8 display,
                                                    const GHOST_DisplaySetting& setting)
 {
-	// This is never going to work robustly in X
-	// but it's currently part of the full screen interface
 
-	// we fudge it for now.
+	/*
+	 * Mode switching code ported from Quake 2 version 3.21 and bzflag version
+	 * 2.4.0:
+	 * ftp://ftp.idsoftware.com/idstuff/source/q2source-3.21.zip
+	 * See linux/gl_glx.c:GLimp_SetMode
+	 * http://wiki.bzflag.org/BZFlag_Source
+	 * See src/platform/SDLDisplay.cxx:SDLDisplay and createWindow
+	 */
+	SDL_Surface *surf;
+	int best_fit, best_dist, dist, x, y;
 
+	SDL_Rect **vidmodes = SDL_ListModes(NULL, SDL_HWSURFACE | SDL_OPENGL |
+			SDL_FULLSCREEN | SDL_HWPALETTE);
+	if (!vidmodes) {
+		fprintf(stderr, "Could not get available video modes: %s.\n",
+				SDL_GetError());
+	}
+
+	best_dist = 9999999;
+	best_fit = -1;
+
+	if (vidmodes == (SDL_Rect **) -1) {
+		/* Any mode is OK. */
+		x = setting.xPixels;
+		y = setting.yPixels;
+	} else {
+		for (int i = 0; vidmodes[i]; i++) {
+			if (setting.xPixels > vidmodes[i]->w ||
+				setting.yPixels > vidmodes[i]->h)
+				continue;
+
+			x = setting.xPixels - vidmodes[i]->w;
+			y = setting.yPixels - vidmodes[i]->h;
+			dist = (x * x) + (y * y);
+			if (dist < best_dist) {
+				best_dist = dist;
+				best_fit = i;
+			}
+		}
+
+		if (best_fit == -1)
+			return GHOST_kFailure;
+
+		x = vidmodes[best_fit]->w;
+		y = vidmodes[best_fit]->h;
+	}
+
+#  ifdef _DEBUG
+	printf("Switching to video mode %dx%d\n", x, y);
+#  endif
+
+	// limit us to the main display
+	static char singleDisplayEnv[] = "SDL_SINGLEDISPLAY=1";
+	putenv(singleDisplayEnv);
+
+	// change to the mode

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-blender-cvs mailing list