As expected, merge

This commit is contained in:
bart@bartbes.ath.cx
2010-02-21 14:07:26 +01:00
4 changed files with 16 additions and 13 deletions
@@ -1686,6 +1686,7 @@
GCC_OPTIMIZATION_LEVEL = 0; GCC_OPTIMIZATION_LEVEL = 0;
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = NO; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = NO;
GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = NO; GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = NO;
GCC_VERSION = 4.0;
GCC_WARN_64_TO_32_BIT_CONVERSION = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
GCC_WARN_ABOUT_MISSING_NEWLINE = NO; GCC_WARN_ABOUT_MISSING_NEWLINE = NO;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
@@ -610,6 +610,14 @@
<File <File
RelativePath="..\..\..\src\modules\graphics\Graphics.cpp" RelativePath="..\..\..\src\modules\graphics\Graphics.cpp"
> >
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\graphics\"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath="..\..\..\src\modules\graphics\Graphics.h" RelativePath="..\..\..\src\modules\graphics\Graphics.h"
+6 -12
View File
@@ -117,7 +117,7 @@ namespace opengl
t.setTransformation(x, y, a, sx, sy, ox, oy); t.setTransformation(x, y, a, sx, sy, ox, oy);
t.transform(v, v, 4); t.transform(v, v, 4);
addv(t, v); addv(v);
// Increment counter. // Increment counter.
next++; next++;
@@ -138,9 +138,9 @@ namespace opengl
// Transform. // Transform.
Matrix t; Matrix t;
t.setTransformation(x, y, a, sx, sy, ox, oy); t.setTransformation(x, y, a, sx, sy, ox, oy);
t.transform(v, quad->getVertices(), 4); t.transform(v, v, 4);
addv(t, v); addv(v);
// Increment counter. // Increment counter.
next++; next++;
@@ -207,24 +207,18 @@ namespace opengl
glPopMatrix(); glPopMatrix();
} }
void SpriteBatch::addv(const Matrix & t, const vertex * v) void SpriteBatch::addv(const vertex * v)
{ {
// Get a pointer to the correct insertion position.
vertex * dst = vertices + next*4;
// Transform.
t.transform(dst, dst, 4);
if(lockp != 0) if(lockp != 0)
{ {
// Copy into mapped memory if buffer is locked. // Copy into mapped memory if buffer is locked.
memcpy(lockp + (next*4), dst, sizeof(vertex)*4); memcpy(lockp + (next*4), v, sizeof(vertex)*4);
} }
else else
{ {
// ... use glBufferSubData otherwise. // ... use glBufferSubData otherwise.
glBindBuffer(GL_ARRAY_BUFFER, vbo[0]); glBindBuffer(GL_ARRAY_BUFFER, vbo[0]);
glBufferSubData(GL_ARRAY_BUFFER, (next*4)*sizeof(vertex), sizeof(vertex)*4, dst); glBufferSubData(GL_ARRAY_BUFFER, (next*4)*sizeof(vertex), sizeof(vertex)*4, v);
glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0);
} }
} }
+1 -1
View File
@@ -101,7 +101,7 @@ namespace opengl
private: private:
void addv(const Matrix & t, const vertex * v); void addv(const vertex * v);
}; // SpriteBatch }; // SpriteBatch