1
0
Fork 0
forked from len0rd/rockbox

sdl: Fix up build failures with -fno-common

Big pile of duplicate variable definitions in quake and duke3d

Change-Id: If5ef873c1dc1d7b3104536f657258e0a06574d53
This commit is contained in:
Solomon Peachy 2025-08-04 20:56:44 -04:00
parent c33602375d
commit 9f91f02159
17 changed files with 58 additions and 40 deletions

View file

@ -11,8 +11,8 @@
#include "platform.h"
/* set these in your _platform_init() implementation. */
int _argc;
char **_argv;
extern int _argc;
extern char **_argv;
/* !!! gads, look at all the namespace polution... */
extern int32_t xres, yres, bytesperline, imageSize, maxpages;

View file

@ -9,8 +9,8 @@
#include "build.h"
short numplayers = 1, myconnectindex = 0;
short connecthead, connectpoint2[MAXPLAYERS];
//short numplayers = 1, myconnectindex = 0;
//short connecthead, connectpoint2[MAXPLAYERS];
//uint8_t syncstate=0;

View file

@ -50,7 +50,7 @@ static short bakpacketptr[MAXPLAYERS][256], bakpacketlen[MAXPLAYERS][256];
static char bakpacketbuf[BAKSIZ];
static long bakpacketplc = 0;
short myconnectindex, numplayers;
short myconnectindex = 0, numplayers = 1;
short connecthead, connectpoint2[MAXPLAYERS];
char syncstate = 0;

View file

@ -27,7 +27,7 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
#include "duke3d.h"
extern int32_t numenvsnds;
uint8_t actor_tog;
extern uint8_t actor_tog;
void updateinterpolations() //Stick at beginning of domovethings
{

View file

@ -78,6 +78,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// #define IS_QUIET( ptr ) ( ( void * )( ptr ) == ( void * )&MV_VolumeTable[ 0 ] )
#define IS_QUIET( vol ) ( ( vol ) == 0 )
SDL_mutex* reverbMutex;
static int MV_ReverbLevel;
int MV_ReverbDelay;
#if 0

View file

@ -122,6 +122,6 @@ int MV_Shutdown( void );
void MV_UnlockMemory( void );
int MV_LockMemory( void );
SDL_mutex* reverbMutex;
extern SDL_mutex* reverbMutex;
#endif

View file

@ -71,6 +71,10 @@ static int32 mousePositionY = 0;
static int32 mouseRelativeX = 0;
static int32 mouseRelativeY = 0;
struct _KeyMapping KeyMapping[MAXGAMEBUTTONS];
int32 MouseMapping[MAXMOUSEBUTTONS];
int32 MouseDigitalAxeMapping[MAXMOUSEAXES][2];
//***************************************************************************
//
// FUNCTIONS

View file

@ -177,12 +177,13 @@ struct _KeyMapping
boolean key_active;
kb_scancode key1;
kb_scancode key2;
/* other mappings go here */
} KeyMapping[MAXGAMEBUTTONS];
int32 MouseMapping[MAXMOUSEBUTTONS];
int32 MouseDigitalAxeMapping[MAXMOUSEAXES][2]; // [axesX/Y][directionLeft/Right or directionUp/Down]
/* other mappings go here */
};
extern struct _KeyMapping KeyMapping[MAXGAMEBUTTONS];
extern int32 MouseMapping[MAXMOUSEBUTTONS];
extern int32 MouseDigitalAxeMapping[MAXMOUSEAXES][2]; // [axesX/Y][directionLeft/Right or directionUp/Down]
int ACTION(int i);

View file

@ -20,6 +20,18 @@
#include "audiolib/music.h"
int g_CV_console_text_color;
int g_CV_num_console_lines;
int g_CV_classic;
int g_CV_TransConsole;
int g_CV_DebugJoystick;
int g_CV_DebugSound;
int g_CV_DebugFileAccess;
uint32_t sounddebugActiveSounds;
uint32_t sounddebugAllocateSoundCalls;
uint32_t sounddebugDeallocateSoundCalls;
int g_CV_CubicInterpolation;
// Bind our Cvars at startup. You can still add bindings after this call, but
// it is recommanded that you bind your default CVars here.
void CVARDEFS_Init()

View file

