Panagiotis Christopoulos Charitos 15 년 전
부모
커밋
52d5f73906
5개의 변경된 파일12개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 1
      src/Core/AsyncLoader.cpp
  2. 6 3
      src/Core/AsyncLoader.h
  3. 2 2
      src/Scene/Camera.h
  4. 1 1
      src/Scene/VisibilityTester.cpp
  5. 2 1
      src/Scene/VisibilityTester.h

+ 1 - 1
src/Core/AsyncLoader.cpp

@@ -15,7 +15,7 @@ void AsyncLoader::start()
 //======================================================================================================================
 // load                                                                                                                =
 //======================================================================================================================
-void AsyncLoader::load(const char* filename, void (*loadCallback)(const char*, void*), void* storage)
+void AsyncLoader::load(const char* filename, LoadCallback loadCallback, void* storage)
 {
 	INFO("New load request for \"" << filename << "\"");
 	boost::mutex::scoped_lock lock(mutexReq);

+ 6 - 3
src/Core/AsyncLoader.h

@@ -15,6 +15,9 @@
 class AsyncLoader
 {
 	public:
+		/// Type of the callback function that the async loader wants
+		typedef void (*LoadCallback)(const char*, void*);
+	
 		/// Default constructor starts the thread
 		AsyncLoader() {start();}
 		
@@ -27,7 +30,7 @@ class AsyncLoader
 		/// It can throw an exception in case of a loading error
 		/// @param storage This points to the storage that the loader will store the data. The storage should not be
 		/// destroyed from other threads
-		void load(const char* filename, void (*loadCallback)(const char*, void*), void* storage);
+		void load(const char* filename, LoadCallback loadCallback, void* storage);
 
 		/// Query the loader and see if its got something
 		/// @param[out] filename The file that finished loading
@@ -41,7 +44,7 @@ class AsyncLoader
 		struct Request
 		{
 			std::string filename;
-			void (*loadCallback)(const char*, void*);
+			LoadCallback loadCallback;
 			void* storage;
 		};
 
@@ -50,7 +53,7 @@ class AsyncLoader
 		{
 			std::string filename;
 			void* storage;
-			bool ok;
+			bool ok; ///< True if the loading was successful
 		};
 
 		std::list<Request> requests;

+ 2 - 2
src/Scene/Camera.h

@@ -100,8 +100,8 @@ class Camera: public SceneNode
 
 		/// Used in deferred shading for the calculation of view vector (see CalcViewVector). The reason we store this
 		/// matrix here is that we dont want it to be re-calculated all the time but only when the projection params
-		/// (fovX, fovY, zNear, zFar) change. Fortunately the projection params change rarely. Note that the Camera as we
-		/// all know re-calculates the matrices only when the parameters change!!
+		/// (fovX, fovY, zNear, zFar) change. Fortunately the projection params change rarely. Note that the Camera as
+		/// we all know re-calculates the matrices only when the parameters change!!
 		Mat4 invProjectionMat;
 		/// @}
 

+ 1 - 1
src/Scene/VisibilityTester.cpp

@@ -12,7 +12,7 @@
 //======================================================================================================================
 // CmpDistanceFromOrigin::operator()                                                                                   =
 //======================================================================================================================
-bool VisibilityTester::CmpDistanceFromOrigin::operator()(const RenderableNode* a, const RenderableNode* b) const
+bool VisibilityTester::CmpDistanceFromOrigin::operator()(const SceneNode* a, const SceneNode* b) const
 {
 	return (a->getWorldTransform().getOrigin() - o).getLengthSquared() <
 	       (b->getWorldTransform().getOrigin() - o).getLengthSquared();

+ 2 - 1
src/Scene/VisibilityTester.h

@@ -11,6 +11,7 @@ class Scene;
 class RenderableNode;
 class SpotLight;
 class PointLight;
+class SceneNode;
 
 
 /// Performs visibility determination tests and fills a few containers with the visible scene nodes
@@ -39,7 +40,7 @@ class VisibilityTester
 		{
 			Vec3 o; ///< The camera origin
 			CmpDistanceFromOrigin(Vec3 o_): o(o_) {}
-			bool operator()(const RenderableNode* a, const RenderableNode* b) const;
+			bool operator()(const SceneNode* a, const SceneNode* b) const;
 		};
 
 		Scene& scene; ///< Know your father