Browse Source

engine: fix style, disable XASH_USE_SELECT

pull/2/head
Alibek Omarov 5 years ago
parent
commit
fa622168a0
  1. 4
      engine/client/console.c
  2. 4
      engine/client/in_evdev.c
  3. 2
      engine/common/sys_con.c
  4. 14
      engine/platform/android/android.c
  5. 8
      engine/platform/android/vid_android.c

4
engine/client/console.c

@ -596,7 +596,7 @@ static qboolean Con_LoadVariableWidthFont( const char *fontname, cl_font_t *font @@ -596,7 +596,7 @@ static qboolean Con_LoadVariableWidthFont( const char *fontname, cl_font_t *font
if( buffer && length >= sizeof( qfont_t ))
{
src = (qfont_t *)buffer;
font->charHeight = src->rowheight * con_fontscale->value;;
font->charHeight = src->rowheight * con_fontscale->value;
font->type = FONT_VARIABLE;
// build rectangles
@ -606,7 +606,7 @@ static qboolean Con_LoadVariableWidthFont( const char *fontname, cl_font_t *font @@ -606,7 +606,7 @@ static qboolean Con_LoadVariableWidthFont( const char *fontname, cl_font_t *font
font->fontRc[i].right = font->fontRc[i].left + src->fontinfo[i].charwidth;
font->fontRc[i].top = (word)src->fontinfo[i].startoffset / fontWidth;
font->fontRc[i].bottom = font->fontRc[i].top + src->rowheight;
font->charWidths[i] = src->fontinfo[i].charwidth * con_fontscale->value;;
font->charWidths[i] = src->fontinfo[i].charwidth * con_fontscale->value;
}
font->valid = true;
}

4
engine/client/in_evdev.c

@ -37,7 +37,7 @@ struct evdev_s @@ -37,7 +37,7 @@ struct evdev_s
int KeycodeFromEvdev(int keycode, int value);
static void Evdev_CheckPermissions()
static void Evdev_CheckPermissions( void )
{
#ifdef __ANDROID__
system( "su 0 chmod 664 /dev/input/event*" );
@ -226,7 +226,7 @@ void Evdev_CloseDevice_f ( void ) @@ -226,7 +226,7 @@ void Evdev_CloseDevice_f ( void )
}
}
void IN_EvdevFrame ()
void IN_EvdevFrame ( void )
{
int dx = 0, dy = 0, i;

2
engine/common/sys_con.c

@ -22,7 +22,7 @@ GNU General Public License for more details. @@ -22,7 +22,7 @@ GNU General Public License for more details.
#define XASH_COLORIZE_CONSOLE
// use with caution, running engine in Qt Creator may cause a freeze in read() call
// I was never encountered this bug anywhere else, so still enable by default
#define XASH_USE_SELECT
// #define XASH_USE_SELECT
#endif
#ifdef XASH_USE_SELECT

14
engine/platform/android/android.c

@ -181,7 +181,7 @@ Lock event queue and return pointer to next event. @@ -181,7 +181,7 @@ Lock event queue and return pointer to next event.
Caller must do Android_PushEvent() to unlock queue after setting parameters.
========================
*/
event_t *Android_AllocEvent()
event_t *Android_AllocEvent( void )
{
Android_Lock();
if( events.count == ANDROID_MAX_EVENTS )
@ -418,6 +418,7 @@ DECLARE_JNI_INTERFACE( void, nativeBall, jint id, jbyte ball, jshort xrel, jshor @@ -418,6 +418,7 @@ DECLARE_JNI_INTERFACE( void, nativeBall, jint id, jbyte ball, jshort xrel, jshor
DECLARE_JNI_INTERFACE( void, nativeHat, jint id, jbyte hat, jbyte key, jboolean down )
{
event_t *event = Android_AllocEvent();
static byte engineKeys;
if( !key )
@ -428,7 +429,6 @@ DECLARE_JNI_INTERFACE( void, nativeHat, jint id, jbyte hat, jbyte key, jboolean @@ -428,7 +429,6 @@ DECLARE_JNI_INTERFACE( void, nativeHat, jint id, jbyte hat, jbyte key, jboolean
else
engineKeys &= ~key;
event_t *event = Android_AllocEvent();
event->type = event_joyhat;
event->arg = id;
event->hat.hat = hat;
@ -584,7 +584,7 @@ Android_Init @@ -584,7 +584,7 @@ Android_Init
Initialize android-related cvars
========================
*/
void Android_Init()
void Android_Init( void )
{
android_sleep = Cvar_Get( "android_sleep", "1", FCVAR_ARCHIVE, "Enable sleep in background" );
}
@ -658,12 +658,14 @@ Android_GetAndroidID @@ -658,12 +658,14 @@ Android_GetAndroidID
const char *Android_GetAndroidID( void )
{
static char id[65];
const char *resultCStr;
jstring resultJNIStr;
if( id[0] )
return id;
jstring resultJNIStr = (jstring)(*jni.env)->CallStaticObjectMethod( jni.env, jni.actcls, jni.getAndroidId );
const char *resultCStr = (*jni.env)->GetStringUTFChars( jni.env, resultJNIStr, NULL );
resultJNIStr = (jstring)(*jni.env)->CallStaticObjectMethod( jni.env, jni.actcls, jni.getAndroidId );
resultCStr = (*jni.env)->GetStringUTFChars( jni.env, resultJNIStr, NULL );
Q_strncpy( id, resultCStr, 64 );
(*jni.env)->ReleaseStringUTFChars( jni.env, resultJNIStr, resultCStr );
@ -795,7 +797,7 @@ Android_RunEvents @@ -795,7 +797,7 @@ Android_RunEvents
Execute all events from queue
========================
*/
void Platform_RunEvents()
void Platform_RunEvents( void )
{
int i;

8
engine/platform/android/vid_android.c

@ -63,7 +63,7 @@ Android_SwapBuffers @@ -63,7 +63,7 @@ Android_SwapBuffers
Update screen. Use native EGL if possible
========================
*/
void GL_SwapBuffers()
void GL_SwapBuffers( void )
{
eglSwapBuffers( negl.dpy, negl.surface );
}
@ -387,7 +387,7 @@ int GL_GetAttribute( int attr, int *val ) @@ -387,7 +387,7 @@ int GL_GetAttribute( int attr, int *val )
return 0;
}
int R_MaxVideoModes()
int R_MaxVideoModes( void )
{
return 0;
}
@ -417,12 +417,12 @@ void GL_UpdateSwapInterval( void ) @@ -417,12 +417,12 @@ void GL_UpdateSwapInterval( void )
}
}
void *SW_LockBuffer()
void *SW_LockBuffer( void )
{
return NULL;
}
void SW_UnlockBuffer()
void SW_UnlockBuffer( void )
{
}

Loading…
Cancel
Save