Skip to content

Commit 6f978e0

Browse files
authored
renamespace (Kenix3#520)
* renamespace * clang format * wii u fix * more wii u fixes * actually commit the thing * keep on fixin on * couple more * apparently that header is causing issues * clang format * fix build * ShipDK -> Ship * clang format * json resource in ship namespace
1 parent a245aaf commit 6f978e0

File tree

234 files changed

+1715
-1680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+1715
-1680
lines changed

src/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ file(GLOB_RECURSE Source_Files__Controller RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
3939
if (CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
4040
list(FILTER Source_Files__Controller EXCLUDE REGEX "controller/controldevice/controller/mapping/keyboard/*")
4141
list(FILTER Source_Files__Controller EXCLUDE REGEX "controller/controldevice/controller/mapping/sdl/*")
42-
list(FILTER Source_Files__Controller EXCLUDE REGEX "controller/deviceindex/LUSDeviceIndexToSDLDeviceIndexMapping.*")
42+
list(FILTER Source_Files__Controller EXCLUDE REGEX "controller/deviceindex/ShipDeviceIndexToSDLDeviceIndexMapping.*")
4343
else()
4444
list(FILTER Source_Files__Controller EXCLUDE REGEX "controller/controldevice/controller/mapping/wiiu/*")
45-
list(FILTER Source_Files__Controller EXCLUDE REGEX "controller/deviceindex/LUSDeviceIndexToWiiUDeviceIndexMapping.*")
45+
list(FILTER Source_Files__Controller EXCLUDE REGEX "controller/deviceindex/ShipDeviceIndexToWiiUDeviceIndexMapping.*")
4646
endif()
4747

4848
source_group("controller" FILES ${Source_Files__Controller})

src/Context.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "port/wiiu/WiiUImpl.h"
2020
#endif
2121

22-
namespace LUS {
22+
namespace Ship {
2323
std::weak_ptr<Context> Context::mContext;
2424

2525
std::shared_ptr<Context> Context::GetInstance() {
@@ -211,7 +211,7 @@ void Context::InitResourceManager(const std::vector<std::string>& otrFiles,
211211
#if defined(__SWITCH__)
212212
printf("Main OTR file not found!\n");
213213
#elif defined(__WIIU__)
214-
LUS::WiiU::ThrowMissingOTR(mMainPath.c_str());
214+
Ship::WiiU::ThrowMissingOTR(mMainPath.c_str());
215215
#else
216216
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "OTR file not found",
217217
"Main OTR file not found. Please generate one", nullptr);
@@ -224,7 +224,7 @@ void Context::InitResourceManager(const std::vector<std::string>& otrFiles,
224224
return;
225225
}
226226
#ifdef __SWITCH__
227-
LUS::Switch::Init(PostInitPhase);
227+
Ship::Switch::Init(PostInitPhase);
228228
#endif
229229
}
230230

@@ -258,7 +258,7 @@ void Context::InitGfxDebugger() {
258258
return;
259259
}
260260

261-
mGfxDebugger = std::make_shared<GfxDebugger>();
261+
mGfxDebugger = std::make_shared<LUS::GfxDebugger>();
262262
}
263263

264264
void Context::InitConsole() {
@@ -315,7 +315,7 @@ std::shared_ptr<Audio> Context::GetAudio() {
315315
return mAudio;
316316
}
317317

318-
std::shared_ptr<GfxDebugger> Context::GetGfxDebugger() {
318+
std::shared_ptr<LUS::GfxDebugger> Context::GetGfxDebugger() {
319319
return mGfxDebugger;
320320
}
321321

@@ -432,4 +432,4 @@ std::string Context::LocateFileAcrossAppDirs(const std::string path, std::string
432432
return "./" + std::string(path);
433433
}
434434

435-
} // namespace LUS
435+
} // namespace Ship

src/Context.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
namespace LUS {
1818
class GfxDebugger;
19+
}
20+
21+
namespace Ship {
1922

2023
class Context {
2124
public:
@@ -48,7 +51,7 @@ class Context {
4851
std::shared_ptr<Window> GetWindow();
4952
std::shared_ptr<Console> GetConsole();
5053
std::shared_ptr<Audio> GetAudio();
51-
std::shared_ptr<GfxDebugger> GetGfxDebugger();
54+
std::shared_ptr<LUS::GfxDebugger> GetGfxDebugger();
5255

5356
std::string GetConfigFilePath();
5457
std::string GetName();
@@ -81,7 +84,7 @@ class Context {
8184
std::shared_ptr<Window> mWindow;
8285
std::shared_ptr<Console> mConsole;
8386
std::shared_ptr<Audio> mAudio;
84-
std::shared_ptr<GfxDebugger> mGfxDebugger;
87+
std::shared_ptr<LUS::GfxDebugger> mGfxDebugger;
8588

8689
std::string mConfigFilePath;
8790
std::string mMainPath;
@@ -90,4 +93,4 @@ class Context {
9093
std::string mName;
9194
std::string mShortName;
9295
};
93-
} // namespace LUS
96+
} // namespace Ship

src/audio/Audio.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "Context.h"
44

5-
namespace LUS {
5+
namespace Ship {
66
Audio::Audio() {
77
}
88

@@ -62,4 +62,4 @@ std::shared_ptr<std::vector<AudioBackend>> Audio::GetAvailableAudioBackends() {
6262
return mAvailableAudioBackends;
6363
}
6464

65-
} // namespace LUS
65+
} // namespace Ship

src/audio/Audio.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <vector>
66
#include "audio/AudioPlayer.h"
77

8-
namespace LUS {
8+
namespace Ship {
99
enum class AudioBackend { WASAPI, SDL };
1010

1111
class Audio {
@@ -27,4 +27,4 @@ class Audio {
2727
AudioBackend mAudioBackend;
2828
std::shared_ptr<std::vector<AudioBackend>> mAvailableAudioBackends;
2929
};
30-
} // namespace LUS
30+
} // namespace Ship

src/audio/AudioPlayer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "AudioPlayer.h"
22
#include "spdlog/spdlog.h"
33

4-
namespace LUS {
4+
namespace Ship {
55
AudioPlayer::AudioPlayer() : mInitialized(false){};
66

77
AudioPlayer::~AudioPlayer() {
@@ -16,4 +16,4 @@ bool AudioPlayer::Init(void) {
1616
bool AudioPlayer::IsInitialized(void) {
1717
return mInitialized;
1818
}
19-
} // namespace LUS
19+
} // namespace Ship

src/audio/AudioPlayer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "stddef.h"
44
#include <string>
55

6-
namespace LUS {
6+
namespace Ship {
77
class AudioPlayer {
88

99
public:
@@ -27,7 +27,7 @@ class AudioPlayer {
2727
private:
2828
bool mInitialized;
2929
};
30-
} // namespace LUS
30+
} // namespace Ship
3131

3232
#ifdef _WIN32
3333
#include "WasapiAudioPlayer.h"

src/audio/SDLAudioPlayer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "SDLAudioPlayer.h"
22
#include <spdlog/spdlog.h>
33

4-
namespace LUS {
4+
namespace Ship {
55
SDLAudioPlayer::SDLAudioPlayer() : AudioPlayer() {
66
}
77

@@ -46,4 +46,4 @@ void SDLAudioPlayer::Play(const uint8_t* buf, size_t len) {
4646
SDL_QueueAudio(mDevice, buf, len);
4747
}
4848
}
49-
} // namespace LUS
49+
} // namespace Ship

src/audio/SDLAudioPlayer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "AudioPlayer.h"
33
#include <SDL2/SDL.h>
44

5-
namespace LUS {
5+
namespace Ship {
66
class SDLAudioPlayer : public AudioPlayer {
77
public:
88
SDLAudioPlayer();
@@ -18,4 +18,4 @@ class SDLAudioPlayer : public AudioPlayer {
1818
private:
1919
SDL_AudioDeviceID mDevice;
2020
};
21-
} // namespace LUS
21+
} // namespace Ship

src/audio/WasapiAudioPlayer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator);
1515
const IID IID_IAudioClient = __uuidof(IAudioClient);
1616
const IID IID_IAudioRenderClient = __uuidof(IAudioRenderClient);
1717

18-
namespace LUS {
18+
namespace Ship {
1919
WasapiAudioPlayer::WasapiAudioPlayer()
2020
: mRefCount(1), mBufferFrameCount(0), mInitialized(false), mStarted(false), AudioPlayer(){};
2121

@@ -164,5 +164,5 @@ HRESULT STDMETHODCALLTYPE WasapiAudioPlayer::QueryInterface(REFIID riid, VOID**
164164
}
165165
return S_OK;
166166
}
167-
} // namespace LUS
167+
} // namespace Ship
168168
#endif

src/audio/WasapiAudioPlayer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
using namespace Microsoft::WRL;
1111

12-
namespace LUS {
12+
namespace Ship {
1313
class WasapiAudioPlayer : public AudioPlayer, public IMMNotificationClient {
1414
public:
1515
WasapiAudioPlayer();
@@ -41,5 +41,5 @@ class WasapiAudioPlayer : public AudioPlayer, public IMMNotificationClient {
4141
bool mInitialized;
4242
bool mStarted;
4343
};
44-
} // namespace LUS
44+
} // namespace Ship
4545
#endif

src/config/Config.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace fs = std::filesystem;
1515

16-
namespace LUS {
16+
namespace Ship {
1717
Config::Config(std::string path) : mPath(std::move(path)), mIsNewInstance(false) {
1818
Reload();
1919
}
@@ -284,4 +284,4 @@ uint32_t ConfigVersionUpdater::GetVersion() {
284284
return mVersion;
285285
}
286286

287-
} // namespace LUS
287+
} // namespace Ship

src/config/Config.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "audio/Audio.h"
88
#include "window/Window.h"
99

10-
namespace LUS {
10+
namespace Ship {
1111

1212
/**
1313
* @brief Abstract class representing a Config Version Updater, intended to express how to
@@ -98,4 +98,4 @@ class Config {
9898
bool mIsNewInstance;
9999
std::map<uint32_t, std::shared_ptr<ConfigVersionUpdater>> mVersionUpdaters;
100100
};
101-
} // namespace LUS
101+
} // namespace Ship

src/config/ConsoleVariable.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "config/Config.h"
77
#include "Context.h"
88

9-
namespace LUS {
9+
namespace Ship {
1010

1111
ConsoleVariable::ConsoleVariable() {
1212
Load();
@@ -165,13 +165,13 @@ void ConsoleVariable::RegisterColor24(const char* name, Color_RGB8 defaultValue)
165165
}
166166

167167
void ConsoleVariable::ClearVariable(const char* name) {
168-
std::shared_ptr<Config> conf = LUS::Context::GetInstance()->GetConfig();
168+
std::shared_ptr<Config> conf = Ship::Context::GetInstance()->GetConfig();
169169
mVariables.erase(name);
170170
conf->Erase(StringHelper::Sprintf("CVars.%s", name));
171171
}
172172

173173
void ConsoleVariable::Save() {
174-
std::shared_ptr<Config> conf = LUS::Context::GetInstance()->GetConfig();
174+
std::shared_ptr<Config> conf = Ship::Context::GetInstance()->GetConfig();
175175

176176
for (const auto& variable : mVariables) {
177177
const std::string key = StringHelper::Sprintf("CVars.%s", variable.first.c_str());
@@ -208,7 +208,7 @@ void ConsoleVariable::Save() {
208208
}
209209

210210
void ConsoleVariable::Load() {
211-
std::shared_ptr<Config> conf = LUS::Context::GetInstance()->GetConfig();
211+
std::shared_ptr<Config> conf = Ship::Context::GetInstance()->GetConfig();
212212
conf->Reload();
213213

214214
LoadFromPath("", conf->GetNestedJson()["CVars"].items());
@@ -265,7 +265,7 @@ void ConsoleVariable::LoadFromPath(
265265
}
266266
}
267267
void ConsoleVariable::LoadLegacy() {
268-
auto conf = LUS::Context::GetPathRelativeToAppDirectory("cvars.cfg");
268+
auto conf = Ship::Context::GetPathRelativeToAppDirectory("cvars.cfg");
269269
if (DiskFile::Exists(conf)) {
270270
const auto lines = DiskFile::ReadAllLines(conf);
271271

@@ -312,4 +312,4 @@ void ConsoleVariable::LoadLegacy() {
312312
fs::remove(conf);
313313
}
314314
}
315-
} // namespace LUS
315+
} // namespace Ship

src/config/ConsoleVariable.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <unordered_map>
88
#include <string>
99

10-
namespace LUS {
10+
namespace Ship {
1111
typedef enum class ConsoleVariableType { Integer, Float, String, Color, Color24 } ConsoleVariableType;
1212

1313
typedef struct CVar {
@@ -58,4 +58,4 @@ class ConsoleVariable {
5858
private:
5959
std::unordered_map<std::string, std::shared_ptr<CVar>> mVariables;
6060
};
61-
} // namespace LUS
61+
} // namespace Ship

src/controller/controldeck/ControlDeck.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
#define IMGUI_DEFINE_MATH_OPERATORS
99
#endif
1010
#include <imgui.h>
11-
#include "controller/deviceindex/LUSDeviceIndexMappingManager.h"
11+
#include "controller/deviceindex/ShipDeviceIndexMappingManager.h"
1212

13-
namespace LUS {
13+
namespace Ship {
1414

1515
ControlDeck::ControlDeck(std::vector<CONTROLLERBUTTONS_T> additionalBitmasks)
1616
: mPads(nullptr), mSinglePlayerMappingMode(false) {
1717
for (int32_t i = 0; i < MAXCONTROLLERS; i++) {
1818
mPorts.push_back(std::make_shared<ControlPort>(i, std::make_shared<Controller>(i, additionalBitmasks)));
1919
}
2020

21-
mDeviceIndexMappingManager = std::make_shared<LUSDeviceIndexMappingManager>();
21+
mDeviceIndexMappingManager = std::make_shared<ShipDeviceIndexMappingManager>();
2222
}
2323

2424
ControlDeck::ControlDeck() : ControlDeck(std::vector<CONTROLLERBUTTONS_T>()) {
@@ -41,7 +41,7 @@ void ControlDeck::Init(uint8_t* controllerBits) {
4141
#ifndef __WIIU__
4242
// if we don't have a config for controller 1, set default keyboard bindings
4343
if (!mPorts[0]->GetConnectedController()->HasConfig()) {
44-
mPorts[0]->GetConnectedController()->AddDefaultMappings(LUSDeviceIndex::Keyboard);
44+
mPorts[0]->GetConnectedController()->AddDefaultMappings(ShipDeviceIndex::Keyboard);
4545
}
4646
#endif
4747

@@ -113,7 +113,7 @@ void ControlDeck::UnblockGameInput(int32_t blockId) {
113113
mGameInputBlockers.erase(blockId);
114114
}
115115

116-
std::shared_ptr<LUSDeviceIndexMappingManager> ControlDeck::GetDeviceIndexMappingManager() {
116+
std::shared_ptr<ShipDeviceIndexMappingManager> ControlDeck::GetDeviceIndexMappingManager() {
117117
return mDeviceIndexMappingManager;
118118
}
119119

@@ -124,4 +124,4 @@ void ControlDeck::SetSinglePlayerMappingMode(bool singlePlayer) {
124124
bool ControlDeck::IsSinglePlayerMappingMode() {
125125
return mSinglePlayerMappingMode;
126126
}
127-
} // namespace LUS
127+
} // namespace Ship

src/controller/controldeck/ControlDeck.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#include <vector>
55
#include <config/Config.h>
66
#include "controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h"
7-
#include "controller/deviceindex/LUSDeviceIndexMappingManager.h"
7+
#include "controller/deviceindex/ShipDeviceIndexMappingManager.h"
88

9-
namespace LUS {
9+
namespace Ship {
1010

1111
class ControlDeck {
1212
public:
@@ -27,10 +27,10 @@ class ControlDeck {
2727
bool IsSinglePlayerMappingMode();
2828

2929
#ifndef __WIIU__
30-
bool ProcessKeyboardEvent(LUS::KbEventType eventType, LUS::KbScancode scancode);
30+
bool ProcessKeyboardEvent(Ship::KbEventType eventType, Ship::KbScancode scancode);
3131
#endif
3232

33-
std::shared_ptr<LUSDeviceIndexMappingManager> GetDeviceIndexMappingManager();
33+
std::shared_ptr<ShipDeviceIndexMappingManager> GetDeviceIndexMappingManager();
3434

3535
private:
3636
std::vector<std::shared_ptr<ControlPort>> mPorts = {};
@@ -40,6 +40,6 @@ class ControlDeck {
4040

4141
bool AllGameInputBlocked();
4242
std::unordered_map<int32_t, bool> mGameInputBlockers;
43-
std::shared_ptr<LUSDeviceIndexMappingManager> mDeviceIndexMappingManager;
43+
std::shared_ptr<ShipDeviceIndexMappingManager> mDeviceIndexMappingManager;
4444
};
45-
} // namespace LUS
45+
} // namespace Ship

0 commit comments

Comments
 (0)