glDrawRangeElements -> glDrawRangeElementsEXT (fixes compilation error; EXT/ARB/etc extensions need to be used for everything not in GL1.1)
Reinserted mu-like symbol. Fixed some minor warnings. This was SVN commit r2838.
This commit is contained in:
parent
d367014972
commit
b8c2f424e7
@ -130,7 +130,7 @@ JSBool JSI_Camera::setCamera( JSContext* cx, JSObject* UNUSED(obj), jsval UNUSED
|
||||
{
|
||||
JSObject* camera = JSVAL_TO_OBJECT( *vp );
|
||||
Camera_Info* cameraInfo;
|
||||
if( !JSVAL_IS_OBJECT( *vp ) || !( cameraInfo = (Camera_Info*)JS_GetInstancePrivate( cx, camera, &JSI_Camera::JSI_class, NULL ) ) )
|
||||
if( !JSVAL_IS_OBJECT( *vp ) || NULL == ( cameraInfo = (Camera_Info*)JS_GetInstancePrivate( cx, camera, &JSI_Camera::JSI_class, NULL ) ) )
|
||||
{
|
||||
JS_ReportError( cx, "[Camera] Invalid object" );
|
||||
}
|
||||
@ -184,7 +184,7 @@ JSBool JSI_Camera::setProperty( JSContext* cx, JSObject* obj, jsval id, jsval* v
|
||||
JSObject* vector3d = JSVAL_TO_OBJECT( *vp );
|
||||
JSI_Vector3D::Vector3D_Info* v = NULL;
|
||||
|
||||
if( JSVAL_IS_OBJECT( *vp ) && ( v = (JSI_Vector3D::Vector3D_Info*)JS_GetInstancePrivate( g_ScriptingHost.getContext(), vector3d, &JSI_Vector3D::JSI_class, NULL ) ) )
|
||||
if( JSVAL_IS_OBJECT( *vp ) && NULL != ( v = (JSI_Vector3D::Vector3D_Info*)JS_GetInstancePrivate( g_ScriptingHost.getContext(), vector3d, &JSI_Vector3D::JSI_class, NULL ) ) )
|
||||
{
|
||||
cameraInfo->Freshen();
|
||||
|
||||
@ -201,7 +201,7 @@ JSBool JSI_Camera::setProperty( JSContext* cx, JSObject* obj, jsval id, jsval* v
|
||||
return( JS_TRUE );
|
||||
}
|
||||
|
||||
#define GETVECTOR( jv ) ( ( JSVAL_IS_OBJECT( jv ) && ( v = (JSI_Vector3D::Vector3D_Info*)JS_GetInstancePrivate( g_ScriptingHost.getContext(), JSVAL_TO_OBJECT( jv ), &JSI_Vector3D::JSI_class, NULL ) ) ) ? *(v->vector) : CVector3D() )
|
||||
#define GETVECTOR( jv ) ( ( JSVAL_IS_OBJECT( jv ) && NULL != ( v = (JSI_Vector3D::Vector3D_Info*)JS_GetInstancePrivate( g_ScriptingHost.getContext(), JSVAL_TO_OBJECT( jv ), &JSI_Vector3D::JSI_class, NULL ) ) ) ? *(v->vector) : CVector3D() )
|
||||
|
||||
|
||||
JSBool JSI_Camera::lookAt( JSContext* cx, JSObject* obj, uint argc, jsval* argv, jsval* rval )
|
||||
|
@ -526,7 +526,7 @@ static void measure_cpu_freq()
|
||||
u64 c1; double t1;
|
||||
do
|
||||
{
|
||||
// note: get_time effectively has a long delay (up to 5 s)
|
||||
// note: get_time effectively has a long delay (up to 5 us)
|
||||
// before returning the time. we call it before rdtsc to
|
||||
// minimize the delay between actually sampling time / TSC,
|
||||
// thus decreasing the chance for interference.
|
||||
|
@ -244,7 +244,7 @@ void CModelRData::RenderStreams(u32 streamflags, bool isplayer)
|
||||
|
||||
// render the lot
|
||||
size_t numFaces=mdldef->GetNumFaces();
|
||||
glDrawRangeElements(GL_TRIANGLES,0,mdldef->GetNumVertices(),numFaces*3,GL_UNSIGNED_SHORT,m_Indices);
|
||||
glDrawRangeElementsEXT(GL_TRIANGLES,0,mdldef->GetNumVertices(),numFaces*3,GL_UNSIGNED_SHORT,m_Indices);
|
||||
|
||||
if(streamflags & STREAM_UV0 & !isplayer)
|
||||
m_Model->GetMaterial().Unbind();
|
||||
@ -364,7 +364,7 @@ void CModelRData::RenderModels(u32 streamflags, u32 flags)
|
||||
|
||||
// render the lot
|
||||
size_t numFaces=mdldef->GetNumFaces();
|
||||
glDrawRangeElements(GL_TRIANGLES, 0, mdldef->GetNumVertices(),
|
||||
glDrawRangeElementsEXT(GL_TRIANGLES, 0, mdldef->GetNumVertices(),
|
||||
numFaces*3, GL_UNSIGNED_SHORT, modeldata->m_Indices);
|
||||
|
||||
// bump stats
|
||||
|
@ -143,14 +143,14 @@ void VertexArray::Layout()
|
||||
|
||||
//debug_printf("Layouting VertexArray\n");
|
||||
|
||||
for(int idx = m_Attributes.size()-1; idx >= 0; --idx)
|
||||
for(int idx = (int)m_Attributes.size()-1; idx >= 0; --idx)
|
||||
{
|
||||
Attribute* attr = m_Attributes[idx];
|
||||
|
||||
if (!attr->type || !attr->elems)
|
||||
continue;
|
||||
|
||||
size_t attrSize;
|
||||
size_t attrSize = 0;
|
||||
|
||||
switch(attr->type) {
|
||||
case GL_UNSIGNED_BYTE: attrSize = sizeof(GLubyte); break;
|
||||
|
Loading…
Reference in New Issue
Block a user