Skip to content

Commit 9a4be39

Browse files
committed
2 parents da66c3e + 023274b commit 9a4be39

File tree

6 files changed

+77
-30
lines changed

6 files changed

+77
-30
lines changed

loader/include/Geode/cocos/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.0.0)
1+
cmake_minimum_required(VERSION 3.21)
22

33
project(cocos-headers CXX)
44

loader/include/Geode/cocos/particle_nodes/CCParticleSystem.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,16 @@ class CC_DLL CCParticleSystem : public CCNode, public CCTextureProtocol
487487
protected:
488488
virtual void updateBlendFunc();
489489
public:
490+
// @note RobTop Addition
491+
bool m_bWorldPosUninitialized;
492+
// @note RobTop Addition
493+
CCPoint m_tWorldPos;
494+
// @note RobTop Addition
495+
ccColor4F m_tUniformColor;
496+
// @note RobTop Addition
497+
ccColor4F m_tUniformDeltaColor;
498+
// @note RobTop Addition
499+
bool m_bUseUniformColorMode;
490500
// saved/loaded in loadDefaults, loadScaledDefaults and saveDefaults
491501

492502
// @note RobTop Addition
@@ -500,11 +510,15 @@ class CC_DLL CCParticleSystem : public CCNode, public CCTextureProtocol
500510
// @note RobTop Addition
501511
float m_fDefaultEndSize;
502512
// @note RobTop Addition
513+
float m_fDefaultAngle;
514+
// @note RobTop Addition
503515
float m_fDefaultModeASpeed;
504516
// @note RobTop Addition
505517
float m_fDefaultModeASpeedVar;
506518
// @note RobTop Addition
507519
CCPoint m_tDefaultPosVar;
520+
// @note RobTop Addition
521+
int m_nCustomParticleIndex;
508522
public:
509523
// @note RobTop Addition
510524
void saveDefaults(void);

loader/include/Geode/cocos/particle_nodes/CCParticleSystemQuad.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,15 @@ class CC_DLL CCParticleSystemQuad : public CCParticleSystem
153153

154154
GLuint m_pBuffersVBO[2]; //0: vertex 1: indices
155155

156+
// @note Robtop Addition
157+
CCRect m_tTextureRect;
158+
// @note Robtop Addition
159+
ccColor4B m_tQuadColor;
160+
// @note Robtop Addition
161+
GLushort m_uParticleIdx;
162+
// @note Robtop Addition
163+
GLubyte m_uOpacity;
164+
156165
public:
157166
/**
158167
* @js ctor
@@ -227,8 +236,8 @@ class CC_DLL CCParticleSystemQuad : public CCParticleSystem
227236
static CCParticleSystemQuad * create(const char*, bool);
228237
static CCParticleSystemQuad * createWithTotalParticles(unsigned int numberOfParticles, bool);
229238

230-
unsigned char getOpacity();
231-
void setOpacity(unsigned char);
239+
GLubyte getOpacity() { return m_uOpacity; }
240+
void setOpacity(GLubyte opacity) { m_uOpacity = opacity; }
232241

233242
void updateTexCoords();
234243

loader/launcher/mac/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.3.0)
1+
cmake_minimum_required(VERSION 3.21)
22

33

44
add_library(GeodeBootstrapper SHARED Bootstrapper.cpp)

loader/src/platform/ios/crashlog.mm

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
// https://gist.github.com/jvranish/4441299
2121

22-
static constexpr size_t FRAME_SIZE = 64;
22+
static constexpr size_t FRAME_SIZE = 128;
2323
static int s_signal = 0;
2424
static siginfo_t* s_siginfo = nullptr;
2525
static ucontext_t* s_context = nullptr;
@@ -70,6 +70,16 @@
7070
if (imageName.empty()) {
7171
imageName = "<Unknown>";
7272
}
73+
74+
// don't print those really long paths
75+
if (
76+
imageName.ends_with("Geode.ios.dylib")
77+
|| imageName.ends_with("GeometryJump")
78+
|| imageName.find("game/geode/unzipped") != std::string::npos
79+
) {
80+
imageName = imageName.substr(imageName.find_last_of('/') + 1);
81+
}
82+
7383
return imageName;
7484
}
7585

@@ -178,20 +188,20 @@ size_t getImageSize(struct mach_header_64 const* header) {
178188
}
179189

180190
extern "C" void signalHandler(int signal, siginfo_t* signalInfo, void* vcontext) {
181-
/*auto context = reinterpret_cast<ucontext_t*>(vcontext);
182-
s_backtraceSize = backtrace(s_backtrace.data(), FRAME_SIZE);
191+
/*auto context = reinterpret_cast<ucontext_t*>(vcontext);
192+
s_backtraceSize = backtrace(s_backtrace.data(), FRAME_SIZE);
183193
184194
// for some reason this is needed, dont ask me why
185-
s_backtrace[2] = reinterpret_cast<void*>(context->uc_mcontext->__ss.__pc);
186-
if (s_backtraceSize < FRAME_SIZE) {
187-
s_backtrace[s_backtraceSize] = nullptr;
188-
}*/
189-
190-
s_signal = signal;
191-
s_siginfo = signalInfo;
192-
s_context = reinterpret_cast<ucontext_t*>(vcontext);
193-
char buf = '1';
194-
write(s_pipe[1], &buf, 1);
195+
s_backtrace[2] = reinterpret_cast<void*>(context->uc_mcontext->__ss.__pc);
196+
if (s_backtraceSize < FRAME_SIZE) {
197+
s_backtrace[s_backtraceSize] = nullptr;
198+
}*/
199+
200+
s_signal = signal;
201+
s_siginfo = signalInfo;
202+
s_context = reinterpret_cast<ucontext_t*>(vcontext);
203+
char buf = '1';
204+
write(s_pipe[1], &buf, 1);
195205
}
196206

