Explorar el Código

next_vec2 return a pointer

mikymod hace 12 años
padre
commit
2955643def
Se han modificado 2 ficheros con 3 adiciones y 3 borrados
  1. 2 2
      src/script/ScriptSystem.cpp
  2. 1 1
      src/script/ScriptSystem.h

+ 2 - 2
src/script/ScriptSystem.cpp

@@ -22,7 +22,7 @@ ScriptSystem::ScriptSystem() :
 }
 
 //-----------------------------------------------------------
-Vec2& ScriptSystem::next_vec2(float nx, float ny)
+Vec2* ScriptSystem::next_vec2(float nx, float ny)
 {
 	uint32_t current = m_vec2_count;
 
@@ -31,7 +31,7 @@ Vec2& ScriptSystem::next_vec2(float nx, float ny)
 
 	m_vec2_count++;
 
-	return m_vec2_list[current];
+	return &m_vec2_list[current];
 }
 
 //-----------------------------------------------------------

+ 1 - 1
src/script/ScriptSystem.h

@@ -21,7 +21,7 @@ public:
 								/// Constructor
 								ScriptSystem();
 								/// Returns the first free Vec2
-	Vec2&						next_vec2(float nx, float ny);
+	Vec2*						next_vec2(float nx, float ny);
 								/// Returns the first free Vec3
 	Vec3&						next_vec3(float nx, float ny, float nz);
 								/// Returns the first free Mat4