diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2010-05-30 01:22:24 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2010-05-30 01:22:24 +0400 |
commit | 9d3157eed000e7c543d04f5ad3efc5990675903b (patch) | |
tree | 54d3fcbc7a128ef0881385f49c57392c38bbd7e0 /source/gameengine/GamePlayer | |
parent | e335321e884f270e2ad28a7b6c75eea7e11bf4b7 (diff) |
Reversing the last merge because I botched it.
Diffstat (limited to 'source/gameengine/GamePlayer')
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_Application.cpp | 23 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_Application.h | 10 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 19 |
3 files changed, 33 insertions, 19 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 71507642226..bde4bf3892b 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -228,7 +228,8 @@ static HWND findGhostWindowHWND(GHOST_IWindow* window) bool GPG_Application::startScreenSaverPreview( HWND parentWindow, const bool stereoVisual, - const int stereoMode) + const int stereoMode, + const GHOST_TUns16 samples) { bool success = false; @@ -240,7 +241,7 @@ bool GPG_Application::startScreenSaverPreview( STR_String title = ""; m_mainWindow = fSystem->createWindow(title, 0, 0, windowWidth, windowHeight, GHOST_kWindowStateMinimized, - GHOST_kDrawingContextTypeOpenGL, stereoVisual); + GHOST_kDrawingContextTypeOpenGL, stereoVisual, samples); if (!m_mainWindow) { printf("error: could not create main window\n"); exit(-1); @@ -282,9 +283,10 @@ bool GPG_Application::startScreenSaverFullScreen( int height, int bpp,int frequency, const bool stereoVisual, - const int stereoMode) + const int stereoMode, + const GHOST_TUns16 samples) { - bool ret = startFullScreen(width, height, bpp, frequency, stereoVisual, stereoMode); + bool ret = startFullScreen(width, height, bpp, frequency, stereoVisual, stereoMode, samples); if (ret) { HWND ghost_hwnd = findGhostWindowHWND(m_mainWindow); @@ -306,13 +308,14 @@ bool GPG_Application::startWindow(STR_String& title, int windowWidth, int windowHeight, const bool stereoVisual, - const int stereoMode) + const int stereoMode, + const GHOST_TUns16 samples) { bool success; // Create the main window //STR_String title ("Blender Player - GHOST"); m_mainWindow = fSystem->createWindow(title, windowLeft, windowTop, windowWidth, windowHeight, GHOST_kWindowStateNormal, - GHOST_kDrawingContextTypeOpenGL, stereoVisual); + GHOST_kDrawingContextTypeOpenGL, stereoVisual, samples); if (!m_mainWindow) { printf("error: could not create main window\n"); exit(-1); @@ -334,10 +337,11 @@ bool GPG_Application::startWindow(STR_String& title, bool GPG_Application::startEmbeddedWindow(STR_String& title, const GHOST_TEmbedderWindowID parentWindow, const bool stereoVisual, - const int stereoMode) { + const int stereoMode, + const GHOST_TUns16 samples) { m_mainWindow = fSystem->createWindow(title, 0, 0, 0, 0, GHOST_kWindowStateNormal, - GHOST_kDrawingContextTypeOpenGL, stereoVisual, parentWindow); + GHOST_kDrawingContextTypeOpenGL, stereoVisual,samples, parentWindow); if (!m_mainWindow) { printf("error: could not create main window\n"); @@ -358,7 +362,8 @@ bool GPG_Application::startFullScreen( int height, int bpp,int frequency, const bool stereoVisual, - const int stereoMode) + const int stereoMode, + const GHOST_TUns16 samples) { bool success; // Create the main window diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h index 48a6c8e78ec..e6a47628923 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.h +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h @@ -59,12 +59,12 @@ public: 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); - bool startFullScreen(int width, int height, int bpp, int frequency, const bool stereoVisual, const int stereoMode); - bool startEmbeddedWindow(STR_String& title, const GHOST_TEmbedderWindowID parent_window, const bool stereoVisual, const int stereoMode); + const bool stereoVisual, const int stereoMode, const GHOST_TUns16 numOfAASamples = 0); + bool startFullScreen(int width, int height, int bpp, int frequency, const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0); + 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); - bool startScreenSaverPreview(HWND parentWindow, const bool stereoVisual, const int stereoMode); + bool startScreenSaverFullScreen(int width, int height, int bpp, int frequency, const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0); + bool startScreenSaverPreview(HWND parentWindow, const bool stereoVisual, const int stereoMode, const GHOST_TUns16 samples=0); #endif virtual bool processEvent(GHOST_IEvent* event); diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index b7ed8666325..69df00949a8 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -214,6 +214,7 @@ void usage(const char* program) printf(" -c: keep console window open\n\n"); #endif printf(" -d: turn debugging on\n\n"); + printf(" -m: sets the number of samples to request for multisampling"); printf(" -g: game engine options:\n\n"); printf(" Name Default Description\n"); printf(" ------------------------------------------------------------------------\n"); @@ -229,6 +230,7 @@ void usage(const char* program) printf("\n"); printf("example: %s -w 320 200 10 10 -g noaudio c:\\loadtest.blend\n", program); printf("example: %s -g show_framerate = 0 c:\\loadtest.blend\n", program); + printf("example: %s -m 4 game.blend", program); } static void get_filename(int argc, char **argv, char *filename) @@ -334,6 +336,7 @@ int main(int argc, char** argv) int windowHeight = 480; GHOST_TUns32 fullScreenWidth = 0; GHOST_TUns32 fullScreenHeight= 0; + GHOST_TUns16 aaSamples = 4; int fullScreenBpp = 32; int fullScreenFrequency = 60; GHOST_TEmbedderWindowID parentWindow = 0; @@ -508,6 +511,12 @@ int main(int argc, char** argv) } } break; + case 'm': + i++; + + if ((i+1) < argc) + aaSamples = atoi(argv[i++]); + break; case 'h': usage(argv[0]); @@ -810,13 +819,13 @@ int main(int argc, char** argv) if (scr_saver_mode == SCREEN_SAVER_MODE_SAVER) { app.startScreenSaverFullScreen(fullScreenWidth, fullScreenHeight, fullScreenBpp, fullScreenFrequency, - stereoWindow, stereomode); + stereoWindow, stereomode, aaSamples); } else #endif { app.startFullScreen(fullScreenWidth, fullScreenHeight, fullScreenBpp, fullScreenFrequency, - stereoWindow, stereomode); + stereoWindow, stereomode, aaSamples); } } else @@ -856,16 +865,16 @@ int main(int argc, char** argv) #ifdef WIN32 if (scr_saver_mode == SCREEN_SAVER_MODE_PREVIEW) { - app.startScreenSaverPreview(scr_saver_hwnd, stereoWindow, stereomode); + app.startScreenSaverPreview(scr_saver_hwnd, stereoWindow, stereomode, aaSamples); } else #endif { if (parentWindow != 0) - app.startEmbeddedWindow(title, parentWindow, stereoWindow, stereomode); + app.startEmbeddedWindow(title, parentWindow, stereoWindow, stereomode, aaSamples); else app.startWindow(title, windowLeft, windowTop, windowWidth, windowHeight, - stereoWindow, stereomode); + stereoWindow, stereomode, aaSamples); } } } |