197207
// https://stackoverflow.com/questions/8278691/how-to-fix-backtrace-line-number-error-in-c
@@ -223,9 +233,9 @@ size_t getImageSize(struct mach_header_64 const* header) {
223233
std::stringstream stacktrace;
224234

225235
auto messages = backtrace_symbols(s_backtrace.data(), s_backtraceSize);
226-
if (s_backtraceSize < FRAME_SIZE) {
227-
messages[s_backtraceSize] = nullptr;
228-
}
236+
if (s_backtraceSize < FRAME_SIZE) {
237+
messages[s_backtraceSize] = nullptr;
238+
}
229239

230240
std::stringstream lines(addr2Line());
231241

@@ -272,7 +282,7 @@ size_t getImageSize(struct mach_header_64 const* header) {
272282
std::getline(stream, function);
273283

274284
cutoff = function.find("+");
275-
stream = std::stringstream(function.substr(cutoff));
285+
stream = std::stringstream(function.substr(cutoff + 1));
276286
stream >> offset;
277287
function = geode::utils::string::trim(function.substr(0, cutoff));
278288

@@ -285,13 +295,25 @@ size_t getImageSize(struct mach_header_64 const* header) {
285295
free(demangle);
286296
}
287297

298+
// don't display the (function + offset) part if it will be bogus.
299+
// the first case (0x0) happens with hook handlers, while the second happens because
300+
// GD exports a few fmt symbols, so backtrace_symbols thinks every function in GD is the last fmt symbol in the binary
301+
if (function == "0x0" || (binary == "GeometryJump" && offset > 0x1000)) {
302+
function = "";
303+
}
304+
288305
if (auto image = imageFromAddress(reinterpret_cast<void*>(address))) {
289306
stacktrace << "- " << getImageName(image) << " + " << std::showbase << std::hex << (address - (uintptr_t)image->imageLoadAddress) << std::dec;
290307
}
291308
else {
292-
stacktrace << "- " << binary << " @ " << std::showbase << std::hex << address << std::dec;
309+
stacktrace << "- " << binary;
293310
}
294-
stacktrace << " (" << function << " + " << offset << ") @ " << std::showbase << std::hex << address << std::dec << "\n";
311+
312+
if (!function.empty()) {
313+
stacktrace << " (" << function << " + " << offset << ")";
314+
}
315+
316+
stacktrace << " @ " << std::showbase << std::hex << address << std::dec << "\n";
295317
}
296318
}
297319

@@ -352,7 +374,7 @@ static void handlerThread() {
352374
while (read(s_pipe[0], &buf, 1) != 0) {
353375
auto signalAddress = reinterpret_cast<void*>(s_context->uc_mcontext->__ss.__pc);
354376
// as you can tell, i moved code from signalHandler to here
355-
if (s_context) {
377+
if (s_context) {
356378
//s_backtraceSize = backtrace(s_backtrace.data(), FRAME_SIZE);
357379
// i can't use 2 because then it'll show the actual stacktrace to be lower than what it actually is
358380
s_backtrace[s_backtraceSize++] = signalAddress;
@@ -366,15 +388,15 @@ static void handlerThread() {
366388
void** frame = reinterpret_cast<void**>(current_fp);
367389
void* next_fp = frame[0];
368390
void* lr = frame[1];
369-
391+
370392
if (next_fp == current_fp || lr == nullptr) break;
371-
393+
372394
s_backtrace[s_backtraceSize++] = lr;
373395
current_fp = next_fp;
374396
}
375397
}
376-
Mod* faultyMod = modFromAddress(signalAddress);
377-
398+
Mod* faultyMod = modFromAddress(signalAddress);
399+
378400
// Mod* faultyMod = nullptr;
379401
// for (int i = 1; i < s_backtraceSize; ++i) {
380402
// auto mod = modFromAddress(s_backtrace[i]);
@@ -387,7 +409,7 @@ static void handlerThread() {
387409

388410
log::error("Geode crashed!\n{}", text);
389411
std::_Exit(EXIT_FAILURE);
390-
//s_signal = 0;
412+
//s_signal = 0;
391413
}
392414
}
393415

loader/src/ui/GeodeUI.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,12 @@ class ModLogoSprite : public CCNode {
269269
}
270270
}
271271
void setSprite(ByteVector&& data, bool postEvent) {
272-
auto image = Ref(new CCImage());
272+
auto image = new CCImage();
273273
image->initWithImageData(data.data(), data.size());
274274

275275
auto texture = CCTextureCache::get()->addUIImage(image, m_modID.c_str());
276+
image->release();
277+
276278
this->setSprite(CCSprite::createWithTexture(texture), postEvent);
277279
}
278280

0 commit comments

Comments
 (0)