mirror of https://github.com/ClassiCube/ClassiCube
macOS: Fix some small mistakes with reference counting
This commit is contained in:
parent
b4fdd26946
commit
b6eb396626
|
|
@ -349,7 +349,8 @@ static void ApplyIcon(void) {
|
|||
img = [img initWithSize:NSMakeSize(CCIcon_Width, CCIcon_Height)];
|
||||
[img addRepresentation:rep];
|
||||
[appHandle setApplicationIconImage:img];
|
||||
//[img release];
|
||||
|
||||
[img release];
|
||||
}
|
||||
|
||||
static pascal OSErr HandleQuitMessage(const AppleEvent* ev, AppleEvent* reply, long handlerRefcon) {
|
||||
|
|
@ -404,7 +405,6 @@ void Window_SetTitle(const cc_string* title) {
|
|||
|
||||
str = [NSString stringWithUTF8String:raw];
|
||||
[winHandle setTitle:str];
|
||||
[str release];
|
||||
}
|
||||
|
||||
// NOTE: Only defined since macOS 10.7 SDK
|
||||
|
|
@ -781,7 +781,7 @@ static int SupportsModernFullscreen(void) {
|
|||
return [winHandle respondsToSelector:@selector(toggleFullScreen:)];
|
||||
}
|
||||
|
||||
static NSOpenGLPixelFormat* MakePixelFormat(cc_bool fullscreen) {
|
||||
static NSOpenGLPixelFormat* InitPixelFormat(cc_bool fullscreen) {
|
||||
// TODO: Is there a penalty for fullscreen contexts in 10.7 and later?
|
||||
// Need to test whether there is a performance penalty or not
|
||||
if (SupportsModernFullscreen()) fullscreen = false;
|
||||
|
|
@ -800,11 +800,11 @@ static NSOpenGLPixelFormat* MakePixelFormat(cc_bool fullscreen) {
|
|||
|
||||
void GLContext_Create(void) {
|
||||
NSOpenGLPixelFormat* fmt;
|
||||
fmt = MakePixelFormat(true);
|
||||
fmt = InitPixelFormat(true);
|
||||
if (!fmt) {
|
||||
Platform_LogConst("Failed to create full screen pixel format.");
|
||||
Platform_LogConst("Trying again to create a non-fullscreen pixel format.");
|
||||
fmt = MakePixelFormat(false);
|
||||
fmt = InitPixelFormat(false);
|
||||
}
|
||||
if (!fmt) Process_Abort("Choosing pixel format");
|
||||
|
||||
|
|
@ -813,9 +813,10 @@ void GLContext_Create(void) {
|
|||
if (!ctxHandle) Process_Abort("Failed to create OpenGL context");
|
||||
|
||||
[ctxHandle setView:viewHandle];
|
||||
[fmt release];
|
||||
[ctxHandle makeCurrentContext];
|
||||
[ctxHandle update];
|
||||
|
||||
[fmt release];
|
||||
}
|
||||
|
||||
void GLContext_Update(void) {
|
||||
|
|
|
|||
|
|
@ -22,17 +22,17 @@
|
|||
|
||||
! Final calculation:
|
||||
! out->c = type << 24
|
||||
! out->x = ((v2->x - v1->x) + v1->x) * 1/zNear
|
||||
! out->y = ((v2->y - v1->y) + v1->y) * 1/zNear
|
||||
! out->x = (t * (v2->x - v1->x) + v1->x) * 1/zNear
|
||||
! out->y = (t * (v2->y - v1->y) + v1->y) * 1/zNear
|
||||
! out->w = 1/zNear
|
||||
!
|
||||
! out->u = (v2->u - v1->u) + v1->u;
|
||||
! out->v = (v2->v - v1->v) + v1->v;
|
||||
! out->u = t * (v2->u - v1->u) + v1->u;
|
||||
! out->v = t * (v2->v - v1->v) + v1->v;
|
||||
!
|
||||
! out->b = (v2->b - v1->b) + v1->b;
|
||||
! out->g = (v2->g - v1->g) + v1->g;
|
||||
! out->r = (v2->r - v1->r) + v1->r;
|
||||
! out->a = (v2->a - v1->a) + v1->a;
|
||||
! out->b = t * (v2->b - v1->b) + v1->b;
|
||||
! out->g = t * (v2->g - v1->g) + v1->g;
|
||||
! out->r = t * (v2->r - v1->r) + v1->r;
|
||||
! out->a = t * (v2->a - v1->a) + v1->a;
|
||||
|
||||
! INPUT ARGUMENTS
|
||||
#define IN1 r4 // input vertex 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue