[Bf-blender-cvs] [e20e6e4] object_nodes: init/free functions for blenvm to have a place for global initializations.

Lukas Tönne noreply at git.blender.org
Tue Nov 24 09:43:01 CET 2015


Commit: e20e6e49ef2039f8654fda9c7abc78dd1d9cf7bd
Author: Lukas Tönne
Date:   Sun Oct 18 16:45:48 2015 +0200
Branches: object_nodes
https://developer.blender.org/rBe20e6e49ef2039f8654fda9c7abc78dd1d9cf7bd

init/free functions for blenvm to have a place for global initializations.

===================================================================

M	source/blender/blenkernel/intern/blender.c
M	source/blender/blenvm/BVM_api.h
M	source/blender/blenvm/intern/bvm_api.cc
M	source/blender/blenvm/intern/bvm_codegen.cc
M	source/blender/blenvm/intern/bvm_nodegraph.h
M	source/creator/CMakeLists.txt
M	source/creator/creator.c
M	source/gameengine/GamePlayer/ghost/CMakeLists.txt
M	source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

===================================================================

diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 9aad3cf..d6be3d0 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -80,6 +80,8 @@
 #include "BKE_sequencer.h"
 #include "BKE_sound.h"
 
+#include "BVM_api.h"
+
 #include "RE_pipeline.h"
 #include "RE_render_ext.h"
 
@@ -129,6 +131,7 @@ void free_blender(void)
 	IMB_moviecache_destruct();
 	
 	free_nodesystem();
+	BVM_free();
 }
 
 void initglobals(void)
diff --git a/source/blender/blenvm/BVM_api.h b/source/blender/blenvm/BVM_api.h
index 50dacfc..3fd7d6e 100644
--- a/source/blender/blenvm/BVM_api.h
+++ b/source/blender/blenvm/BVM_api.h
@@ -43,6 +43,9 @@ struct BVMExpression;
 struct BVMFunction;
 struct BVMModule;
 
+void BVM_init(void);
+void BVM_free(void);
+
 struct BVMModule *BVM_module_create(void);
 void BVM_module_free(struct BVMModule *mod);
 
diff --git a/source/blender/blenvm/intern/bvm_api.cc b/source/blender/blenvm/intern/bvm_api.cc
index 18af7e2..3793042 100644
--- a/source/blender/blenvm/intern/bvm_api.cc
+++ b/source/blender/blenvm/intern/bvm_api.cc
@@ -48,6 +48,16 @@ extern "C" {
 #include "bvm_module.h"
 #include "bvm_nodegraph.h"
 
+void BVM_init(void)
+{
+}
+
+void BVM_free(void)
+{
+}
+
+/* ------------------------------------------------------------------------- */
+
 BLI_INLINE bvm::Module *_MOD(struct BVMModule *mod)
 { return (bvm::Module *)mod; }
 
diff --git a/source/blender/blenvm/intern/bvm_codegen.cc b/source/blender/blenvm/intern/bvm_codegen.cc
index ff8a4ba..7b8f0c7 100644
--- a/source/blender/blenvm/intern/bvm_codegen.cc
+++ b/source/blender/blenvm/intern/bvm_codegen.cc
@@ -129,9 +129,10 @@ Expression *BVMCompiler::codegen_expression(const NodeGraph &graph)
 		push_stack_index(expr->return_value(0).stack_offset);
 //		push_stack_index(0x0F);
 //		push_opcode(OP_ASSIGN_FLOAT3);
-		push_opcode(OP_END);
 	}
 	
+	push_opcode(OP_END);
+	
 	Expression *result = expr;
 	expr = NULL;
 	return result;
diff --git a/source/blender/blenvm/intern/bvm_nodegraph.h b/source/blender/blenvm/intern/bvm_nodegraph.h
index 969fb53..13d0815 100644
--- a/source/blender/blenvm/intern/bvm_nodegraph.h
+++ b/source/blender/blenvm/intern/bvm_nodegraph.h
@@ -46,7 +46,7 @@ extern "C" {
 #endif
 }
 
-#include "BVM_types.h"
+#include "bvm_opcode.h"
 #include "bvm_type_desc.h"
 
 namespace bvm {
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 8feb882..3c8386f 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -30,6 +30,7 @@ blender_include_dirs(
 	../../intern/glew-mx
 	../blender/blenlib
 	../blender/blenkernel
+	../blender/blenvm
 	../blender/blenloader
 	../blender/depsgraph
 	../blender/editors/include
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 40525bb..ddde70b 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -93,6 +93,8 @@
 #include "BKE_image.h"
 #include "BKE_particle.h"
 
+#include "BVM_api.h"
+
 #include "DEG_depsgraph.h"
 
 #include "IMB_imbuf.h"  /* for IMB_init */
@@ -1765,6 +1767,7 @@ int main(
 	RE_engines_init();
 	init_nodesystem();
 	psys_init_rng();
+	BVM_init();
 	/* end second init */
 
 
diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
index 283f222..0842e88 100644
--- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
@@ -41,6 +41,7 @@ set(INC
 	../../../blender/blenfont
 	../../../blender/blenkernel
 	../../../blender/blenlib
+	../../../blender/blenvm
 	../../../blender/blenloader
 	../../../blender/blentranslation
 	../../../blender/gpu
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 137f4cd..5b4890a 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -79,6 +79,8 @@ extern "C"
 #include "BKE_text.h"
 #include "BKE_sound.h"
 
+#include "BVM_api.h"
+
 #include "IMB_imbuf.h"
 #include "IMB_moviecache.h"
 	
@@ -454,6 +456,7 @@ int main(int argc, char** argv)
 	RNA_init();
 
 	init_nodesystem();
+	BVM_init();
 	
 	initglobals();
 
@@ -1139,6 +1142,7 @@ int main(int argc, char** argv)
 	 * we may get troubles later on */
 
 	free_nodesystem();
+	BVM_free();
 
 	// Cleanup
 	RNA_exit();




More information about the Bf-blender-cvs mailing list