update for recent changes to Object

This commit is contained in:
Bill Currie 2003-07-29 19:55:41 +00:00
parent 5c1875ba28
commit da86367824
8 changed files with 30 additions and 30 deletions

View file

@ -7,7 +7,7 @@
float duration; float duration;
} }
- (id) initWithFile: (string) file duration: (float) time; - (id) initWithFile: (string) file duration: (float) time;
- (void) free; - (void) dealloc;
- (Point) size; - (Point) size;
- (float) duration; - (float) duration;
- (void) draw: (integer) x :(integer) y; - (void) draw: (integer) x :(integer) y;

View file

@ -11,10 +11,10 @@
return self; return self;
} }
- (void) free - (void) dealloc
{ {
[picture free]; [picture dealloc];
[super free]; [super dealloc];
} }
- (Point) size - (Point) size

View file

@ -11,7 +11,7 @@
+ (void) initClass; + (void) initClass;
- (id) initWithComponents: (integer) x : (integer) y; - (id) initWithComponents: (integer) x : (integer) y;
- (void) free; - (void) dealloc;
- (integer) handle; - (integer) handle;
- (Point) origin; - (Point) origin;
- (Point) size; - (Point) size;
@ -40,7 +40,7 @@
} }
- (id) initWithComponents: (integer)x :(integer)y :(string) _file; - (id) initWithComponents: (integer)x :(integer)y :(string) _file;
- (void) free; - (void) dealloc;
- (Point) size; - (Point) size;
- (void) setFile: (string) _file; - (void) setFile: (string) _file;
- (void) display; - (void) display;
@ -57,7 +57,7 @@
BOOL looping; BOOL looping;
} }
- (id) initWithComponents: (integer) x :(integer) y; - (id) initWithComponents: (integer) x :(integer) y;
- (void) free; - (void) dealloc;
- (Point) size; - (Point) size;
- (void) addFrame: (Frame) frame; - (void) addFrame: (Frame) frame;
- (void) changeFrame; - (void) changeFrame;

View file

@ -23,11 +23,11 @@ integer HUDHandleClass;
return self; return self;
} }
- (void) free - (void) dealloc
{ {
[origin free]; [origin dealloc];
GIB_Handle_Free (handle, HUDHandleClass); GIB_Handle_Free (handle, HUDHandleClass);
[super free]; [super dealloc];
} }
- (integer) handle - (integer) handle
@ -110,10 +110,10 @@ integer HUDHandleClass;
return self; return self;
} }
- (void) free - (void) dealloc
{ {
[picture free]; [picture dealloc];
[super free]; [super dealloc];
} }
- (Point) size - (Point) size
@ -123,7 +123,7 @@ integer HUDHandleClass;
- (void) setFile: (string) _file - (void) setFile: (string) _file
{ {
[picture free]; [picture dealloc];
picture = [[QPic alloc] initName :_file]; picture = [[QPic alloc] initName :_file];
} }
@ -147,10 +147,10 @@ integer HUDHandleClass;
return self; return self;
} }
- (void) free - (void) dealloc
{ {
[frames free]; [frames dealloc];
[super free]; [super dealloc];
} }
- (Point) size - (Point) size

View file

