[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38973] branches/soc-2011-cucumber: Adding a checkbox to the UI to allow the full screen Blender Player to use the current desktop resolution instead of the resolution setting .

Daniel Stokes kupomail at gmail.com
Wed Aug 3 10:02:55 CEST 2011


Revision: 38973
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38973
Author:   kupoman
Date:     2011-08-03 08:02:54 +0000 (Wed, 03 Aug 2011)
Log Message:
-----------
Adding a checkbox to the UI to allow the full screen Blender Player to use the current desktop resolution instead of the resolution setting.

Modified Paths:
--------------
    branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_game.py
    branches/soc-2011-cucumber/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2011-cucumber/source/blender/makesrna/intern/rna_scene.c
    branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
    branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_Application.h
    branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

Modified: branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_game.py
===================================================================
--- branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_game.py	2011-08-03 08:02:32 UTC (rev 38972)
+++ branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_game.py	2011-08-03 08:02:54 UTC (rev 38973)
@@ -284,19 +284,20 @@
         
         row = layout.row()
         row.operator("wm.blenderplayer_start", text="Start")
-        row.prop(gs, "show_fullscreen")
+        row.label()
         
         row = layout.row()
-        row.prop(gs, "samples")
-        
-        row = layout.row()
         row.label(text="Resolution:")
         row = layout.row(align=True)
         row.prop(gs, "resolution_x", slider=False, text="X")
         row.prop(gs, "resolution_y", slider=False, text="Y")
+        row = layout.row()
+        row.prop(gs, "show_fullscreen")
+        row.prop(gs, "use_desktop")
         
         col = layout.column()
         col.label(text="Quality:")
+        col.prop(gs, "samples")
         col = layout.column(align=True)
         col.prop(gs, "depth", text="Bit Depth", slider=False)
         col.prop(gs, "frequency", text="Refresh Rate", slider=False)

Modified: branches/soc-2011-cucumber/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/soc-2011-cucumber/source/blender/makesdna/DNA_scene_types.h	2011-08-03 08:02:32 UTC (rev 38972)
+++ branches/soc-2011-cucumber/source/blender/makesdna/DNA_scene_types.h	2011-08-03 08:02:54 UTC (rev 38973)
@@ -452,8 +452,8 @@
 
 	/*  standalone player */
 	struct GameFraming framing;
-	short fullscreen, xplay, yplay, freqplay;
-	short depth, attrib, rt1, rt2, aasamples, pad4[3];
+	short fullscreen, use_desktop, xplay, yplay, freqplay;
+	short depth, attrib, rt1, rt2, aasamples, pad4[2];
 
 	/* stereo/dome mode */
 	struct GameDome dome;

Modified: branches/soc-2011-cucumber/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/soc-2011-cucumber/source/blender/makesrna/intern/rna_scene.c	2011-08-03 08:02:32 UTC (rev 38972)
+++ branches/soc-2011-cucumber/source/blender/makesrna/intern/rna_scene.c	2011-08-03 08:02:54 UTC (rev 38973)
@@ -1764,6 +1764,11 @@
 	RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
 	RNA_def_property_update(prop, NC_SCENE, NULL);
 
+	prop= RNA_def_property(srna, "use_desktop", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "use_desktop", 1.0);
+	RNA_def_property_ui_text(prop, "Desktop", "Uses the current desktop resultion in fullscreen mode");
+	RNA_def_property_update(prop, NC_SCENE, NULL);
+
 	/* Dynamic Lights */
 	prop= RNA_def_property(srna, "dynamic_points", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "dynpoints");

Modified: branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
===================================================================
--- branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_Application.cpp	2011-08-03 08:02:32 UTC (rev 38972)
+++ branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_Application.cpp	2011-08-03 08:02:54 UTC (rev 38973)
@@ -370,13 +370,16 @@
 		int bpp,int frequency,
 		const bool stereoVisual,
 		const int stereoMode,
-		const GHOST_TUns16 samples)
+		const GHOST_TUns16 samples,
+		bool useDesktop)
 {
 	bool success;
+	GHOST_TUns32 sysWidth=0, sysHeight=0;
+	fSystem->getMainDisplayDimensions(sysWidth, sysHeight);
 	// Create the main window
 	GHOST_DisplaySetting setting;
-	setting.xPixels = width;
-	setting.yPixels = height;
+	setting.xPixels = (useDesktop) ? sysWidth : width;
+	setting.yPixels = (useDesktop) ? sysHeight : height;
 	setting.bpp = bpp;
 	setting.frequency = frequency;
 

Modified: branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_Application.h
===================================================================
--- branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_Application.h	2011-08-03 08:02:32 UTC (rev 38972)
+++ branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_Application.h	2011-08-03 08:02:54 UTC (rev 38973)
@@ -64,7 +64,7 @@
 			bool SetGameEngineData(struct Main* maggie, struct Scene* scene, int argc, char** argv);
 			bool startWindow(STR_String& title, int windowLeft, int windowTop, int windowWidth, int windowHeight,
 			const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0);
-			bool startFullScreen(int width, int height, int bpp, int frequency, const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0);
+			bool startFullScreen(int width, int height, int bpp, int frequency, const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0, bool useDesktop=false);
 			bool startEmbeddedWindow(STR_String& title, const GHOST_TEmbedderWindowID parent_window, const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0);
 #ifdef WIN32
 			bool startScreenSaverFullScreen(int width, int height, int bpp, int frequency, const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0);

Modified: branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
===================================================================
--- branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp	2011-08-03 08:02:32 UTC (rev 38972)
+++ branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp	2011-08-03 08:02:54 UTC (rev 38973)
@@ -896,7 +896,7 @@
 #endif
 								{
 									app.startFullScreen(fullScreenWidth, fullScreenHeight, fullScreenBpp, fullScreenFrequency,
-										stereoWindow, stereomode, aasamples);
+										stereoWindow, stereomode, aasamples, scene->gm.use_desktop);
 								}
 							}
 							else




More information about the Bf-blender-cvs mailing list