diff --git a/ref/gl/gl2_shim/gl2_shim.c b/ref/gl/gl2_shim/gl2_shim.c index 988b8154..3fa5df38 100644 --- a/ref/gl/gl2_shim/gl2_shim.c +++ b/ref/gl/gl2_shim/gl2_shim.c @@ -1681,10 +1681,12 @@ static void APIENTRY GL2_BindBufferARB( GLenum buf, GLuint obj ) rpglBindBufferARB( buf, obj ); } +#if 0 static void APIENTRY GL2_ActiveTextureARB( GLenum tex ) { //gl2wrap_arrays.texture = GL_TEXTURE0_ARB - tex; } +#endif static void APIENTRY GL2_ClientActiveTextureARB( GLenum tex ) { @@ -1736,6 +1738,7 @@ static void APIENTRY GL2_ShadeModel(GLenum mode) { } +#if XASH_GLES static void APIENTRY GL2_PolygonMode(GLenum face, GLenum mode) { } @@ -1747,6 +1750,7 @@ static void APIENTRY GL2_PointSize(GLfloat size) static void APIENTRY GL2_DrawBuffer(GLenum mode) { } +#endif #if XASH_EMSCRIPTEN static void GL2_PolygonOffset( GLfloat factor, GLfloat units ) @@ -1783,10 +1787,12 @@ void GL2_ShimInstall( void ) GL2_OVERRIDE_PTR( TexEnvi ) GL2_OVERRIDE_PTR( TexEnvf ) GL2_OVERRIDE_PTR( ClientActiveTextureARB ) - //GL2_OVERRIDE_PTR( ActiveTextureARB ) +#if 0 // FIXME: figure out why it's disabled + GL2_OVERRIDE_PTR( ActiveTextureARB ) +#endif GL2_OVERRIDE_PTR( Fogi ) GL2_OVERRIDE_PTR( ShadeModel ) -#ifdef XASH_GLES +#if XASH_GLES _pglDepthRangef = gEngfuncs.GL_GetProcAddress( "glDepthRangef" ); GL2_OVERRIDE_PTR( PolygonMode ) GL2_OVERRIDE_PTR( PointSize ) diff --git a/ref/gl/gl_image.c b/ref/gl/gl_image.c index 66c1ebfc..216039fa 100644 --- a/ref/gl/gl_image.c +++ b/ref/gl/gl_image.c @@ -1860,35 +1860,6 @@ INTERNAL TEXTURES ============================================================================== */ -/* -================== -GL_FakeImage -================== -*/ -static rgbdata_t *GL_FakeImage( int width, int height, int depth, int flags ) -{ - static byte data2D[1024]; // 16x16x4 - static rgbdata_t r_image; - - // also use this for bad textures, but without alpha - r_image.width = Q_max( 1, width ); - r_image.height = Q_max( 1, height ); - r_image.depth = Q_max( 1, depth ); - r_image.flags = flags; - r_image.type = PF_RGBA_32; - r_image.size = r_image.width * r_image.height * r_image.depth * 4; - r_image.buffer = (r_image.size > sizeof( data2D )) ? NULL : data2D; - r_image.palette = NULL; - r_image.numMips = 1; - r_image.encode = 0; - - if( FBitSet( r_image.flags, IMAGE_CUBEMAP )) - r_image.size *= 6; - memset( data2D, 0xFF, sizeof( data2D )); - - return &r_image; -} - /* ================== R_InitDlightTexture diff --git a/ref/gl/gl_opengl.c b/ref/gl/gl_opengl.c index a52750a0..70617e0f 100644 --- a/ref/gl/gl_opengl.c +++ b/ref/gl/gl_opengl.c @@ -428,6 +428,7 @@ DebugCallback For ARB_debug_output ======================== */ +#if !XASH_GL4ES // GL4ES doesn't provide glDebug functions, even as stubs static void APIENTRY GL_DebugOutput( GLuint source, GLuint type, GLuint id, GLuint severity, GLint length, const GLcharARB *message, GLvoid *userParam ) { switch( type ) @@ -449,6 +450,7 @@ static void APIENTRY GL_DebugOutput( GLuint source, GLuint type, GLuint id, GLui break; } } +#endif // !XASH_GL4ES /* ================= @@ -1076,7 +1078,8 @@ void GL_InitExtensions( void ) pglGetIntegerv( GL_MAX_TEXTURE_SIZE, &glConfig.max_2d_texture_size ); if( glConfig.max_2d_texture_size <= 0 ) glConfig.max_2d_texture_size = 256; -#if !XASH_GL4ES + +#if !XASH_GL4ES // GL4ES doesn't provide glDebugMessage functions, even as stubs // enable gldebug if allowed if( GL_Support( GL_DEBUG_OUTPUT )) { @@ -1093,7 +1096,8 @@ void GL_InitExtensions( void ) // enable all the low priority messages pglDebugMessageControlARB( GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW_ARB, 0, NULL, true ); } -#endif +#endif // !XASH_GL4ES + if( GL_Support( GL_TEXTURE_2D_RECT_EXT )) pglGetIntegerv( GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT, &glConfig.max_2d_rectangle_size ); diff --git a/ref/null/r_context.c b/ref/null/r_context.c index 807bb51f..e2b537b6 100644 --- a/ref/null/r_context.c +++ b/ref/null/r_context.c @@ -229,31 +229,6 @@ static int RefGetParm( int parm, int arg ) return 0; } -static void GetDetailScaleForTexture( int texture, float *xScale, float *yScale ) -{ - *xScale = *yScale = 1.0f; -} - -static void GetExtraParmsForTexture( int texture, byte *red, byte *green, byte *blue, byte *alpha ) -{ - *red = *green = *blue = *alpha = 0; -} - -static float GetFrameTime( void ) -{ - return 0.0f; -} - -static void R_SetCurrentEntity( struct cl_entity_s *ent ) -{ - ; -} - -static void R_SetCurrentModel( struct model_s *mod ) -{ - ; -} - static int GL_FindTexture( const char *name ) { return 0; @@ -279,36 +254,11 @@ static int GL_CreateTexture( const char *name, int width, int height, const void return 0; } -static int GL_LoadTextureArray( const char **names, int flags ) -{ - return 0; -} - -static int GL_CreateTextureArray( const char *name, int width, int height, int depth, const void *buffer, texFlags_t flags ) -{ - return 0; -} - static void R_OverrideTextureSourceSize( unsigned int textnum, unsigned int srcWidth, unsigned int srcHeight ) { } -static void DrawSingleDecal( struct decal_s *pDecal, struct msurface_s *fa ) -{ - ; -} - -static float *R_DecalSetupVerts( struct decal_s *pDecal, struct msurface_s *surf, int texture, int *outCount ) -{ - return NULL; -} - -static void R_EntityRemoveDecals( struct model_s *mod ) -{ - ; -} - static void GL_UpdateTexture( int texnum, int cols, int rows, int width, int height, const byte *buffer, pixformat_t fmt ) { ; @@ -319,37 +269,6 @@ static void GL_Bind( int tmu, unsigned int texnum ) ; } -static void GL_LoadTextureMatrix( const float *glmatrix ) -{ - ; -} - -static void GL_TexGen( unsigned int coord, unsigned int mode ) -{ - ; -} - -static void GL_UpdateTexSize( int texnum, int width, int height, int depth ) -{ - ; -} - -static void GL_DrawParticles( const struct ref_viewpass_s *rvp, qboolean trans_pass, float frametime ) -{ - ; -} - -static colorVec LightVec( const float *start, const float *end, float *lightspot, float *lightvec ) -{ - colorVec c = { 0 }; - return c; -} - -static struct mstudiotex_s *StudioGetTexture( struct cl_entity_s *e ) -{ - return NULL; -} - static void GL_RenderFrame( const struct ref_viewpass_s *rvp ) { ; @@ -370,11 +289,6 @@ static byte *Mod_GetCurrentVis( void ) return NULL; } -static void *R_GetProcAddress( const char *name ) -{ - return NULL; -} - static void Color4f( float r, float g, float b, float a ) { ; @@ -385,11 +299,6 @@ static void Color4ub( unsigned char r, unsigned char g, unsigned char b, unsigne ; } -static void TexCoord2f( float u, float v ) -{ - ; -} - static void Vertex3fv( const float *worldPnt ) { ; @@ -400,26 +309,6 @@ static void Vertex3f( float x, float y, float z ) ; } -static void Fog( float flFogColor[3], float flStart, float flEnd, int bOn ) -{ - ; -} - -static void ScreenToWorld( const float *screen, float *world ) -{ - ; -} - -static void GetMatrix( const int pname, float *matrix ) -{ - ; -} - -static void FogParams( float flDensity, int iFogSkybox ) -{ - ; -} - static void CullFace( TRICULLSTYLE mode ) { ; diff --git a/ref/soft/r_image.c b/ref/soft/r_image.c index c3f281f9..6d5d27b7 100644 --- a/ref/soft/r_image.c +++ b/ref/soft/r_image.c @@ -800,35 +800,6 @@ INTERNAL TEXTURES ============================================================================== */ -/* -================== -GL_FakeImage -================== -*/ -static rgbdata_t *GL_FakeImage( int width, int height, int depth, int flags ) -{ - static byte data2D[1024]; // 16x16x4 - static rgbdata_t r_image; - - // also use this for bad textures, but without alpha - r_image.width = Q_max( 1, width ); - r_image.height = Q_max( 1, height ); - r_image.depth = Q_max( 1, depth ); - r_image.flags = flags; - r_image.type = PF_RGBA_32; - r_image.size = r_image.width * r_image.height * r_image.depth * 4; - r_image.buffer = ( r_image.size > sizeof( data2D )) ? NULL : data2D; - r_image.palette = NULL; - r_image.numMips = 1; - r_image.encode = 0; - - if( FBitSet( r_image.flags, IMAGE_CUBEMAP )) - r_image.size *= 6; - memset( data2D, 0xFF, sizeof( data2D )); - - return &r_image; -} - /* ================== R_InitDlightTexture