mirror of
https://github.com/PrimeDecomp/prime.git
synced 2026-07-12 18:18:56 -07:00
Enable clangd integration & revamp VS Code config
This commit is contained in:
+28
-18
@@ -1,21 +1,31 @@
|
||||
__pycache__/
|
||||
*.dol
|
||||
*.dump
|
||||
*.exe
|
||||
*.map
|
||||
build/
|
||||
ctx.c
|
||||
tools/elf2dol
|
||||
tools/elf2rel
|
||||
tools/metroidbuildinfo
|
||||
tools/mwcc_compiler
|
||||
*.bat
|
||||
# IDE folders
|
||||
.idea/
|
||||
versions/
|
||||
build.ninja
|
||||
.ninja_deps
|
||||
.ninja_lock
|
||||
.ninja_log
|
||||
objdiff.json
|
||||
.vs/
|
||||
.vscode/
|
||||
|
||||
# Caches
|
||||
__pycache__
|
||||
.mypy_cache
|
||||
.cache/
|
||||
|
||||
# Original files
|
||||
orig/*/*
|
||||
!orig/*/.gitkeep
|
||||
|
||||
# Build files
|
||||
build/
|
||||
.ninja_*
|
||||
build.ninja
|
||||
|
||||
# decompctx output
|
||||
ctx.*
|
||||
*.ctx
|
||||
|
||||
# Generated configs
|
||||
objdiff.json
|
||||
compile_commands.json
|
||||
|
||||
# Miscellaneous
|
||||
/*.txt
|
||||
*.exe
|
||||
*.dol
|
||||
|
||||
Vendored
-26
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Linux",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/include",
|
||||
"${workspaceFolder}/libc",
|
||||
"${workspaceFolder}/extern/musyx/include",
|
||||
"${workspaceFolder}/build/*/include"
|
||||
],
|
||||
"cStandard": "c99",
|
||||
"cppStandard": "c++98",
|
||||
"intelliSenseMode": "linux-clang-x86",
|
||||
"compilerPath": "",
|
||||
"configurationProvider": "ms-vscode.makefile-tools",
|
||||
"browse": {
|
||||
"path": [
|
||||
"${workspaceFolder}/include",
|
||||
"${workspaceFolder}/libc"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
Vendored
+8
-2
@@ -1,7 +1,13 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"ms-vscode.cpptools",
|
||||
"akiramiyakoda.cppincludeguard",
|
||||
"ms-python.black-formatter"
|
||||
"llvm-vs-code-extensions.vscode-clangd",
|
||||
"ms-python.black-formatter",
|
||||
"ms-python.flake8",
|
||||
],
|
||||
"unwantedRecommendations": [
|
||||
"ms-vscode.cmake-tools",
|
||||
"ms-vscode.cpptools-extension-pack",
|
||||
"ms-vscode.cpptools",
|
||||
]
|
||||
}
|
||||
|
||||
Vendored
+7
-11
@@ -1,27 +1,21 @@
|
||||
{
|
||||
"[c]": {
|
||||
"files.encoding": "utf8",
|
||||
"editor.defaultFormatter": "ms-vscode.cpptools"
|
||||
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
|
||||
},
|
||||
"[cpp]": {
|
||||
"files.encoding": "utf8",
|
||||
"editor.defaultFormatter": "ms-vscode.cpptools"
|
||||
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
|
||||
},
|
||||
"[python]": {
|
||||
"editor.defaultFormatter": "ms-python.black-formatter"
|
||||
},
|
||||
"clangd.arguments": ["--header-insertion=never"],
|
||||
"clangd.fallbackFlags": [
|
||||
"-I${workspaceFolder}/include",
|
||||
"-I${workspaceFolder}/libc",
|
||||
"-I${workspaceFolder}/extern/musyx/include",
|
||||
"-D__MWERKS__",
|
||||
],
|
||||
"editor.tabSize": 2,
|
||||
"files.associations": {
|
||||
"source_location": "cpp",
|
||||
"*.h": "c",
|
||||
"*.inc": "c"
|
||||
"*.inc": "c",
|
||||
".clangd": "yaml",
|
||||
},
|
||||
"files.autoSave": "onFocusChange",
|
||||
"files.insertFinalNewline": true,
|
||||
@@ -50,5 +44,7 @@
|
||||
"C/C++ Include Guard.Auto Update Path Blocklist": [
|
||||
"include/zlib"
|
||||
],
|
||||
"cmake.configureOnOpen": false
|
||||
"cmake.configureOnOpen": false,
|
||||
// Disable C++ intellisense engine, use clangd instead
|
||||
"C_Cpp.intelliSenseEngine": "disabled"
|
||||
}
|
||||
|
||||
Vendored
+2
-30
@@ -1,40 +1,12 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
// Use Ctrl+Shift+B to run build tasks.
|
||||
// Or "Run Build Task" in the Command Palette.
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "ninja",
|
||||
"type": "shell",
|
||||
"command": "ninja",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "all_source",
|
||||
"type": "shell",
|
||||
"command": "ninja all_source",
|
||||
"group": "build",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "all_source_host",
|
||||
"type": "shell",
|
||||
"command": "ninja all_source_host",
|
||||
"problemMatcher": {
|
||||
"base": "$gcc"
|
||||
},
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"label": "current file (host)",
|
||||
"type": "shell",
|
||||
"command": "ninja host/${relativeFile}",
|
||||
"problemMatcher": {
|
||||
"base": "$gcc"
|
||||
},
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
static void* Alloc(size_t len, IAllocator::EHint hint = IAllocator::kHI_None,
|
||||
IAllocator::EScope scope = IAllocator::kSC_Unk1,
|
||||
IAllocator::EType type = IAllocator::kTP_Heap,
|
||||
const CCallStack& callstack = CCallStack(-1, "??(??)"));
|
||||
const CCallStack& callstack = CCallStack(-1, "\?\?(\?\?)"));
|
||||
static void Free(const void* ptr);
|
||||
static void SetOutOfMemoryCallback(IAllocator::FOutOfMemoryCb callback, const void* context);
|
||||
static void OffsetFakeStatics(int);
|
||||
@@ -32,7 +32,7 @@ void* operator new(size_t sz, const char*, const char*);
|
||||
void* operator new[](size_t sz, const char*, const char*);
|
||||
inline void operator delete(void* ptr) { CMemory::Free(ptr); }
|
||||
inline void operator delete[](void* ptr) { CMemory::Free(ptr); }
|
||||
#define rs_new new ("??(??)", nullptr)
|
||||
#define rs_new new ("\?\?(\?\?)", nullptr)
|
||||
#else
|
||||
void operator delete(void* ptr);
|
||||
void operator delete[](void* ptr);
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
|
||||
// -> CFrameDelayedKiller
|
||||
void* operator new(size_t sz, const char*, const char*);
|
||||
void* operator new(size_t sz) { return operator new(sz, "??(??)", nullptr); }
|
||||
void* operator new(size_t sz) { return operator new(sz, "\?\?(\?\?)", nullptr); }
|
||||
void operator delete(void* ptr, size_t sz);
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ template < typename T >
|
||||
class TOneStatic {
|
||||
public:
|
||||
void* operator new(size_t sz, const char*, const char*);
|
||||
void* operator new(size_t sz) { return operator new(sz, "??(??)", nullptr); }
|
||||
void* operator new(size_t sz) { return operator new(sz, "\?\?(\?\?)", nullptr); }
|
||||
void operator delete(void* ptr);
|
||||
|
||||
private:
|
||||
|
||||
+11
-4
@@ -65,18 +65,25 @@ typedef int BOOL;
|
||||
#define NULL 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(__cplusplus) || __cplusplus < 201103L
|
||||
// Define nullptr as NULL
|
||||
#ifndef nullptr
|
||||
#define nullptr NULL
|
||||
#endif
|
||||
#endif // !defined(__cplusplus) || __cplusplus < 201103L
|
||||
|
||||
#if defined(__MWERKS__)
|
||||
#if defined(__cplusplus) && __cplusplus < 201103L
|
||||
#if defined(__clang__)
|
||||
// Allow override in < C++11 mode with clangd
|
||||
#pragma clang diagnostic ignored "-Wc++11-extensions"
|
||||
#else
|
||||
// Define override as nothing
|
||||
#ifndef override
|
||||
#define override
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // defined(__clang__)
|
||||
#endif // defined(__cplusplus) && __cplusplus < 201103L
|
||||
|
||||
#ifndef ATTRIBUTE_ALIGN
|
||||
#if defined(__MWERKS__) || defined(__GNUC__)
|
||||
|
||||
@@ -136,11 +136,11 @@ public:
|
||||
return *this;
|
||||
}
|
||||
iterator operator--(int) { return iterator(this->curent->x0_prev); }
|
||||
T* get_pointer() const { return current->get_value(); }
|
||||
T& operator*() const { return *current->get_value(); }
|
||||
T* operator->() const { return current->get_value(); }
|
||||
bool operator==(const iterator& other) const { return current == other.current; }
|
||||
bool operator!=(const iterator& other) const { return current != other.current; }
|
||||
T* get_pointer() const { return this->current->get_value(); }
|
||||
T& operator*() const { return *this->current->get_value(); }
|
||||
T* operator->() const { return this->current->get_value(); }
|
||||
bool operator==(const iterator& other) const { return this->current == other.current; }
|
||||
bool operator!=(const iterator& other) const { return this->current != other.current; }
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
@@ -101,10 +101,10 @@ public:
|
||||
return *this;
|
||||
}
|
||||
pointer_iterator operator+(int v) const {
|
||||
return pointer_iterator(current + v);
|
||||
return pointer_iterator(this->current + v);
|
||||
}
|
||||
pointer_iterator operator-(int v) const {
|
||||
return pointer_iterator(current - v);
|
||||
return pointer_iterator(this->current - v);
|
||||
}
|
||||
// HACK: non-const operator- is required to match vector::insert
|
||||
difference_type operator-(const pointer_iterator& other) { return this->current - other.current; }
|
||||
|
||||
@@ -52,7 +52,7 @@ single_ptr< T >& single_ptr< T >::Set(T* ptr) {
|
||||
return *this = ptr;
|
||||
}
|
||||
|
||||
typedef single_ptr< void > unk_singleptr;
|
||||
typedef single_ptr< int > unk_singleptr;
|
||||
CHECK_SIZEOF(unk_singleptr, 0x4);
|
||||
} // namespace rstl
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ typename vector< T, Alloc >::iterator vector< T, Alloc >::erase(iterator first,
|
||||
return first;
|
||||
}
|
||||
|
||||
typedef vector< void > unk_vector;
|
||||
typedef vector< int > unk_vector;
|
||||
CHECK_SIZEOF(unk_vector, 0x10)
|
||||
} // namespace rstl
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// C++98 static assert
|
||||
|
||||
#ifdef __MWERKS__
|
||||
struct false_type {
|
||||
static const int value = 0;
|
||||
};
|
||||
@@ -17,7 +18,6 @@ struct _n_is_equal< A, A > : true_type {};
|
||||
template < class T, int N >
|
||||
struct check_sizeof : _n_is_equal< sizeof(T), N > {};
|
||||
|
||||
#ifdef __MWERKS__
|
||||
#ifndef offsetof
|
||||
typedef unsigned long size_t;
|
||||
#define offsetof(type, member) ((size_t) & (((type*)0)->member))
|
||||
@@ -26,6 +26,11 @@ typedef unsigned long size_t;
|
||||
#define NESTED_CHECK_SIZEOF(parent, cls, size) extern int cls##_check[check_sizeof< parent::cls, size >::value];
|
||||
#define CHECK_OFFSETOF(cls, member, offset) \
|
||||
extern int cls##_check_offset##[_n_is_equal< offsetof(cls, member), offset >::value];
|
||||
#elif defined(__clang__) && defined(__powerpc__) // Enable for clangd
|
||||
#pragma clang diagnostic ignored "-Wc++17-extensions" // Allow _Static_assert without message
|
||||
#define CHECK_SIZEOF(cls, size) _Static_assert(sizeof(cls) == size);
|
||||
#define NESTED_CHECK_SIZEOF(parent, cls, size) _Static_assert(sizeof(parent::cls) == size);
|
||||
#define CHECK_OFFSETOF(cls, member, offset) _Static_assert(offsetof(cls, member) == offset);
|
||||
#else
|
||||
#define CHECK_SIZEOF(cls, size)
|
||||
#define NESTED_CHECK_SIZEOF(parent, cls, size)
|
||||
|
||||
@@ -164,6 +164,7 @@ static inline int __fpclassifyd(double x) {
|
||||
#define isinf(x) (fpclassify(x) == FP_INFINITE)
|
||||
#define isfinite(x) ((fpclassify(x) > FP_INFINITE))
|
||||
|
||||
#ifdef __MWERKS__
|
||||
extern inline float sqrtf(float x) {
|
||||
static const double _half = .5;
|
||||
static const double _three = 3.0;
|
||||
@@ -198,6 +199,10 @@ _MATH_INLINE double sqrt(double x) {
|
||||
}
|
||||
return INFINITY;
|
||||
}
|
||||
#else
|
||||
float sqrtf(float x);
|
||||
double sqrt(double x);
|
||||
#endif
|
||||
|
||||
static inline float ldexpf(float x, int exp) { return (float)ldexp((double)x, exp); }
|
||||
static inline double scalbn(double x, int n) { return ldexp(x, n); }
|
||||
|
||||
@@ -23,7 +23,7 @@ bool CARAMManager::Initialize(uint chunkSize) {
|
||||
mpARAMStart = ARAlloc(chunkSize * numChunks);
|
||||
mpBookKeepingMemory = (uint*)CMemory::Alloc(numChunks * 4, IAllocator::kHI_None,
|
||||
IAllocator::kSC_Unk1, IAllocator::kTP_Heap,
|
||||
CCallStack(-1, "??(??)"));
|
||||
CCallStack(-1, "\?\?(\?\?)"));
|
||||
CMemory::OffsetFakeStatics(mNumChunks * 4);
|
||||
|
||||
for (uint i = 0; i < numChunks; ++i) {
|
||||
|
||||
@@ -48,11 +48,11 @@ CArchitectureMessage MakeMsg::CreateControllerStatus(EArchMsgTarget target, cons
|
||||
}
|
||||
|
||||
CArchitectureMessage MakeMsg::CreateQuitGameplay(EArchMsgTarget target) {
|
||||
return CArchitectureMessage(target, kAM_QuitGameplay, new("??(??)", nullptr) CArchMsgParmNull());
|
||||
return CArchitectureMessage(target, kAM_QuitGameplay, rs_new CArchMsgParmNull());
|
||||
}
|
||||
|
||||
CArchitectureMessage MakeMsg::CreateFrameBegin(EArchMsgTarget target, const int& a) {
|
||||
return CArchitectureMessage(target, kAM_FrameBegin, new("??(??)", nullptr) CArchMsgParmInt32(a));
|
||||
return CArchitectureMessage(target, kAM_FrameBegin, rs_new CArchMsgParmInt32(a));
|
||||
}
|
||||
|
||||
const CArchMsgParmInt32& MakeMsg::GetParmFrameBegin(const CArchitectureMessage& msg) {
|
||||
@@ -60,5 +60,5 @@ const CArchMsgParmInt32& MakeMsg::GetParmFrameBegin(const CArchitectureMessage&
|
||||
}
|
||||
|
||||
CArchitectureMessage MakeMsg::CreateFrameEnd(EArchMsgTarget target, const int& a) {
|
||||
return CArchitectureMessage(target, kAM_FrameEnd, new("??(??)", nullptr) CArchMsgParmInt32(a));
|
||||
return CArchitectureMessage(target, kAM_FrameEnd, rs_new CArchMsgParmInt32(a));
|
||||
}
|
||||
|
||||
@@ -772,10 +772,11 @@ void CPlayer::Update(float dt, CStateManager& mgr) {
|
||||
switch (x2f8_morphBallState) {
|
||||
case kMS_Unmorphed:
|
||||
case kMS_Morphing:
|
||||
case kMS_Unmorphing:
|
||||
case kMS_Unmorphing: {
|
||||
CTransform4f gunXf = GetModelData()->GetScaledLocatorTransform(rstl::string_l(kGunLocator));
|
||||
x7f4_gunWorldXf = GetTransform() * gunXf;
|
||||
break;
|
||||
}
|
||||
case kMS_Morphed:
|
||||
break;
|
||||
}
|
||||
@@ -2005,7 +2006,8 @@ void CPlayer::UpdateFreeLook(float dt) {
|
||||
}
|
||||
|
||||
angleVelP = x3e8_horizFreeLookAngleVel - x3e4_freeLookYawAngle;
|
||||
dx = lookDeltaAngle * CMath::Clamp(0.f, fabsf(angleVelP / gpTweakPlayer->GetHorizontalFreeLookAngleVel()), 1.f);
|
||||
dx = lookDeltaAngle *
|
||||
CMath::Clamp(0.f, fabsf(angleVelP / gpTweakPlayer->GetHorizontalFreeLookAngleVel()), 1.f);
|
||||
if (0.f <= angleVelP) {
|
||||
x3e4_freeLookYawAngle += dx;
|
||||
} else {
|
||||
|
||||
@@ -87,7 +87,7 @@ const char* s1 = "MiscSamus_AGSC";
|
||||
const char* s2 = "UI_AGSC";
|
||||
const char* s3 = "Weapons_AGSC";
|
||||
const char* s4 = "ZZZ_AGSC";
|
||||
const char* s5 = "??(??)";
|
||||
const char* s5 = "\?\?(\?\?)";
|
||||
const char* s6 = "";
|
||||
const char* s7 = "%d";
|
||||
const char* st8 = ".pak";
|
||||
|
||||
@@ -55,6 +55,7 @@ def dtk_url(tag: str) -> str:
|
||||
repo = "https://github.com/encounter/decomp-toolkit"
|
||||
return f"{repo}/releases/download/{tag}/dtk-{system}-{arch}{suffix}"
|
||||
|
||||
|
||||
def objdiff_cli_url(tag: str) -> str:
|
||||
uname = platform.uname()
|
||||
suffix = ""
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user