mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 09:06:55 -04:00
iOS: Change updater message because you don't need to compile source code to update anymore
This commit is contained in:
parent
0e993ff6d4
commit
aefed23229
@ -77,8 +77,9 @@ static void DoCreateWindow(int width, int height, int flags) {
|
|||||||
Window_Main.Handle = win_handle;
|
Window_Main.Handle = win_handle;
|
||||||
/* TODO grab using SDL_SetWindowGrab? seems to be unnecessary on Linux at least */
|
/* TODO grab using SDL_SetWindowGrab? seems to be unnecessary on Linux at least */
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window_Create2D(int width, int height) { DoCreateWindow(width, height, 0); }
|
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); }
|
void Window_Create3D(int width, int height) { DoCreateWindow(width, height, SDL_WINDOW_OPENGL); }
|
||||||
#else
|
#else
|
||||||
void Window_Create3D(int width, int height) { DoCreateWindow(width, height, 0); }
|
void Window_Create3D(int width, int height) { DoCreateWindow(width, height, 0); }
|
||||||
|
@ -61,8 +61,13 @@ static void DoCreateWindow(int width, int height, int flags) {
|
|||||||
Window_Main.Handle = win_handle;
|
Window_Main.Handle = win_handle;
|
||||||
/* TODO grab using SDL_SetWindowGrab? seems to be unnecessary on Linux at least */
|
/* TODO grab using SDL_SetWindowGrab? seems to be unnecessary on Linux at least */
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window_Create2D(int width, int height) { DoCreateWindow(width, height, 0); }
|
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); }
|
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) {
|
void Window_SetTitle(const cc_string* title) {
|
||||||
char str[NATIVE_STR_LEN];
|
char str[NATIVE_STR_LEN];
|
||||||
|
@ -19,8 +19,6 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <UIKit/UIKit.h>
|
#include <UIKit/UIKit.h>
|
||||||
#include <UIKit/UIPasteboard.h>
|
#include <UIKit/UIPasteboard.h>
|
||||||
#include <OpenGLES/ES2/gl.h>
|
|
||||||
#include <OpenGLES/ES2/glext.h>
|
|
||||||
#include <CoreText/CoreText.h>
|
#include <CoreText/CoreText.h>
|
||||||
|
|
||||||
#ifdef TARGET_OS_TV
|
#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) {
|
void Window_Create2D(int width, int height) {
|
||||||
launcherMode = true;
|
launcherMode = true;
|
||||||
CGRect bounds = DoCreateWindow();
|
CGRect bounds = DoCreateWindow();
|
||||||
@ -701,49 +703,25 @@ void Window_Create2D(int width, int height) {
|
|||||||
cc_controller.view = view_handle;
|
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) {
|
void Window_Create3D(int width, int height) {
|
||||||
launcherMode = false;
|
launcherMode = false;
|
||||||
CGRect bounds = DoCreateWindow();
|
CGRect bounds = DoCreateWindow();
|
||||||
|
|
||||||
// CAEAGLLayer - iOS 2.0
|
view_handle = [[CC3DView alloc] initWithFrame:bounds];
|
||||||
view_handle = [[CCGLView alloc] initWithFrame:bounds];
|
|
||||||
view_handle.multipleTouchEnabled = true;
|
view_handle.multipleTouchEnabled = true;
|
||||||
cc_controller.view = view_handle;
|
cc_controller.view = view_handle;
|
||||||
|
|
||||||
CAEAGLLayer* layer = (CAEAGLLayer*)view_handle.layer;
|
Init3DLayer();
|
||||||
layer.opaque = YES;
|
|
||||||
layer.drawableProperties =
|
|
||||||
@{
|
|
||||||
kEAGLDrawablePropertyRetainedBacking : [NSNumber numberWithBool:NO],
|
|
||||||
kEAGLDrawablePropertyColorFormat : kEAGLColorFormatRGBA8
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*########################################################################################################################*
|
/*########################################################################################################################*
|
||||||
*--------------------------------------------------------GLContext--------------------------------------------------------*
|
*--------------------------------------------------------GLContext--------------------------------------------------------*
|
||||||
*#########################################################################################################################*/
|
*#########################################################################################################################*/
|
||||||
|
#if CC_GFX_BACKEND == CC_GFX_BACKEND_GL
|
||||||
|
#include <OpenGLES/ES2/gl.h>
|
||||||
|
#include <OpenGLES/ES2/glext.h>
|
||||||
|
|
||||||
static EAGLContext* ctx_handle;
|
static EAGLContext* ctx_handle;
|
||||||
static GLuint framebuffer;
|
static GLuint framebuffer;
|
||||||
static GLuint color_renderbuffer, depth_renderbuffer;
|
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_SetFpsLimit(cc_bool vsync, float minFrameMs) { }
|
||||||
void GLContext_GetApiInfo(cc_string* info) { }
|
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----------------------------------------------------------*
|
*--------------------------------------------------------Updater----------------------------------------------------------*
|
||||||
*#########################################################################################################################*/
|
*#########################################################################################################################*/
|
||||||
const char* const Updater_OGL = NULL;
|
const struct UpdaterInfo Updater_Info = {
|
||||||
const char* const Updater_D3D9 = NULL;
|
"&eRedownload and reinstall to update", 0
|
||||||
|
};
|
||||||
cc_bool Updater_Clean(void) { return true; }
|
cc_bool Updater_Clean(void) { return true; }
|
||||||
|
|
||||||
cc_result Updater_GetBuildTime(cc_uint64* t) {
|
cc_result Updater_GetBuildTime(cc_uint64* t) {
|
||||||
@ -873,6 +877,7 @@ cc_result Process_StartOpen(const cc_string* args) {
|
|||||||
// openURL - iOS 2.0 (deprecated)
|
// openURL - iOS 2.0 (deprecated)
|
||||||
NSString* str = ToNSString(args);
|
NSString* str = ToNSString(args);
|
||||||
NSURL* url = [[NSURL alloc] initWithString:str];
|
NSURL* url = [[NSURL alloc] initWithString:str];
|
||||||
|
|
||||||
[UIApplication.sharedApplication openURL:url];
|
[UIApplication.sharedApplication openURL:url];
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user