[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38968] branches/soc-2011-cucumber: Committing a patch from Mitchell Stokes (Moguri) to include a setting in the UI for the Blenderplayer multisampling.
Daniel Stokes
kupomail at gmail.com
Wed Aug 3 08:57:47 CEST 2011
Revision: 38968
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38968
Author: kupoman
Date: 2011-08-03 06:57:47 +0000 (Wed, 03 Aug 2011)
Log Message:
-----------
Committing a patch from Mitchell Stokes (Moguri) to include a setting in the UI for the Blenderplayer multisampling.
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_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 06:42:55 UTC (rev 38967)
+++ branches/soc-2011-cucumber/release/scripts/startup/bl_ui/properties_game.py 2011-08-03 06:57:47 UTC (rev 38968)
@@ -287,6 +287,9 @@
row.prop(gs, "show_fullscreen")
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")
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 06:42:55 UTC (rev 38967)
+++ branches/soc-2011-cucumber/source/blender/makesdna/DNA_scene_types.h 2011-08-03 06:57:47 UTC (rev 38968)
@@ -453,7 +453,7 @@
/* standalone player */
struct GameFraming framing;
short fullscreen, xplay, yplay, freqplay;
- short depth, attrib, rt1, rt2;
+ short depth, attrib, rt1, rt2, aasamples, pad4[3];
/* 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 06:42:55 UTC (rev 38967)
+++ branches/soc-2011-cucumber/source/blender/makesrna/intern/rna_scene.c 2011-08-03 06:57:47 UTC (rev 38968)
@@ -1652,6 +1652,14 @@
StructRNA *srna;
PropertyRNA *prop;
+ static EnumPropertyItem aasamples_items[] ={
+ {0, "SAMPLES_0", 0, "Off", ""},
+ {2, "SAMPLES_2", 0, "2x", ""},
+ {4, "SAMPLES_4", 0, "4x", ""},
+ {8, "SAMPLES_8", 0, "8x", ""},
+ {16, "SAMPLES_16", 0, "16x", ""},
+ {0, NULL, 0, NULL, NULL}};
+
static EnumPropertyItem framing_types_items[] ={
{SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
{SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
@@ -1720,6 +1728,11 @@
RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
RNA_def_property_update(prop, NC_SCENE, NULL);
+ prop= RNA_def_property(srna, "samples", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "aasamples");
+ RNA_def_property_enum_items(prop, aasamples_items);
+ RNA_def_property_ui_text(prop, "AA Samples", "The number of AA Samples to use for MSAA");
+
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_range(prop, 8, 32);
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 06:42:55 UTC (rev 38967)
+++ branches/soc-2011-cucumber/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp 2011-08-03 06:57:47 UTC (rev 38968)
@@ -371,6 +371,7 @@
GHOST_TEmbedderWindowID parentWindow = 0;
bool isBlenderPlayer = false;
int validArguments=0;
+ bool samplesParFound = false;
GHOST_TUns16 aasamples = 0;
#ifdef __linux__
@@ -584,8 +585,14 @@
break;
case 'm':
i++;
+ samplesParFound = true;
if ((i+1) <= validArguments )
- aasamples = atoi(argv[i++]);
+ aasamples = atoi(argv[i++]);
+ else
+ {
+ error = true;
+ printf("error: No argument supplied for -m");
+ }
break;
case 'c':
i++;
@@ -841,6 +848,9 @@
else
scene->gm.stereoflag = STEREO_ENABLED;
+ if (!samplesParFound)
+ aasamples = scene->gm.aasamples;
+
if (stereoFlag == STEREO_DOME){
stereomode = RAS_IRasterizer::RAS_STEREO_DOME;
scene->gm.stereoflag = STEREO_DOME;
More information about the Bf-blender-cvs
mailing list