Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-01-13 05:39:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-13 05:39:57 +0400
commit705f23064e8ba3e96690d163c98687fc79d4a179 (patch)
tree13251a1f24cfb219a62c4f64c6750cadec7ff712 /source/gameengine
parent9e59fed5d8ff9f63477b3a73d2b02eaa55abd6cd (diff)
parentdbdd1c2ea7496546f4f7e17350720a6005cdb187 (diff)
svn merge ^/trunk/blender -r43294:43338
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp468
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp11
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.h2
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp16
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp6
5 files changed, 218 insertions, 285 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index f64bcf14d11..1cecac4001c 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -2152,6 +2152,155 @@ KX_GameObject* getGameOb(STR_String busc,CListValue* sumolist){
}
+/* helper for BL_ConvertBlenderObjects, avoids code duplication
+ * note: all var names match args are passed from the caller */
+static void bl_ConvertBlenderObject_Single(
+ KX_BlenderSceneConverter *converter,
+ Scene *blenderscene, Object *blenderobject,
+ vector<MT_Vector3> &inivel, vector<MT_Vector3> &iniang,
+ vector<parentChildLink> &vec_parent_child,
+ CListValue* logicbrick_conversionlist,
+ CListValue* objectlist, CListValue* inactivelist, CListValue* sumolist,
+ KX_Scene* kxscene, KX_GameObject* gameobj,
+ SCA_LogicManager* logicmgr, SCA_TimeEventManager* timemgr,
+ bool isInActiveLayer
+ )
+{
+ MT_Point3 posPrev;
+ MT_Matrix3x3 angor;
+ if (converter->addInitFromFrame) blenderscene->r.cfra=blenderscene->r.sfra;
+
+ MT_Point3 pos(
+ blenderobject->loc[0]+blenderobject->dloc[0],
+ blenderobject->loc[1]+blenderobject->dloc[1],
+ blenderobject->loc[2]+blenderobject->dloc[2]
+ );
+ MT_Vector3 eulxyz(blenderobject->rot);
+ MT_Vector3 scale(blenderobject->size);
+ if (converter->addInitFromFrame){//rcruiz
+ float eulxyzPrev[3];
+ blenderscene->r.cfra=blenderscene->r.sfra-1;
+ //XXX update_for_newframe();
+ MT_Vector3 tmp=pos-MT_Point3(blenderobject->loc[0]+blenderobject->dloc[0],
+ blenderobject->loc[1]+blenderobject->dloc[1],
+ blenderobject->loc[2]+blenderobject->dloc[2]
+ );
+ eulxyzPrev[0]=blenderobject->rot[0];
+ eulxyzPrev[1]=blenderobject->rot[1];
+ eulxyzPrev[2]=blenderobject->rot[2];
+
+ double fps = (double) blenderscene->r.frs_sec/
+ (double) blenderscene->r.frs_sec_base;
+
+ tmp.scale(fps, fps, fps);
+ inivel.push_back(tmp);
+ tmp=eulxyz-eulxyzPrev;
+ tmp.scale(fps, fps, fps);
+ iniang.push_back(tmp);
+ blenderscene->r.cfra=blenderscene->r.sfra;
+ //XXX update_for_newframe();
+ }
+
+ gameobj->NodeSetLocalPosition(pos);
+ gameobj->NodeSetLocalOrientation(MT_Matrix3x3(eulxyz));
+ gameobj->NodeSetLocalScale(scale);
+ gameobj->NodeUpdateGS(0);
+
+ BL_ConvertMaterialIpos(blenderobject, gameobj, converter);
+
+ sumolist->Add(gameobj->AddRef());
+
+ BL_ConvertProperties(blenderobject,gameobj,timemgr,kxscene,isInActiveLayer);
+
+ gameobj->SetName(blenderobject->id.name + 2);
+
+ // update children/parent hierarchy
+ if ((blenderobject->parent != 0)&&(!converter->addInitFromFrame))
+ {
+ // blender has an additional 'parentinverse' offset in each object
+ SG_Callbacks callback(NULL,NULL,NULL,KX_Scene::KX_ScenegraphUpdateFunc,KX_Scene::KX_ScenegraphRescheduleFunc);
+ SG_Node* parentinversenode = new SG_Node(NULL,kxscene,callback);
+
+ // define a normal parent relationship for this node.
+ KX_NormalParentRelation * parent_relation = KX_NormalParentRelation::New();
+ parentinversenode->SetParentRelation(parent_relation);
+
+ parentChildLink pclink;
+ pclink.m_blenderchild = blenderobject;
+ pclink.m_gamechildnode = parentinversenode;
+ vec_parent_child.push_back(pclink);
+
+ float* fl = (float*) blenderobject->parentinv;
+ MT_Transform parinvtrans(fl);
+ parentinversenode->SetLocalPosition(parinvtrans.getOrigin());
+ // problem here: the parent inverse transform combines scaling and rotation
+ // in the basis but the scenegraph needs separate rotation and scaling.
+ // This is not important for OpenGL (it uses 4x4 matrix) but it is important
+ // for the physic engine that needs a separate scaling
+ //parentinversenode->SetLocalOrientation(parinvtrans.getBasis());
+
+ // Extract the rotation and the scaling from the basis
+ MT_Matrix3x3 ori(parinvtrans.getBasis());
+ MT_Vector3 x(ori.getColumn(0));
+ MT_Vector3 y(ori.getColumn(1));
+ MT_Vector3 z(ori.getColumn(2));
+ MT_Vector3 parscale(x.length(), y.length(), z.length());
+ if (!MT_fuzzyZero(parscale[0]))
+ x /= parscale[0];
+ if (!MT_fuzzyZero(parscale[1]))
+ y /= parscale[1];
+ if (!MT_fuzzyZero(parscale[2]))
+ z /= parscale[2];
+ ori.setColumn(0, x);
+ ori.setColumn(1, y);
+ ori.setColumn(2, z);
+ parentinversenode->SetLocalOrientation(ori);
+ parentinversenode->SetLocalScale(parscale);
+
+ parentinversenode->AddChild(gameobj->GetSGNode());
+ }
+
+ // needed for python scripting
+ logicmgr->RegisterGameObjectName(gameobj->GetName(),gameobj);
+
+ // needed for group duplication
+ logicmgr->RegisterGameObj(blenderobject, gameobj);
+ for (int i = 0; i < gameobj->GetMeshCount(); i++)
+ logicmgr->RegisterGameMeshName(gameobj->GetMesh(i)->GetName(), blenderobject);
+
+ converter->RegisterGameObject(gameobj, blenderobject);
+ // this was put in rapidly, needs to be looked at more closely
+ // only draw/use objects in active 'blender' layers
+
+ logicbrick_conversionlist->Add(gameobj->AddRef());
+
+ if (converter->addInitFromFrame){
+ posPrev=gameobj->NodeGetWorldPosition();
+ angor=gameobj->NodeGetWorldOrientation();
+ }
+ if (isInActiveLayer)
+ {
+ objectlist->Add(gameobj->AddRef());
+ //tf.Add(gameobj->GetSGNode());
+
+ gameobj->NodeUpdateGS(0);
+ gameobj->AddMeshUser();
+
+ }
+ else
+ {
+ //we must store this object otherwise it will be deleted
+ //at the end of this function if it is not a root object
+ inactivelist->Add(gameobj->AddRef());
+ }
+
+ if (converter->addInitFromFrame) {
+ gameobj->NodeSetLocalPosition(posPrev);
+ gameobj->NodeSetLocalOrientation(angor);
+ }
+}
+
+
// convert blender objects into ketsji gameobjects
void BL_ConvertBlenderObjects(struct Main* maggie,
KX_Scene* kxscene,
@@ -2162,7 +2311,21 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
KX_BlenderSceneConverter* converter,
bool alwaysUseExpandFraming
)
-{
+{
+
+#define BL_CONVERTBLENDEROBJECT_SINGLE \
+ bl_ConvertBlenderObject_Single(converter, \
+ blenderscene, blenderobject, \
+ inivel, iniang, \
+ vec_parent_child, \
+ logicbrick_conversionlist, \
+ objectlist, inactivelist, sumolist, \
+ kxscene, gameobj, \
+ logicmgr, timemgr, \
+ isInActiveLayer \
+ )
+
+
Scene *blenderscene = kxscene->GetBlenderScene();
// for SETLOOPER
@@ -2265,155 +2428,27 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
if (!isInActiveLayer)
addobj=false;
- if (gameobj&&addobj)
+ if (gameobj)
{
- MT_Point3 posPrev;
- MT_Matrix3x3 angor;
- if (converter->addInitFromFrame) blenderscene->r.cfra=blenderscene->r.sfra;
-
- MT_Point3 pos;
- pos.setValue(
- blenderobject->loc[0]+blenderobject->dloc[0],
- blenderobject->loc[1]+blenderobject->dloc[1],
- blenderobject->loc[2]+blenderobject->dloc[2]
- );
- MT_Vector3 eulxyz(blenderobject->rot);
- MT_Vector3 scale(blenderobject->size);
- if (converter->addInitFromFrame){//rcruiz
- float eulxyzPrev[3];
- blenderscene->r.cfra=blenderscene->r.sfra-1;
- //XXX update_for_newframe();
- MT_Vector3 tmp=pos-MT_Point3(blenderobject->loc[0]+blenderobject->dloc[0],
- blenderobject->loc[1]+blenderobject->dloc[1],
- blenderobject->loc[2]+blenderobject->dloc[2]
- );
- eulxyzPrev[0]=blenderobject->rot[0];
- eulxyzPrev[1]=blenderobject->rot[1];
- eulxyzPrev[2]=blenderobject->rot[2];
-
- double fps = (double) blenderscene->r.frs_sec/
- (double) blenderscene->r.frs_sec_base;
-
- tmp.scale(fps, fps, fps);
- inivel.push_back(tmp);
- tmp=eulxyz-eulxyzPrev;
- tmp.scale(fps, fps, fps);
- iniang.push_back(tmp);
- blenderscene->r.cfra=blenderscene->r.sfra;
- //XXX update_for_newframe();
- }
-
- gameobj->NodeSetLocalPosition(pos);
- gameobj->NodeSetLocalOrientation(MT_Matrix3x3(eulxyz));
- gameobj->NodeSetLocalScale(scale);
- gameobj->NodeUpdateGS(0);
+ if (addobj)
+ { /* macro calls object conversion funcs */
+ BL_CONVERTBLENDEROBJECT_SINGLE;
- BL_ConvertMaterialIpos(blenderobject, gameobj, converter);
-
- sumolist->Add(gameobj->AddRef());
-
- BL_ConvertProperties(blenderobject,gameobj,timemgr,kxscene,isInActiveLayer);
-
- gameobj->SetName(blenderobject->id.name + 2);
-
- // update children/parent hierarchy
- if ((blenderobject->parent != 0)&&(!converter->addInitFromFrame))
- {
- // blender has an additional 'parentinverse' offset in each object
- SG_Callbacks callback(NULL,NULL,NULL,KX_Scene::KX_ScenegraphUpdateFunc,KX_Scene::KX_ScenegraphRescheduleFunc);
- SG_Node* parentinversenode = new SG_Node(NULL,kxscene,callback);
-
- // define a normal parent relationship for this node.
- KX_NormalParentRelation * parent_relation = KX_NormalParentRelation::New();
- parentinversenode->SetParentRelation(parent_relation);
-
- parentChildLink pclink;
- pclink.m_blenderchild = blenderobject;
- pclink.m_gamechildnode = parentinversenode;
- vec_parent_child.push_back(pclink);
-
- float* fl = (float*) blenderobject->parentinv;
- MT_Transform parinvtrans(fl);
- parentinversenode->SetLocalPosition(parinvtrans.getOrigin());
- // problem here: the parent inverse transform combines scaling and rotation
- // in the basis but the scenegraph needs separate rotation and scaling.
- // This is not important for OpenGL (it uses 4x4 matrix) but it is important
- // for the physic engine that needs a separate scaling
- //parentinversenode->SetLocalOrientation(parinvtrans.getBasis());
-
- // Extract the rotation and the scaling from the basis
- MT_Matrix3x3 ori(parinvtrans.getBasis());
- MT_Vector3 x(ori.getColumn(0));
- MT_Vector3 y(ori.getColumn(1));
- MT_Vector3 z(ori.getColumn(2));
- MT_Vector3 parscale(x.length(), y.length(), z.length());
- if (!MT_fuzzyZero(parscale[0]))
- x /= parscale[0];
- if (!MT_fuzzyZero(parscale[1]))
- y /= parscale[1];
- if (!MT_fuzzyZero(parscale[2]))
- z /= parscale[2];
- ori.setColumn(0, x);
- ori.setColumn(1, y);
- ori.setColumn(2, z);
- parentinversenode->SetLocalOrientation(ori);
- parentinversenode->SetLocalScale(parscale);
-
- parentinversenode->AddChild(gameobj->GetSGNode());
+ if (gameobj->IsDupliGroup()) {
+ grouplist.insert(blenderobject->dup_group);
+ }
}
-
- // needed for python scripting
- logicmgr->RegisterGameObjectName(gameobj->GetName(),gameobj);
- // needed for group duplication
- logicmgr->RegisterGameObj(blenderobject, gameobj);
- for (int i = 0; i < gameobj->GetMeshCount(); i++)
- logicmgr->RegisterGameMeshName(gameobj->GetMesh(i)->GetName(), blenderobject);
-
- converter->RegisterGameObject(gameobj, blenderobject);
- // this was put in rapidly, needs to be looked at more closely
- // only draw/use objects in active 'blender' layers
-
- logicbrick_conversionlist->Add(gameobj->AddRef());
-
- if (converter->addInitFromFrame){
- posPrev=gameobj->NodeGetWorldPosition();
- angor=gameobj->NodeGetWorldOrientation();
- }
- if (isInActiveLayer)
- {
- objectlist->Add(gameobj->AddRef());
- //tf.Add(gameobj->GetSGNode());
-
- gameobj->NodeUpdateGS(0);
- gameobj->AddMeshUser();
-
- }
- else
- {
- //we must store this object otherwise it will be deleted
- //at the end of this function if it is not a root object
- inactivelist->Add(gameobj->AddRef());
- }
- if (gameobj->IsDupliGroup())
- grouplist.insert(blenderobject->dup_group);
- if (converter->addInitFromFrame){
- gameobj->NodeSetLocalPosition(posPrev);
- gameobj->NodeSetLocalOrientation(angor);
- }
-
- }
- /* Note about memory leak issues:
- When a CValue derived class is created, m_refcount is initialized to 1
- so the class must be released after being used to make sure that it won't
- hang in memory. If the object needs to be stored for a long time,
- use AddRef() so that this Release() does not free the object.
- Make sure that for any AddRef() there is a Release()!!!!
- Do the same for any object derived from CValue, CExpression and NG_NetworkMessage
- */
- if (gameobj)
+ /* Note about memory leak issues:
+ * When a CValue derived class is created, m_refcount is initialized to 1
+ * so the class must be released after being used to make sure that it won't
+ * hang in memory. If the object needs to be stored for a long time,
+ * use AddRef() so that this Release() does not free the object.
+ * Make sure that for any AddRef() there is a Release()!!!!
+ * Do the same for any object derived from CValue, CExpression and NG_NetworkMessage
+ */
gameobj->Release();
-
+ }
}
if (!grouplist.empty())
@@ -2453,147 +2488,26 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
if (converter->addInitFromFrame)
if (!isInActiveLayer)
addobj=false;
-
- if (gameobj&&addobj)
+
+ if (gameobj)
{
- MT_Point3 posPrev;
- MT_Matrix3x3 angor;
- if (converter->addInitFromFrame)
- blenderscene->r.cfra=blenderscene->r.sfra;
-
- MT_Point3 pos(
- blenderobject->loc[0]+blenderobject->dloc[0],
- blenderobject->loc[1]+blenderobject->dloc[1],
- blenderobject->loc[2]+blenderobject->dloc[2]
- );
- MT_Vector3 eulxyz(blenderobject->rot);
- MT_Vector3 scale(blenderobject->size);
- if (converter->addInitFromFrame){//rcruiz
- float eulxyzPrev[3];
- blenderscene->r.cfra=blenderscene->r.sfra-1;
- //XXX update_for_newframe();
- MT_Vector3 tmp=pos-MT_Point3(blenderobject->loc[0]+blenderobject->dloc[0],
- blenderobject->loc[1]+blenderobject->dloc[1],
- blenderobject->loc[2]+blenderobject->dloc[2]
- );
- eulxyzPrev[0]=blenderobject->rot[0];
- eulxyzPrev[1]=blenderobject->rot[1];
- eulxyzPrev[2]=blenderobject->rot[2];
-
- double fps = (double) blenderscene->r.frs_sec/
- (double) blenderscene->r.frs_sec_base;
-
- tmp.scale(fps, fps, fps);
- inivel.push_back(tmp);
- tmp=eulxyz-eulxyzPrev;
- tmp.scale(fps, fps, fps);
- iniang.push_back(tmp);
- blenderscene->r.cfra=blenderscene->r.sfra;
- //XXX update_for_newframe();
- }
-
- gameobj->NodeSetLocalPosition(pos);
- gameobj->NodeSetLocalOrientation(MT_Matrix3x3(eulxyz));
- gameobj->NodeSetLocalScale(scale);
- gameobj->NodeUpdateGS(0);
-
- BL_ConvertMaterialIpos(blenderobject,gameobj, converter);
-
- sumolist->Add(gameobj->AddRef());
-
- BL_ConvertProperties(blenderobject,gameobj,timemgr,kxscene,isInActiveLayer);
-
-
- gameobj->SetName(blenderobject->id.name + 2);
-
- // update children/parent hierarchy
- if ((blenderobject->parent != 0)&&(!converter->addInitFromFrame))
- {
- // blender has an additional 'parentinverse' offset in each object
- SG_Callbacks callback(NULL,NULL,NULL,KX_Scene::KX_ScenegraphUpdateFunc,KX_Scene::KX_ScenegraphRescheduleFunc);
- SG_Node* parentinversenode = new SG_Node(NULL,kxscene,callback);
-
- // define a normal parent relationship for this node.
- KX_NormalParentRelation * parent_relation = KX_NormalParentRelation::New();
- parentinversenode->SetParentRelation(parent_relation);
-
- parentChildLink pclink;
- pclink.m_blenderchild = blenderobject;
- pclink.m_gamechildnode = parentinversenode;
- vec_parent_child.push_back(pclink);
-
- float* fl = (float*) blenderobject->parentinv;
- MT_Transform parinvtrans(fl);
- parentinversenode->SetLocalPosition(parinvtrans.getOrigin());
-
- // Extract the rotation and the scaling from the basis
- MT_Matrix3x3 ori(parinvtrans.getBasis());
- MT_Vector3 x(ori.getColumn(0));
- MT_Vector3 y(ori.getColumn(1));
- MT_Vector3 z(ori.getColumn(2));
- MT_Vector3 localscale(x.length(), y.length(), z.length());
- if (!MT_fuzzyZero(localscale[0]))
- x /= localscale[0];
- if (!MT_fuzzyZero(localscale[1]))
- y /= localscale[1];
- if (!MT_fuzzyZero(localscale[2]))
- z /= localscale[2];
- ori.setColumn(0, x);
- ori.setColumn(1, y);
- ori.setColumn(2, z);
- parentinversenode->SetLocalOrientation(ori);
- parentinversenode->SetLocalScale(localscale);
-
- parentinversenode->AddChild(gameobj->GetSGNode());
- }
-
- // needed for python scripting
- logicmgr->RegisterGameObjectName(gameobj->GetName(),gameobj);
-
- // needed for group duplication
- logicmgr->RegisterGameObj(blenderobject, gameobj);
- for (int i = 0; i < gameobj->GetMeshCount(); i++)
- logicmgr->RegisterGameMeshName(gameobj->GetMesh(i)->GetName(), blenderobject);
-
- converter->RegisterGameObject(gameobj, blenderobject);
- // this was put in rapidly, needs to be looked at more closely
- // only draw/use objects in active 'blender' layers
-
- logicbrick_conversionlist->Add(gameobj->AddRef());
-
- if (converter->addInitFromFrame){
- posPrev=gameobj->NodeGetWorldPosition();
- angor=gameobj->NodeGetWorldOrientation();
- }
- if (isInActiveLayer)
- {
- objectlist->Add(gameobj->AddRef());
- //tf.Add(gameobj->GetSGNode());
-
- gameobj->NodeUpdateGS(0);
- gameobj->AddMeshUser();
+ if (addobj)
+ { /* macro calls object conversion funcs */
+ BL_CONVERTBLENDEROBJECT_SINGLE;
}
- else
- {
- //we must store this object otherwise it will be deleted
- //at the end of this function if it is not a root object
- inactivelist->Add(gameobj->AddRef());
- }
if (gameobj->IsDupliGroup())
{
- // check that the group is not already converted
if (allgrouplist.insert(blenderobject->dup_group).second)
+ {
grouplist.insert(blenderobject->dup_group);
+ }
}
- if (converter->addInitFromFrame){
- gameobj->NodeSetLocalPosition(posPrev);
- gameobj->NodeSetLocalOrientation(angor);
- }
-
- }
- if (gameobj)
+
+
+ /* see comment above re: mem leaks */
gameobj->Release();
+ }
}
}
}
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index f249510ecc7..f7c366599ef 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -372,17 +372,20 @@ bool GPG_Application::startFullScreen(
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;
- fSystem->beginFullScreen(setting, &m_mainWindow, stereoVisual);
+ fSystem->beginFullScreen(setting, &m_mainWindow, stereoVisual, samples);
m_mainWindow->setCursorVisibility(false);
m_mainWindow->setState(GHOST_kWindowStateFullScreen);
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h
index 37625dc8998..51dac5cb3f3 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.h
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h
@@ -64,7 +64,7 @@ public:
bool SetGameEngineData(struct Main* maggie, struct Scene* scene, GlobalSettings* gs, 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);
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index e84df921fd5..c725847037a 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -365,6 +365,7 @@ int main(int argc, char** argv)
GHOST_TEmbedderWindowID parentWindow = 0;
bool isBlenderPlayer = false;
int validArguments=0;
+ bool samplesParFound = false;
GHOST_TUns16 aasamples = 0;
#ifdef __linux__
@@ -582,8 +583,14 @@ int main(int argc, char** argv)
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++;
@@ -819,7 +826,7 @@ int main(int argc, char** argv)
if ((!fullScreenParFound) && (!windowParFound))
{
// Only use file settings when command line did not override
- if (scene->gm.fullscreen) {
+ if ((scene->gm.playerflag & GAME_PLAYER_FULLSCREEN)) {
//printf("fullscreen option found in Blender file\n");
fullScreen = true;
fullScreenWidth= scene->gm.xplay;
@@ -848,6 +855,9 @@ int main(int argc, char** argv)
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;
@@ -893,7 +903,7 @@ int main(int argc, char** argv)
#endif
{
app.startFullScreen(fullScreenWidth, fullScreenHeight, fullScreenBpp, fullScreenFrequency,
- stereoWindow, stereomode, aasamples);
+ stereoWindow, stereomode, aasamples, (scene->gm.playerflag & GAME_PLAYER_DESKTOP_RESOLUTION));
}
}
else
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 9a2c0cb89b1..114ca735265 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -47,6 +47,12 @@
#undef _XOPEN_SOURCE
#endif
+#if defined(__sun) || defined(sun)
+#if defined(_XPG4)
+#undef _XPG4
+#endif
+#endif
+
#include <Python.h>
extern "C" {