Skip to content

Commit adbee24

Browse files
committed
fix: use the real NSObject from Foundation
1 parent cd09ddb commit adbee24

39 files changed

+107
-213
lines changed

Diff for: .clangd

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
CompileFlags:
2-
Add:
2+
Add:
33
- "-Isrc/Linux/blockheads"
44
- "-Isrc/Linux/GLKit"
55
- "-Isrc/Mac/BlockheadsServer/BlockheadsServer"
66
- "-Isrc/Mac/BlockheadsServer/blockheads_server"
77
- "-Isrc/SharedSource"
88
- "-fobjc-nonfragile-abi"
9+
- "-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" # Windows specific I think (fixes stupid intelesense issues)

Diff for: .vscode/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"*.h": "objective-cpp"
4+
},
5+
}

Diff for: src/Linux/blockheads/TryCatchHandler.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// Copyright (C) 1997-2019 Steve Nygard.
55
//
66

7-
//! #import <objc/NSObject.h>
7+
#import <Foundation/NSObject.h>
88

9-
@interface TryCatchHandler //! : NSObject
9+
@interface TryCatchHandler : NSObject
1010
{
1111
}
1212

Diff for: src/Mac/BlockheadsServer/BlockheadsServer/Flurry.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// Copyright (C) 1997-2019 Steve Nygard.
55
//
66

7-
//! #import <objc/NSObject.h>
7+
#import <Foundation/NSObject.h>
88

9-
@interface Flurry //! : NSObject
9+
@interface Flurry : NSObject
1010
{
1111
}
1212

Diff for: src/Mac/BlockheadsServer/BlockheadsServer/GameController.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
// Copyright (C) 1997-2019 Steve Nygard.
55
//
66

7-
//! FIXME: Bad macro hack
8-
#ifndef BOOL
9-
#define BOOL bool
10-
#endif
11-
12-
//! #import <objc/NSObject.h>
7+
#import <Foundation/NSObject.h>
138

149
#import "BHNetNodeDelegate-Protocol.h"
1510
#import "WorldDelegate-Protocol.h"
@@ -18,7 +13,7 @@
1813
@protocol GameControllerDelegate
1914
, NSObject;
2015

