Browse Source

psvita: use crtlib where possible

pull/2/head
fgsfds 2 years ago committed by Alibek Omarov
parent
commit
70a73e47a7
  1. 2
      engine/common/system.c
  2. 11
      ref/gl/vgl_shim/vgl_shim.c

2
engine/common/system.c

@ -136,7 +136,7 @@ const char *Sys_GetCurrentUser( void ) @@ -136,7 +136,7 @@ const char *Sys_GetCurrentUser( void )
#elif XASH_PSVITA
static string username;
sceAppUtilSystemParamGetString( SCE_SYSTEM_PARAM_ID_USERNAME, username, sizeof( username ) - 1 );
if( username[0] )
if( !COM_CheckStringEmpty( username ) )
return username;
#elif XASH_POSIX && !XASH_ANDROID && !XASH_NSWITCH
uid_t uid = geteuid();

11
ref/gl/vgl_shim/vgl_shim.c

@ -36,6 +36,7 @@ GNU General Public License for more details. @@ -36,6 +36,7 @@ GNU General Public License for more details.
#include "dlight.h"
#include "ref_api.h"
#include "com_strings.h"
#include "crtlib.h"
#include "vgl_shim.h"
#define MAX_SHADERLEN 4096
@ -136,17 +137,17 @@ static GLuint VGL_GenerateShader( const vgl_prog_t *prog, GLenum type ) @@ -136,17 +137,17 @@ static GLuint VGL_GenerateShader( const vgl_prog_t *prog, GLenum type )
for ( i = 0; i < VGL_FLAG_MAX; ++i )
{
snprintf( tmp, sizeof( tmp ), "#define %s %d\n", vgl_flag_name[i], prog->flags & ( 1 << i ) );
strncat( shader, tmp, MAX_SHADERLEN );
Q_snprintf( tmp, sizeof( tmp ), "#define %s %d\n", vgl_flag_name[i], prog->flags & ( 1 << i ) );
Q_strncat( shader, tmp, MAX_SHADERLEN );
}
if ( type == GL_FRAGMENT_SHADER )
strncat( shader, vgl_frag_src, MAX_SHADERLEN );
Q_strncat( shader, vgl_frag_src, MAX_SHADERLEN );
else
strncat( shader, vgl_vert_src, MAX_SHADERLEN );
Q_strncat( shader, vgl_vert_src, MAX_SHADERLEN );
id = glCreateShader( type );
len = strlen( shader );
len = Q_strlen( shader );
glShaderSource( id, 1, (const void *)&shader, &len );
glCompileShader( id );
glGetShaderiv( id, GL_COMPILE_STATUS, &status );

Loading…
Cancel
Save