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
if( buffer && length >= sizeof( qfont_t )) if( buffer && length >= sizeof( qfont_t ))
{ {
src = (qfont_t *)buffer; src = (qfont_t *)buffer;
font->charHeight = src->rowheight * con_fontscale->value;; font->charHeight = src->rowheight * con_fontscale->value;
font->type = FONT_VARIABLE; font->type = FONT_VARIABLE;
// build rectangles // build rectangles
@ -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].right = font->fontRc[i].left + src->fontinfo[i].charwidth;
font->fontRc[i].top = (word)src->fontinfo[i].startoffset / fontWidth; font->fontRc[i].top = (word)src->fontinfo[i].startoffset / fontWidth;
font->fontRc[i].bottom = font->fontRc[i].top + src->rowheight; 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; font->valid = true;
} }

4
engine/client/in_evdev.c

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

2
engine/common/sys_con.c

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

14
engine/platform/android/android.c

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

8
engine/platform/android/vid_android.c

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

Loading…
Cancel
Save