From 6d3f249dcc746cc7845ef88ddb8ce3bcc9221aca Mon Sep 17 00:00:00 2001 From: degasus Date: Tue, 8 Jul 2014 15:58:25 +0200 Subject: [PATCH] mark all local variables as static --- Source/Core/AudioCommon/DPL2Decoder.cpp | 24 ++--- Source/Core/Core/ARDecrypt.cpp | 4 +- Source/Core/Core/Core.cpp | 18 ++-- Source/Core/Core/Core.h | 3 + Source/Core/Core/CoreTiming.cpp | 24 ++--- Source/Core/Core/DSP/DSPCore.cpp | 4 +- Source/Core/Core/DSP/DSPInterpreter.cpp | 2 +- Source/Core/Core/GeckoCode.cpp | 2 +- Source/Core/Core/HLE/HLE_Misc.cpp | 4 +- Source/Core/Core/HW/AudioInterface.cpp | 2 +- Source/Core/Core/HW/DSP.cpp | 4 +- Source/Core/Core/HW/DSPLLE/DSPLLE.cpp | 4 +- Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp | 10 +- Source/Core/Core/HW/DVDInterface.cpp | 8 +- Source/Core/Core/HW/EXI.cpp | 2 +- Source/Core/Core/HW/GCMemcardDirectory.cpp | 2 +- Source/Core/Core/HW/Memmap.cpp | 20 ++-- Source/Core/Core/HW/Memmap.h | 2 + Source/Core/Core/HW/ProcessorInterface.cpp | 8 +- Source/Core/Core/HW/SystemTimers.cpp | 22 ++-- Source/Core/Core/HW/WII_IPC.cpp | 2 +- .../Core/Core/HW/WiimoteReal/WiimoteReal.cpp | 2 +- Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp | 8 +- Source/Core/Core/Movie.cpp | 45 ++++---- Source/Core/Core/NetPlayClient.cpp | 2 +- Source/Core/Core/PatchEngine.cpp | 4 +- Source/Core/Core/PatchEngine.h | 3 + .../Core/PowerPC/Interpreter/Interpreter.cpp | 2 +- Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp | 2 +- Source/Core/Core/PowerPC/PowerPC.cpp | 4 +- Source/Core/Core/Tracer.cpp | 6 +- Source/Core/Core/VolumeHandler.cpp | 2 +- Source/Core/DiscIO/DiscScrubber.cpp | 18 ++-- Source/Core/DiscIO/FileMonitor.cpp | 10 +- Source/Core/DolphinWX/ARCodeAddEdit.cpp | 3 +- Source/Core/DolphinWX/FifoPlayerDlg.cpp | 2 +- Source/Core/DolphinWX/FrameTools.cpp | 2 +- Source/Core/DolphinWX/GLInterface/GLX.cpp | 2 +- Source/Core/DolphinWX/GameListCtrl.cpp | 4 +- Source/Core/DolphinWX/ISOProperties.cpp | 6 +- Source/Core/DolphinWX/ISOProperties.h | 4 + Source/Core/DolphinWX/Main.h | 2 + Source/Core/DolphinWX/PHackSettings.cpp | 2 - Source/Core/DolphinWX/PatchAddEdit.cpp | 2 - Source/Core/DolphinWX/VideoConfigDiag.cpp | 100 +++++++++--------- .../OGL/GLExtensions/GLExtensions.cpp | 8 +- .../VideoBackends/OGL/ProgramShaderCache.cpp | 2 +- Source/Core/VideoBackends/OGL/Render.cpp | 2 +- .../Core/VideoBackends/Software/Clipper.cpp | 6 +- .../VideoBackends/Software/EfbInterface.cpp | 2 +- .../VideoBackends/Software/HwRasterizer.cpp | 8 +- .../VideoBackends/Software/Rasterizer.cpp | 28 ++--- .../Software/SWCommandProcessor.cpp | 16 +-- .../VideoBackends/Software/SWRenderer.cpp | 2 +- Source/Core/VideoCommon/CommandProcessor.cpp | 18 ++-- Source/Core/VideoCommon/DriverDetails.cpp | 12 +-- Source/Core/VideoCommon/HiresTextures.cpp | 2 +- Source/Core/VideoCommon/MainBase.cpp | 4 +- Source/Core/VideoCommon/PixelEngine.cpp | 8 +- Source/Core/VideoCommon/RenderBase.cpp | 6 +- Source/Core/VideoCommon/TextureCacheBase.cpp | 2 +- .../Core/VideoCommon/TextureDecoder_x64.cpp | 4 +- Source/Core/VideoCommon/VertexLoader.h | 9 ++ .../Core/VideoCommon/VertexShaderManager.cpp | 2 +- 64 files changed, 283 insertions(+), 266 deletions(-) diff --git a/Source/Core/AudioCommon/DPL2Decoder.cpp b/Source/Core/AudioCommon/DPL2Decoder.cpp index 883584e650..c82a160b29 100644 --- a/Source/Core/AudioCommon/DPL2Decoder.cpp +++ b/Source/Core/AudioCommon/DPL2Decoder.cpp @@ -23,18 +23,18 @@ #define M_SQRT1_2 0.70710678118654752440 #endif -int olddelay = -1; -unsigned int oldfreq = 0; -unsigned int dlbuflen; -int cyc_pos; -float l_fwr, r_fwr, lpr_fwr, lmr_fwr; -std::vector fwrbuf_l, fwrbuf_r; -float adapt_l_gain, adapt_r_gain, adapt_lpr_gain, adapt_lmr_gain; -std::vector lf, rf, lr, rr, cf, cr; -float LFE_buf[256]; -unsigned int lfe_pos; -float *filter_coefs_lfe; -unsigned int len125; +static int olddelay = -1; +static unsigned int oldfreq = 0; +static unsigned int dlbuflen; +static int cyc_pos; +static float l_fwr, r_fwr, lpr_fwr, lmr_fwr; +static std::vector fwrbuf_l, fwrbuf_r; +static float adapt_l_gain, adapt_r_gain, adapt_lpr_gain, adapt_lmr_gain; +static std::vector lf, rf, lr, rr, cf, cr; +static float LFE_buf[256]; +static unsigned int lfe_pos; +static float *filter_coefs_lfe; +static unsigned int len125; template static _ftype_t dotproduct(int count,const T *buf,const _ftype_t *coefficients) { diff --git a/Source/Core/Core/ARDecrypt.cpp b/Source/Core/Core/ARDecrypt.cpp index 46e456ebc0..74814def85 100644 --- a/Source/Core/Core/ARDecrypt.cpp +++ b/Source/Core/Core/ARDecrypt.cpp @@ -18,9 +18,9 @@ namespace ActionReplay { // Alphanumeric filter for text<->bin conversion -const char *filter = "0123456789ABCDEFGHJKMNPQRTUVWXYZILOS"; +static const char *filter = "0123456789ABCDEFGHJKMNPQRTUVWXYZILOS"; -u32 genseeds[0x20]; +static u32 genseeds[0x20]; const u8 gentable0[0x38] = { 0x39, 0x31, 0x29, 0x21, 0x19, 0x11, 0x09, 0x01, diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index d23436760d..f7221003dd 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -66,9 +66,9 @@ namespace Core { // Declarations and definitions -Common::Timer Timer; -volatile u32 DrawnFrame = 0; -u32 DrawnVideo = 0; +static Common::Timer Timer; +static volatile u32 DrawnFrame = 0; +static u32 DrawnVideo = 0; // Function forwarding const char *Callback_ISOName(void); @@ -77,12 +77,12 @@ void Callback_WiimoteInterruptChannel(int _number, u16 _channelID, const void* _ // Function declarations void EmuThread(); -bool g_bStopping = false; -bool g_bHwInit = false; -bool g_bStarted = false; -void *g_pWindowHandle = nullptr; -std::string g_stateFileName; -std::thread g_EmuThread; +static bool g_bStopping = false; +static bool g_bHwInit = false; +static bool g_bStarted = false; +static void *g_pWindowHandle = nullptr; +static std::string g_stateFileName; +static std::thread g_EmuThread; static StoppedCallbackFunc s_onStoppedCb = nullptr; static std::thread g_cpu_thread; diff --git a/Source/Core/Core/Core.h b/Source/Core/Core/Core.h index 655c5f9301..de16154e8f 100644 --- a/Source/Core/Core/Core.h +++ b/Source/Core/Core/Core.h @@ -17,6 +17,9 @@ #include "Common/CommonTypes.h" #include "Core/CoreParameter.h" +// TODO: ugly, remove +extern bool g_aspect_wide; + namespace Core { diff --git a/Source/Core/Core/CoreTiming.cpp b/Source/Core/Core/CoreTiming.cpp index 5ebb4d84c4..01e6f171a3 100644 --- a/Source/Core/Core/CoreTiming.cpp +++ b/Source/Core/Core/CoreTiming.cpp @@ -27,7 +27,7 @@ struct EventType std::string name; }; -std::vector event_types; +static std::vector event_types; struct BaseEvent { @@ -41,26 +41,26 @@ typedef LinkedListItem Event; // STATE_TO_SAVE static Event *first; static std::mutex tsWriteLock; -Common::FifoQueue tsQueue; +static Common::FifoQueue tsQueue; // event pools -Event *eventPool = nullptr; +static Event *eventPool = nullptr; int slicelength; -int maxSliceLength = MAX_SLICE_LENGTH; +static int maxSliceLength = MAX_SLICE_LENGTH; -s64 globalTimer; -s64 idledCycles; +static s64 globalTimer; +static s64 idledCycles; -u32 fakeDecStartValue; -u64 fakeDecStartTicks; -u64 fakeTBStartValue; -u64 fakeTBStartTicks; +static u32 fakeDecStartValue; +static u64 fakeDecStartTicks; +static u64 fakeTBStartValue; +static u64 fakeTBStartTicks; -int ev_lost; +static int ev_lost; -void (*advanceCallback)(int cyclesExecuted) = nullptr; +static void (*advanceCallback)(int cyclesExecuted) = nullptr; static Event* GetNewEvent() { diff --git a/Source/Core/Core/DSP/DSPCore.cpp b/Source/Core/Core/DSP/DSPCore.cpp index dfa483ce47..c85fde78d4 100644 --- a/Source/Core/Core/DSP/DSPCore.cpp +++ b/Source/Core/Core/DSP/DSPCore.cpp @@ -38,12 +38,12 @@ SDSP g_dsp; DSPBreakpoints dsp_breakpoints; -DSPCoreState core_state = DSPCORE_STOP; +static DSPCoreState core_state = DSPCORE_STOP; u16 cyclesLeft = 0; bool init_hax = false; DSPEmitter *dspjit = nullptr; std::unique_ptr g_dsp_cap; -Common::Event step_event; +static Common::Event step_event; // Returns false if the hash fails and the user hits "Yes" static bool VerifyRoms() diff --git a/Source/Core/Core/DSP/DSPInterpreter.cpp b/Source/Core/Core/DSP/DSPInterpreter.cpp index 4898dbe924..89b300c545 100644 --- a/Source/Core/Core/DSP/DSPInterpreter.cpp +++ b/Source/Core/Core/DSP/DSPInterpreter.cpp @@ -31,7 +31,7 @@ namespace DSPInterpreter { -volatile u32 gdsp_running; +static volatile u32 gdsp_running; // NOTE: These have nothing to do with g_dsp.r.cr ! diff --git a/Source/Core/Core/GeckoCode.cpp b/Source/Core/Core/GeckoCode.cpp index cfb3da29e3..dd0c6c5b3d 100644 --- a/Source/Core/Core/GeckoCode.cpp +++ b/Source/Core/Core/GeckoCode.cpp @@ -45,7 +45,7 @@ bool GeckoCode::Compare(GeckoCode compare) const static bool code_handler_installed = false; // the currently active codes -std::vector active_codes; +static std::vector active_codes; static std::mutex active_codes_lock; void SetActiveCodes(const std::vector& gcodes) diff --git a/Source/Core/Core/HLE/HLE_Misc.cpp b/Source/Core/Core/HLE/HLE_Misc.cpp index 8d552232d9..c3f2e6dbca 100644 --- a/Source/Core/Core/HLE/HLE_Misc.cpp +++ b/Source/Core/Core/HLE/HLE_Misc.cpp @@ -30,8 +30,8 @@ namespace HLE_Misc { -std::string args; -u32 argsPtr; +static std::string args; +static u32 argsPtr; // If you just want to kill a function, one of the three following are usually appropriate. // According to the PPC ABI, the return value is always in r3. diff --git a/Source/Core/Core/HW/AudioInterface.cpp b/Source/Core/Core/HW/AudioInterface.cpp index 2b9746dbc8..0b8b5ea792 100644 --- a/Source/Core/Core/HW/AudioInterface.cpp +++ b/Source/Core/Core/HW/AudioInterface.cpp @@ -147,7 +147,7 @@ static void GenerateAudioInterrupt(); static void UpdateInterrupts(); static void IncreaseSampleCount(const u32 _uAmount); static u64 GetAIPeriod(); -int et_AI; +static int et_AI; void Init() { diff --git a/Source/Core/Core/HW/DSP.cpp b/Source/Core/Core/HW/DSP.cpp index e5ede8930d..23bf23cf3b 100644 --- a/Source/Core/Core/HW/DSP.cpp +++ b/Source/Core/Core/HW/DSP.cpp @@ -175,7 +175,7 @@ static ARAM_Info g_ARAM_Info; static u16 g_AR_MODE; static u16 g_AR_REFRESH; -DSPEmulator *dsp_emulator; +static DSPEmulator *dsp_emulator; static int dsp_slice = 0; static bool dsp_is_lle = false; @@ -205,7 +205,7 @@ void WriteARAM(u8 _iValue, u32 _iAddress); bool Update_DSP_ReadRegister(); void Update_DSP_WriteRegister(); -int et_GenerateDSPInterrupt; +static int et_GenerateDSPInterrupt; static void GenerateDSPInterrupt_Wrapper(u64 userdata, int cyclesLate) { diff --git a/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp b/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp index 6d8d322b51..26a12a98da 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp +++ b/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp @@ -37,8 +37,8 @@ DSPLLE::DSPLLE() m_cycle_count = 0; } -Common::Event dspEvent; -Common::Event ppcEvent; +static Common::Event dspEvent; +static Common::Event ppcEvent; void DSPLLE::DoState(PointerWrap &p) { diff --git a/Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp b/Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp index f89326a148..d8356ba8f6 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp +++ b/Source/Core/Core/HW/DSPLLE/DSPSymbols.cpp @@ -20,11 +20,11 @@ namespace DSPSymbols DSPSymbolDB g_dsp_symbol_db; -std::map addr_to_line; -std::map line_to_addr; -std::map line_to_symbol; -std::vector lines; -int line_counter = 0; +static std::map addr_to_line; +static std::map line_to_addr; +static std::map line_to_symbol; +static std::vector lines; +static int line_counter = 0; int Addr2Line(u16 address) // -1 for not found { diff --git a/Source/Core/Core/HW/DVDInterface.cpp b/Source/Core/Core/HW/DVDInterface.cpp index 120f7455de..7e4ebf5919 100644 --- a/Source/Core/Core/HW/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVDInterface.cpp @@ -206,11 +206,11 @@ static u32 CurrentStart; static u32 LoopLength; static u32 CurrentLength; -u32 g_ErrorCode = 0; -bool g_bDiscInside = false; +static u32 g_ErrorCode = 0; +static bool g_bDiscInside = false; bool g_bStream = false; -int tc = 0; -int dtk = 0; +static int tc = 0; +static int dtk = 0; static u64 g_last_read_offset; static u64 g_last_read_time; diff --git a/Source/Core/Core/HW/EXI.cpp b/Source/Core/Core/HW/EXI.cpp index cbbeff1bf1..a32f6cd972 100644 --- a/Source/Core/Core/HW/EXI.cpp +++ b/Source/Core/Core/HW/EXI.cpp @@ -21,7 +21,7 @@ namespace ExpansionInterface static int changeDevice; -CEXIChannel *g_Channels[MAX_EXI_CHANNELS]; +static CEXIChannel *g_Channels[MAX_EXI_CHANNELS]; void Init() { initSRAM(); diff --git a/Source/Core/Core/HW/GCMemcardDirectory.cpp b/Source/Core/Core/HW/GCMemcardDirectory.cpp index d223402354..13fec8b185 100644 --- a/Source/Core/Core/HW/GCMemcardDirectory.cpp +++ b/Source/Core/Core/HW/GCMemcardDirectory.cpp @@ -10,7 +10,7 @@ #include "DiscIO/Volume.h" const int NO_INDEX = -1; -const char *MC_HDR = "MC_SYSTEM_AREA"; +static const char *MC_HDR = "MC_SYSTEM_AREA"; int GCMemcardDirectory::LoadGCI(std::string fileName, int region) { File::IOFile gcifile(fileName, "rb"); diff --git a/Source/Core/Core/HW/Memmap.cpp b/Source/Core/Core/HW/Memmap.cpp index ce8bfd1fc1..707dac1fb1 100644 --- a/Source/Core/Core/HW/Memmap.cpp +++ b/Source/Core/Core/HW/Memmap.cpp @@ -46,7 +46,7 @@ namespace Memory /* Enable the Translation Lookaside Buffer functions. TLBHack = 1 in Dolphin.ini or a .ini file will set this to true */ bool bFakeVMEM = false; -bool bMMU = false; +static bool bMMU = false; // ============== @@ -57,11 +57,11 @@ bool bMMU = false; u8* base = nullptr; // The MemArena class -MemArena g_arena; +static MemArena g_arena; // ============== // STATE_TO_SAVE -bool m_IsInitialized = false; // Save the Init(), Shutdown() state +static bool m_IsInitialized = false; // Save the Init(), Shutdown() state // END STATE_TO_SAVE // 64-bit: Pointers to low-mem (sub-0x10000000) mirror @@ -74,14 +74,14 @@ u8 *m_pFakeVMEM; // 64-bit: Pointers to high-mem mirrors // 32-bit: Same as above -u8 *m_pPhysicalRAM; -u8 *m_pVirtualCachedRAM; -u8 *m_pVirtualUncachedRAM; -u8 *m_pPhysicalEXRAM; // wii only -u8 *m_pVirtualCachedEXRAM; // wii only -u8 *m_pVirtualUncachedEXRAM; // wii only +static u8 *m_pPhysicalRAM; +static u8 *m_pVirtualCachedRAM; +static u8 *m_pVirtualUncachedRAM; +static u8 *m_pPhysicalEXRAM; // wii only +static u8 *m_pVirtualCachedEXRAM; // wii only +static u8 *m_pVirtualUncachedEXRAM; // wii only //u8 *m_pVirtualEFB; -u8 *m_pVirtualL1Cache; +static u8 *m_pVirtualL1Cache; u8 *m_pVirtualFakeVMEM; // MMIO mapping object. diff --git a/Source/Core/Core/HW/Memmap.h b/Source/Core/Core/HW/Memmap.h index 084674d7d1..c40d0b2e82 100644 --- a/Source/Core/Core/HW/Memmap.h +++ b/Source/Core/Core/HW/Memmap.h @@ -46,6 +46,8 @@ extern u8 *m_pRAM; extern u8 *m_pEXRAM; extern u8 *m_pL1Cache; extern u8 *m_pVirtualFakeVMEM; +extern u8 *m_pFakeVMEM; +extern bool bFakeVMEM; enum { diff --git a/Source/Core/Core/HW/ProcessorInterface.cpp b/Source/Core/Core/HW/ProcessorInterface.cpp index 13cdabffd4..46aac4e007 100644 --- a/Source/Core/Core/HW/ProcessorInterface.cpp +++ b/Source/Core/Core/HW/ProcessorInterface.cpp @@ -43,10 +43,10 @@ u32 Fifo_CPUBase; u32 Fifo_CPUEnd; u32 Fifo_CPUWritePointer; -u32 m_Fifo_Reset; -u32 m_ResetCode; -u32 m_FlipperRev; -u32 m_Unknown; +static u32 m_Fifo_Reset; +static u32 m_ResetCode; +static u32 m_FlipperRev; +static u32 m_Unknown; // ID and callback for scheduling reset button presses/releases diff --git a/Source/Core/Core/HW/SystemTimers.cpp b/Source/Core/Core/HW/SystemTimers.cpp index d8b6adab0c..2099397be4 100644 --- a/Source/Core/Core/HW/SystemTimers.cpp +++ b/Source/Core/Core/HW/SystemTimers.cpp @@ -82,7 +82,7 @@ IPC_HLE_PERIOD: For the Wiimote this is the call schedule: namespace SystemTimers { -u32 CPU_CORE_CLOCK = 486000000u; // 486 mhz (its not 485, stop bugging me!) +static u32 CPU_CORE_CLOCK = 486000000u; // 486 mhz (its not 485, stop bugging me!) /* GameCube MHz @@ -109,19 +109,19 @@ enum TIMER_RATIO = 12 }; -int et_Dec; -int et_VI; -int et_SI; -int et_CP; -int et_AudioDMA; -int et_DSP; -int et_IPC_HLE; -int et_PatchEngine; // PatchEngine updates every 1/60th of a second by default -int et_Throttle; +static int et_Dec; +static int et_VI; +static int et_SI; +static int et_CP; +static int et_AudioDMA; +static int et_DSP; +static int et_IPC_HLE; +static int et_PatchEngine; // PatchEngine updates every 1/60th of a second by default +static int et_Throttle; // These are badly educated guesses // Feel free to experiment. Set these in Init below. -int +static int // This is a fixed value, don't change it AUDIO_DMA_PERIOD, diff --git a/Source/Core/Core/HW/WII_IPC.cpp b/Source/Core/Core/HW/WII_IPC.cpp index efbe44d770..8b1c855513 100644 --- a/Source/Core/Core/HW/WII_IPC.cpp +++ b/Source/Core/Core/HW/WII_IPC.cpp @@ -101,7 +101,7 @@ static u32 arm_irq_masks; static u32 sensorbar_power; // do we need to care about this? -int updateInterrupts; +static int updateInterrupts; void DoState(PointerWrap &p) { diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp index 74546e9548..177a0ee3c7 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp @@ -29,7 +29,7 @@ void TryToConnectWiimote(Wiimote*); void HandleWiimoteDisconnect(int index); void DoneWithWiimote(int index); -bool g_real_wiimotes_initialized = false; +static bool g_real_wiimotes_initialized = false; std::recursive_mutex g_refresh_lock; diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp index 7e2e586e87..9c1fb7670a 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp @@ -61,16 +61,16 @@ namespace WII_IPC_HLE_Interface { typedef std::map TDeviceMap; -TDeviceMap g_DeviceMap; +static TDeviceMap g_DeviceMap; // STATE_TO_SAVE typedef std::map TFileNameMap; #define IPC_MAX_FDS 0x18 #define ES_MAX_COUNT 2 -IWII_IPC_HLE_Device* g_FdMap[IPC_MAX_FDS]; -bool es_inuse[ES_MAX_COUNT]; -IWII_IPC_HLE_Device* es_handles[ES_MAX_COUNT]; +static IWII_IPC_HLE_Device* g_FdMap[IPC_MAX_FDS]; +static bool es_inuse[ES_MAX_COUNT]; +static IWII_IPC_HLE_Device* es_handles[ES_MAX_COUNT]; typedef std::deque ipc_msg_queue; diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index 29eb3308ce..7f4f1c111c 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -35,12 +35,12 @@ // The chunk to allocate movie data in multiples of. #define DTM_BASE_LENGTH (1024) -std::mutex cs_frameSkip; +static std::mutex cs_frameSkip; namespace Movie { bool g_bFrameStep = false; -bool g_bFrameStop = false; +static bool g_bFrameStop = false; bool g_bReadOnly = true; u32 g_rerecords = 0; PlayMode g_playMode = MODE_NONE; @@ -48,39 +48,40 @@ PlayMode g_playMode = MODE_NONE; u32 g_framesToSkip = 0, g_frameSkipCounter = 0; u8 g_numPads = 0; -ControllerState g_padState; -DTMHeader tmpHeader; -u8* tmpInput = nullptr; -size_t tmpInputAllocated = 0; +static ControllerState g_padState; +static DTMHeader tmpHeader; +static u8* tmpInput = nullptr; +static size_t tmpInputAllocated = 0; u64 g_currentByte = 0, g_totalBytes = 0; u64 g_currentFrame = 0, g_totalFrames = 0; // VI u64 g_currentLagCount = 0, g_totalLagCount = 0; // just stats u64 g_currentInputCount = 0, g_totalInputCount = 0; // just stats u64 g_totalTickCount = 0, g_tickCountAtLastInput = 0; // just stats -u64 g_recordingStartTime; // seconds since 1970 that recording started -bool bSaveConfig = false, bSkipIdle = false, bDualCore = false, bProgressive = false, bDSPHLE = false, bFastDiscSpeed = false; -bool g_bClearSave = false, bSyncGPU = false, bNetPlay = false; -std::string videoBackend = "unknown"; -int iCPUCore = 1; +static u64 g_recordingStartTime; // seconds since 1970 that recording started +static bool bSaveConfig = false, bSkipIdle = false, bDualCore = false, bProgressive = false, bDSPHLE = false, bFastDiscSpeed = false; +bool g_bClearSave = false; +static bool bSyncGPU = false, bNetPlay = false; +static std::string videoBackend = "unknown"; +static int iCPUCore = 1; bool g_bDiscChange = false; std::string g_discChange = ""; -std::string author = ""; +static std::string author = ""; u64 g_titleID = 0; -unsigned char MD5[16]; -u8 bongos, memcards; -u8 revision[20]; -u32 DSPiromHash = 0; -u32 DSPcoefHash = 0; +static unsigned char MD5[16]; +static u8 bongos, memcards; +static u8 revision[20]; +static u32 DSPiromHash = 0; +static u32 DSPcoefHash = 0; -bool g_bRecordingFromSaveState = false; +static bool g_bRecordingFromSaveState = false; bool g_bPolled = false; -int g_currentSaveVersion = 0; +static int g_currentSaveVersion = 0; -std::string tmpStateFilename = File::GetUserPath(D_STATESAVES_IDX) + "dtm.sav"; +static std::string tmpStateFilename = File::GetUserPath(D_STATESAVES_IDX) + "dtm.sav"; -std::string g_InputDisplay[8]; +static std::string g_InputDisplay[8]; -ManipFunction mfunc = nullptr; +static ManipFunction mfunc = nullptr; static void EnsureTmpInputSize(size_t bound) { diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 84eeb72565..f6087db050 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -17,7 +17,7 @@ #include "Core/IPC_HLE/WII_IPC_HLE_WiiMote.h" -std::mutex crit_netplay_client; +static std::mutex crit_netplay_client; static NetPlayClient * netplay_client = nullptr; NetSettings g_NetPlaySettings; diff --git a/Source/Core/Core/PatchEngine.cpp b/Source/Core/Core/PatchEngine.cpp index 8de5c5db51..402c91ca18 100644 --- a/Source/Core/Core/PatchEngine.cpp +++ b/Source/Core/Core/PatchEngine.cpp @@ -43,8 +43,8 @@ const char *PatchTypeStrings[] = "dword", }; -std::vector onFrame; -std::map speedHacks; +static std::vector onFrame; +static std::map speedHacks; void LoadPatchSection(const std::string& section, std::vector& patches, IniFile& globalIni, IniFile& localIni) { diff --git a/Source/Core/Core/PatchEngine.h b/Source/Core/Core/PatchEngine.h index 2eb08fcc31..4c36bca82e 100644 --- a/Source/Core/Core/PatchEngine.h +++ b/Source/Core/Core/PatchEngine.h @@ -5,6 +5,8 @@ #pragma once #include +#include + #include "Common/IniFile.h" namespace PatchEngine @@ -65,3 +67,4 @@ inline int GetPatchTypeCharLength(PatchType type) } } // namespace +extern std::vector onFrame; diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp index e5247f12be..a82d7bcc82 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp @@ -65,7 +65,7 @@ static void patches() }*/ } -int startTrace = 0; +static int startTrace = 0; static void Trace(UGeckoInstruction& instCode) { diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp index 8c58ae6418..cbba470354 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp +++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp @@ -221,7 +221,7 @@ namespace JitILProfiler } } }; - std::unique_ptr finalizer; + static std::unique_ptr finalizer; static void Init() { finalizer = std::make_unique(); diff --git a/Source/Core/Core/PowerPC/PowerPC.cpp b/Source/Core/Core/PowerPC/PowerPC.cpp index b80d2c57c1..caa7f02eb5 100644 --- a/Source/Core/Core/PowerPC/PowerPC.cpp +++ b/Source/Core/Core/PowerPC/PowerPC.cpp @@ -30,10 +30,10 @@ namespace PowerPC // STATE_TO_SAVE PowerPCState GC_ALIGNED16(ppcState); -volatile CPUState state = CPU_STEPPING; +static volatile CPUState state = CPU_STEPPING; Interpreter * const interpreter = Interpreter::getInstance(); -CoreMode mode; +static CoreMode mode; BreakPoints breakpoints; MemChecks memchecks; diff --git a/Source/Core/Core/Tracer.cpp b/Source/Core/Core/Tracer.cpp index 0a6e1068b1..5418a24994 100644 --- a/Source/Core/Core/Tracer.cpp +++ b/Source/Core/Core/Tracer.cpp @@ -14,10 +14,10 @@ namespace Core { -File::IOFile tracefile; +static File::IOFile tracefile; -bool bReadTrace = false; -bool bWriteTrace = false; +static bool bReadTrace = false; +static bool bWriteTrace = false; void StartTrace(bool write) { diff --git a/Source/Core/Core/VolumeHandler.cpp b/Source/Core/Core/VolumeHandler.cpp index 5f48545daf..e0b58cd8ae 100644 --- a/Source/Core/Core/VolumeHandler.cpp +++ b/Source/Core/Core/VolumeHandler.cpp @@ -8,7 +8,7 @@ namespace VolumeHandler { -DiscIO::IVolume* g_pVolume = nullptr; +static DiscIO::IVolume* g_pVolume = nullptr; DiscIO::IVolume *GetVolume() { diff --git a/Source/Core/DiscIO/DiscScrubber.cpp b/Source/Core/DiscIO/DiscScrubber.cpp index 69d98ff046..77936d16b4 100644 --- a/Source/Core/DiscIO/DiscScrubber.cpp +++ b/Source/Core/DiscIO/DiscScrubber.cpp @@ -24,15 +24,15 @@ namespace DiscScrubber #define CLUSTER_SIZE 0x8000 -u8* m_FreeTable = nullptr; -u64 m_FileSize; -u64 m_BlockCount; -u32 m_BlockSize; -int m_BlocksPerCluster; -bool m_isScrubbing = false; +static u8* m_FreeTable = nullptr; +static u64 m_FileSize; +static u64 m_BlockCount; +static u32 m_BlockSize; +static int m_BlocksPerCluster; +static bool m_isScrubbing = false; -std::string m_Filename; -IVolume* m_Disc = nullptr; +static std::string m_Filename; +static IVolume* m_Disc = nullptr; struct SPartitionHeader { @@ -67,7 +67,7 @@ struct SPartitionGroup u64 PartitionsOffset; std::vector PartitionsVec; }; -SPartitionGroup PartitionGroup[4]; +static SPartitionGroup PartitionGroup[4]; void MarkAsUsed(u64 _Offset, u64 _Size); diff --git a/Source/Core/DiscIO/FileMonitor.cpp b/Source/Core/DiscIO/FileMonitor.cpp index dba7c9ff74..ce8799b227 100644 --- a/Source/Core/DiscIO/FileMonitor.cpp +++ b/Source/Core/DiscIO/FileMonitor.cpp @@ -25,11 +25,11 @@ namespace FileMon { -DiscIO::IVolume *OpenISO = nullptr; -DiscIO::IFileSystem *pFileSystem = nullptr; -std::vector GCFiles; -std::string ISOFile = "", CurrentFile = ""; -bool FileAccess = true; +static DiscIO::IVolume *OpenISO = nullptr; +static DiscIO::IFileSystem *pFileSystem = nullptr; +static std::vector GCFiles; +static std::string ISOFile = "", CurrentFile = ""; +static bool FileAccess = true; // Filtered files bool IsSoundFile(const std::string& filename) diff --git a/Source/Core/DolphinWX/ARCodeAddEdit.cpp b/Source/Core/DolphinWX/ARCodeAddEdit.cpp index d821de79bb..6bcfc4fe8d 100644 --- a/Source/Core/DolphinWX/ARCodeAddEdit.cpp +++ b/Source/Core/DolphinWX/ARCodeAddEdit.cpp @@ -25,12 +25,11 @@ #include "Core/ActionReplay.h" #include "Core/ARDecrypt.h" #include "DolphinWX/ARCodeAddEdit.h" +#include "DolphinWX/ISOProperties.h" #include "DolphinWX/WxUtils.h" class wxWindow; -extern std::vector arCodes; - BEGIN_EVENT_TABLE(CARCodeAddEdit, wxDialog) EVT_BUTTON(wxID_OK, CARCodeAddEdit::SaveCheatData) EVT_SPIN(ID_ENTRY_SELECT, CARCodeAddEdit::ChangeEntry) diff --git a/Source/Core/DolphinWX/FifoPlayerDlg.cpp b/Source/Core/DolphinWX/FifoPlayerDlg.cpp index aa5eacc2cc..e3aea78148 100644 --- a/Source/Core/DolphinWX/FifoPlayerDlg.cpp +++ b/Source/Core/DolphinWX/FifoPlayerDlg.cpp @@ -52,7 +52,7 @@ DEFINE_EVENT_TYPE(FRAME_WRITTEN_EVENT) using namespace std; -std::recursive_mutex sMutex; +static std::recursive_mutex sMutex; wxEvtHandler *volatile FifoPlayerDlg::m_EvtHandler = nullptr; FifoPlayerDlg::FifoPlayerDlg(wxWindow * const parent) : diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 7cd29d7ef5..b33cd4bab1 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -119,7 +119,7 @@ extern "C" { class InputPlugin; class wxFrame; -bool confirmStop = false; +static bool confirmStop = false; // Create menu items // --------------------- diff --git a/Source/Core/DolphinWX/GLInterface/GLX.cpp b/Source/Core/DolphinWX/GLInterface/GLX.cpp index 0994320e6b..8c9005bd81 100644 --- a/Source/Core/DolphinWX/GLInterface/GLX.cpp +++ b/Source/Core/DolphinWX/GLInterface/GLX.cpp @@ -12,7 +12,7 @@ #include "VideoCommon/VideoConfig.h" typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); -PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = nullptr; +static PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = nullptr; // Show the current FPS void cInterfaceGLX::UpdateFPSDisplay(const std::string& text) diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index e9e7764cb2..33eb8cf3f7 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -82,7 +82,7 @@ size_t CGameListCtrl::m_currentItem = 0; size_t CGameListCtrl::m_numberItem = 0; std::string CGameListCtrl::m_currentFilename; -bool sorted = false; +static bool sorted = false; extern CFrame* main_frame; @@ -657,7 +657,7 @@ const GameListItem *CGameListCtrl::GetISO(size_t index) const return nullptr; } -CGameListCtrl *caller; +static CGameListCtrl *caller; static int wxCALLBACK wxListCompare(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData) { // return 1 if item1 > item2 diff --git a/Source/Core/DolphinWX/ISOProperties.cpp b/Source/Core/DolphinWX/ISOProperties.cpp index c801ac0244..0593fd9c1f 100644 --- a/Source/Core/DolphinWX/ISOProperties.cpp +++ b/Source/Core/DolphinWX/ISOProperties.cpp @@ -87,10 +87,10 @@ struct WiiPartition DiscIO::IFileSystem *FileSystem; std::vector Files; }; -std::vector WiiDisc; +static std::vector WiiDisc; -DiscIO::IVolume *OpenISO = nullptr; -DiscIO::IFileSystem *pFileSystem = nullptr; +static DiscIO::IVolume *OpenISO = nullptr; +static DiscIO::IFileSystem *pFileSystem = nullptr; std::vector onFrame; std::vector arCodes; diff --git a/Source/Core/DolphinWX/ISOProperties.h b/Source/Core/DolphinWX/ISOProperties.h index 5db5af8810..4596d7de43 100644 --- a/Source/Core/DolphinWX/ISOProperties.h +++ b/Source/Core/DolphinWX/ISOProperties.h @@ -19,6 +19,7 @@ #include #include "Common/IniFile.h" +#include "Core/ActionReplay.h" class GameListItem; class wxButton; @@ -32,6 +33,8 @@ class wxWindow; namespace DiscIO { struct SFileInfo; } namespace Gecko { class CodeConfigPanel; } +extern std::vector arCodes; + struct PHackData { bool PHackSZNear; @@ -39,6 +42,7 @@ struct PHackData std::string PHZNear; std::string PHZFar; }; +extern PHackData PHack_Data; class CISOProperties : public wxDialog { diff --git a/Source/Core/DolphinWX/Main.h b/Source/Core/DolphinWX/Main.h index 80c6f6db50..3d07046a50 100644 --- a/Source/Core/DolphinWX/Main.h +++ b/Source/Core/DolphinWX/Main.h @@ -15,6 +15,8 @@ class wxLocale; class wxTimer; class wxTimerEvent; +extern CFrame* main_frame; + // Define a new application class DolphinApp : public wxApp { diff --git a/Source/Core/DolphinWX/PHackSettings.cpp b/Source/Core/DolphinWX/PHackSettings.cpp index af20038ef5..f5267d197e 100644 --- a/Source/Core/DolphinWX/PHackSettings.cpp +++ b/Source/Core/DolphinWX/PHackSettings.cpp @@ -26,8 +26,6 @@ class wxWindow; -extern PHackData PHack_Data; - BEGIN_EVENT_TABLE(CPHackSettings, wxDialog) EVT_CHOICE(ID_PHACK_CHOICE, CPHackSettings::SetRefresh) EVT_BUTTON(wxID_OK, CPHackSettings::SavePHackData) diff --git a/Source/Core/DolphinWX/PatchAddEdit.cpp b/Source/Core/DolphinWX/PatchAddEdit.cpp index 2dd3454d77..30242b6b0f 100644 --- a/Source/Core/DolphinWX/PatchAddEdit.cpp +++ b/Source/Core/DolphinWX/PatchAddEdit.cpp @@ -29,8 +29,6 @@ class wxWindow; -extern std::vector onFrame; - BEGIN_EVENT_TABLE(CPatchAddEdit, wxDialog) EVT_BUTTON(wxID_OK, CPatchAddEdit::SavePatchData) EVT_BUTTON(ID_ENTRY_ADD, CPatchAddEdit::AddRemoveEntry) diff --git a/Source/Core/DolphinWX/VideoConfigDiag.cpp b/Source/Core/DolphinWX/VideoConfigDiag.cpp index 2490a5c286..6b74a54f66 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/VideoConfigDiag.cpp @@ -93,60 +93,60 @@ void VideoConfigDiag::Event_Close(wxCloseEvent& ev) } #if defined(_WIN32) -wxString backend_desc = wxTRANSLATE("Selects what graphics API to use internally.\nThe software renderer is only used for debugging, so you'll want to use either Direct3D or OpenGL. Different games will behave differently on each backend, so for best emulation experience it's recommended to try both and chose the one that fits your requirements best.\nNote that the Direct3D backend is not available on old Windows versions.\n\nIf unsure, use OpenGL."); +static wxString backend_desc = wxTRANSLATE("Selects what graphics API to use internally.\nThe software renderer is only used for debugging, so you'll want to use either Direct3D or OpenGL. Different games will behave differently on each backend, so for best emulation experience it's recommended to try both and chose the one that fits your requirements best.\nNote that the Direct3D backend is not available on old Windows versions.\n\nIf unsure, use OpenGL."); #else -wxString backend_desc = wxTRANSLATE("Selects what graphics API to use internally.\nThe software renderer is only used for debugging, so unless you have a reason to use it you'll want to select OpenGL here.\n\nIf unsure, use OpenGL."); +static wxString backend_desc = wxTRANSLATE("Selects what graphics API to use internally.\nThe software renderer is only used for debugging, so unless you have a reason to use it you'll want to select OpenGL here.\n\nIf unsure, use OpenGL."); #endif -wxString adapter_desc = wxTRANSLATE("Select a hardware adapter to use.\n\nIf unsure, use the first one."); -wxString display_res_desc = wxTRANSLATE("Selects the display resolution used in fullscreen mode.\nThis should always be bigger than or equal to the internal resolution. Performance impact is negligible.\n\nIf unsure, use your desktop resolution.\nIf still unsure, use the highest resolution which works for you."); -wxString use_fullscreen_desc = wxTRANSLATE("Enable this if you want the whole screen to be used for rendering.\nIf this is disabled, a render window will be created instead.\n\nIf unsure, leave this unchecked."); -wxString auto_window_size_desc = wxTRANSLATE("Automatically adjusts the window size to your internal resolution.\n\nIf unsure, leave this unchecked."); -wxString keep_window_on_top_desc = wxTRANSLATE("Keep the game window on top of all other windows.\n\nIf unsure, leave this unchecked."); -wxString hide_mouse_cursor_desc = wxTRANSLATE("Hides the mouse cursor if it's on top of the emulation window.\n\nIf unsure, leave this checked."); -wxString render_to_main_win_desc = wxTRANSLATE("Enable this if you want to use the main Dolphin window for rendering rather than a separate render window.\n\nIf unsure, leave this unchecked."); -wxString prog_scan_desc = wxTRANSLATE("Enables progressive scan if supported by the emulated software.\nMost games don't care about this.\n\nIf unsure, leave this unchecked."); -wxString ar_desc = wxTRANSLATE("Select what aspect ratio to use when rendering:\nAuto: Use the native aspect ratio\nForce 16:9: Stretch the picture to an aspect ratio of 16:9.\nForce 4:3: Stretch the picture to an aspect ratio of 4:3.\nStretch to Window: Stretch the picture to the window size.\n\nIf unsure, select Auto."); -wxString ws_hack_desc = wxTRANSLATE("Force the game to output graphics for widescreen resolutions.\nCauses graphical glitches is some games.\n\nIf unsure, leave this unchecked."); -wxString vsync_desc = wxTRANSLATE("Wait for vertical blanks in order to reduce tearing.\nDecreases performance if emulation speed is below 100%.\n\nIf unsure, leave this unchecked."); -wxString af_desc = wxTRANSLATE("Enable anisotropic filtering.\nEnhances visual quality of textures that are at oblique viewing angles.\nMight cause issues in a small number of games.\n\nIf unsure, select 1x."); -wxString aa_desc = wxTRANSLATE("Reduces the amount of aliasing caused by rasterizing 3D graphics.\nThis makes the rendered picture look less blocky.\nHeavily decreases emulation speed and sometimes causes issues.\n\nIf unsure, select None."); -wxString scaled_efb_copy_desc = wxTRANSLATE("Greatly increases quality of textures generated using render to texture effects.\nRaising the internal resolution will improve the effect of this setting.\nSlightly decreases performance and possibly causes issues (although unlikely).\n\nIf unsure, leave this checked."); -wxString pixel_lighting_desc = wxTRANSLATE("Calculate lighting of 3D graphics per-pixel rather than per vertex.\nDecreases emulation speed by some percent (depending on your GPU).\nThis usually is a safe enhancement, but might cause issues sometimes.\n\nIf unsure, leave this unchecked."); -wxString fast_depth_calc_desc = wxTRANSLATE("Use a less accurate algorithm to calculate depth values.\nCauses issues in a few games but might give a decent speedup.\n\nIf unsure, leave this checked."); -wxString force_filtering_desc = wxTRANSLATE("Force texture filtering even if the emulated game explicitly disabled it.\nImproves texture quality slightly but causes glitches in some games.\n\nIf unsure, leave this unchecked."); -wxString _3d_vision_desc = wxTRANSLATE("Enable 3D effects via stereoscopy using Nvidia 3D Vision technology if it's supported by your GPU.\nPossibly causes issues.\nRequires fullscreen to work.\n\nIf unsure, leave this unchecked."); -wxString internal_res_desc = wxTRANSLATE("Specifies the resolution used to render at. A high resolution will improve visual quality a lot but is also quite heavy on performance and might cause glitches in certain games.\n\"Multiple of 640x528\" is a bit slower than \"Window Size\" but yields less issues. Generally speaking, the lower the internal resolution is, the better your performance will be.\n\nIf unsure, select 640x528."); -wxString efb_access_desc = wxTRANSLATE("Ignore any requests of the CPU to read from or write to the EFB.\nImproves performance in some games, but might disable some gameplay-related features or graphical effects.\n\nIf unsure, leave this unchecked."); -wxString efb_emulate_format_changes_desc = wxTRANSLATE("Ignore any changes to the EFB format.\nImproves performance in many games without any negative effect. Causes graphical defects in a small number of other games though.\n\nIf unsure, leave this checked."); -wxString efb_copy_desc = wxTRANSLATE("Disable emulation of EFB copies.\nThese are often used for post-processing or render-to-texture effects, so while checking this setting gives a great speedup it almost always also causes issues.\n\nIf unsure, leave this unchecked."); -wxString efb_copy_texture_desc = wxTRANSLATE("Store EFB copies in GPU texture objects.\nThis is not so accurate, but it works well enough for most games and gives a great speedup over EFB to RAM.\n\nIf unsure, leave this checked."); -wxString efb_copy_ram_desc = wxTRANSLATE("Accurately emulate EFB copies.\nSome games depend on this for certain graphical effects or gameplay functionality.\n\nIf unsure, check EFB to Texture instead."); -wxString stc_desc = wxTRANSLATE("The safer you adjust this, the less likely the emulator will be missing any texture updates from RAM.\n\nIf unsure, use the rightmost value."); -wxString wireframe_desc = wxTRANSLATE("Render the scene as a wireframe.\n\nIf unsure, leave this unchecked."); -wxString disable_fog_desc = wxTRANSLATE("Makes distant objects more visible by removing fog, thus increasing the overall detail.\nDisabling fog will break some games which rely on proper fog emulation.\n\nIf unsure, leave this unchecked."); -wxString disable_dstalpha_desc = wxTRANSLATE("Disables emulation of a hardware feature called destination alpha, which is used in many games for various graphical effects.\n\nIf unsure, leave this unchecked."); -wxString show_fps_desc = wxTRANSLATE("Show the number of frames rendered per second as a measure of emulation speed.\n\nIf unsure, leave this unchecked."); -wxString log_render_time_to_file_desc = wxTRANSLATE("Log the render time of every frame to User/Logs/render_time.txt. Use this feature when you want to measure the performance of Dolphin.\n\nIf unsure, leave this unchecked."); -wxString show_input_display_desc = wxTRANSLATE("Display the inputs read by the emulator.\n\nIf unsure, leave this unchecked."); -wxString show_stats_desc = wxTRANSLATE("Show various statistics.\n\nIf unsure, leave this unchecked."); -wxString texfmt_desc = wxTRANSLATE("Modify textures to show the format they're encoded in. Needs an emulation reset in most cases.\n\nIf unsure, leave this unchecked."); -wxString efb_copy_regions_desc = wxTRANSLATE("[BROKEN]\nHighlight regions the EFB was copied from.\n\nIf unsure, leave this unchecked."); -wxString xfb_desc = wxTRANSLATE("Disable any XFB emulation.\nSpeeds up emulation a lot but causes heavy glitches in many games which rely on them (especially homebrew applications).\n\nIf unsure, leave this checked."); -wxString xfb_virtual_desc = wxTRANSLATE("Emulate XFBs using GPU texture objects.\nFixes many games which don't work without XFB emulation while not being as slow as real XFB emulation. However, it may still fail for a lot of other games (especially homebrew applications).\n\nIf unsure, leave this checked."); -wxString xfb_real_desc = wxTRANSLATE("Emulate XFBs accurately.\nSlows down emulation a lot and prohibits high-resolution rendering but is necessary to emulate a number of games properly.\n\nIf unsure, check virtual XFB emulation instead."); -wxString dump_textures_desc = wxTRANSLATE("Dump decoded game textures to User/Dump/Textures//\n\nIf unsure, leave this unchecked."); -wxString load_hires_textures_desc = wxTRANSLATE("Load custom textures from User/Load/Textures//\n\nIf unsure, leave this unchecked."); -wxString dump_efb_desc = wxTRANSLATE("Dump the contents of EFB copies to User/Dump/Textures/\n\nIf unsure, leave this unchecked."); -wxString dump_frames_desc = wxTRANSLATE("Dump all rendered frames to an AVI file in User/Dump/Frames/\n\nIf unsure, leave this unchecked."); +static wxString adapter_desc = wxTRANSLATE("Select a hardware adapter to use.\n\nIf unsure, use the first one."); +static wxString display_res_desc = wxTRANSLATE("Selects the display resolution used in fullscreen mode.\nThis should always be bigger than or equal to the internal resolution. Performance impact is negligible.\n\nIf unsure, use your desktop resolution.\nIf still unsure, use the highest resolution which works for you."); +static wxString use_fullscreen_desc = wxTRANSLATE("Enable this if you want the whole screen to be used for rendering.\nIf this is disabled, a render window will be created instead.\n\nIf unsure, leave this unchecked."); +static wxString auto_window_size_desc = wxTRANSLATE("Automatically adjusts the window size to your internal resolution.\n\nIf unsure, leave this unchecked."); +static wxString keep_window_on_top_desc = wxTRANSLATE("Keep the game window on top of all other windows.\n\nIf unsure, leave this unchecked."); +static wxString hide_mouse_cursor_desc = wxTRANSLATE("Hides the mouse cursor if it's on top of the emulation window.\n\nIf unsure, leave this checked."); +static wxString render_to_main_win_desc = wxTRANSLATE("Enable this if you want to use the main Dolphin window for rendering rather than a separate render window.\n\nIf unsure, leave this unchecked."); +static wxString prog_scan_desc = wxTRANSLATE("Enables progressive scan if supported by the emulated software.\nMost games don't care about this.\n\nIf unsure, leave this unchecked."); +static wxString ar_desc = wxTRANSLATE("Select what aspect ratio to use when rendering:\nAuto: Use the native aspect ratio\nForce 16:9: Stretch the picture to an aspect ratio of 16:9.\nForce 4:3: Stretch the picture to an aspect ratio of 4:3.\nStretch to Window: Stretch the picture to the window size.\n\nIf unsure, select Auto."); +static wxString ws_hack_desc = wxTRANSLATE("Force the game to output graphics for widescreen resolutions.\nCauses graphical glitches is some games.\n\nIf unsure, leave this unchecked."); +static wxString vsync_desc = wxTRANSLATE("Wait for vertical blanks in order to reduce tearing.\nDecreases performance if emulation speed is below 100%.\n\nIf unsure, leave this unchecked."); +static wxString af_desc = wxTRANSLATE("Enable anisotropic filtering.\nEnhances visual quality of textures that are at oblique viewing angles.\nMight cause issues in a small number of games.\n\nIf unsure, select 1x."); +static wxString aa_desc = wxTRANSLATE("Reduces the amount of aliasing caused by rasterizing 3D graphics.\nThis makes the rendered picture look less blocky.\nHeavily decreases emulation speed and sometimes causes issues.\n\nIf unsure, select None."); +static wxString scaled_efb_copy_desc = wxTRANSLATE("Greatly increases quality of textures generated using render to texture effects.\nRaising the internal resolution will improve the effect of this setting.\nSlightly decreases performance and possibly causes issues (although unlikely).\n\nIf unsure, leave this checked."); +static wxString pixel_lighting_desc = wxTRANSLATE("Calculate lighting of 3D graphics per-pixel rather than per vertex.\nDecreases emulation speed by some percent (depending on your GPU).\nThis usually is a safe enhancement, but might cause issues sometimes.\n\nIf unsure, leave this unchecked."); +static wxString fast_depth_calc_desc = wxTRANSLATE("Use a less accurate algorithm to calculate depth values.\nCauses issues in a few games but might give a decent speedup.\n\nIf unsure, leave this checked."); +static wxString force_filtering_desc = wxTRANSLATE("Force texture filtering even if the emulated game explicitly disabled it.\nImproves texture quality slightly but causes glitches in some games.\n\nIf unsure, leave this unchecked."); +static wxString _3d_vision_desc = wxTRANSLATE("Enable 3D effects via stereoscopy using Nvidia 3D Vision technology if it's supported by your GPU.\nPossibly causes issues.\nRequires fullscreen to work.\n\nIf unsure, leave this unchecked."); +static wxString internal_res_desc = wxTRANSLATE("Specifies the resolution used to render at. A high resolution will improve visual quality a lot but is also quite heavy on performance and might cause glitches in certain games.\n\"Multiple of 640x528\" is a bit slower than \"Window Size\" but yields less issues. Generally speaking, the lower the internal resolution is, the better your performance will be.\n\nIf unsure, select 640x528."); +static wxString efb_access_desc = wxTRANSLATE("Ignore any requests of the CPU to read from or write to the EFB.\nImproves performance in some games, but might disable some gameplay-related features or graphical effects.\n\nIf unsure, leave this unchecked."); +static wxString efb_emulate_format_changes_desc = wxTRANSLATE("Ignore any changes to the EFB format.\nImproves performance in many games without any negative effect. Causes graphical defects in a small number of other games though.\n\nIf unsure, leave this checked."); +static wxString efb_copy_desc = wxTRANSLATE("Disable emulation of EFB copies.\nThese are often used for post-processing or render-to-texture effects, so while checking this setting gives a great speedup it almost always also causes issues.\n\nIf unsure, leave this unchecked."); +static wxString efb_copy_texture_desc = wxTRANSLATE("Store EFB copies in GPU texture objects.\nThis is not so accurate, but it works well enough for most games and gives a great speedup over EFB to RAM.\n\nIf unsure, leave this checked."); +static wxString efb_copy_ram_desc = wxTRANSLATE("Accurately emulate EFB copies.\nSome games depend on this for certain graphical effects or gameplay functionality.\n\nIf unsure, check EFB to Texture instead."); +static wxString stc_desc = wxTRANSLATE("The safer you adjust this, the less likely the emulator will be missing any texture updates from RAM.\n\nIf unsure, use the rightmost value."); +static wxString wireframe_desc = wxTRANSLATE("Render the scene as a wireframe.\n\nIf unsure, leave this unchecked."); +static wxString disable_fog_desc = wxTRANSLATE("Makes distant objects more visible by removing fog, thus increasing the overall detail.\nDisabling fog will break some games which rely on proper fog emulation.\n\nIf unsure, leave this unchecked."); +static wxString disable_dstalpha_desc = wxTRANSLATE("Disables emulation of a hardware feature called destination alpha, which is used in many games for various graphical effects.\n\nIf unsure, leave this unchecked."); +static wxString show_fps_desc = wxTRANSLATE("Show the number of frames rendered per second as a measure of emulation speed.\n\nIf unsure, leave this unchecked."); +static wxString log_render_time_to_file_desc = wxTRANSLATE("Log the render time of every frame to User/Logs/render_time.txt. Use this feature when you want to measure the performance of Dolphin.\n\nIf unsure, leave this unchecked."); +static wxString show_input_display_desc = wxTRANSLATE("Display the inputs read by the emulator.\n\nIf unsure, leave this unchecked."); +static wxString show_stats_desc = wxTRANSLATE("Show various statistics.\n\nIf unsure, leave this unchecked."); +static wxString texfmt_desc = wxTRANSLATE("Modify textures to show the format they're encoded in. Needs an emulation reset in most cases.\n\nIf unsure, leave this unchecked."); +static wxString efb_copy_regions_desc = wxTRANSLATE("[BROKEN]\nHighlight regions the EFB was copied from.\n\nIf unsure, leave this unchecked."); +static wxString xfb_desc = wxTRANSLATE("Disable any XFB emulation.\nSpeeds up emulation a lot but causes heavy glitches in many games which rely on them (especially homebrew applications).\n\nIf unsure, leave this checked."); +static wxString xfb_virtual_desc = wxTRANSLATE("Emulate XFBs using GPU texture objects.\nFixes many games which don't work without XFB emulation while not being as slow as real XFB emulation. However, it may still fail for a lot of other games (especially homebrew applications).\n\nIf unsure, leave this checked."); +static wxString xfb_real_desc = wxTRANSLATE("Emulate XFBs accurately.\nSlows down emulation a lot and prohibits high-resolution rendering but is necessary to emulate a number of games properly.\n\nIf unsure, check virtual XFB emulation instead."); +static wxString dump_textures_desc = wxTRANSLATE("Dump decoded game textures to User/Dump/Textures//\n\nIf unsure, leave this unchecked."); +static wxString load_hires_textures_desc = wxTRANSLATE("Load custom textures from User/Load/Textures//\n\nIf unsure, leave this unchecked."); +static wxString dump_efb_desc = wxTRANSLATE("Dump the contents of EFB copies to User/Dump/Textures/\n\nIf unsure, leave this unchecked."); +static wxString dump_frames_desc = wxTRANSLATE("Dump all rendered frames to an AVI file in User/Dump/Frames/\n\nIf unsure, leave this unchecked."); #if !defined WIN32 && defined HAVE_LIBAV -wxString use_ffv1_desc = wxTRANSLATE("Encode frame dumps using the FFV1 codec.\n\nIf unsure, leave this unchecked."); +static wxString use_ffv1_desc = wxTRANSLATE("Encode frame dumps using the FFV1 codec.\n\nIf unsure, leave this unchecked."); #endif -wxString free_look_desc = wxTRANSLATE("This feature allows you to change the game's camera.\nMove the mouse while holding the right mouse button to pan and while holding the middle button to move.\nHold SHIFT and press one of the WASD keys to move the camera by a certain step distance (SHIFT+0 to move faster and SHIFT+9 to move slower). Press SHIFT+R to reset the camera.\n\nIf unsure, leave this unchecked."); -wxString crop_desc = wxTRANSLATE("Crop the picture from 4:3 to 5:4 or from 16:9 to 16:10.\n\nIf unsure, leave this unchecked."); -wxString omp_desc = wxTRANSLATE("Use multiple threads to decode textures.\nMight result in a speedup (especially on CPUs with more than two cores).\n\nIf unsure, leave this unchecked."); -wxString ppshader_desc = wxTRANSLATE("Apply a post-processing effect after finishing a frame.\n\nIf unsure, select (off)."); -wxString cache_efb_copies_desc = wxTRANSLATE("Slightly speeds up EFB to RAM copies by sacrificing emulation accuracy.\nSometimes also increases visual quality.\nIf you're experiencing any issues, try raising texture cache accuracy or disable this option.\n\nIf unsure, leave this unchecked."); -wxString shader_errors_desc = wxTRANSLATE("Usually if shader compilation fails, an error message is displayed.\nHowever, one may skip the popups to allow interruption free gameplay by checking this option.\n\nIf unsure, leave this unchecked."); +static wxString free_look_desc = wxTRANSLATE("This feature allows you to change the game's camera.\nMove the mouse while holding the right mouse button to pan and while holding the middle button to move.\nHold SHIFT and press one of the WASD keys to move the camera by a certain step distance (SHIFT+0 to move faster and SHIFT+9 to move slower). Press SHIFT+R to reset the camera.\n\nIf unsure, leave this unchecked."); +static wxString crop_desc = wxTRANSLATE("Crop the picture from 4:3 to 5:4 or from 16:9 to 16:10.\n\nIf unsure, leave this unchecked."); +static wxString omp_desc = wxTRANSLATE("Use multiple threads to decode textures.\nMight result in a speedup (especially on CPUs with more than two cores).\n\nIf unsure, leave this unchecked."); +static wxString ppshader_desc = wxTRANSLATE("Apply a post-processing effect after finishing a frame.\n\nIf unsure, select (off)."); +static wxString cache_efb_copies_desc = wxTRANSLATE("Slightly speeds up EFB to RAM copies by sacrificing emulation accuracy.\nSometimes also increases visual quality.\nIf you're experiencing any issues, try raising texture cache accuracy or disable this option.\n\nIf unsure, leave this unchecked."); +static wxString shader_errors_desc = wxTRANSLATE("Usually if shader compilation fails, an error message is displayed.\nHowever, one may skip the popups to allow interruption free gameplay by checking this option.\n\nIf unsure, leave this unchecked."); // Search for available resolutions - TODO: Move to Common? diff --git a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp index 5a62de6e65..7b70871ccb 100644 --- a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp +++ b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp @@ -1574,10 +1574,10 @@ const GLFunc gl_function_array[] = namespace GLExtensions { // Private members and functions - bool _isES3; - bool _isES; - u32 _GLVersion; - std::unordered_map m_extension_list; + static bool _isES3; + static bool _isES; + static u32 _GLVersion; + static std::unordered_map m_extension_list; // Private initialization functions bool InitFunctionPointers(); diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp index cafa560485..99f3ad5485 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp @@ -29,7 +29,7 @@ s32 ProgramShaderCache::s_ubo_align; static StreamBuffer *s_buffer; static int num_failures = 0; -LinearDiskCache g_program_disk_cache; +static LinearDiskCache g_program_disk_cache; static GLuint CurrentProgram = 0; ProgramShaderCache::PCache ProgramShaderCache::pshaders; ProgramShaderCache::PCacheEntry* ProgramShaderCache::last_entry; diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 5cdc8d031f..2674c8a3ee 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -67,7 +67,7 @@ void VideoConfig::UpdateProjectionHack() ::UpdateProjectionHack(g_Config.iPhackvalue, g_Config.sPhackvalue); } -int OSDInternalW, OSDInternalH; +static int OSDInternalW, OSDInternalH; namespace OGL { diff --git a/Source/Core/VideoBackends/Software/Clipper.cpp b/Source/Core/VideoBackends/Software/Clipper.cpp index 4bdbe85230..9e8e603a92 100644 --- a/Source/Core/VideoBackends/Software/Clipper.cpp +++ b/Source/Core/VideoBackends/Software/Clipper.cpp @@ -47,10 +47,10 @@ namespace Clipper { enum { NUM_CLIPPED_VERTICES = 33, NUM_INDICES = NUM_CLIPPED_VERTICES + 3 }; - float m_ViewOffset[2]; + static float m_ViewOffset[2]; - OutputVertexData ClippedVertices[NUM_CLIPPED_VERTICES]; - OutputVertexData *Vertices[NUM_INDICES]; + static OutputVertexData ClippedVertices[NUM_CLIPPED_VERTICES]; + static OutputVertexData *Vertices[NUM_INDICES]; void DoState(PointerWrap &p) { diff --git a/Source/Core/VideoBackends/Software/EfbInterface.cpp b/Source/Core/VideoBackends/Software/EfbInterface.cpp index fd985f8662..aabbee0607 100644 --- a/Source/Core/VideoBackends/Software/EfbInterface.cpp +++ b/Source/Core/VideoBackends/Software/EfbInterface.cpp @@ -14,7 +14,7 @@ #include "VideoCommon/PixelEngine.h" -u8 efb[EFB_WIDTH*EFB_HEIGHT*6]; +static u8 efb[EFB_WIDTH*EFB_HEIGHT*6]; namespace EfbInterface { diff --git a/Source/Core/VideoBackends/Software/HwRasterizer.cpp b/Source/Core/VideoBackends/Software/HwRasterizer.cpp index 9515e8d8af..5645c26bf9 100644 --- a/Source/Core/VideoBackends/Software/HwRasterizer.cpp +++ b/Source/Core/VideoBackends/Software/HwRasterizer.cpp @@ -16,11 +16,11 @@ namespace HwRasterizer { - float efbHalfWidth; - float efbHalfHeight; - bool hasTexture; + static float efbHalfWidth; + static float efbHalfHeight; + static bool hasTexture; - u8 *temp; + static u8 *temp; // Programs static GLuint colProg, texProg, clearProg; diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp index 90fe84ffee..1a5e469435 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.cpp +++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp @@ -32,23 +32,23 @@ static inline s32 FixedLog2(float f) namespace Rasterizer { -Slope ZSlope; -Slope WSlope; -Slope ColorSlopes[2][4]; -Slope TexSlopes[8][3]; +static Slope ZSlope; +static Slope WSlope; +static Slope ColorSlopes[2][4]; +static Slope TexSlopes[8][3]; -s32 vertex0X; -s32 vertex0Y; -float vertexOffsetX; -float vertexOffsetY; +static s32 vertex0X; +static s32 vertex0Y; +static float vertexOffsetX; +static float vertexOffsetY; -s32 scissorLeft = 0; -s32 scissorTop = 0; -s32 scissorRight = 0; -s32 scissorBottom = 0; +static s32 scissorLeft = 0; +static s32 scissorTop = 0; +static s32 scissorRight = 0; +static s32 scissorBottom = 0; -Tev tev; -RasterBlock rasterBlock; +static Tev tev; +static RasterBlock rasterBlock; void DoState(PointerWrap &p) { diff --git a/Source/Core/VideoBackends/Software/SWCommandProcessor.cpp b/Source/Core/VideoBackends/Software/SWCommandProcessor.cpp index ed8115f1ab..1a2dcc0cbf 100644 --- a/Source/Core/VideoBackends/Software/SWCommandProcessor.cpp +++ b/Source/Core/VideoBackends/Software/SWCommandProcessor.cpp @@ -33,14 +33,14 @@ enum // STATE_TO_SAVE // variables -const int commandBufferSize = 1024 * 1024; -const int maxCommandBufferWrite = commandBufferSize - GATHER_PIPE_SIZE; -u8 commandBuffer[commandBufferSize]; -u32 readPos; -u32 writePos; -int et_UpdateInterrupts; -volatile bool interruptSet; -volatile bool interruptWaiting; +static const int commandBufferSize = 1024 * 1024; +static const int maxCommandBufferWrite = commandBufferSize - GATHER_PIPE_SIZE; +static u8 commandBuffer[commandBufferSize]; +static u32 readPos; +static u32 writePos; +static int et_UpdateInterrupts; +static volatile bool interruptSet; +static volatile bool interruptWaiting; CPReg cpreg; // shared between gfx and emulator thread diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp index 5bd44782a7..40e89dd3d1 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.cpp +++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp @@ -32,7 +32,7 @@ static std::string s_sScreenshotName; // Rasterfont isn't compatible with GLES // degasus: I think it does, but I can't test it -RasterFont* s_pfont = nullptr; +static RasterFont* s_pfont = nullptr; void SWRenderer::Init() { diff --git a/Source/Core/VideoCommon/CommandProcessor.cpp b/Source/Core/VideoCommon/CommandProcessor.cpp index c27681ac3c..e42b7227db 100644 --- a/Source/Core/VideoCommon/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/CommandProcessor.cpp @@ -24,21 +24,21 @@ namespace CommandProcessor { -int et_UpdateInterrupts; +static int et_UpdateInterrupts; // TODO(ector): Warn on bbox read/write // STATE_TO_SAVE SCPFifoStruct fifo; -UCPStatusReg m_CPStatusReg; -UCPCtrlReg m_CPCtrlReg; -UCPClearReg m_CPClearReg; +static UCPStatusReg m_CPStatusReg; +static UCPCtrlReg m_CPCtrlReg; +static UCPClearReg m_CPClearReg; -u16 m_bboxleft; -u16 m_bboxtop; -u16 m_bboxright; -u16 m_bboxbottom; -u16 m_tokenReg; +static u16 m_bboxleft; +static u16 m_bboxtop; +static u16 m_bboxright; +static u16 m_bboxbottom; +static u16 m_tokenReg; volatile bool isPossibleWaitingSetDrawDone = false; volatile bool interruptSet= false; diff --git a/Source/Core/VideoCommon/DriverDetails.cpp b/Source/Core/VideoCommon/DriverDetails.cpp index 9646e6a140..0580bd98c9 100644 --- a/Source/Core/VideoCommon/DriverDetails.cpp +++ b/Source/Core/VideoCommon/DriverDetails.cpp @@ -32,14 +32,14 @@ namespace DriverDetails const u32 m_os = OS_ALL | OS_LINUX; #endif - Vendor m_vendor = VENDOR_UNKNOWN; - Driver m_driver = DRIVER_UNKNOWN; - s32 m_family = 0; - double m_version = 0.0; + static Vendor m_vendor = VENDOR_UNKNOWN; + static Driver m_driver = DRIVER_UNKNOWN; + static s32 m_family = 0; + static double m_version = 0.0; // This is a list of all known bugs for each vendor // We use this to check if the device and driver has a issue - BugInfo m_known_bugs[] = { + static BugInfo m_known_bugs[] = { {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, -1, BUG_NODYNUBOACCESS, 14.0, -1.0, true}, {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, -1, BUG_BROKENCENTROID, 14.0, 46.0, true}, {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, -1, BUG_BROKENINFOLOG, -1.0, 46.0, true}, @@ -59,7 +59,7 @@ namespace DriverDetails {OS_LINUX, VENDOR_NVIDIA, DRIVER_NVIDIA, -1, BUG_BROKENUNSYNCMAPPING, -1.0, -1.0, true}, }; - std::map m_bugs; + static std::map m_bugs; void Init(Vendor vendor, Driver driver, const double version, const s32 family) { diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp index af7e8bbe40..f9e7d918c9 100644 --- a/Source/Core/VideoCommon/HiresTextures.cpp +++ b/Source/Core/VideoCommon/HiresTextures.cpp @@ -18,7 +18,7 @@ namespace HiresTextures { -std::map textureMap; +static std::map textureMap; void Init(const std::string& gameCode) { diff --git a/Source/Core/VideoCommon/MainBase.cpp b/Source/Core/VideoCommon/MainBase.cpp index f9ccc47375..f96201c92d 100644 --- a/Source/Core/VideoCommon/MainBase.cpp +++ b/Source/Core/VideoCommon/MainBase.cpp @@ -22,8 +22,8 @@ volatile u32 s_swapRequested = false; u32 s_efbAccessRequested = false; volatile u32 s_FifoShuttingDown = false; -std::condition_variable s_perf_query_cond; -std::mutex s_perf_query_lock; +static std::condition_variable s_perf_query_cond; +static std::mutex s_perf_query_lock; static volatile bool s_perf_query_requested; static volatile struct diff --git a/Source/Core/VideoCommon/PixelEngine.cpp b/Source/Core/VideoCommon/PixelEngine.cpp index 85d4ed34f8..a66dd5ee98 100644 --- a/Source/Core/VideoCommon/PixelEngine.cpp +++ b/Source/Core/VideoCommon/PixelEngine.cpp @@ -97,14 +97,14 @@ static UPEAlphaReadReg m_AlphaRead; static UPECtrlReg m_Control; //static u16 m_Token; // token value most recently encountered -volatile u32 g_bSignalTokenInterrupt; -volatile u32 g_bSignalFinishInterrupt; +static volatile u32 g_bSignalTokenInterrupt; +static volatile u32 g_bSignalFinishInterrupt; static int et_SetTokenOnMainThread; static int et_SetFinishOnMainThread; -volatile u32 interruptSetToken = 0; -volatile u32 interruptSetFinish = 0; +static volatile u32 interruptSetToken = 0; +static volatile u32 interruptSetFinish = 0; u16 bbox[4]; bool bbox_active; diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 2c95cdf89d..508dda77ca 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -40,7 +40,8 @@ // TODO: Move these out of here. int frameCount; -int OSDChoice, OSDTime; +int OSDChoice; +static int OSDTime; Renderer *g_renderer = nullptr; @@ -350,9 +351,6 @@ void Renderer::DrawDebugText() g_renderer->RenderText(final_yellow, 20, 20, 0xFFFFFF00); } -// TODO: remove -extern bool g_aspect_wide; - void Renderer::UpdateDrawRectangle(int backbuffer_width, int backbuffer_height) { float FloatGLWidth = (float)backbuffer_width; diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index edb0f49ac2..33d6b3b919 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -36,7 +36,7 @@ TextureCache::TexCache TextureCache::textures; TextureCache::BackupConfig TextureCache::backup_config; -bool invalidate_texture_cache_requested; +static bool invalidate_texture_cache_requested; TextureCache::TCacheEntryBase::~TCacheEntryBase() { diff --git a/Source/Core/VideoCommon/TextureDecoder_x64.cpp b/Source/Core/VideoCommon/TextureDecoder_x64.cpp index 45bd06f06d..63e5207c82 100644 --- a/Source/Core/VideoCommon/TextureDecoder_x64.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_x64.cpp @@ -32,8 +32,8 @@ #pragma clang diagnostic ignored "-Wshadow" #endif -bool TexFmt_Overlay_Enable=false; -bool TexFmt_Overlay_Center=false; +static bool TexFmt_Overlay_Enable=false; +static bool TexFmt_Overlay_Center=false; extern const char* texfmt[]; extern const unsigned char sfont_map[]; diff --git a/Source/Core/VideoCommon/VertexLoader.h b/Source/Core/VideoCommon/VertexLoader.h index 407a20edc8..853d5d4bc4 100644 --- a/Source/Core/VideoCommon/VertexLoader.h +++ b/Source/Core/VideoCommon/VertexLoader.h @@ -23,6 +23,15 @@ #endif #endif +// They are used for the communication with the loader functions +extern NativeVertexFormat *g_nativeVertexFmt; +extern int tcIndex; +extern int colIndex; +extern TVtxAttr* pVtxAttr; +extern int colElements[2]; +extern float posScale; +extern float tcScale[8]; + class VertexLoaderUID { u32 vid[5]; diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp index 2507acfbb7..dd233403cb 100644 --- a/Source/Core/VideoCommon/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/VertexShaderManager.cpp @@ -18,7 +18,7 @@ #include "VideoCommon/VideoConfig.h" #include "VideoCommon/XFMemory.h" -float GC_ALIGNED16(g_fProjectionMatrix[16]); +static float GC_ALIGNED16(g_fProjectionMatrix[16]); // track changes static bool bTexMatricesChanged[2], bPosNormalMatrixChanged, bProjectionChanged, bViewportChanged;