Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github: enable gcc3 workflow back by request #1467

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ jobs:
# targetos: android
# targetarch: 64

# - os: ubuntu-20.04
# targetos: motomagx
# targetarch: armv6

- os: ubuntu-20.04
targetos: motomagx
targetarch: armv6
- os: ubuntu-latest
targetos: nswitch
targetarch: arm64
Expand Down
2 changes: 1 addition & 1 deletion engine/client/in_touch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ void Touch_Init( void )
#if SDL_VERSION_ATLEAST( 2, 0, 10 )
SDL_SetHint( SDL_HINT_MOUSE_TOUCH_EVENTS, "0" );
SDL_SetHint( SDL_HINT_TOUCH_MOUSE_EVENTS, "0" );
#elif defined(SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH)
#elif defined( SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH )
SDL_SetHint( SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH, "1" );
#endif

Expand Down
4 changes: 2 additions & 2 deletions engine/client/vid_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ typedef struct vidmode_s
int height;
} vidmode_t;

typedef enum window_mode_e
enum window_mode_e
{
WINDOW_MODE_WINDOWED = 0,
WINDOW_MODE_FULLSCREEN,
WINDOW_MODE_BORDERLESS,
WINDOW_MODE_COUNT,
} window_mode_t;
};

typedef struct
{
Expand Down
12 changes: 6 additions & 6 deletions engine/client/voice.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ GNU General Public License for more details.
#include "protocol.h" // MAX_CLIENTS
#include "sound.h"

typedef struct OpusCustomEncoder OpusCustomEncoder;
typedef struct OpusCustomDecoder OpusCustomDecoder;
typedef struct OpusCustomMode OpusCustomMode;
struct OpusCustomEncoder;
struct OpusCustomDecoder;
struct OpusCustomMode;

#define VOICE_LOOPBACK_INDEX (-2)
#define VOICE_LOCALCLIENT_INDEX (-1)
Expand Down Expand Up @@ -59,9 +59,9 @@ typedef struct voice_state_s
voice_status_t players_status[MAX_CLIENTS];

// opus stuff
OpusCustomMode *custom_mode;
OpusCustomEncoder *encoder;
OpusCustomDecoder *decoder;
struct OpusCustomMode *custom_mode;
struct OpusCustomEncoder *encoder;
struct OpusCustomDecoder *decoder;

// audio info
uint width;
Expand Down
2 changes: 1 addition & 1 deletion engine/common/crashhandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ static void Sys_Crash( int signal, siginfo_t *si, void *context)
pc = (void*)ucontext->uc_mcontext.pc;
bp = (void*)ucontext->uc_mcontext.regs[29];
sp = (void*)ucontext->uc_mcontext.sp;
#elif XASH_ARM
#elif XASH_ARM && !XASH_MAGX
pc = (void*)ucontext->uc_mcontext.arm_pc;
bp = (void*)ucontext->uc_mcontext.arm_fp;
sp = (void*)ucontext->uc_mcontext.arm_sp;
Expand Down
8 changes: 6 additions & 2 deletions engine/platform/sdl/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ static void SDLash_KeyEvent( SDL_KeyboardEvent key )
case SDL_SCANCODE_MINUS: keynum = '-'; break;
case SDL_SCANCODE_TAB: keynum = K_TAB; break;
case SDL_SCANCODE_RETURN: keynum = K_ENTER; break;
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
case SDL_SCANCODE_AC_BACK:
#endif
case SDL_SCANCODE_ESCAPE: keynum = K_ESCAPE; break;
case SDL_SCANCODE_SPACE: keynum = K_SPACE; break;
case SDL_SCANCODE_BACKSPACE: keynum = K_BACKSPACE; break;
Expand Down Expand Up @@ -259,9 +261,9 @@ static void SDLash_KeyEvent( SDL_KeyboardEvent key )
host.force_draw_version_time = host.realtime + FORCE_DRAW_VERSION_TIME;
break;
}
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
case SDL_SCANCODE_PAUSE: keynum = K_PAUSE; break;
case SDL_SCANCODE_SCROLLLOCK: keynum = K_SCROLLOCK; break;
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
case SDL_SCANCODE_APPLICATION: keynum = K_WIN; break; // (compose key) ???
// don't console spam on known functional buttons, not used in engine
case SDL_SCANCODE_MUTE:
Expand Down Expand Up @@ -305,8 +307,10 @@ static void SDLash_MouseEvent( SDL_MouseButtonEvent button )

