Missing files from r1153.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1154 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2007-09-01 12:07:02 +00:00
parent 1afa377d76
commit 2df17375b1
7 changed files with 36 additions and 10 deletions

View File

@ -604,14 +604,14 @@
isa = PBXContainerItemProxy;
containerPortal = 1A0519340C7CCAC900BA5CCA /* DebugOXP.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 8D5B49AC048680CD000E48DA /* DebugOXP */;
remoteGlobalIDString = 8D5B49AC048680CD000E48DA;
remoteInfo = DebugOXP;
};
1AD267550C83052600B4BFD1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
proxyType = 1;
remoteGlobalIDString = 0865423506B8447D000CA0AB /* Oolite */;
remoteGlobalIDString = 0865423506B8447D000CA0AB;
remoteInfo = Oolite;
};
/* End PBXContainerItemProxy section */

View File

@ -40,6 +40,11 @@ _JS_ResolveStub
_OOReportJavaScriptBadPropertySelector
_OOReportJavaScriptError
_JS_InternString
_JS_AddNamedRoot
_JS_RemoveRoot
_JSValueToObject
_JS_SetProperty
_OOReportJavaScriptWarning
# Symbols exported for warning supression. Without these, we get lines like
# /usr/bin/ld: warning symbol: _NXArgc referenced dynamically and must be exported

View File

@ -747,25 +747,25 @@ static int scriptRandomSeed = -1; // ensure proper random function
- (NSNumber *) clock_secs_number // returns the game time in seconds
{
return [NSNumber numberWithInt:floor(ship_clock)];
return [NSNumber numberWithUnsignedLongLong:ship_clock];
}
- (NSNumber *) clock_mins_number // returns the game time in minutes
{
return [NSNumber numberWithInt:floor(ship_clock / 60.0)];
return [NSNumber numberWithUnsignedLongLong:ship_clock / 60.0];
}
- (NSNumber *) clock_hours_number // returns the game time in hours
{
return [NSNumber numberWithInt:floor(ship_clock / 3600.0)];
return [NSNumber numberWithUnsignedLongLong:ship_clock / 3600.0];
}
- (NSNumber *) clock_days_number // returns the game time in days
{
return [NSNumber numberWithInt:floor(ship_clock / 86400.0)];
return [NSNumber numberWithUnsignedLongLong:ship_clock / 86400.0];
}

View File

@ -29,7 +29,7 @@ MA 02110-1301, USA.
#import "OOOpenGL.h"
@interface OOColor : NSObject
@interface OOColor : NSObject <NSCopying>
{
GLfloat rgba[4];
}

View File

@ -29,6 +29,7 @@ MA 02110-1301, USA.
@implementation OOColor
// Set methods are internal, because OOColor is immutable (as seen from outside).
- (void) setRGBA:(GLfloat)r:(GLfloat)g:(GLfloat)b:(GLfloat)a
{
rgba[0] = r;
@ -77,6 +78,13 @@ MA 02110-1301, USA.
}
- (id)copyWithZone:(NSZone *)zone
{
// Copy is implemented as retain since OOColor is immutable.
return [self retain];
}
/* Create NSCalibratedRGBColorSpace colors.
*/
+ (OOColor *)colorWithCalibratedHue:(float)hue saturation:(float)saturation brightness:(float)brightness alpha:(float)alpha
@ -105,7 +113,11 @@ MA 02110-1301, USA.
{
if (description == nil) return nil;
if ([description isKindOfClass:[NSString class]])
if ([description isKindOfClass:[OOColor class]])
{
return [[description copy] autorelease];
}
else if ([description isKindOfClass:[NSString class]])
{
if ([description hasSuffix:@"Color"])
{

View File

@ -313,6 +313,12 @@ static JSFunctionSpec sScriptMethods[] =
// Pop running scripts stack
sRunningStack = stackElement.back;
JS_ClearNewbornRoots(context);
// FIXME: should probably be JS_MaybeGC(), and moved to a higher level.
// Here for stress testing of sorts.
JS_GC(context);
return OK;
}
}

View File

@ -96,7 +96,7 @@ static JSClass MissionVars_class =
JS_PropertyStub,
MissionVarsGetProperty,
MissionVarsSetProperty,
JS_EnumerateStub,
JS_EnumerateStub, // FIXME: should have an enumerate callback
JS_ResolveStub,
JS_ConvertStub,
JS_FinalizeStub
@ -1020,6 +1020,7 @@ static NSMutableDictionary *sObjectConverters;
id JSValueToObject(JSContext *context, jsval value)
{
// FIXME: add handler for arrays.
if (JSVAL_IS_NULL(value) || JSVAL_IS_VOID(value)) return nil;
if (JSVAL_IS_INT(value))
@ -1051,8 +1052,10 @@ id JSObjectToObject(JSContext *context, JSObject *object)
NSValue *wrappedClass = nil;
NSValue *wrappedConverter = nil;
JSClassConverterCallback converter = NULL;
JSClass *class = NULL;
wrappedClass = [NSValue valueWithPointer:JS_GetClass(object)];
class = JS_GetClass(object);
wrappedClass = [NSValue valueWithPointer:class];
if (wrappedClass != nil) wrappedConverter = [sObjectConverters objectForKey:wrappedClass];
if (wrappedConverter != nil)
{