mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 21:50:48 +00:00
Netsynch the sector local taglists.
This commit is contained in:
parent
7904856e8e
commit
ae07b7c96c
2 changed files with 28 additions and 7 deletions
|
@ -798,7 +798,7 @@ static boolean P_AreStringArgsEqual(const line_t *li, const line_t *spawnli)
|
||||||
//
|
//
|
||||||
static void P_NetArchiveWorld(void)
|
static void P_NetArchiveWorld(void)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i, j;
|
||||||
INT32 statsec = 0, statline = 0;
|
INT32 statsec = 0, statline = 0;
|
||||||
const line_t *li = lines;
|
const line_t *li = lines;
|
||||||
const line_t *spawnli = spawnlines;
|
const line_t *spawnli = spawnlines;
|
||||||
|
@ -849,7 +849,7 @@ static void P_NetArchiveWorld(void)
|
||||||
if (ss->ceilingpic_angle != spawnss->ceilingpic_angle)
|
if (ss->ceilingpic_angle != spawnss->ceilingpic_angle)
|
||||||
diff2 |= SD_CEILANG;
|
diff2 |= SD_CEILANG;
|
||||||
|
|
||||||
if (ss->tag != spawnss->tag)
|
if (!Tag_Compare(&ss->tags, &spawnss->tags))
|
||||||
diff2 |= SD_TAG;
|
diff2 |= SD_TAG;
|
||||||
if (ss->nexttag != spawnss->nexttag || ss->firsttag != spawnss->firsttag)
|
if (ss->nexttag != spawnss->nexttag || ss->firsttag != spawnss->firsttag)
|
||||||
diff3 |= SD_TAGLIST;
|
diff3 |= SD_TAGLIST;
|
||||||
|
@ -912,7 +912,12 @@ static void P_NetArchiveWorld(void)
|
||||||
WRITEANGLE(put, ss->floorpic_angle);
|
WRITEANGLE(put, ss->floorpic_angle);
|
||||||
if (diff2 & SD_CEILANG)
|
if (diff2 & SD_CEILANG)
|
||||||
WRITEANGLE(put, ss->ceilingpic_angle);
|
WRITEANGLE(put, ss->ceilingpic_angle);
|
||||||
if (diff2 & SD_TAG) // save only the tag
|
if (diff2 & SD_TAG)
|
||||||
|
{
|
||||||
|
WRITEUINT32(put, ss->tags.count);
|
||||||
|
for (j = 0; j < ss->tags.count; j++)
|
||||||
|
WRITEINT16(put, ss->tags.tags[j]);
|
||||||
|
}
|
||||||
WRITEINT16(put, ss->tag);
|
WRITEINT16(put, ss->tag);
|
||||||
if (diff3 & SD_TAGLIST) // save both firsttag and nexttag
|
if (diff3 & SD_TAGLIST) // save both firsttag and nexttag
|
||||||
{ // either of these could be changed even if tag isn't
|
{ // either of these could be changed even if tag isn't
|
||||||
|
@ -1076,7 +1081,7 @@ static void P_NetArchiveWorld(void)
|
||||||
//
|
//
|
||||||
static void P_NetUnArchiveWorld(void)
|
static void P_NetUnArchiveWorld(void)
|
||||||
{
|
{
|
||||||
UINT16 i;
|
UINT16 i, j;
|
||||||
line_t *li;
|
line_t *li;
|
||||||
side_t *si;
|
side_t *si;
|
||||||
UINT8 *get;
|
UINT8 *get;
|
||||||
|
@ -1150,6 +1155,17 @@ static void P_NetUnArchiveWorld(void)
|
||||||
if (diff2 & SD_CEILANG)
|
if (diff2 & SD_CEILANG)
|
||||||
sectors[i].ceilingpic_angle = READANGLE(get);
|
sectors[i].ceilingpic_angle = READANGLE(get);
|
||||||
if (diff2 & SD_TAG)
|
if (diff2 & SD_TAG)
|
||||||
|
{
|
||||||
|
size_t ncount = READUINT32(get);
|
||||||
|
if (ncount != sectors[i].tags.count)
|
||||||
|
{
|
||||||
|
sectors[i].tags.count = ncount;
|
||||||
|
sectors[i].tags.tags = Z_Realloc(sectors[i].tags.tags, ncount*sizeof(mtag_t), PU_LEVEL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < ncount; j++)
|
||||||
|
sectors[i].tags.tags[j] = READINT16(get);
|
||||||
|
}
|
||||||
sectors[i].tag = READINT16(get); // DON'T use P_ChangeSectorTag
|
sectors[i].tag = READINT16(get); // DON'T use P_ChangeSectorTag
|
||||||
if (diff3 & SD_TAGLIST)
|
if (diff3 & SD_TAGLIST)
|
||||||
{
|
{
|
||||||
|
|
|
@ -936,7 +936,7 @@ static void P_LoadSectors(UINT8 *data)
|
||||||
ss->lightlevel = SHORT(ms->lightlevel);
|
ss->lightlevel = SHORT(ms->lightlevel);
|
||||||
ss->special = SHORT(ms->special);
|
ss->special = SHORT(ms->special);
|
||||||
ss->tag = SHORT(ms->tag);
|
ss->tag = SHORT(ms->tag);
|
||||||
Tag_FSet(&ss->tags, ss->tag);
|
Tag_FSet(&ss->tags, SHORT(ms->tag));
|
||||||
|
|
||||||
ss->floor_xoffs = ss->floor_yoffs = 0;
|
ss->floor_xoffs = ss->floor_yoffs = 0;
|
||||||
ss->ceiling_xoffs = ss->ceiling_yoffs = 0;
|
ss->ceiling_xoffs = ss->ceiling_yoffs = 0;
|
||||||
|
@ -1051,7 +1051,7 @@ static void P_LoadLinedefs(UINT8 *data)
|
||||||
ld->flags = SHORT(mld->flags);
|
ld->flags = SHORT(mld->flags);
|
||||||
ld->special = SHORT(mld->special);
|
ld->special = SHORT(mld->special);
|
||||||
ld->tag = SHORT(mld->tag);
|
ld->tag = SHORT(mld->tag);
|
||||||
Tag_FSet(&ld->tags, ld->tag);
|
Tag_FSet(&ld->tags, SHORT(mld->tag));
|
||||||
memset(ld->args, 0, NUMLINEARGS*sizeof(*ld->args));
|
memset(ld->args, 0, NUMLINEARGS*sizeof(*ld->args));
|
||||||
memset(ld->stringargs, 0x00, NUMLINESTRINGARGS*sizeof(*ld->stringargs));
|
memset(ld->stringargs, 0x00, NUMLINESTRINGARGS*sizeof(*ld->stringargs));
|
||||||
ld->alpha = FRACUNIT;
|
ld->alpha = FRACUNIT;
|
||||||
|
@ -1282,7 +1282,7 @@ static void P_LoadThings(UINT8 *data)
|
||||||
mt->options = READUINT16(data);
|
mt->options = READUINT16(data);
|
||||||
mt->extrainfo = (UINT8)(mt->type >> 12);
|
mt->extrainfo = (UINT8)(mt->type >> 12);
|
||||||
mt->tag = 0;
|
mt->tag = 0;
|
||||||
Tag_FSet(&mt->tags, mt->tag);
|
Tag_FSet(&mt->tags, 0);
|
||||||
|
|
||||||
mt->type &= 4095;
|
mt->type &= 4095;
|
||||||
|
|
||||||
|
@ -2921,6 +2921,7 @@ static boolean P_LoadMapFromFile(void)
|
||||||
{
|
{
|
||||||
virtres_t *virt = vres_GetMap(lastloadedmaplumpnum);
|
virtres_t *virt = vres_GetMap(lastloadedmaplumpnum);
|
||||||
virtlump_t *textmap = vres_Find(virt, "TEXTMAP");
|
virtlump_t *textmap = vres_Find(virt, "TEXTMAP");
|
||||||
|
size_t i;
|
||||||
udmf = textmap != NULL;
|
udmf = textmap != NULL;
|
||||||
|
|
||||||
if (!P_LoadMapData(virt))
|
if (!P_LoadMapData(virt))
|
||||||
|
@ -2942,6 +2943,10 @@ static boolean P_LoadMapFromFile(void)
|
||||||
memcpy(spawnlines, lines, numlines * sizeof(*lines));
|
memcpy(spawnlines, lines, numlines * sizeof(*lines));
|
||||||
memcpy(spawnsides, sides, numsides * sizeof(*sides));
|
memcpy(spawnsides, sides, numsides * sizeof(*sides));
|
||||||
|
|
||||||
|
for (i = 0; i < numsectors; i++)
|
||||||
|
if (sectors[i].tags.count)
|
||||||
|
spawnsectors[i].tags.tags = memcpy(Z_Malloc(sectors[i].tags.count*sizeof(mtag_t), PU_LEVEL, NULL), sectors[i].tags.tags, sectors[i].tags.count*sizeof(mtag_t));
|
||||||
|
|
||||||
P_MakeMapMD5(virt, &mapmd5);
|
P_MakeMapMD5(virt, &mapmd5);
|
||||||
|
|
||||||
vres_Free(virt);
|
vres_Free(virt);
|
||||||
|
|
Loading…
Reference in a new issue