if( button.state == SDL_RELEASED )
down = 0;
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
else if( button.clicks >= 2 )
down = 2; // special state for double-click in UI
#endif
else
down = 1;

Expand Down Expand Up @@ -669,7 +673,7 @@ static void SDLash_EventFilter( SDL_Event *event )
}
#else
case SDL_VIDEORESIZE:
VID_SaveWindowSize( event->resize.w, event->resize.h );
VID_SaveWindowSize( event->resize.w, event->resize.h, false );
break;
case SDL_ACTIVEEVENT:
SDLash_ActiveEvent( event->active.gain );
Expand Down
27 changes: 22 additions & 5 deletions engine/platform/sdl/s_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ so it can unlock and free the data block after it has been played.
=======================================================================
*/
static int sdl_dev;
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
static SDL_AudioDeviceID in_dev = 0;
static SDL_AudioFormat sdl_format;
#endif
static char sdl_backend_name[32];

void SDL_SoundCallback( void *userdata, Uint8 *stream, int len )
Expand Down Expand Up @@ -100,10 +101,12 @@ qboolean SNDDMA_Init( void )
SDL_AudioSpec desired, obtained;
int samplecount;

#if SDL_VERSION_ATLEAST( 2, 0, 0 )
// even if we don't have PA
// we still can safely set env variables
SDL_setenv( "PULSE_PROP_application.name", GI->title, 1 );
SDL_setenv( "PULSE_PROP_media.role", "game", 1 );
#endif

if( SDL_Init( SDL_INIT_AUDIO ))
{
Expand Down Expand Up @@ -148,8 +151,6 @@ qboolean SNDDMA_Init( void )
dma.buffer = Z_Calloc( dma.samples * 2 );
dma.samplepos = 0;

sdl_format = obtained.format;

Con_Printf( "Using SDL audio driver: %s @ %d Hz\n", SDL_GetCurrentAudioDriver( ), obtained.freq );
Q_snprintf( sdl_backend_name, sizeof( sdl_backend_name ), "SDL (%s)", SDL_GetCurrentAudioDriver( ));
dma.initialized = true;
Expand Down Expand Up @@ -263,14 +264,15 @@ VoiceCapture_Init
*/
qboolean VoiceCapture_Init( void )
{
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
SDL_AudioSpec wanted, spec;

if( !SDLash_IsAudioError( in_dev ))
{
VoiceCapture_Shutdown();
}

SDL_zero( wanted );
memset( &wanted, 0, sizeof( wanted ));
wanted.freq = voice.samplerate;
wanted.format = AUDIO_S16LSB;
wanted.channels = VOICE_PCM_CHANNELS;
Expand All @@ -284,9 +286,12 @@ qboolean VoiceCapture_Init( void )
Con_Printf( "VoiceCapture_Init: error creating capture device (%s)\n", SDL_GetError() );
return false;
}

Con_Printf( S_NOTE "VoiceCapture_Init: capture device creation success (%i: %s)\n", in_dev, SDL_GetAudioDeviceName( in_dev, SDL_TRUE ) );
return true;
#else // SDL_VERSION_ATLEAST( 2, 0, 0 )
return false;
#endif // SDL_VERSION_ATLEAST( 2, 0, 0 )
}

/*
Expand All @@ -296,11 +301,15 @@ VoiceCapture_Activate
*/
qboolean VoiceCapture_Activate( qboolean activate )
{
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
if( SDLash_IsAudioError( in_dev ))
return false;

SDL_PauseAudioDevice( in_dev, activate ? SDL_FALSE : SDL_TRUE );
return true;
#else // SDL_VERSION_ATLEAST( 2, 0, 0 )
return false;
#endif // SDL_VERSION_ATLEAST( 2, 0, 0 )
}

