Fix the tangled mess of entity connections.

What was the person who wrote valueForQKey thinking? Make the function
const-correct and bubble the changes through the code.
This commit is contained in:
Bill Currie 2010-09-28 00:29:16 +09:00
parent 3574668fe3
commit 62c73b300e
11 changed files with 31 additions and 33 deletions

View File

@ -28,11 +28,11 @@ typedef struct epair_s {
-(BOOL) modifiable;
-setModifiable:(BOOL) m;
-(char *) targetname;
-(const char *) targetname;
-writeToFILE:(FILE *)f region:(BOOL) reg;
-(char *) valueForQKey:(char *) k;
-(const char *) valueForQKey:(const char *) k;
-getVector:(vec3_t)v forKey:(char *) k;
-setKey:(const char *)

View File

@ -129,23 +129,20 @@ vec3_t bad_maxs = { 8, 8, 8 };
}
-(char *) valueForQKey:(char *) k
-(const char *) valueForQKey:(const char *) k
{
epair_t *e;
static char ret[64];
for (e = epairs; e; e = e->next)
if (!strcmp (k, e->key)) {
strcpy (ret, e->value);
return ret;
}
if (!strcmp (k, e->key))
return e->value;
return "";
}
-getVector:(vec3_t)
v forKey:(char *) k
{
char *c;
const char *c;
c =[self valueForQKey:k];
@ -244,9 +241,9 @@ targetname
If the entity does not have a "targetname" key, a unique one is generated
=============
*/
-(char *) targetname
-(const char *) targetname
{
char *t;
const char *t;
int i, count;
id ent;
int tval, maxt;
@ -291,7 +288,7 @@ int nument;
{
char *key;
id eclass, brush;
char *spawn;
const char *spawn;
vec3_t emins, emaxs;
vec3_t org;
texturedef_t td;

View File

@ -39,7 +39,7 @@ typedef enum { esize_model, esize_fixed } esize_t;
}
-initForSourceDirectory:(char *) path;
-(id) classForName:(char *) name;
-(id) classForName:(const char *) name;
-(void) scanDirectory;
@end

View File

@ -260,7 +260,7 @@ id entity_classes_i;
return self;
}
-(id) classForName:(char *) name
-(id) classForName:(const char *) name
{
int i;
id o;

View File

@ -224,7 +224,8 @@ readMapFile
*/
-readMapFile:(char *) fname
{
char *dat, *cl;
char *dat;
const char *wad, *cl;
id new;
id ent;
int i, c;
@ -264,13 +265,13 @@ readMapFile
[self addSelected];
// load the apropriate texture wad
dat =[currentEntity valueForQKey:"wad"];
if (dat && dat[0]) {
if (dat[0] == '/') // remove old style fullpaths
wad =[currentEntity valueForQKey:"wad"];
if (wad && wad[0]) {
if (wad[0] == '/') // remove old style fullpaths
[currentEntity removeKeyPair:"wad"];
else {
if (strcmp ([texturepalette_i currentWad], dat))
[project_i setTextureWad:dat];
if (strcmp ([texturepalette_i currentWad], wad))
[project_i setTextureWad:wad];
}
}
// center the camera and XY view on the playerstart

View File

@ -74,7 +74,7 @@ extern id project_i;
-(char *) currentProjectFile;
-setTextureWad:(char *) wf;
-setTextureWad:(const char *) wf;
-addToOutput:(char *) string;
-clearBspOutput:sender;

View File

@ -261,7 +261,7 @@ t in:(id) obj
}
-setTextureWad:(char *) wf
-setTextureWad:(const char *) wf
{
int i, c;
char *name;

View File

@ -990,9 +990,9 @@ BOOL fakebrush;
vec3_t dest, origin;
vec3_t mid;
vec3_t forward, right;
char *targname;
const char *targname;
vec3_t min, max, temp;
char *targ;
const char *targ;
targ =[parent valueForQKey:"target"];
@ -1077,7 +1077,7 @@ XYDrawSelf
int i, j;
winding_t *w;
vec3_t mid, end, s1, s2;
char *val;
const char *val;
float ang;
id worldent, currentent;
BOOL keybrush;
@ -1546,7 +1546,7 @@ Set the regioned flag based on if the object is containted in region_min/max
-newRegion
{
int i;
char *name;
const char *name;
// filter away entities
if (parent !=[map_i objectAtIndex:0]) {

View File

@ -34,7 +34,7 @@ typedef struct {
extern int tex_count;
extern qtexture_t qtextures[MAX_TEXTURES];
void TEX_InitFromWad (char *path);
void TEX_InitFromWad (const char *path);
qtexture_t *TEX_ForName (char *name);
@ -71,7 +71,7 @@ extern id texturepalette_i;
}
-(char *) currentWad;
-initPaletteFromWadfile:(char *) wf;
-initPaletteFromWadfile:(const char *) wf;
-computeTextureViewSize;
-alphabetize;
-getList;

View File

@ -174,7 +174,7 @@ TEX_InitFromWad
=================
*/
void
TEX_InitFromWad (char *path)
TEX_InitFromWad (const char *path)
{
int i;
char newpath[1024];
@ -268,7 +268,7 @@ TEX_ForName (char *name)
return currentwad;
}
-initPaletteFromWadfile:(char *) wf
-initPaletteFromWadfile:(const char *) wf
{
int i;
texpal_t t;

View File

@ -118,7 +118,7 @@ id things_i;
}
-selectClass:(char *) class
-selectClass:(const char *) class
{
id classent;
@ -141,9 +141,9 @@ id things_i;
-newCurrentEntity
{
id ent, classent, cell;
char *classname;
const char *classname;
int r, c;
char *flagname;
const char *flagname;
int flags;
ent =[map_i currentEntity];