Skip to content

Commit

Permalink
Added Group defs, removed obsolete stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jul 29, 2003
1 parent d1ad75a commit 07007b0
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 18 deletions.
41 changes: 23 additions & 18 deletions doomsday/Src/dedfile.c
Expand Up @@ -68,7 +68,6 @@ void DED_Destroy(ded_t *ded)
{
int i;

// free(ded->includes);
free(ded->flags);
free(ded->mobjs);
free(ded->states);
Expand All @@ -78,34 +77,27 @@ void DED_Destroy(ded_t *ded)
free(ded->sounds);
free(ded->music);
free(ded->mapinfo);
for(i=0; i<ded->count.text.num; i++) free(ded->text[i].text);
for(i = 0; i < ded->count.text.num; i++)
{
free(ded->text[i].text);
}
free(ded->text);
for(i=0; i<ded->count.tenviron.num; i++) free(ded->tenviron[i].textures);
for(i = 0; i < ded->count.tenviron.num; i++)
{
free(ded->tenviron[i].textures);
}
free(ded->tenviron);
for(i=0; i<ded->count.values.num; i++)
for(i = 0; i < ded->count.values.num; i++)
{
free(ded->values[i].id);
free(ded->values[i].text);
}
free(ded->values);
free(ded->decorations);
free(ded->groups);
free(ded->sectors);
}

/*int DED_AddInclude(ded_t *ded, char *inc)
{
ded_path_t *pth = DED_NewEntry( (void**) &ded->includes,
&ded->count.includes, sizeof(ded_path_t));
strcpy(pth->path, inc);
return pth - ded->includes;
}
void DED_RemoveInclude(ded_t *ded, int index)
{
DED_DelEntry(index, (void**) &ded->includes, &ded->count.includes,
sizeof(ded_path_t));
}*/

int DED_AddMobj(ded_t *ded, char *idstr)
{
ded_mobj_t *mo = DED_NewEntry( (void**) &ded->mobjs,
Expand Down Expand Up @@ -363,6 +355,19 @@ void DED_RemoveDecoration(ded_t *ded, int index)
sizeof(ded_decor_t));
}

int DED_AddGroup(ded_t *ded)
{
ded_group_t *group = DED_NewEntry( (void**) &ded->groups,
&ded->count.groups, sizeof(ded_group_t));
return group - ded->groups;
}

void DED_RemoveGroup(ded_t *ded, int index)
{
DED_DelEntry(index, (void**) &ded->groups, &ded->count.groups,
sizeof(ded_group_t));
}

int DED_AddSector(ded_t *ded, int id)
{
ded_sectortype_t *sec = DED_NewEntry( (void**) &ded->sectors,
Expand Down
37 changes: 37 additions & 0 deletions doomsday/Src/dedread.c
Expand Up @@ -1249,6 +1249,43 @@ int DED_ReadData(ded_t *ded, char *buffer, const char *sourceFile)
}
prev_decordef_idx = idx;
}
if(ISTOKEN("Group"))
{
ded_group_t *grp;
idx = DED_AddGroup(ded);
grp = ded->groups + idx;
sub = 0;
FINDBEGIN;
for(;;)
{
READLABEL;
if(ISLABEL("Texture") || ISLABEL("Flat"))
{
grp->is_texture = ISLABEL("Texture");
if(sub == DED_GROUP_NUM_MEMBERS)
{
SetError("Too many group members.");
retval = false;
goto ded_end_read;
}
FINDBEGIN;
for(;;)
{
READLABEL;
RV_STR("ID", grp->members[sub].name)
RV_FLT("Tics", grp->members[sub].tics)
RV_FLT("Random", grp->members[sub].random_tics)
RV_END
CHECKSC;
}
grp->count = ++sub;
}
else RV_STR("Flags", grp->flags)
RV_END
CHECKSC;
}
grp->count = ++sub;
}
if(ISTOKEN("Line")) // Line Type
{
// A new line type.
Expand Down

0 comments on commit 07007b0

Please sign in to comment.