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:
authorErwin Coumans <blender@erwincoumans.com>2006-01-06 06:46:54 +0300
committerErwin Coumans <blender@erwincoumans.com>2006-01-06 06:46:54 +0300
commit2e6d57618232b8b4ce8e5afe84fd278041cbbbfe (patch)
treec0f05e6b59aada420dd600f1138e9149b97d9e9d /source/gameengine/GamePlayer/ghost
parentef520a8cc9e863aa234be0ee60d1038e7ec8fc44 (diff)
Sorry to break the cvs-closed status, so if you really need to make a new 2.40 build, just disable the game engine if it doesn't compile for a platform. Again, sorry if this breaks non-windows platforms, but I hope people help to get this amazing fix working for all platforms. Armature-fixing contribution from Snailrose. Also lots of cool things from Snailrose and Lagan.
Armatures are back Split screen Double sided lightning Ambient lighting Alpha test Material IPO support (one per object atm) Blender materials GLSL shaders - Python access Up to three texture samplers from the material panel ( 2D & Cube map ) Python access to a second set of uv coordinates See http://www.elysiun.com/forum/viewtopic.php?t=58057
Diffstat (limited to 'source/gameengine/GamePlayer/ghost')
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp27
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.h3
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp1
3 files changed, 29 insertions, 2 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index b1c4a4d6d25..c5324776edb 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -62,6 +62,8 @@ extern "C"
#endif // __cplusplus
#include "BLI_blenlib.h"
#include "BLO_readfile.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
#ifdef __cplusplus
}
#endif // __cplusplus
@@ -82,6 +84,7 @@ extern "C"
#include "RAS_GLExtensionManager.h"
#include "KX_PythonInit.h"
#include "KX_PyConstraintBinding.h"
+#include "BL_Material.h" // MAXTEX
#include "KX_BlenderSceneConverter.h"
#include "NG_LoopBackNetworkDeviceInterface.h"
@@ -126,7 +129,8 @@ GPG_Application::GPG_Application(GHOST_ISystem* system, struct Main* maggie, STR
m_rasterizer(0),
m_sceneconverter(0),
m_networkdevice(0),
- m_audiodevice(0)
+ m_audiodevice(0),
+ m_blendermat(0)
{
fSystem = system;
}
@@ -147,6 +151,7 @@ bool GPG_Application::SetGameEngineData(struct Main* maggie, STR_String startSce
if (maggie != NULL && startSceneName != "")
{
+ G.scene = (Scene*)maggie->scene.first;
m_maggie = maggie;
m_startSceneName = startSceneName;
result = true;
@@ -488,6 +493,23 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
bool profile = (SYS_GetCommandLineInt(syshandle, "show_profile", 0) != 0);
bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0);
bool useVertexArrays = SYS_GetCommandLineInt(syshandle,"vertexarrays",1) != 0;
+
+#ifdef GL_ARB_multitexture
+ // ----------------------------------
+ if(bgl::RAS_EXT_support._ARB_multitexture && bgl::QueryVersion(1, 1)) {
+ m_blendermat = (SYS_GetCommandLineInt(syshandle, "blender_material", 0) != 0);
+ int unitmax=0;
+ glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&unitmax);
+ bgl::max_texture_units = MAXTEX>unitmax?unitmax:MAXTEX;
+ //std::cout << "using(" << bgl::max_texture_units << ") of(" << unitmax << ") texture units." << std::endl;
+ } else {
+ bgl::max_texture_units = 0;
+ }
+#else
+ m_blendermat=0;
+#endif//GL_ARB_multitexture
+ // ----------------------------------
+
// create the canvas, rasterizer and rendertools
m_canvas = new GPG_Canvas(window);
if (!m_canvas)
@@ -606,7 +628,8 @@ bool GPG_Application::startEngine(void)
// if (always_use_expand_framing)
// sceneconverter->SetAlwaysUseExpandFraming(true);
-
+ if(m_blendermat)
+ m_sceneconverter->SetMaterials(true);
KX_Scene* startscene = new KX_Scene(m_keyboard,
m_mouse,
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h
index 2724b5ac2e3..11ede4d51ca 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.h
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h
@@ -142,5 +142,8 @@ protected:
NG_LoopBackNetworkDeviceInterface* m_networkdevice;
/** Sound device. */
SND_IAudioDevice* m_audiodevice;
+
+ bool m_blendermat;
+
};
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index d7a9ad2b41d..5b67f8b8029 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -194,6 +194,7 @@ void usage(char* program)
printf(" show_properties 0 Show debug properties\n");
printf(" show_profile 0 Show profiling information\n");
printf(" vertexarrays 1 Enable vertex arrays\n");
+ printf(" blender_material 0 Enable material settings\n");
printf("\n");
printf("example: %s -p 10 10 320 200 -g noaudio c:\\loadtest.blend\n", program);
printf("example: %s -g vertexarrays = 0 c:\\loadtest.blend\n", program);