From 828c85a1bf6045dc76d1197635a4b71d897206c3 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Thu, 26 Mar 2015 11:35:41 +0100 Subject: sound module: Append functions with BKE (makes it easier to make them out from local functions) --- source/gameengine/GamePlayer/ghost/GPG_Application.cpp | 6 +++--- source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source/gameengine/GamePlayer') diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 6b69a991968..b8ce67743de 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -636,7 +636,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) if (!m_networkdevice) goto initFailed; - sound_init(m_maggie); + BKE_sound_init(m_maggie); // create a ketsjisystem (only needed for timing and stuff) m_kxsystem = new GPG_System (m_system); @@ -672,7 +672,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) return m_engineInitialized; initFailed: - sound_exit(); + BKE_sound_exit(); delete m_kxsystem; delete m_networkdevice; delete m_mouse; @@ -847,7 +847,7 @@ void GPG_Application::exitEngine() if (!m_engineInitialized) return; - sound_exit(); + BKE_sound_exit(); if (m_ketsjiengine) { stopEngine(); diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 915fe614957..a4c9472df2f 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -517,7 +517,7 @@ int main(int argc, char** argv) // enable fast mipmap generation U.use_gpu_mipmap = 1; - sound_init_once(); + BKE_sound_init_once(); set_free_windowmanager_cb(wm_free); -- cgit v1.2.3 From e36b0cb8f32fc4302499c87e5c2b4c1ecc7a6543 Mon Sep 17 00:00:00 2001 From: Thomas Szepe Date: Tue, 7 Apr 2015 18:32:25 +0200 Subject: BGE: New API method getDisplayDimensions This patch adds a new API function to get the actual display dimensions in pixels. Reviewers: dfelinto, sybren, lordloki, moguri Reviewed By: lordloki, moguri Differential Revision: https://developer.blender.org/D648 --- source/gameengine/GamePlayer/common/GPC_Canvas.h | 2 ++ source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp | 12 ++++++++++++ source/gameengine/GamePlayer/ghost/GPG_Canvas.h | 2 ++ 3 files changed, 16 insertions(+) (limited to 'source/gameengine/GamePlayer') diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.h b/source/gameengine/GamePlayer/common/GPC_Canvas.h index acbea477e38..34cc9759a08 100644 --- a/source/gameengine/GamePlayer/common/GPC_Canvas.h +++ b/source/gameengine/GamePlayer/common/GPC_Canvas.h @@ -71,6 +71,8 @@ public: virtual void ResizeWindow(int width, int height) {} + virtual void GetDisplayDimensions(int &width, int &height) {} + /** * \section Methods inherited from abstract base class RAS_ICanvas. */ diff --git a/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp b/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp index 556f85804ea..09eb1691dae 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp @@ -121,6 +121,18 @@ bool GPG_Canvas::GetSwapInterval(int& intervalOut) return false; } +void GPG_Canvas::GetDisplayDimensions(int &width, int &height) + { + unsigned int uiwidth; + unsigned int uiheight; + + GHOST_ISystem *system = GHOST_ISystem::getSystem(); + system->getMainDisplayDimensions(uiwidth, uiheight); + + width = uiwidth; + height = uiheight; +} + void GPG_Canvas::ResizeWindow(int width, int height) { if (m_window->getState() == GHOST_kWindowStateFullScreen) diff --git a/source/gameengine/GamePlayer/ghost/GPG_Canvas.h b/source/gameengine/GamePlayer/ghost/GPG_Canvas.h index 337c2cedf55..18afbf6cd9e 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Canvas.h +++ b/source/gameengine/GamePlayer/ghost/GPG_Canvas.h @@ -63,6 +63,8 @@ public: virtual float GetMouseNormalizedX(int x); virtual float GetMouseNormalizedY(int y); + virtual void GetDisplayDimensions(int &width, int &height); + virtual void ResizeWindow(int width, int height); virtual void SetFullScreen(bool enable); virtual bool GetFullScreen(); -- cgit v1.2.3 From 23a79c42b5efce2c0d1aa27bd01751380ca9fb41 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 4 May 2015 14:38:46 +0500 Subject: BGE Player: Fix compilation error after cleanup commit da8a62a --- source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/gameengine/GamePlayer') diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index a4c9472df2f..9e5b1464ac0 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -519,7 +519,7 @@ int main(int argc, char** argv) BKE_sound_init_once(); - set_free_windowmanager_cb(wm_free); + BKE_library_callback_free_window_manager_set(wm_free); /* if running blenderplayer the last argument can't be parsed since it has to be the filename. else it is bundled */ isBlenderPlayer = !BLO_is_a_runtime(argv[0]); -- cgit v1.2.3 From 2da9a39418379ffd286a195188bcfba78eb4bf38 Mon Sep 17 00:00:00 2001 From: Porteries Tristan Date: Sat, 23 May 2015 12:12:43 +0200 Subject: BGE : Fix black material on meshes without materials in blenderplayer. Blenderplayer forgot to initialize the default material (defmaterail) with function init_def_material(). This reverts also the plumber commit 2fa4a48bcef05671890fafc3fe50a8fa619f0259. Reviewers: campbellbarton --- source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/gameengine/GamePlayer') diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 9e5b1464ac0..faa29e15b65 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -74,6 +74,7 @@ extern "C" #include "BKE_report.h" #include "BKE_library.h" #include "BKE_modifier.h" +#include "BKE_material.h" #include "BKE_text.h" #include "BKE_sound.h" @@ -519,6 +520,9 @@ int main(int argc, char** argv) BKE_sound_init_once(); + // Initialize a default material for meshes without materials. + init_def_material(); + BKE_library_callback_free_window_manager_set(wm_free); /* if running blenderplayer the last argument can't be parsed since it has to be the filename. else it is bundled */ -- cgit v1.2.3