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:
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp2
-rw-r--r--source/gameengine/Converter/KX_ConvertSensors.cpp24
-rw-r--r--source/gameengine/Expressions/BoolValue.cpp2
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp75
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.h1
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp4
-rw-r--r--source/gameengine/Ketsji/BL_Texture.cpp7
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp3
-rw-r--r--source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h2
-rw-r--r--source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h2
-rw-r--r--source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h2
-rw-r--r--source/gameengine/SceneGraph/SG_ParentRelation.h2
-rw-r--r--source/gameengine/VideoTexture/ImageBuff.cpp2
-rw-r--r--source/gameengine/VideoTexture/ImageBuff.h2
-rw-r--r--source/gameengine/VideoTexture/VideoFFmpeg.cpp6
16 files changed, 80 insertions, 60 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index cef068ccbaa..1b8f857c2cb 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -458,7 +458,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
// itself is unaware of the extra space, so we clear the whole region for it.
glClearColor(scene->gm.framing.col[0], scene->gm.framing.col[1], scene->gm.framing.col[2], 1.0f);
glViewport(ar->winrct.xmin, ar->winrct.ymin,
- ar->winrct.xmax - ar->winrct.xmin, ar->winrct.ymax - ar->winrct.ymin);
+ BLI_RCT_SIZE_X(&ar->winrct), BLI_RCT_SIZE_Y(&ar->winrct));
glClear(GL_COLOR_BUFFER_BIT);
}
diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp
index 93eeaaf05fb..9f155a6ebc3 100644
--- a/source/gameengine/Converter/KX_ConvertSensors.cpp
+++ b/source/gameengine/Converter/KX_ConvertSensors.cpp
@@ -657,19 +657,19 @@ void BL_ConvertSensors(struct Object* blenderobject,
if (gamecont) {
logicmgr->RegisterToSensor(gamecont,gamesensor);
- } else {
- printf(
- "Warning, sensor \"%s\" could not find its controller "
- "(link %d of %d) from object \"%s\"\n"
- "\tthere has been an error converting the blender controller for the game engine,"
- "logic may be incorrect\n", sens->name, i+1, sens->totlinks, blenderobject->id.name+2);
}
- } else {
- printf(
- "Warning, sensor \"%s\" has lost a link to a controller "
- "(link %d of %d) from object \"%s\"\n"
- "\tpossible causes are partially appended objects or an error reading the file,"
- "logic may be incorrect\n", sens->name, i+1, sens->totlinks, blenderobject->id.name+2);
+ else {
+ printf("Warning, sensor \"%s\" could not find its controller "
+ "(link %d of %d) from object \"%s\"\n"
+ "\tthere has been an error converting the blender controller for the game engine,"
+ "logic may be incorrect\n", sens->name, i+1, sens->totlinks, blenderobject->id.name+2);
+ }
+ }
+ else {
+ printf("Warning, sensor \"%s\" has lost a link to a controller "
+ "(link %d of %d) from object \"%s\"\n"
+ "\tpossible causes are partially appended objects or an error reading the file,"
+ "logic may be incorrect\n", sens->name, i+1, sens->totlinks, blenderobject->id.name+2);
}
}
// special case: Keyboard sensor with no link
diff --git a/source/gameengine/Expressions/BoolValue.cpp b/source/gameengine/Expressions/BoolValue.cpp
index b3c4dc144df..40997a25be1 100644
--- a/source/gameengine/Expressions/BoolValue.cpp
+++ b/source/gameengine/Expressions/BoolValue.cpp
@@ -139,7 +139,7 @@ this object
default:
{
ret = new CErrorValue(val->GetText() + op2str(op) +
- "[operator not allowed on booleans]");
+ "[operator not allowed on booleans]");
break;
}
}
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index eccb83fe80c..21de7011eda 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -464,31 +464,34 @@ bool GPG_Application::processEvent(GHOST_IEvent* event)
handled = false;
break;
- case GHOST_kEventWindowUpdate:
- {
- GHOST_IWindow* window = event->getWindow();
- if (!m_system->validWindow(window)) break;
- // Update the state of the game engine
- if (m_kxsystem && !m_exitRequested)
- {
- // Proceed to next frame
- window->activateDrawingContext();
-
- // first check if we want to exit
- m_exitRequested = m_ketsjiengine->GetExitCode();
-
- // kick the engine
- bool renderFrame = m_ketsjiengine->NextFrame();
- if (renderFrame)
- {
- // render the frame
- m_ketsjiengine->Render();
- }
- }
- m_exitString = m_ketsjiengine->GetExitString();
- }
- break;
-
+ // The player now runs as often as it can (repsecting vsync and fixedtime).
+ // This allows the player to break 100fps, but this code is being left here
+ // as reference. (see EngineNextFrame)
+ //case GHOST_kEventWindowUpdate:
+ // {
+ // GHOST_IWindow* window = event->getWindow();
+ // if (!m_system->validWindow(window)) break;
+ // // Update the state of the game engine
+ // if (m_kxsystem && !m_exitRequested)
+ // {
+ // // Proceed to next frame
+ // window->activateDrawingContext();
+
+ // // first check if we want to exit
+ // m_exitRequested = m_ketsjiengine->GetExitCode();
+ //
+ // // kick the engine
+ // bool renderFrame = m_ketsjiengine->NextFrame();
+ // if (renderFrame)
+ // {
+ // // render the frame
+ // m_ketsjiengine->Render();
+ // }
+ // }
+ // m_exitString = m_ketsjiengine->GetExitString();
+ // }
+ // break;
+ //
case GHOST_kEventWindowSize:
{
GHOST_IWindow* window = event->getWindow();
@@ -789,6 +792,28 @@ void GPG_Application::stopEngine()
m_engineRunning = false;
}
+void GPG_Application::EngineNextFrame()
+{
+ // Update the state of the game engine
+ if (m_kxsystem && !m_exitRequested)
+ {
+ // Proceed to next frame
+ if (m_mainWindow)
+ m_mainWindow->activateDrawingContext();
+
+ // first check if we want to exit
+ m_exitRequested = m_ketsjiengine->GetExitCode();
+
+ // kick the engine
+ bool renderFrame = m_ketsjiengine->NextFrame();
+ if (renderFrame && m_mainWindow)
+ {
+ // render the frame
+ m_ketsjiengine->Render();
+ }
+ }
+ m_exitString = m_ketsjiengine->GetExitString();
+}
void GPG_Application::exitEngine()
{
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h
index 51dac5cb3f3..e04fcc2a555 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.h
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h
@@ -77,6 +77,7 @@ public:
GlobalSettings* getGlobalSettings(void);
bool StartGameEngine(int stereoMode);
void StopGameEngine();
+ void EngineNextFrame();
protected:
bool handleWheel(GHOST_IEvent* event);
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 025611972ce..41f641b4368 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -194,7 +194,7 @@ void usage(const char* program, bool isBlenderPlayer)
}
printf("usage: %s [-w [w h l t]] [-f [fw fh fb ff]] %s[-g gamengineoptions] "
- "[-s stereomode] [-m aasamples] %s\n", program, consoleoption, example_filename);
+ "[-s stereomode] [-m aasamples] %s\n", program, consoleoption, example_filename);
printf(" -h: Prints this command summary\n\n");
printf(" -w: display in a window\n");
printf(" --Optional parameters--\n");
@@ -970,6 +970,8 @@ int main(int argc, char** argv)
{
system->processEvents(false);
system->dispatchEvents();
+ app.EngineNextFrame();
+
if ((exitcode = app.getExitRequested()))
{
run = false;
diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp
index e4e3fb95543..b8cc4ebeff9 100644
--- a/source/gameengine/Ketsji/BL_Texture.cpp
+++ b/source/gameengine/Ketsji/BL_Texture.cpp
@@ -193,7 +193,7 @@ void BL_Texture::InitGLTex(unsigned int *pix,int x,int y,bool mipmap)
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
-void BL_Texture::InitGLCompressedTex(ImBuf* ibuf, bool mipmap)
+void BL_Texture::InitGLCompressedTex(ImBuf *ibuf, bool mipmap)
{
#ifndef WITH_DDS
// Fall back to uncompressed if DDS isn't enabled
@@ -201,11 +201,6 @@ void BL_Texture::InitGLCompressedTex(ImBuf* ibuf, bool mipmap)
return;
#else
glBindTexture(GL_TEXTURE_2D, mTexture);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
if (GPU_upload_dxt_texture(ibuf) == 0) {
InitGLTex(ibuf->rect, ibuf->x, ibuf->y, mipmap);
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp
index a9602d16430..ac17adaf052 100644
--- a/source/gameengine/Ketsji/KX_Camera.cpp
+++ b/source/gameengine/Ketsji/KX_Camera.cpp
@@ -1048,7 +1048,9 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay,
{
Py_DECREF(argValue);
PyErr_SetString(PyExc_TypeError,
- "Error in getScreenRay. Invalid 2D coordinate. Expected a normalized 2D screen coordinate, a distance and an optional property argument");
+ "Error in getScreenRay. Invalid 2D coordinate. "
+ "Expected a normalized 2D screen coordinate, "
+ "a distance and an optional property argument");
return NULL;
}
Py_DECREF(argValue);
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 04a806dfd92..3818cef7d6e 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -1688,7 +1688,8 @@ PyObject* KX_GameObject::PyReplaceMesh(PyObject* args)
PyObject* KX_GameObject::PyEndObject()
{
- KX_Scene *scene = KX_GetActiveScene();
+ SG_Node* node = this->GetSGNode();
+ KX_Scene* scene = static_cast<KX_Scene*>(node->GetSGClientInfo());
scene->DelayedRemoveObject(this);
diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
index e0aba795e01..f49f2473036 100644
--- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
+++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
@@ -27,7 +27,7 @@
/** \file KX_SCA_AddObjectActuator.h
* \ingroup ketsji
- * \attention Previously existed as: \source\gameengine\GameLogic\SCA_AddObjectActuator.h
+ * \attention Previously existed as: source/gameengine/GameLogic/SCA_AddObjectActuator.h
* Please look here for revision history.
*/
diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h
index 1a503c074ed..3399ed90667 100644
--- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h
+++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h
@@ -28,7 +28,7 @@
/** \file KX_SCA_EndObjectActuator.h
* \ingroup ketsji
* \brief Add object to the game world on action of this actuator
- * \attention Previously existed as: \source\gameengine\GameLogic\SCA_EndObjectActuator.h
+ * \attention Previously existed as: source/gameengine/GameLogic/SCA_EndObjectActuator.h
* Please look here for revision history.
*/
diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
index d756c48f0f9..6db16a0e1b6 100644
--- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
+++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
@@ -28,7 +28,7 @@
/** \file KX_SCA_ReplaceMeshActuator.h
* \ingroup ketsji
* \brief Add object to the game world on action of this actuator
- * \attention Previously existed as: \source\gameengine\GameLogic\SCA_ReplaceMeshActuator.h
+ * \attention Previously existed as: source/gameengine/GameLogic/SCA_ReplaceMeshActuator.h
* Please look here for revision history.
*/
diff --git a/source/gameengine/SceneGraph/SG_ParentRelation.h b/source/gameengine/SceneGraph/SG_ParentRelation.h
index 925c0ed2766..4478ed11bc1 100644
--- a/source/gameengine/SceneGraph/SG_ParentRelation.h
+++ b/source/gameengine/SceneGraph/SG_ParentRelation.h
@@ -82,7 +82,7 @@ public :
* You must provide a way of duplicating an
* instance of an SG_ParentRelation. This should
* return a pointer to a new duplicate allocated
- * on the heap. Responsibilty for deleting the
+ * on the heap. Responsibility for deleting the
* duplicate resides with the caller of this method.
*/
diff --git a/source/gameengine/VideoTexture/ImageBuff.cpp b/source/gameengine/VideoTexture/ImageBuff.cpp
index 9854da0ea86..17513d20a39 100644
--- a/source/gameengine/VideoTexture/ImageBuff.cpp
+++ b/source/gameengine/VideoTexture/ImageBuff.cpp
@@ -144,7 +144,7 @@ void ImageBuff::clear (short width, short height, unsigned char color)
// img must point to a array of RGBA data of size width*height
void ImageBuff::plot (unsigned char * img, short width, short height, short x, short y, short mode)
{
- struct ImBuf* tmpbuf;
+ struct ImBuf *tmpbuf;
if (m_size[0] == 0 || m_size[1] == 0 || width <= 0 || height <= 0)
return;
diff --git a/source/gameengine/VideoTexture/ImageBuff.h b/source/gameengine/VideoTexture/ImageBuff.h
index b3e7386c899..b2bdbc17dc9 100644
--- a/source/gameengine/VideoTexture/ImageBuff.h
+++ b/source/gameengine/VideoTexture/ImageBuff.h
@@ -38,7 +38,7 @@ struct ImBuf;
class ImageBuff : public ImageBase
{
private:
- struct ImBuf* m_imbuf; // temporary structure for buffer manipulation
+ struct ImBuf *m_imbuf; // temporary structure for buffer manipulation
public:
/// constructor
ImageBuff (void) : ImageBase(true), m_imbuf(NULL) {}
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
index 4586a50e6a9..1ba944aa955 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
@@ -52,8 +52,6 @@ const long timeScale = 1000;
#define CATCH_EXCP catch (Exception & exp) \
{ exp.report(); m_status = SourceError; }
-extern "C" void do_init_ffmpeg();
-
// class RenderVideo
// constructor
@@ -521,8 +519,6 @@ void VideoFFmpeg::releaseFrame(AVFrame* frame)
// open video file
void VideoFFmpeg::openFile (char * filename)
{
- do_init_ffmpeg();
-
if (openStream(filename, NULL, NULL) != 0)
return;
@@ -586,8 +582,6 @@ void VideoFFmpeg::openCam (char * file, short camIdx)
char filename[28], rateStr[20];
char *p;
- do_init_ffmpeg();
-
#ifdef WIN32
// video capture on windows only through Video For Windows driver
inputFormat = av_find_input_format("vfwcap");