/*
Expand All @@ -310,13 +319,17 @@ VoiceCapture_Lock
*/
qboolean VoiceCapture_Lock( qboolean lock )
{
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
if( SDLash_IsAudioError( in_dev ))
return false;

if( lock ) SDL_LockAudioDevice( in_dev );
else SDL_UnlockAudioDevice( in_dev );

return true;
#else // SDL_VERSION_ATLEAST( 2, 0, 0 )
return false;
#endif // SDL_VERSION_ATLEAST( 2, 0, 0 )
}

/*
Expand All @@ -326,10 +339,14 @@ VoiceCapture_Shutdown
*/
void VoiceCapture_Shutdown( void )
{
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
if( SDLash_IsAudioError( in_dev ))
return;

SDL_CloseAudioDevice( in_dev );
#else // SDL_VERSION_ATLEAST( 2, 0, 0 )
return false;
#endif // SDL_VERSION_ATLEAST( 2, 0, 0 )
}

#endif // XASH_SOUND == SOUND_SDL
26 changes: 14 additions & 12 deletions engine/platform/sdl/vid_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ static qboolean VID_CreateWindowWithSafeGL( const char *wndname, int xpos, int y
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
host.hWnd = SDL_CreateWindow( wndname, xpos, ypos, w, h, flags );
#else
host.hWnd = sw.surf = SDL_SetVideoMode( width, height, 16, flags );
host.hWnd = sw.surf = SDL_SetVideoMode( w, h, 16, flags );
#endif
// we have window, exit loop
if( host.hWnd )
Expand Down Expand Up @@ -728,13 +728,16 @@ VID_CreateWindow
qboolean VID_CreateWindow( int width, int height, window_mode_t window_mode )
{
string wndname;
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
qboolean maximized = vid_maximized.value != 0.0f;
Uint32 wndFlags = SDL_WINDOW_SHOWN | SDL_WINDOW_MOUSE_FOCUS;
int xpos, ypos;
Uint32 wndFlags;
qboolean maximized;

Q_strncpy( wndname, GI->title, sizeof( wndname ));

#if SDL_VERSION_ATLEAST( 2, 0, 0 )
maximized = vid_maximized.value != 0.0f;
SetBits( wndFlags, SDL_WINDOW_SHOWN | SDL_WINDOW_MOUSE_FOCUS );

if( vid_highdpi.value )
SetBits( wndFlags, SDL_WINDOW_ALLOW_HIGHDPI );
if( !glw_state.software )
Expand Down Expand Up @@ -849,13 +852,14 @@ qboolean VID_CreateWindow( int width, int height, window_mode_t window_mode )
}

#else // SDL_VERSION_ATLEAST( 2, 0, 0 )
Uint32 flags = 0;
xpos = window_xpos.value;
ypos = window_ypos.value;

if( window_mode != WINDOW_MODE_WINDOWED )
SetBits( flags, SDL_FULLSCREEN|SDL_HWSURFACE );
SetBits( wndFlags, SDL_FULLSCREEN|SDL_HWSURFACE );

if( !glw_state.software )
SetBits( flags, SDL_OPENGL );
SetBits( wndFlags, SDL_OPENGL );

if( !VID_CreateWindowWithSafeGL( wndname, xpos, ypos, width, height, wndFlags ))
return false;
Expand Down Expand Up @@ -939,7 +943,7 @@ int GL_SetAttribute( int attr, int val )
#ifdef SDL_HINT_OPENGL_ES_DRIVER
if( val == REF_GL_CONTEXT_PROFILE_ES )
{
SDL_SetHint(SDL_HINT_OPENGL_ES_DRIVER, "1");
SDL_SetHint( SDL_HINT_OPENGL_ES_DRIVER, "1" );
SDL_SetHint( "SDL_VIDEO_X11_FORCE_EGL", "1" );
}
#endif // SDL_HINT_OPENGL_ES_DRIVER
Expand Down Expand Up @@ -1012,9 +1016,6 @@ qboolean R_Init_Video( const int type )
SDL_DisplayMode displayMode;
SDL_GetCurrentDisplayMode(0, &displayMode);
refState.desktopBitsPixel = SDL_BITSPERPIXEL( displayMode.format );
#else
refState.desktopBitsPixel = 16;
#endif

#ifdef SDL_HINT_QTWAYLAND_WINDOW_FLAGS
SDL_SetHint( SDL_HINT_QTWAYLAND_WINDOW_FLAGS, "OverridesSystemGestures" );
Expand All @@ -1023,11 +1024,12 @@ qboolean R_Init_Video( const int type )
SDL_SetHint( SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION, "landscape" );
#endif

#if SDL_VERSION_ATLEAST( 2, 0, 0 ) && !XASH_WIN32
SDL_SetHint( "SDL_VIDEO_X11_XRANDR", "1" );
SDL_SetHint( "SDL_VIDEO_X11_XVIDMODE", "1" );
if( Sys_CheckParm( "-egl" ) )
SDL_SetHint( "SDL_VIDEO_X11_FORCE_EGL", "1" );
#else
refState.desktopBitsPixel = 16;
#endif

// must be initialized before creating window
Expand Down
4 changes: 2 additions & 2 deletions engine/ref_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ typedef struct remap_info_s
model_t *model; // for catch model changes
} remap_info_t;

typedef struct convar_s convar_t;
struct convar_s;
struct con_nprint_s;
struct engine_studio_api_s;
struct r_studio_interface_s;
Expand Down Expand Up @@ -270,7 +270,7 @@ typedef struct ref_api_s
const char *(*pfnGetCvarString)( const char *szName );
void (*Cvar_SetValue)( const char *name, float value );
void (*Cvar_Set)( const char *name, const char *value );
void (*Cvar_RegisterVariable)( convar_t *var );
void (*Cvar_RegisterVariable)( struct convar_s *var );
void (*Cvar_FullSet)( const char *var_name, const char *value, int flags );

// command handlers
Expand Down
4 changes: 2 additions & 2 deletions filesystem/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ enum
DIRENTRY_CASEINSENSITIVE = -2, // directory is already caseinsensitive, just copy whatever is left
};

typedef struct dir_s
struct dir_s
{
string name;
int numentries;
struct dir_s *entries; // sorted
} dir_t;
};

static qboolean Platform_GetDirectoryCaseSensitivity( const char *dir )
{
Expand Down
9 changes: 4 additions & 5 deletions scripts/gha/build_motomagx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@

cd $GITHUB_WORKSPACE || die

mkdir -p Xash/valve/cl_dlls
mkdir -p Xash/valve/dlls
./waf configure -T fast --enable-magx build -v install --destdir=Xash/ --strip || die

pushd hlsdk || die
./waf configure -T fast --enable-magx --enable-simple-mod-hacks build install --destdir=../Xash || die
./waf configure -T fast --enable-magx build -v install --destdir=../Xash --strip || die
git checkout opfor
./waf configure -T fast --enable-magx build -v install --destdir=../Xash --strip || die
popd

./waf configure -T fast --enable-magx build install --destdir=Xash/ || die

cat > Xash/run.sh << 'EOF'
mypath=${0%/*}
LIBDIR1=/ezxlocal/download/mystuff/games/lib
Expand Down
4 changes: 4 additions & 0 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def configure(conf):
conf.options.SINGLE_BINARY = True
conf.options.NO_ASYNC_RESOLVE = True
conf.define('XASH_SDLMAIN', 1)
conf.define('XASH_MAGX', 1)
enforce_pic = False
elif conf.env.DEST_OS == 'dos':
conf.options.SINGLE_BINARY = True
Expand Down Expand Up @@ -275,6 +276,9 @@ def configure(conf):
# Do not warn us about bug in SDL_Audio headers
conf.env.append_unique('CFLAGS', ['-Wno-attributes'])
conf.env.append_unique('CXXFLAGS', ['-Wno-attributes'])
elif conf.env.MAGX:
conf.env.append_unique('CFLAGS', ['-std=gnu99'])
conf.env.append_unique('CXXFLAGS', ['-std=gnu++98'])

conf.check_cc(cflags=cflags, linkflags=linkflags, msg='Checking for required C flags')
conf.check_cxx(cxxflags=cxxflags, linkflags=linkflags, msg='Checking for required C++ flags')
Expand Down
Loading