@ -76,7 +76,7 @@ void (integer argc, string [] argv) gib_hud_start_anim_f =
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
anim = GIB_Handle_Get (stoi (argv[i]), HUDHandleClass); anim = GIB_Handle_Get (stoi (argv[i]), HUDHandleClass);
if (anim && [anim isKindOf :[HUDAnimation class]]) if (anim && [anim isKindOfClass :[HUDAnimation class]])
[anim start]; [anim start];
} }
}; };
@ -91,7 +91,7 @@ void (integer argc, string [] argv) gib_hud_stop_anim_f =
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
anim = GIB_Handle_Get (stoi (argv[i]), HUDHandleClass); anim = GIB_Handle_Get (stoi (argv[i]), HUDHandleClass);
if (anim && [anim isKindOf :[HUDAnimation class]]) if (anim && [anim isKindOfClass :[HUDAnimation class]])
[anim stop]; [anim stop];
} }
}; };
@ -104,7 +104,7 @@ void (integer argc, string [] argv) gib_hud_set_looping_f =
return; return;
anim = GIB_Handle_Get (stoi (argv[1]), HUDHandleClass); anim = GIB_Handle_Get (stoi (argv[1]), HUDHandleClass);
if (anim && [anim isKindOf :[HUDAnimation class]]) { if (anim && [anim isKindOfClass :[HUDAnimation class]]) {
switch (argv[2]) { switch (argv[2]) {
case "yes": case "yes":
case "true": case "true":
@ -132,7 +132,7 @@ void (integer argc, string [] argv) gib_hud_delete_f =
trashObject = GIB_Handle_Get (stoi (argv[i]), HUDHandleClass); trashObject = GIB_Handle_Get (stoi (argv[i]), HUDHandleClass);
if (trashObject) { if (trashObject) {
[HUDObjects removeItem :trashObject]; [HUDObjects removeItem :trashObject];
[trashObject free]; [trashObject dealloc];
} else } else
dprint (sprintf ("Warning: no HUD object associated with handle %i\n", stoi (argv[i]))); dprint (sprintf ("Warning: no HUD object associated with handle %i\n", stoi (argv[i])));
} }
@ -156,7 +156,7 @@ void (integer argc, string [] argv) gib_hud_get_rect_f =
myPoint = [myObject size]; myPoint = [myObject size];
GIB_Return (itos ([myPoint x])); GIB_Return (itos ([myPoint x]));
GIB_Return (itos ([myPoint y])); GIB_Return (itos ([myPoint y]));
[myPoint free]; [myPoint dealloc];
}; };
@ -176,7 +176,7 @@ void (integer argc, string [] argv) gib_hud_set_translate_f =
else else
for (i = 1; i < argc - 2; i++) for (i = 1; i < argc - 2; i++)
[(HUDObject) GIB_Handle_Get (stoi (argv[i]), HUDHandleClass) setOrigin :p]; [(HUDObject) GIB_Handle_Get (stoi (argv[i]), HUDHandleClass) setOrigin :p];
[p free]; [p dealloc];
}; };
void (integer argc, string [] argv) gib_hud_set_text_f = void (integer argc, string [] argv) gib_hud_set_text_f =
@ -187,7 +187,7 @@ void (integer argc, string [] argv) gib_hud_set_text_f =
return; return;
myObject = GIB_Handle_Get (stoi (argv[1]), HUDHandleClass); myObject = GIB_Handle_Get (stoi (argv[1]), HUDHandleClass);
if (!myObject || ![myObject isKindOf :[HUDText class]]) if (!myObject || ![myObject isKindOfClass :[HUDText class]])
return; return;
[myObject setText :argv[2]]; [myObject setText :argv[2]];
}; };
@ -200,7 +200,7 @@ void (integer argc, string [] argv) gib_hud_set_file_f =
return; return;
myObject = GIB_Handle_Get (stoi (argv[1]), HUDHandleClass); myObject = GIB_Handle_Get (stoi (argv[1]), HUDHandleClass);
if (!myObject || ![myObject isKindOf :[HUDGraphic class]]) if (!myObject || ![myObject isKindOfClass :[HUDGraphic class]])
return; return;
[myObject setFile :argv[2]]; [myObject setFile :argv[2]];
}; };

View file

@ -37,7 +37,7 @@
org = trace_endpos - v_forward * 4; org = trace_endpos - v_forward * 4;
if ([trace_ent.@this takeDamage: self inflictor: s attacker: s : damage]) if ([trace_ent.@this takeDamage:self :s :s :damage])
SpawnBlood (org, 20); SpawnBlood (org, 20);
else { else {
sound (s, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); sound (s, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM);

View file

@ -110,14 +110,14 @@
{ {
local integer i; local integer i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
[array[i] perform:selector]; [array[i] performSelector:selector];
} }
-(void)makeObjectsPerformSelector:(SEL)selector withObject:(id)arg -(void)makeObjectsPerformSelector:(SEL)selector withObject:(id)arg
{ {
local integer i; local integer i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
[array[i] perform:selector withObject:arg]; [array[i] performSelector:selector withObject:arg];
} }
@end @end

View file

@ -125,14 +125,14 @@
{ {
local list_bucket_t [] e; local list_bucket_t [] e;
for (e = head; e; e = e.next) for (e = head; e; e = e.next)
[e.obj perform:selector]; [e.obj performSelector:selector];
} }
-(void)makeObjectsPerformSelector:(SEL)selector withObject:(id)arg -(void)makeObjectsPerformSelector:(SEL)selector withObject:(id)arg
{ {
local list_bucket_t [] e; local list_bucket_t [] e;
for (e = head; e; e = e.next) for (e = head; e; e = e.next)
[e.obj perform:selector withObject:arg]; [e.obj performSelector:selector withObject:arg];
} }
@end @end