Monthly Archives: January 2010

Building netrek vanilla 2.16 for MacTrek

Ever since OS X 10.5 came out, the embedded netrek server in MacTrek simply quit. I never got a good fix for that, which is why MacTrek 1.5 no longer supports a local server. At least that way a player

Tagged with: ,
Posted in Code

Discography

I’ve been playing music since 1990 and started recording as soon as other people could bear to listen to it. Over the years many recordings were made and some made it onto albums. For historical reasons, and to help my

Tagged with:
Posted in Music

Taming Snow Leopard: CGDisplaySwitchToMode deprecation

Last one.. (i hope) here’s a snippet that will flick the screen in a best match resolution using only 10.6 API. – (void) setDisplay:(CGDirectDisplayID) dspy toMode: (struct screenMode) screenMode { CGDisplayModeRef mode; CGDisplayErr err; CGDisplayModeRef originalMode = CGDisplayCopyDisplayMode(kCGDirectMainDisplay); if (

Tagged with: ,
Posted in Code

Taming Snow Leopard: CGDisplayBestModeForParameters deprecation

We used to have a cool function that would give us the best match for a given resolution, it’s deprecated so let’s work around it. Again Apple failed to provide a documented example so here is one: struct screenMode {

Tagged with: ,
Posted in Code

Taming Snow Leopard: CGDisplayBitsPerPixel deprecation

This one is tricky, since Apple does not provide you with an alternative API. There is one hidden in the header files however, replace: .. bitsPerPixel = CGDisplayBitsPerPixel(CGMainDisplayID()); .. with: — (size_t) displayBitsPerPixel:(CGDirectDisplayID) displayId { CGDisplayModeRef mode = CGDisplayCopyDisplayMode(displayId); size_t

Tagged with: ,
Posted in Apple, Code

Taming Snow Leopard: stringWithCString: length depreciation

I know this one has been depreciated in 10.5 to but i never found a nice replacement until now: message = [NSString stringWithCString:(buffer + 4) length:(arg2 -5)]; becomes: message = [[[NSString alloc] initWithBytes:(buffer + 4) length:(arg2 -5) encoding:NSASCIIStringEncoding] autorelease];

Tagged with: , ,
Posted in Code

Taming Snow leopard: Format not a string literal and format arguments

I am porting MacTrek to OS X 10.6 native (from 10.4) and i got the “Format not a string literal and format arguments” error a couple of hundred times. Source of the problem is: #define LLLog if([[NSUserDefaults standardUserDefaults]boolForKey:@”LLLogDisabled”]!=YES)NSLog Apparently NSLog

Tagged with: ,
Posted in Code
Categories