@@ -46,7 +46,7 @@ class VertexBufferData | |||||
IDirect3DVertexBuffer9 *m_vbo; | IDirect3DVertexBuffer9 *m_vbo; | ||||
#elif defined _XBOX | #elif defined _XBOX | ||||
D3DVertexBuffer *m_vbo; | D3DVertexBuffer *m_vbo; | ||||
#elif !defined __ANDROID__ | |||||
#else | |||||
GLuint m_vbo; | GLuint m_vbo; | ||||
uint8_t *m_memory; | uint8_t *m_memory; | ||||
size_t m_size; | size_t m_size; | ||||
@@ -473,7 +473,7 @@ VertexBuffer::VertexBuffer(size_t size) | |||||
if (FAILED(g_d3ddevice->CreateVertexBuffer(size, D3DUSAGE_WRITEONLY, NULL, | if (FAILED(g_d3ddevice->CreateVertexBuffer(size, D3DUSAGE_WRITEONLY, NULL, | ||||
D3DPOOL_MANAGED, &m_data->m_vbo, NULL))) | D3DPOOL_MANAGED, &m_data->m_vbo, NULL))) | ||||
Abort(); | Abort(); | ||||
#elif !defined __CELLOS_LV2__ && !defined __ANDROID__ | |||||
#elif !defined __CELLOS_LV2__ | |||||
glGenBuffers(1, &m_data->m_vbo); | glGenBuffers(1, &m_data->m_vbo); | ||||
m_data->m_memory = new uint8_t[size]; | m_data->m_memory = new uint8_t[size]; | ||||
m_data->m_size = size; | m_data->m_size = size; | ||||
@@ -485,7 +485,7 @@ VertexBuffer::~VertexBuffer() | |||||
#if defined USE_D3D9 || defined _XBOX | #if defined USE_D3D9 || defined _XBOX | ||||
if (FAILED(m_data->m_vbo->Release())) | if (FAILED(m_data->m_vbo->Release())) | ||||
Abort(); | Abort(); | ||||
#elif !defined __CELLOS_LV2__ && !defined __ANDROID__ | |||||
#elif !defined __CELLOS_LV2__ | |||||
glDeleteBuffers(1, &m_data->m_vbo); | glDeleteBuffers(1, &m_data->m_vbo); | ||||
delete[] m_data->m_memory; | delete[] m_data->m_memory; | ||||
#endif | #endif | ||||
@@ -499,7 +499,7 @@ void *VertexBuffer::Lock(size_t offset, size_t size) | |||||
if (FAILED(m_data->m_vbo->Lock(offset, size, (void **)&ret, 0))) | if (FAILED(m_data->m_vbo->Lock(offset, size, (void **)&ret, 0))) | ||||
Abort(); | Abort(); | ||||
return ret; | return ret; | ||||
#elif !defined __CELLOS_LV2__ && !defined __ANDROID__ | |||||
#elif !defined __CELLOS_LV2__ | |||||
return m_data->m_memory + offset; | return m_data->m_memory + offset; | ||||
#endif | #endif | ||||
} | } | ||||
@@ -509,7 +509,7 @@ void VertexBuffer::Unlock() | |||||
#if defined USE_D3D9 || defined _XBOX | #if defined USE_D3D9 || defined _XBOX | ||||
if (FAILED(m_data->m_vbo->Unlock())) | if (FAILED(m_data->m_vbo->Unlock())) | ||||
Abort(); | Abort(); | ||||
#elif !defined __CELLOS_LV2__ && !defined __ANDROID__ | |||||
#elif !defined __CELLOS_LV2__ | |||||
glBindBuffer(GL_ARRAY_BUFFER, m_data->m_vbo); | glBindBuffer(GL_ARRAY_BUFFER, m_data->m_vbo); | ||||
glBufferData(GL_ARRAY_BUFFER, m_data->m_size, m_data->m_memory, | glBufferData(GL_ARRAY_BUFFER, m_data->m_size, m_data->m_memory, | ||||
GL_STATIC_DRAW); | GL_STATIC_DRAW); | ||||
@@ -18,9 +18,8 @@ | |||||
#include <stdint.h> | #include <stdint.h> | ||||
#include <cmath> | #include <cmath> | ||||
#if !defined __ANDROID__ | |||||
# include <iostream> | |||||
#endif | |||||
#include <ostream> | |||||
#include <algorithm> | |||||
#include "lol/math/half.h" | #include "lol/math/half.h" | ||||
#include "lol/math/real.h" | #include "lol/math/real.h" | ||||
@@ -235,10 +234,8 @@ template <typename T> struct Vec2 : BVec2<T> | |||||
DECLARE_MEMBER_OPS(Vec2, x) | DECLARE_MEMBER_OPS(Vec2, x) | ||||
#if !defined __ANDROID__ | |||||
template<typename U> | template<typename U> | ||||
friend std::ostream &operator<<(std::ostream &stream, Vec2<U> const &v); | friend std::ostream &operator<<(std::ostream &stream, Vec2<U> const &v); | ||||
#endif | |||||
}; | }; | ||||
/* | /* | ||||
@@ -269,10 +266,8 @@ template <typename T> struct Cmplx | |||||
} | } | ||||
inline T norm() const { return length(*this); } | inline T norm() const { return length(*this); } | ||||
#if !defined __ANDROID__ | |||||
template<typename U> | template<typename U> | ||||
friend std::ostream &operator<<(std::ostream &stream, Cmplx<U> const &v); | friend std::ostream &operator<<(std::ostream &stream, Cmplx<U> const &v); | ||||
#endif | |||||
T x, y; | T x, y; | ||||
}; | }; | ||||
@@ -493,10 +488,8 @@ template <typename T> struct Vec3 : BVec3<T> | |||||
DECLARE_MEMBER_OPS(Vec3, x) | DECLARE_MEMBER_OPS(Vec3, x) | ||||
#if !defined __ANDROID__ | |||||
template<typename U> | template<typename U> | ||||
friend std::ostream &operator<<(std::ostream &stream, Vec3<U> const &v); | friend std::ostream &operator<<(std::ostream &stream, Vec3<U> const &v); | ||||
#endif | |||||
}; | }; | ||||
/* | /* | ||||
@@ -902,10 +895,8 @@ template <typename T> struct Vec4 : BVec4<T> | |||||
DECLARE_MEMBER_OPS(Vec4, x) | DECLARE_MEMBER_OPS(Vec4, x) | ||||
#if !defined __ANDROID__ | |||||
template<typename U> | template<typename U> | ||||
friend std::ostream &operator<<(std::ostream &stream, Vec4<U> const &v); | friend std::ostream &operator<<(std::ostream &stream, Vec4<U> const &v); | ||||
#endif | |||||
}; | }; | ||||
/* | /* | ||||
@@ -983,10 +974,8 @@ template <typename T> struct Quat | |||||
return Vec3<T>(q.x, q.y, q.z); | return Vec3<T>(q.x, q.y, q.z); | ||||
} | } | ||||
#if !defined __ANDROID__ | |||||
template<typename U> | template<typename U> | ||||
friend std::ostream &operator<<(std::ostream &stream, Quat<U> const &v); | friend std::ostream &operator<<(std::ostream &stream, Quat<U> const &v); | ||||
#endif | |||||
/* XXX: storage order is wxyz, unlike vectors! */ | /* XXX: storage order is wxyz, unlike vectors! */ | ||||
T w, x, y, z; | T w, x, y, z; | ||||
@@ -1592,10 +1581,8 @@ template <typename T> struct Mat2 | |||||
void printf() const; | void printf() const; | ||||
#if !defined __ANDROID__ | |||||
template<class U> | template<class U> | ||||
friend std::ostream &operator<<(std::ostream &stream, Mat2<U> const &m); | friend std::ostream &operator<<(std::ostream &stream, Mat2<U> const &m); | ||||
#endif | |||||
inline Mat2<T> operator +(Mat2<T> const m) const | inline Mat2<T> operator +(Mat2<T> const m) const | ||||
{ | { | ||||
@@ -1717,10 +1704,8 @@ template <typename T> struct Mat3 | |||||
void printf() const; | void printf() const; | ||||
#if !defined __ANDROID__ | |||||
template<class U> | template<class U> | ||||
friend std::ostream &operator<<(std::ostream &stream, Mat3<U> const &m); | friend std::ostream &operator<<(std::ostream &stream, Mat3<U> const &m); | ||||
#endif | |||||
inline Mat3<T> operator +(Mat3<T> const m) const | inline Mat3<T> operator +(Mat3<T> const m) const | ||||
{ | { | ||||
@@ -1884,10 +1869,8 @@ template <typename T> struct Mat4 | |||||
void printf() const; | void printf() const; | ||||
#if !defined __ANDROID__ | |||||
template<class U> | template<class U> | ||||
friend std::ostream &operator<<(std::ostream &stream, Mat4<U> const &m); | friend std::ostream &operator<<(std::ostream &stream, Mat4<U> const &m); | ||||
#endif | |||||
inline Mat4<T> operator +(Mat4<T> const &m) const | inline Mat4<T> operator +(Mat4<T> const &m) const | ||||
{ | { | ||||
@@ -29,6 +29,8 @@ | |||||
#include <cstdlib> /* free() */ | #include <cstdlib> /* free() */ | ||||
#include <cstring> /* strdup() */ | #include <cstring> /* strdup() */ | ||||
#include <ostream> /* std::ostream */ | |||||
#include "core.h" | #include "core.h" | ||||
using namespace std; | using namespace std; | ||||
@@ -237,7 +239,6 @@ template<> void mat4::printf() const | |||||
p[0][3], p[1][3], p[2][3], p[3][3]); | p[0][3], p[1][3], p[2][3], p[3][3]); | ||||
} | } | ||||
#if !defined __ANDROID__ | |||||
template<> std::ostream &operator<<(std::ostream &stream, ivec2 const &v) | template<> std::ostream &operator<<(std::ostream &stream, ivec2 const &v) | ||||
{ | { | ||||
return stream << "(" << v.x << ", " << v.y << ")"; | return stream << "(" << v.x << ", " << v.y << ")"; | ||||
@@ -304,7 +305,6 @@ template<> std::ostream &operator<<(std::ostream &stream, mat4 const &m) | |||||
<< ", " << m[2][3] << ", " << m[3][3] << "))"; | << ", " << m[2][3] << ", " << m[3][3] << "))"; | ||||
return stream; | return stream; | ||||
} | } | ||||
#endif | |||||
template<> mat3 mat3::scale(float x, float y, float z) | template<> mat3 mat3::scale(float x, float y, float z) | ||||
{ | { | ||||