21-
@interface GameController //! : NSObject <BHNetNodeDelegate, WorldDelegate>
16+
@interface GameController : NSObject <BHNetNodeDelegate, WorldDelegate>
2217
{
2318
World* world;
2419
BHServer* bhServer;

Diff for: src/Mac/BlockheadsServer/blockheads_server/CommandLineDelegate.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,13 @@
44
// Copyright (C) 1997-2019 Steve Nygard.
55
//
66

7-
//! FIXME: Bad macro hack
8-
#ifndef BOOL
9-
#define BOOL bool
10-
#endif
11-
12-
//! #import <objc/NSObject.h>
7+
#import <Foundation/NSObject.h>
138

149
#import "GameControllerDelegate-Protocol.h"
1510

1611
@class GameController, NSFileHandle, NSString;
1712

18-
@interface CommandLineDelegate //! : NSObject <GameControllerDelegate>
13+
@interface CommandLineDelegate : NSObject <GameControllerDelegate>
1914
{
2015
GameController* gameController;
2116
NSFileHandle* stdinHandle;

Diff for: src/SharedSource/Action.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,14 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
//! FIXME: Bad macro hack.
9-
#ifndef BOOL
10-
#define BOOL bool
11-
#endif
12-
13-
//! #import <objc/NSObject.h>
148
#import <Foundation/NSObject.h>
9+
1510
#import "Blockhead.h"
1611
#import "MJMath.h"
1712

1813
@class CraftableItemObject, DrawCube, InventoryItem, NSDictionary, NSMutableDictionary;
1914

20-
@interface Action //! : NSObject
15+
@interface Action : NSObject
2116
{
2217
BOOL inProgress;
2318
BOOL complete;

Diff for: src/SharedSource/Action.mm

+18-12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
@implementation Action
44

5+
@synthesize interactionTestResult;
6+
@synthesize blockCube;
7+
@synthesize craftCountOrExtraData;
8+
@synthesize animationTimer;
9+
@synthesize isAI;
10+
@synthesize pathType;
11+
@synthesize goalInteraction;
12+
@synthesize interactionObjectID;
13+
@synthesize interactionItemSubIndex;
14+
@synthesize interactionItemIndex;
15+
@synthesize interactionItem;
16+
@synthesize inventoryChange;
17+
@synthesize goalTilePos;
18+
@synthesize complete;
19+
@synthesize inProgress;
20+
521
- (void)dealloc
622
{
723
[self->interactionItem autorelease];
@@ -17,21 +33,11 @@ - (NSMutableDictionary*)getSaveDict
1733
{
1834
}
1935

20-
- (Action*)initWithSaveDict:(id)arg1 inventoryItems:(id)arg2
36+
- (Action*)initWithSaveDict:(NSDictionary*)saveDict inventoryItems:(NSArray*)inventoryItems
2137
{
2238
}
2339

24-
- (Action*)initWithGoalPos:(intpair)arg1
25-
goalInteraction:(int)arg2
26-
pathType:(int)arg3
27-
interactionItem:(id)arg4
28-
itemIndex:(short)arg5
29-
itemSubIndex:(short)arg6
30-
interactionObjectID:(unsigned long long)arg7
31-
craftableItemObject:(id)arg8
32-
craftCountOrExtraData:(short)arg9
33-
isAI:(bool)arg10
34-
inventoryChange:(id)arg11
40+
- (Action*)initWithGoalPos:(intpair)goalTilePos_ goalInteraction:(int)goalInteraction_ pathType:(int)pathType_ interactionItem:(InventoryItem*)interactionItem_ itemIndex:(uint16_t)interactionItemIndex_ itemSubIndex:(uint16_t)interactionSubItemIndex_ interactionObjectID:(uint64_t)interactionObjectID_ craftableItemObject:(CraftableItemObject*)craftableItemObject_ craftCountOrExtraData:(uint16_t)craftCountOrExtraData_ isAI:(bool)isAI_ inventoryChange:(NSDictionary*)inventoryChange_
3541
{
3642
}
3743

Diff for: src/SharedSource/BHMatch.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
//! FIXME: Bad macro hack
9-
#ifndef BOOL
10-
#define BOOL bool
11-
#endif
12-
13-
//! #import <objc/NSObject.h>
8+
#import <Foundation/NSObject.h>
149

1510
@class NSString;
1611
@protocol BHMatchDelegate;
1712

18-
@interface BHMatch //! : NSObject
13+
@interface BHMatch : NSObject
1914
{
2015
id<BHMatchDelegate> delegate;
2116
NSString* host;

Diff for: src/SharedSource/BHNetNode.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,14 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
//! FIXME: Bad macro hack
9-
#ifndef BOOL
10-
#define BOOL bool
11-
#endif
12-
13-
//! #import <objc/NSObject.h>
8+
#import <Foundation/NSObject.h>
149

1510
#import "BHMatchDelegate-Protocol.h"
1611

1712
@class BHMatch, GKVoiceChat, NSArray, NSMutableArray, NSMutableDictionary;
1813
@protocol BHNetNodeDelegate;
1914

20-
@interface BHNetNode //! : NSObject <BHMatchDelegate>
15+
@interface BHNetNode : NSObject <BHMatchDelegate>
2116
{
2217
NSObject<BHNetNodeDelegate>* delegate;
2318
BHMatch* match;

Diff for: src/SharedSource/BlockheadAI.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
//! FIXME: Bad macro hack
9-
#ifndef BOOL
10-
#define BOOL bool
11-
#endif
12-
13-
//! #import <objc/NSObject.h>
8+
#import <Foundation/NSObject.h>
149

1510
@class Blockhead, NoiseFunction, World;
1611

17-
@interface BlockheadAI //! : NSObject
12+
@interface BlockheadAI : NSObject
1813
{
1914
Blockhead* blockhead;
2015
World* world;

Diff for: src/SharedSource/ClientTileLoader.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
//! FIXME: Bad macro hack
9-
#ifndef BOOL
10-
#define BOOL bool
11-
#endif
12-
13-
//! #import <objc/NSObject.h>
8+
#import <Foundation/NSObject.h>
149

1510
@class BHClient, NSMutableDictionary, NSString, NoiseFunction, World;
1611

17-
@interface ClientTileLoader //! : NSObject
12+
@interface ClientTileLoader : NSObject
1813
{
1914
World* world;
2015
BHClient* client;

Diff for: src/SharedSource/CraftableItemObject.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
//! #import <objc/NSObject.h>
8+
#import <Foundation/NSObject.h>
99

10-
@interface CraftableItemObject //! : NSObject
10+
@interface CraftableItemObject : NSObject
1111
{
1212
struct CraftableItem craftableItem;
1313
}

Diff for: src/SharedSource/CrystalManager.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
//! FIXME: Bad macro hack
9-
#ifndef BOOL
10-
#define BOOL bool
11-
#endif
12-
13-
//! #import <objc/NSObject.h>
8+
#import <Foundation/NSObject.h>
149

1510
@class NSOperationQueue, NSString;
1611
@protocol CrystalManagerWatcher;
1712

18-
@interface CrystalManager //! : NSObject
13+
@interface CrystalManager : NSObject
1914
{
2015
NSOperationQueue* saveQueue;
2116
int crystalCount;

Diff for: src/SharedSource/Database.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
//! FIXME: Bad macro hack
9-
#ifndef BOOL
10-
#define BOOL bool
11-
#endif
12-
13-
//! #import <objc/NSObject.h>
8+
#import <Foundation/NSObject.h>
149

1510
@class DatabaseEnvironment, NSString;
1611

17-
@interface Database //! : NSObject
12+
@interface Database : NSObject
1813
{
1914
DatabaseEnvironment* databaseEnvironment;
2015
struct MDB_env* env;

Diff for: src/SharedSource/DatabaseConvertor.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
//! FIXME: Bad macro hack
9-
#ifndef BOOL
10-
#define BOOL bool
11-
#endif
12-
13-
//! #import <objc/NSObject.h>
8+
#import <Foundation/NSObject.h>
149

1510
@class Database, NSDictionary, NSMutableArray, NSString, World;
1611

17-
@interface DatabaseConvertor //! : NSObject
12+
@interface DatabaseConvertor : NSObject
1813
{
1914
World* world;
2015
Database* worldDatabase;

Diff for: src/SharedSource/DatabaseEnvironment.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
//! FIXME: Bad macro hack
9-
#ifndef BOOL
10-
#define BOOL bool
11-
#endif
12-
13-
//! #import <objc/NSObject.h>
8+
#import <Foundation/NSObject.h>
149

1510
@class NSString;
1611

17-
@interface DatabaseEnvironment //! : NSObject
12+
@interface DatabaseEnvironment : NSObject
1813
{
1914
struct MDB_env* env;
2015
struct MDB_txn* bulkTransaction;

Diff for: src/SharedSource/DynamicObject.h

+3-8
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,13 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
#import "MJMath.h"
9-
10-
//! FIXME: Bad macro hack
11-
#ifndef BOOL
12-
#define BOOL bool
13-
#endif
8+
#import <Foundation/NSObject.h>
149

15-
//! #import <objc/NSObject.h>
10+
#import "MJMath.h"
1611

1712
@class CPCache, DynamicWorld, NSString, World;
1813

19-
@interface DynamicObject //! : NSObject
14+
@interface DynamicObject : NSObject
2015
{
2116
World* world;
2217
DynamicWorld* dynamicWorld;

Diff for: src/SharedSource/DynamicWorld.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,13 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
//! FIXME: Bad macro hack
9-
#ifndef BOOL
10-
#define BOOL bool
11-
#endif
12-
13-
//! #import <objc/NSObject.h>
8+
#import <Foundation/NSObject.h>
149

1510
@class BHClient, BHServer, CPCache, ClientTileLoader, Database, NSDictionary,
1611
NSMutableArray, NSMutableDictionary, NSMutableIndexSet, NSString,
1712
NoiseFunction, WirePathCreator, World, WorldTileLoader;
1813

19-
@interface DynamicWorld //! : NSObject
14+
@interface DynamicWorld : NSObject
2015
{
2116
World* world;
2217
WorldTileLoader* worldTileLoader;

Diff for: src/SharedSource/FishingRod.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
//! FIXME: Bad macro hack
9-
#ifndef BOOL
10-
#define BOOL bool
11-
#endif
12-
13-
//! #import <objc/NSObject.h>
8+
#import <Foundation/NSObject.h>
149

1510
@class Blockhead, CPTexture2D, ClownFish, MJSound, Shader, World;
1611

17-
@interface FishingRod //! : NSObject
12+
@interface FishingRod : NSObject
1813
{
1914
World* world;
2015
Blockhead* blockhead;

Diff for: src/SharedSource/HarmableDynamicObject-Protocol.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// Copyright (C) 1997-2019 Steve Nygard.
66
//
77

8-
#import "NSObject-Protocol.h"
9-
#import "Vector2.h"
8+
#import <Foundation/NSObject.h>
109

10+
#import "Vector2.h"
1111

1212
@class Blockhead;
1313

0 commit comments

Comments
 (0)