Browse Source

scripting

Panagiotis Christopoulos Charitos 16 years ago
parent
commit
b5e3089551
5 changed files with 17 additions and 40 deletions
  1. 9 19
      src/renderer/r_bs.cpp
  2. 2 0
      src/resources/resource.cpp
  3. 3 0
      src/resources/resource.h
  4. 0 18
      src/scene/mesh_node.cpp
  5. 3 3
      src/scene/mesh_node.h

+ 9 - 19
src/renderer/r_bs.cpp

@@ -17,11 +17,9 @@
 namespace r {
 namespace bs {
 
-/*
-=======================================================================================================================================
-VARS                                                                                                                                  =
-=======================================================================================================================================
-*/
+//=====================================================================================================================================
+// VARS                                                                                                                               =
+//=====================================================================================================================================
 static fbo_t b_fbo; ///< blending models FBO
 static fbo_t r_fbo; ///< refracting models FBO
 
@@ -30,11 +28,9 @@ static fbo_t r_fbo; ///< refracting models FBO
 static shader_prog_t* r2b_shdr;
 
 
-/*
-=======================================================================================================================================
-InitBFBO                                                                                                                              =
-=======================================================================================================================================
-*/
+//=====================================================================================================================================
+// InitB                                                                                                                              =
+//=====================================================================================================================================
 static void InitB()
 {
 	// create FBO
@@ -57,11 +53,9 @@ static void InitB()
 }
 
 
-/*
-=======================================================================================================================================
-InitRFBO                                                                                                                              =
-=======================================================================================================================================
-*/
+//=====================================================================================================================================
+// InitR                                                                                                                              =
+//=====================================================================================================================================
 static void InitR()
 {
 	// create FBO
@@ -136,10 +130,6 @@ void RunStage( const camera_t& cam )
 
 	}
 
-	// render the smodels
-	/*for( uint i=0; i<scene::models.size(); i++ )
-		Render<model_t, true>( scene::models[i] );*/
-
 
 	// restore a few things
 	glDepthMask( true );

+ 2 - 0
src/resources/resource.cpp

@@ -5,6 +5,7 @@
 #include "mesh.h"
 #include "skel_anim.h"
 #include "light_props.h"
+#include "script.h"
 
 
 namespace rsrc {
@@ -22,5 +23,6 @@ container_t<mesh_t>        meshes;
 container_t<skeleton_t>    skeletons;
 container_t<skel_anim_t>   skel_anims;
 container_t<light_props_t> light_props;
+container_t<script_t>      scripts;
 
 } // end namespace

+ 3 - 0
src/resources/resource.h

@@ -14,6 +14,7 @@ class mesh_t;
 class skeleton_t;
 class skel_anim_t;
 class light_props_t;
+class script_t;
 
 namespace rsrc {
 template< typename type_t > class container_t;
@@ -40,6 +41,7 @@ class resource_t
 	friend class rsrc::container_t<mesh_t>;
 	friend class rsrc::container_t<skel_anim_t>;
 	friend class rsrc::container_t<light_props_t>;
+	friend class rsrc::container_t<script_t>;
 	friend class shader_prog_t;
 
 	public:
@@ -62,6 +64,7 @@ extern container_t<mesh_t>        meshes;
 extern container_t<skeleton_t>    skeletons;
 extern container_t<skel_anim_t>   skel_anims;
 extern container_t<light_props_t> light_props;
+extern container_t<script_t>      scripts;
 
 
 /// resource container template class

+ 0 - 18
src/scene/mesh_node.cpp

@@ -107,21 +107,3 @@ void mesh_node_t::Render( material_t* mtl ) const
 	vbo_t::UnbindAllTargets();
 	glPopMatrix();
 }
-
-
-//=====================================================================================================================================
-// Render                                                                                                                             =
-//=====================================================================================================================================
-void mesh_node_t::Render()
-{
-	Render( material );
-}
-
-
-//=====================================================================================================================================
-// RenderDepth                                                                                                                        =
-//=====================================================================================================================================
-void mesh_node_t::RenderDepth()
-{
-	Render( material->dp_mtl );
-}

+ 3 - 3
src/scene/mesh_node.h

@@ -14,7 +14,7 @@ class material_t;
 class mesh_node_t: public node_t
 {
 	private:
-		void Render( material_t* mtl ) const;
+		void Render( material_t* mtl ) const; ///< Common code for Render() and RenderDepth()
 
 	public:
 		// resources
@@ -25,8 +25,8 @@ class mesh_node_t: public node_t
 		skel_controller_t* skel_controller;
 		// funcs
 		mesh_node_t(): node_t(NT_MESH), skel_controller(NULL) {}
-		void Render();
-		void RenderDepth();
+		void Render() { Render(material); }
+		void RenderDepth() { Render( material->dp_mtl ); }
 		void Init( const char* filename );
 		void Deinit();
 };