discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ghack - GNUstep roguelike


From: Dr. H. Nikolaus Schaller
Subject: Re: Ghack - GNUstep roguelike
Date: Tue, 12 Mar 2013 08:20:43 +0100

Hi,

>>> 
>>> 1. the code uses [[NSMutableString new] initWithString:@"..."]
>>> 
>>> This fails on OSX, because +new already calls -init and returns some 
>>> NSCFString
>>> subclass that does not understand -initWithString. Please use 
>>> [NSMutableString alloc] initWithString:...
> 
> One trick is to edit a file /usr/include/GNUstep/Foundation.h on macosx and 
> put #import <Cocoa/Cocoa.h> in it. Then again NSString is the way to go 
> sometimes.
> 
> It was made for GNUStep hence the roguelike.

Well, even on GNUstep it is wrong to initialize an object that is already 
initialized.

And the [Class new] method is a shortcut for [[Class alloc] init].

i.e. you have to replace

[[[Class alloc] init] initWithString:...]


> 
>>> 
>>> 2. OS X and QantumSTEP don't have the PS() operator functions
> 
> There is GS in this case on MacOS X, with some other framework library for 
> iOS.

???

I want to link your code either against Cocoa or QuantumSTEP. And these systems 
don't provide the PS() operators. I.e. your code is making assumptions about 
the libraries that limit portability. But all of them provide a full 
implementation of NSBezierPath. So why use cryptic and undocumented 
PS()-operators instead of a well documented @interface?

> 
>>> 
>>> I have added some macros to my code to build an NSBezierPath and 
>>> fill/stroke it.
>>> 
>>> 3. there is no [con getSymbolData] method in drawRogueCharacter
>>> 
>>> Shouldn't that be getCharacterXpmData?
> 
> This is in development if I find the time for it.

Ok, I will watch out for updates.

> 
>>> 
>>> 4. the code uses strndup() which is a GNU/Linux extension not available 
>>> everywhere
>>> 
> 
> Again, GNUStep is a UNIX/Linux system.

No. GNUstep also runs on BSD and others. Even Windows.

See: http://stackoverflow.com/questions/6062822/whats-wrong-with-strndup

> 
>>> I have added the code from 
>>> http://opensource.apple.com/source/gcc/gcc-5575.11/libiberty/strndup.c
>>> 
>>> 5. the GhackInfo.plist is missing some or using different keys for OS X 
>>> (icon file, executable)
>>> 
>>> BR and please continue the good work!
> 
> These are in ./Resources/. It uses the mouse not the keyboard :-)

???

Key = key for a NSDictionary. Not Key-board button.

Your http://code.google.com/p/ghack/source/browse/Ghack-0.1/GhackInfo.plist 
defines:

{
ApplicationDescription = "GNUstep roguelike game";
ApplicationIcon = "Ghack.tiff";
ApplicationName = Ghack;
ApplicationRelease = "0.2";
Authors = (
"Marko Riedel"
);
Copyright = "Copyright (C) 2002-2011 Free Software Foundation, Inc";
CopyrightDescription = "Released under GPL v2";
FullVersionID = "0.2";
NSExecutable = Ghack;
NSIcon = "Ghack.tiff";
NSPrincipalClass = NSApplication;
NSRole = Application;
URL = "http://gap.nongnu.org/gmines/";;
}

For being source code compatible to Cocoa it should include

ApplicationIcon -> CFBundleIconFile
FullVersionID -> CFBundleVersion
NSExecutable -> CFBundleExecutable
NSIcon -> CFBundleIconFile

etc.

> 
> Good points, Thanks for the comment.

Yes, please improve!

> FYI, I am working on an ObjC game for 
> iOS, called zoowy the wizard : http://code.google.com/p/zoowy/downloads/list
> 
> Here's a screenshot : http://zoowy.googlecode.com/files/zoowy-screenshot-1.png
> 
> It includes a XCode project file.

Well, porting iOS to GNUstep or QuantumSTEP is more difficult.

> 
> Enjoy and take care,

same to you,
-- hns




reply via email to

[Prev in Thread] Current Thread [Next in Thread]