iOS: Change updater message because you don't need to compile source code to update anymore

This commit is contained in:
UnknownShadow200 2024-05-26 18:49:42 +10:00
parent 0e993ff6d4
commit aefed23229
3 changed files with 49 additions and 38 deletions

View File

@ -77,8 +77,9 @@ static void DoCreateWindow(int width, int height, int flags) {
Window_Main.Handle = win_handle;
/* TODO grab using SDL_SetWindowGrab? seems to be unnecessary on Linux at least */
}
void Window_Create2D(int width, int height) { DoCreateWindow(width, height, 0); }
#if !defined CC_BUILD_SOFTGPU
#if CC_GFX_BACKEND == CC_GFX_BACKEND_GL
void Window_Create3D(int width, int height) { DoCreateWindow(width, height, SDL_WINDOW_OPENGL); }
#else
void Window_Create3D(int width, int height) { DoCreateWindow(width, height, 0); }

View File

@ -61,8 +61,13 @@ static void DoCreateWindow(int width, int height, int flags) {
Window_Main.Handle = win_handle;
/* TODO grab using SDL_SetWindowGrab? seems to be unnecessary on Linux at least */
}
void Window_Create2D(int width, int height) { DoCreateWindow(width, height, 0); }
#if CC_GFX_BACKEND == CC_GFX_BACKEND_GL
void Window_Create3D(int width, int height) { DoCreateWindow(width, height, SDL_WINDOW_OPENGL); }
#else
void Window_Create3D(int width, int height) { DoCreateWindow(width, height, 0); }
#endif
void Window_SetTitle(const cc_string* title) {
char str[NATIVE_STR_LEN];

View File

@ -19,8 +19,6 @@
#include <sys/stat.h>
#include <UIKit/UIKit.h>
#include <UIKit/UIPasteboard.h>
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#include <CoreText/CoreText.h>
#ifdef TARGET_OS_TV
@ -690,8 +688,12 @@ cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) {
/*#########################################################################################################################*
*--------------------------------------------------------2D window--------------------------------------------------------*
*-----------------------------------------------------Window creation-----------------------------------------------------*
*#########################################################################################################################*/
@interface CC3DView : UIView
@end
static void Init3DLayer(void);
void Window_Create2D(int width, int height) {
launcherMode = true;
CGRect bounds = DoCreateWindow();
@ -701,49 +703,25 @@ void Window_Create2D(int width, int height) {
cc_controller.view = view_handle;
}
/*#########################################################################################################################*
*--------------------------------------------------------3D window--------------------------------------------------------*
*#########################################################################################################################*/
static void GLContext_OnLayout(void);
@interface CCGLView : UIView
@end
@implementation CCGLView
+ (Class)layerClass {
return [CAEAGLLayer class];
}
- (void)layoutSubviews {
[super layoutSubviews];
GLContext_OnLayout();
}
@end
void Window_Create3D(int width, int height) {
launcherMode = false;
CGRect bounds = DoCreateWindow();
// CAEAGLLayer - iOS 2.0
view_handle = [[CCGLView alloc] initWithFrame:bounds];
view_handle = [[CC3DView alloc] initWithFrame:bounds];
view_handle.multipleTouchEnabled = true;
cc_controller.view = view_handle;
CAEAGLLayer* layer = (CAEAGLLayer*)view_handle.layer;
layer.opaque = YES;
layer.drawableProperties =
@{
kEAGLDrawablePropertyRetainedBacking : [NSNumber numberWithBool:NO],
kEAGLDrawablePropertyColorFormat : kEAGLColorFormatRGBA8
};
Init3DLayer();
}
/*########################################################################################################################*
*--------------------------------------------------------GLContext--------------------------------------------------------*
*#########################################################################################################################*/
#if CC_GFX_BACKEND == CC_GFX_BACKEND_GL
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
static EAGLContext* ctx_handle;
static GLuint framebuffer;
static GLuint color_renderbuffer, depth_renderbuffer;
@ -837,14 +815,40 @@ cc_bool GLContext_SwapBuffers(void) {
}
void GLContext_SetFpsLimit(cc_bool vsync, float minFrameMs) { }
void GLContext_GetApiInfo(cc_string* info) { }
const struct UpdaterInfo Updater_Info = { "&eCompile latest source code to update", 0 };
@implementation CC3DView
+ (Class)layerClass {
return [CAEAGLLayer class];
}
- (void)layoutSubviews {
[super layoutSubviews];
GLContext_OnLayout();
}
@end
static void Init3DLayer(void) {
// CAEAGLLayer - iOS 2.0
CAEAGLLayer* layer = (CAEAGLLayer*)view_handle.layer;
layer.opaque = YES;
layer.drawableProperties =
@{
kEAGLDrawablePropertyRetainedBacking : [NSNumber numberWithBool:NO],
kEAGLDrawablePropertyColorFormat : kEAGLColorFormatRGBA8
};
}
#endif
/*########################################################################################################################*
*--------------------------------------------------------Updater----------------------------------------------------------*
*#########################################################################################################################*/
const char* const Updater_OGL = NULL;
const char* const Updater_D3D9 = NULL;
const struct UpdaterInfo Updater_Info = {
"&eRedownload and reinstall to update", 0
};
cc_bool Updater_Clean(void) { return true; }
cc_result Updater_GetBuildTime(cc_uint64* t) {
@ -873,6 +877,7 @@ cc_result Process_StartOpen(const cc_string* args) {
// openURL - iOS 2.0 (deprecated)
NSString* str = ToNSString(args);
NSURL* url = [[NSURL alloc] initWithString:str];
[UIApplication.sharedApplication openURL:url];
return 0;
}