mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-12-03 17:51:25 +00:00
clean up some warnings, NSSearchPathForDirectoriesInDomains fixes
This commit is contained in:
parent
fafa3fcb8e
commit
aab9497a47
@ -224,6 +224,9 @@ static BOOL contextHasMakeCurrentReadExtension(CGLContextObj context){
|
||||
}
|
||||
#endif
|
||||
|
||||
static void _CGLCreateDynamicPbufferBacking(CGLContextObj context);
|
||||
static void _CGLDestroyDynamicPbufferBacking(CGLContextObj context);
|
||||
|
||||
static void resizeBackingIfNeeded(CGLContextObj context){
|
||||
if(!context->resizeBacking)
|
||||
return;
|
||||
@ -399,14 +402,6 @@ static BOOL contextHasPbufferExtension(CGLContextObj context){
|
||||
return YES;
|
||||
}
|
||||
|
||||
static int powerOfTwo(int value){
|
||||
int result=1;
|
||||
|
||||
while(result<value)
|
||||
result*=2;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void _CGLCreateDynamicPbufferBacking(CGLContextObj context){
|
||||
|
||||
@ -507,7 +502,7 @@ void _CGLCreateBufferBackingIfPossible(CGLContextObj context){
|
||||
CGLSetCurrentContext(saveContext);
|
||||
}
|
||||
|
||||
void _CGLDestroyStaticPbufferBacking(CGLContextObj context){
|
||||
static void _CGLDestroyStaticPbufferBacking(CGLContextObj context){
|
||||
// Window context must be current for pBuffer functions to work.
|
||||
opengl_wglMakeCurrent(context->windowDC,context->windowGLContext);
|
||||
reportGLErrorIfNeeded(__PRETTY_FUNCTION__,__LINE__);
|
||||
@ -531,7 +526,7 @@ void _CGLDestroyStaticPbufferBacking(CGLContextObj context){
|
||||
context->staticPbufferDC=NULL;
|
||||
}
|
||||
|
||||
void _CGLDestroyDynamicPbufferBacking(CGLContextObj context){
|
||||
static void _CGLDestroyDynamicPbufferBacking(CGLContextObj context){
|
||||
// Window context must be current for pBuffer functions to work.
|
||||
|
||||
opengl_wglMakeCurrent(context->windowDC,context->windowGLContext);
|
||||
|
@ -205,7 +205,7 @@ NSString * const NSInvalidatedAllObjectsKey=@"NSInvalidatedAllObjectsKey";
|
||||
}
|
||||
|
||||
-(NSAtomicStoreCacheNode *)_cacheNodeForObjectID:(NSManagedObjectID *)objectID {
|
||||
NSAtomicStore *store=[_storeCoordinator _persistentStoreForObjectID:objectID];
|
||||
NSAtomicStore *store=(NSAtomicStore *)[_storeCoordinator _persistentStoreForObjectID:objectID];
|
||||
|
||||
return [store cacheNodeForObjectID:objectID];
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ static NSMutableDictionary *_storeTypes=nil;
|
||||
NSManagedObjectModel *model=[self managedObjectModel];
|
||||
NSEntityDescription *entity=[[model entitiesByName] objectForKey:entityName];
|
||||
|
||||
return [[self _persistentStoreWithIdentifier:host] objectIDForEntity:entity referenceObject:referenceObject];
|
||||
return [(NSAtomicStore *)[self _persistentStoreWithIdentifier:host] objectIDForEntity:entity referenceObject:referenceObject];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -214,7 +214,9 @@
|
||||
break;
|
||||
|
||||
case NSDateAttributeType:
|
||||
objectValue=[NSCalendarDate dateWithNaturalLanguageString:stringValue];
|
||||
objectValue=nil;
|
||||
// we don't want to use NSCalendarDate
|
||||
// objectValue=[NSCalendarDate dateWithNaturalLanguageString:stringValue];
|
||||
break;
|
||||
|
||||
case NSBinaryDataAttributeType:
|
||||
|
@ -156,13 +156,13 @@ size_t strlcpy(char *dst, const char *src, size_t size) {
|
||||
|
||||
char *strnstr(const char *s1,const char *s2, size_t n) {
|
||||
if(s2[0]=='\0')
|
||||
return s1;
|
||||
return (char *)s1;
|
||||
|
||||
size_t i,patLength=strlen(s2);
|
||||
|
||||
for(i=0;s1[i]!='\0' && i+patLength<=n;i++)
|
||||
if(strncmp(s1+i,s2,patLength)==0)
|
||||
return s1+i;
|
||||
return (char *)(s1+i);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -8,12 +8,14 @@ struct __CFBoolean {
|
||||
|
||||
#define ToNSNumber(object) ((NSNumber *)object)
|
||||
|
||||
@implementation NSNumber_CF(CF)
|
||||
|
||||
CFTypeID CFBooleanGetTypeID(void) {
|
||||
return kNSCFTypeBoolean;
|
||||
}
|
||||
|
||||
CFNumberType CFNumberGetType(CFNumberRef self) {
|
||||
if([self isKindOfClass:[NSNumber_CF class]])
|
||||
if([ToNSNumber(self) isKindOfClass:[NSNumber_CF class]])
|
||||
return ((NSNumber_CF *)self)->_type;
|
||||
|
||||
return kCFNumberIntType;
|
||||
@ -22,3 +24,5 @@ CFNumberType CFNumberGetType(CFNumberRef self) {
|
||||
Boolean CFBooleanGetValue(CFBooleanRef self) {
|
||||
return [ToNSNumber(self) boolValue];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -289,16 +289,23 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
NSArray *NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory,NSSearchPathDomainMask mask,BOOL expand) {
|
||||
if(mask!=NSUserDomainMask)
|
||||
NSUnimplementedFunction();
|
||||
|
||||
|
||||
/* Callers expect the directories to exist, so create them if needed.
|
||||
*/
|
||||
|
||||
if(directory==NSCachesDirectory){
|
||||
NSString *path=[[[NSHomeDirectory() stringByAppendingPathComponent:@"Library"] stringByAppendingPathComponent:@"Caches"] stringByAppendingPathComponent:[[NSProcessInfo processInfo] processName]];
|
||||
NSString *path=[[NSHomeDirectory() stringByAppendingPathComponent:@"Library"] stringByAppendingPathComponent:@"Caches"];
|
||||
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil];
|
||||
|
||||
return [NSArray arrayWithObject:path];
|
||||
}
|
||||
|
||||
if(directory==NSApplicationSupportDirectory){
|
||||
NSString *path=[[[NSHomeDirectory() stringByAppendingPathComponent:@"Library"] stringByAppendingPathComponent:@"Application Support"] stringByAppendingPathComponent:[[NSProcessInfo processInfo] processName]];
|
||||
|
||||
NSString *path=[[NSHomeDirectory() stringByAppendingPathComponent:@"Library"] stringByAppendingPathComponent:@"Application Support"];
|
||||
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil];
|
||||
|
||||
return [NSArray arrayWithObject:path];
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <Foundation/NSMutableDictionary.h>
|
||||
#import <Foundation/NSMutableArray.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <string.h>
|
||||
|
||||
enum {
|
||||
STATE_content,
|
||||
|
@ -29,12 +29,14 @@
|
||||
|
||||
@implementation O2Paint_image
|
||||
|
||||
#if 0
|
||||
ONYX2D_STATIC int O2PaintReadResampledHighSpan_largb32f_PRE(O2Paint *selfX,int x,int y,O2argb32f *span,int length){
|
||||
O2Paint_image *self=(O2Paint_image *)selfX;
|
||||
|
||||
O2ImageBicubic_largb32f_PRE(self->_image,x,y,span,length,self->m_surfaceToPaintMatrix);
|
||||
return length;
|
||||
}
|
||||
#endif
|
||||
|
||||
ONYX2D_STATIC int O2PaintReadResampledLowSpan_largb32f_PRE(O2Paint *selfX,int x,int y,O2argb32f *span,int length){
|
||||
O2Paint_image *self=(O2Paint_image *)selfX;
|
||||
|
@ -40,6 +40,7 @@ static void dump(O2TTFDecoderRef self,NSString *format,...){
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static CFIndex currentPosition(O2TTFDecoderRef self){
|
||||
return self->_position;
|
||||
}
|
||||
@ -47,6 +48,7 @@ static CFIndex currentPosition(O2TTFDecoderRef self){
|
||||
static void seekToPosition(O2TTFDecoderRef self,CFIndex value){
|
||||
self->_position=value;
|
||||
}
|
||||
#endif
|
||||
|
||||
static uint8_t decode_uint8(O2TTFDecoderRef self){
|
||||
if(self->_position>=self->_length){
|
||||
|
@ -1161,7 +1161,7 @@ BOOL VGPathAddQuadTo(VGPath *self,O2Point p0, O2Point p1, O2Point p2, BOOL subpa
|
||||
}
|
||||
|
||||
// Tessellates a cubic-to segment.
|
||||
|
||||
#if 0
|
||||
// Bezier to lines from: Windows Graphics Programming by Feng Yuan
|
||||
static void bezier(VGPath *self,double x1,double y1,double x2, double y2,double x3,double y3,double x4,double y4,unsigned *prevFlags,O2Point *pp,O2Point *tp){
|
||||
// Ax+By+C=0 is the line (x1,y1) (x4,y4);
|
||||
@ -1199,6 +1199,7 @@ static void bezier(VGPath *self,double x1,double y1,double x2, double y2,double
|
||||
bezier(self,x/8,y/8,x2334/4,y2334/4,x34/2,y34/2,x4,y4,prevFlags,pp,tp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL VGPathAddCubicTo(VGPath *self,O2Point p0, O2Point p1, O2Point p2, O2Point p3, BOOL subpathHasGeometry){
|
||||
if(Vector2IsEqual(p0,p1) && Vector2IsEqual(p0,p2) && Vector2IsEqual(p0 ,p3))
|
||||
|
@ -161,6 +161,7 @@ static void applyCoverageToSpan_lRGBA8888_PRE(O2argb8u *dst,uint8_t *coverageSpa
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void drawGray8Stencil(O2Context_builtin_gdi *self,O2Surface *surface,CGFloat fpx,CGFloat fpy,O2Paint *paint,uint8_t *coverage,size_t bytesPerRow,size_t width,size_t height,int left,int top){
|
||||
int x=lroundf(fpx)+left;
|
||||
int y=lroundf(fpy)-top;
|
||||
@ -231,7 +232,6 @@ static void drawGray8Stencil(O2Context_builtin_gdi *self,O2Surface *surface,CGFl
|
||||
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void drawFreeTypeBitmap(O2Context_builtin_gdi *self,O2Surface *surface,O2GlyphStencilRef stencil,CGFloat fpx,CGFloat fpy,O2Paint *paint){
|
||||
drawGray8Stencil(self,surface,fpx,fpy,paint,O2GlyphStencilGetCoverage(stencil),O2GlyphStencilGetWidth(stencil),O2GlyphStencilGetWidth(stencil),O2GlyphStencilGetHeight(stencil),O2GlyphStencilGetLeft(stencil),O2GlyphStencilGetTop(stencil));
|
||||
}
|
||||
|
@ -116,7 +116,7 @@
|
||||
|
||||
[_renderer render];
|
||||
|
||||
[pixelSurface flushBuffer];
|
||||
[pixelSurface readBuffer];
|
||||
}
|
||||
|
||||
-(void)render {
|
||||
|
@ -6,6 +6,10 @@
|
||||
#import <OpenGL/OpenGL.h>
|
||||
#import <Onyx2D/O2Surface.h>
|
||||
|
||||
@interface CALayer(private)
|
||||
-(NSNumber *)_textureId;
|
||||
@end
|
||||
|
||||
@implementation CARenderer
|
||||
|
||||
-(CGRect)bounds {
|
||||
|
Loading…
Reference in New Issue
Block a user