@ -22,18 +22,16 @@ void CVARDEFS_FunctionHelp(void* var);
//
// Variable declarations
//
int g_CV_console_text_color;
int g_CV_num_console_lines;
int g_CV_classic;
int g_CV_TransConsole;
int g_CV_DebugJoystick;
int g_CV_DebugSound;
int g_CV_DebugFileAccess;
uint32_t sounddebugActiveSounds;
uint32_t sounddebugAllocateSoundCalls;
uint32_t sounddebugDeallocateSoundCalls;
extern int g_CV_console_text_color;
extern int g_CV_num_console_lines;
extern int g_CV_classic;
extern int g_CV_TransConsole;
extern int g_CV_DebugJoystick;
extern int g_CV_DebugSound;
extern int g_CV_DebugFileAccess;
extern uint32_t sounddebugActiveSounds;
extern uint32_t sounddebugAllocateSoundCalls;
extern uint32_t sounddebugDeallocateSoundCalls;
extern int g_CV_CubicInterpolation;
int g_CV_CubicInterpolation;
#endif
#endif

View file

@ -344,9 +344,9 @@ struct animwalltype
extern struct animwalltype animwall[MAXANIMWALLS];
extern short numanimwalls,probey,lastprobey;
char *mymembuf;
extern char *mymembuf;
extern uint8_t typebuflen;
char typebuf[41];
extern char typebuf[41];
extern uint8_t MusicPtr[72000];
extern int32_t msx[2048],msy[2048];
extern short cyclers[MAXCYCLERS][6],numcyclers;

View file

@ -35,6 +35,8 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
char *mymembuf;
uint8_t MusicPtr[72000];
char **_argv;
int _argc;
crc32_t crc32lookup[] = {
// good:

View file

@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static int miplevel;
float scale_for_mip;
int screenwidth;
//int screenwidth;
int ubasestep, errorterm, erroradjustup, erroradjustdown;
int vstartscan;

View file

@ -89,10 +89,10 @@ extern fixedpoint_t d_sdivzoriginFPM, d_tdivzoriginFPM, d_zioriginFPM;
//Dan: ID Software was already using a minute amount of fixed point. I duplicated
//these just for consistancy in the conversion, and so the types would match.
fixed16_t sadjust, tadjust;
fixed16_t bbextents, bbextentt;
fixedpoint_t sadjustFPM, tadjustFPM;
fixedpoint_t bbextentsFPM, bbextenttFPM;
extern fixed16_t sadjust, tadjust;
extern fixed16_t bbextents, bbextentt;
//fixedpoint_t sadjustFPM, tadjustFPM;
//fixedpoint_t bbextentsFPM, bbextenttFPM;
void D_DrawSpans8 (espan_t *pspans);
@ -110,7 +110,7 @@ void D_DrawSkyScans8 (espan_t *pspan);
void D_DrawSkyScans16 (espan_t *pspan);
void R_ShowSubDiv (void);
void (*prealspandrawer)(void);
// void (*prealspandrawer)(void);
surfcache_t *D_CacheSurface (msurface_t *surface, int miplevel);
extern int D_MipLevelForScale (float scale);

View file

@ -42,12 +42,12 @@ int d_sdivzstepv_fxp, d_tdivzstepv_fxp, d_zistepv_fxp;
int d_sdivzorigin_fxp, d_tdivzorigin_fxp, d_ziorigin_fxp;
#endif
int d_ziorigin_fxp, d_zistepv_fxp, d_zistepu_fxp;
//int d_ziorigin_fxp, d_zistepv_fxp, d_zistepu_fxp;
#ifdef USE_PQ_OPT
//JB: Optimization
int sdivzstepu, tdivzstepu, zistepu;
int sdivzstepv, tdivzstepv, zistepv;
//int sdivzstepu, tdivzstepu, zistepu;
//int sdivzstepv, tdivzstepv, zistepv;
int sdivzorigin, tdivzorigin, ziorigin;
#endif

View file

@ -19,8 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "quakedef.h"
void (*vid_menudrawfn)(void);
void (*vid_menukeyfn)(int key);
//void (*vid_menudrawfn)(void);
//void (*vid_menukeyfn)(int key);
enum {m_none, m_main, m_singleplayer, m_load, m_save, m_multiplayer, m_setup, m_net, m_options, m_video, m_keys, m_help, m_quit, m_serialconfig, m_modemconfig, m_lanconfig, m_gameoptions, m_search, m_slist} m_state;

View file

@ -50,7 +50,7 @@ int scr_fullupdate;
int clearconsole;
int clearnotify;
viddef_t vid; // global video state
//viddef_t vid; // global video state
vrect_t *pconupdate;
vrect_t scr_vrect;