OS X: Fix build. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@5094 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-03-26 20:39:02 +00:00
parent 0805a0ed45
commit 598011d59a
3 changed files with 27 additions and 7 deletions

View file

@ -20,17 +20,17 @@
self = [super init]; self = [super init];
if (self) { if (self) {
struct grpfile *p; struct grpfile *p;
int i;
list = [[NSMutableArray alloc] init]; list = [[NSMutableArray alloc] init];
for (p = foundgrps; p; p=p->next) { for (p = foundgrps; p; p=p->next) {
for (i=0; i<NUMGRPFILES; i++) if (p->crcval == internalgrpfiles[i].crcval) break; struct grpfile const * const group = GetInternalGroup(p->crcval);
if (i == NUMGRPFILES) continue; if (group == NULL)
[list addObject:[[GrpFile alloc] initWithGrpfile:p andName:[NSString stringWithCString:internalgrpfiles[i].name encoding:NSUTF8StringEncoding]]]; continue;
[list addObject:[[GrpFile alloc] initWithGrpfile:p andName:[NSString stringWithCString:group->name encoding:NSUTF8StringEncoding]]];
} }
} }
return self; return self;
} }

View file

@ -60,6 +60,16 @@ struct grpfile internalgrpfiles[] =
{ "NAPALM", NAPALM_CRC, 44365728, GAMEFLAG_NAM|GAMEFLAG_NAPALM, 0, NULL, NULL, NULL, NULL }, { "NAPALM", NAPALM_CRC, 44365728, GAMEFLAG_NAM|GAMEFLAG_NAPALM, 0, NULL, NULL, NULL, NULL },
{ "WWII GI", WW2GI_CRC, 77939508, GAMEFLAG_WW2GI|GAMEFLAG_NAM, 0, NULL, NULL, NULL, NULL }, { "WWII GI", WW2GI_CRC, 77939508, GAMEFLAG_WW2GI|GAMEFLAG_NAM, 0, NULL, NULL, NULL, NULL },
}; };
struct grpfile const * GetInternalGroup(int32_t crcval)
{
for (size_t i = 0; i < ARRAY_SIZE(internalgrpfiles); i++)
if (crcval == internalgrpfiles[i].crcval)
return &internalgrpfiles[i];
return NULL;
}
struct grpfile *foundgrps = NULL; struct grpfile *foundgrps = NULL;
struct grpfile *listgrps = NULL; struct grpfile *listgrps = NULL;

View file

@ -23,6 +23,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef grpscan_h_ #ifndef grpscan_h_
#define grpscan_h_ #define grpscan_h_
#ifdef __cplusplus
extern "C" {
#endif
#define MAXLISTNAMELEN 32 #define MAXLISTNAMELEN 32
// List of internally-known GRP files // List of internally-known GRP files
@ -71,8 +75,14 @@ extern struct grpfile internalgrpfiles[];
extern struct grpfile *foundgrps; extern struct grpfile *foundgrps;
extern struct grpfile *listgrps; extern struct grpfile *listgrps;
extern struct grpfile const * GetInternalGroup(int32_t crcval);
extern struct grpfile * FindGroup(int32_t crcval); extern struct grpfile * FindGroup(int32_t crcval);
int32_t ScanGroups(void); int32_t ScanGroups(void);
void FreeGroups(void); void FreeGroups(void);
#ifdef __cplusplus
}
#endif
#endif #endif