Improve ios/android instructions in readme, and also get rid of one redundant frame in stacktraces on some platforms

This commit is contained in:
UnknownShadow200 2022-08-17 21:17:09 +10:00
parent 85bca0cb23
commit 224df71aac
2 changed files with 32 additions and 20 deletions

View file

@ -1,4 +1,4 @@
ClassiCube is a custom Minecraft Classic and ClassiCube client written in C that works on Windows, macOS, Linux, Android, FreeBSD, NetBSD, OpenBSD, Solaris, Haiku, and in a web browser.<br>
ClassiCube is a custom Minecraft Classic and ClassiCube client written in C that works on Windows, macOS, Linux, Android, iOS, FreeBSD, NetBSD, OpenBSD, Solaris, Haiku, and in a web browser.<br>
**It is not affiliated with (or supported by) Mojang AB, Minecraft, or Microsoft in any way.**
![screenshot_n](http://i.imgur.com/FCiwl27.png)
@ -108,6 +108,28 @@ Although the regular linux compiliation flags will work fine, to take full advan
```cc *.c interop_cocoa.m -o ClassiCube -framework Cocoa -framework OpenGL -framework IOKit -lobjc```
## Compiling - for Android
##### Using Android Studio GUI
Open `android` folder in Android Studio (TODO explain more detailed)
##### Using command line (gradle)
Run `gradlew` in android folder (TODO explain more detailed)
## Compiling - for iOS
iOS version will have issues as it's incomplete and only tested in iOS Simulator
##### Using Xcode GUI
Import `ios/CCIOS.xcodeproj` project into Xcode (TODO explain more detailed)
##### Using command line (Xcode)
`xcodebuild -sdk iphoneos -configuration Debug` (TODO explain more detailed)
## Compiling - other desktop OSes
#### FreeBSD
@ -150,17 +172,6 @@ Install libsdl2_devel, openal_devel, and libexecinfo_devel package if needed
The generated javascript file has some issues. [See here for how to fix](doc/compile-fixes.md#webclient-patches)
#### Android
Use Android Studio or run gradlew in android folder (TODO explain more detailed)
#### iOS
```clang *.c interop_ios.m -framework UIKit -framework OpenGLES -framework CoreGraphics -framework QuartzCore -framework Foundation```
iOS version will have issues as it's incomplete and only tested in iOS Simulator
##### Other
You'll have to write the necessary code. You should read portability.md in doc folder.

View file

@ -347,11 +347,6 @@ void Logger_Backtrace(cc_string* trace, void* ctx) {
String_AppendConst(trace, _NL);
}
#endif
static void DumpBacktrace(cc_string* str, void* ctx) {
static const cc_string backtrace = String_FromConst("-- backtrace --" _NL);
Logger_Log(&backtrace);
Logger_Backtrace(str, ctx);
}
/*########################################################################################################################*
@ -973,7 +968,8 @@ static void CloseLogFile(void) {
#define GFX_BACKEND " (Unknown)"
#endif
static void AbortCommon(cc_result result, const char* raw_msg, void* ctx) {
static void AbortCommon(cc_result result, const char* raw_msg, void* ctx) {
static const cc_string backtrace = String_FromConst("-- backtrace --" _NL);
cc_string msg; char msgBuffer[3070 + 1];
String_InitArray_NT(msg, msgBuffer);
@ -992,9 +988,14 @@ static void AbortCommon(cc_result result, const char* raw_msg, void* ctx) {
String_AppendConst(&msg, "Full details of the crash have been logged to 'client.log'.\n");
String_AppendConst(&msg, "Please report this on the ClassiCube forums or to UnknownShadow200.\n\n");
if (ctx) DumpRegisters(ctx);
DumpBacktrace(&msg, ctx);
/* These two function calls used to be in a separate DumpBacktrace function */
/* However that was not always inlined by the compiler, which resulted in a */
/* useless strackframe being logged - so manually inline Logger_Backtrace call */
Logger_Log(&backtrace);
Logger_Backtrace(&msg, ctx);
DumpMisc(ctx);
CloseLogFile();