Trying to fix stuff.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4069 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
2c7220af2e
commit
71dce10318
3 changed files with 38 additions and 10 deletions
|
@ -1007,6 +1007,7 @@ void NET_IntegerToMask (netadr_t *a, netadr_t *amask, int bits)
|
||||||
case NA_LOOPBACK:
|
case NA_LOOPBACK:
|
||||||
break;
|
break;
|
||||||
// warning: enumeration value âNA_*â not handled in switch
|
// warning: enumeration value âNA_*â not handled in switch
|
||||||
|
case NA_WEBSOCKET:
|
||||||
case NA_TCP:
|
case NA_TCP:
|
||||||
case NA_TCPV6:
|
case NA_TCPV6:
|
||||||
case NA_IRC:
|
case NA_IRC:
|
||||||
|
@ -2114,7 +2115,7 @@ typedef struct {
|
||||||
|
|
||||||
void tobase64(unsigned char *out, int outlen, unsigned char *in, int inlen)
|
void tobase64(unsigned char *out, int outlen, unsigned char *in, int inlen)
|
||||||
{
|
{
|
||||||
static tab[64] =
|
static unsigned char tab[64] =
|
||||||
{
|
{
|
||||||
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
|
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
|
||||||
'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',
|
'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',
|
||||||
|
@ -4317,6 +4318,7 @@ void SVNET_AddPort_f(void)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
// warning: enumeration value ‘NA_*’ not handled in switch
|
// warning: enumeration value ‘NA_*’ not handled in switch
|
||||||
|
case NA_WEBSOCKET:
|
||||||
case NA_INVALID:
|
case NA_INVALID:
|
||||||
case NA_LOOPBACK:
|
case NA_LOOPBACK:
|
||||||
case NA_BROADCAST_IP:
|
case NA_BROADCAST_IP:
|
||||||
|
@ -4667,12 +4669,12 @@ vfsfile_t *FS_OpenTCP(const char *name)
|
||||||
}
|
}
|
||||||
#elif 0 //defined(HAVE_WEBSOCKCL)
|
#elif 0 //defined(HAVE_WEBSOCKCL)
|
||||||
This code is disabled.
|
This code is disabled.
|
||||||
I cannot provide a reliable mechanism over chrome/nacl's websockets at this time.
|
I cannot provide a reliable mechanism over chrome/nacls websockets at this time.
|
||||||
Some module within the ppapi/nacl/chrome stack refuses to forward the data when stressed.
|
Some module within the ppapi/nacl/chrome stack refuses to forward the data when stressed.
|
||||||
All I can determine is that the connection has a gap.
|
All I can determine is that the connection has a gap.
|
||||||
Hopefully this should be fixed by pepper_19.
|
Hopefully this should be fixed by pepper_19.
|
||||||
|
|
||||||
As far as I'm aware, this and the relevent code in QTV should be functionally complete.
|
As far as Im aware, this and the relevent code in QTV should be functionally complete.
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,8 @@ typedef struct
|
||||||
float heights[SECTHEIGHTSIZE*SECTHEIGHTSIZE];
|
float heights[SECTHEIGHTSIZE*SECTHEIGHTSIZE];
|
||||||
unsigned short holes;
|
unsigned short holes;
|
||||||
float waterheight;
|
float waterheight;
|
||||||
|
float minh;
|
||||||
|
float maxh;
|
||||||
} dsection_t;
|
} dsection_t;
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -54,6 +56,7 @@ typedef struct
|
||||||
unsigned short holes;
|
unsigned short holes;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
float waterheight;
|
float waterheight;
|
||||||
|
float minh, maxh;
|
||||||
struct heightmap_s *hmmod;
|
struct heightmap_s *hmmod;
|
||||||
|
|
||||||
#ifndef SERVERONLY
|
#ifndef SERVERONLY
|
||||||
|
@ -63,7 +66,6 @@ typedef struct
|
||||||
|
|
||||||
texnums_t textures;
|
texnums_t textures;
|
||||||
vbo_t vbo;
|
vbo_t vbo;
|
||||||
float minh, maxh;
|
|
||||||
mesh_t mesh;
|
mesh_t mesh;
|
||||||
mesh_t *amesh;
|
mesh_t *amesh;
|
||||||
qboolean modified:1;
|
qboolean modified:1;
|
||||||
|
@ -85,11 +87,13 @@ typedef struct heightmap_s {
|
||||||
mesh_t *askymesh;
|
mesh_t *askymesh;
|
||||||
unsigned int exteriorcontents;
|
unsigned int exteriorcontents;
|
||||||
|
|
||||||
|
#ifndef SERVERONLY
|
||||||
struct lmsect_s
|
struct lmsect_s
|
||||||
{
|
{
|
||||||
struct lmsect_s *next;
|
struct lmsect_s *next;
|
||||||
int lm, x, y;
|
int lm, x, y;
|
||||||
} *unusedlmsects;
|
} *unusedlmsects;
|
||||||
|
#endif
|
||||||
} heightmap_t;
|
} heightmap_t;
|
||||||
|
|
||||||
static void Terr_LoadSectionTextures(hmsection_t *s)
|
static void Terr_LoadSectionTextures(hmsection_t *s)
|
||||||
|
@ -109,6 +113,7 @@ static void Terr_LoadSectionTextures(hmsection_t *s)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef SERVERONLY
|
||||||
static void Terr_InitLightmap(hmsection_t *s)
|
static void Terr_InitLightmap(hmsection_t *s)
|
||||||
{
|
{
|
||||||
heightmap_t *hm = s->hmmod;
|
heightmap_t *hm = s->hmmod;
|
||||||
|
@ -140,6 +145,7 @@ static void Terr_InitLightmap(hmsection_t *s)
|
||||||
|
|
||||||
free(lms);
|
free(lms);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static char *Terr_DiskSectionName(heightmap_t *hm, int sx, int sy)
|
static char *Terr_DiskSectionName(heightmap_t *hm, int sx, int sy)
|
||||||
{
|
{
|
||||||
|
@ -159,13 +165,15 @@ static hmsection_t *Terr_LoadSection(heightmap_t *hm, hmsection_t *s, int sx, in
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*queue the file for download if we don't have it yet*/
|
/*queue the file for download if we don't have it yet*/
|
||||||
if (FS_LoadFile(Terr_DiskSectionName(hm, sx, sy), &ds) < 0
|
if (FS_LoadFile(Terr_DiskSectionName(hm, sx, sy), (void**)&ds) < 0
|
||||||
#ifndef CLIENTONLY
|
#ifndef CLIENTONLY
|
||||||
&& !sv.state
|
&& !sv.state
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
#ifndef SERVERONLY
|
||||||
CL_CheckOrEnqueDownloadFile(Terr_DiskSectionName(hm, sx, sy), NULL, 0);
|
CL_CheckOrEnqueDownloadFile(Terr_DiskSectionName(hm, sx, sy), NULL, 0);
|
||||||
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +194,10 @@ static hmsection_t *Terr_LoadSection(heightmap_t *hm, hmsection_t *s, int sx, in
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memset(s, 0, sizeof(*s));
|
memset(s, 0, sizeof(*s));
|
||||||
|
|
||||||
|
#ifndef SERVERONLY
|
||||||
s->lightmap = -1;
|
s->lightmap = -1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
s->hmmod = hm;
|
s->hmmod = hm;
|
||||||
|
@ -200,6 +211,7 @@ static hmsection_t *Terr_LoadSection(heightmap_t *hm, hmsection_t *s, int sx, in
|
||||||
|
|
||||||
if (ds)
|
if (ds)
|
||||||
{
|
{
|
||||||
|
s->flags = ds->flags;
|
||||||
#ifndef SERVERONLY
|
#ifndef SERVERONLY
|
||||||
Q_strncpyz(s->texname[0], ds->texname[0], sizeof(s->texname[0]));
|
Q_strncpyz(s->texname[0], ds->texname[0], sizeof(s->texname[0]));
|
||||||
Q_strncpyz(s->texname[1], ds->texname[1], sizeof(s->texname[1]));
|
Q_strncpyz(s->texname[1], ds->texname[1], sizeof(s->texname[1]));
|
||||||
|
@ -233,6 +245,9 @@ static hmsection_t *Terr_LoadSection(heightmap_t *hm, hmsection_t *s, int sx, in
|
||||||
{
|
{
|
||||||
s->heights[i] = LittleFloat(ds->heights[i]);
|
s->heights[i] = LittleFloat(ds->heights[i]);
|
||||||
}
|
}
|
||||||
|
s->minh = ds->minh;
|
||||||
|
s->maxh = ds->maxh;
|
||||||
|
s->waterheight = ds->waterheight;
|
||||||
|
|
||||||
FS_FreeFile(ds);
|
FS_FreeFile(ds);
|
||||||
}
|
}
|
||||||
|
@ -361,6 +376,8 @@ static void Terr_SaveSection(heightmap_t *hm, hmsection_t *s, int sx, int sy)
|
||||||
ds.heights[i] = LittleFloat(s->heights[i]);
|
ds.heights[i] = LittleFloat(s->heights[i]);
|
||||||
}
|
}
|
||||||
ds.holes = s->holes;
|
ds.holes = s->holes;
|
||||||
|
ds.minh = s->minh:
|
||||||
|
ds.maxh = s->maxh:
|
||||||
|
|
||||||
FS_WriteFile(Terr_DiskSectionName(hm, sx, sy), &ds, sizeof(ds), FS_GAMEONLY);
|
FS_WriteFile(Terr_DiskSectionName(hm, sx, sy), &ds, sizeof(ds), FS_GAMEONLY);
|
||||||
#endif
|
#endif
|
||||||
|
@ -417,6 +434,7 @@ void HeightMap_Save(heightmap_t *hm)
|
||||||
|
|
||||||
void Terr_DestroySection(heightmap_t *hm, hmsection_t *s)
|
void Terr_DestroySection(heightmap_t *hm, hmsection_t *s)
|
||||||
{
|
{
|
||||||
|
#ifndef SERVERONLY
|
||||||
if (hm && s->lightmap >= 0)
|
if (hm && s->lightmap >= 0)
|
||||||
{
|
{
|
||||||
struct lmsect_s *lms;
|
struct lmsect_s *lms;
|
||||||
|
@ -439,6 +457,8 @@ void Terr_DestroySection(heightmap_t *hm, hmsection_t *s)
|
||||||
|
|
||||||
free(s->mesh.xyz_array);
|
free(s->mesh.xyz_array);
|
||||||
free(s->mesh.indexes);
|
free(s->mesh.indexes);
|
||||||
|
#endif
|
||||||
|
|
||||||
free(s);
|
free(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,7 +489,11 @@ void Terr_PurgeTerrainModel(model_t *mod, qboolean lightmapsonly)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else if (lightmapsonly)
|
else if (lightmapsonly)
|
||||||
|
{
|
||||||
|
#ifndef SERVERONLY
|
||||||
s->lightmap = -1;
|
s->lightmap = -1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
c->section[sx+sy*MAXSECTIONS] = NULL;
|
c->section[sx+sy*MAXSECTIONS] = NULL;
|
||||||
|
@ -483,6 +507,7 @@ void Terr_PurgeTerrainModel(model_t *mod, qboolean lightmapsonly)
|
||||||
free(c);
|
free(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifndef SERVERONLY
|
||||||
while (hm->unusedlmsects)
|
while (hm->unusedlmsects)
|
||||||
{
|
{
|
||||||
struct lmsect_s *lms;
|
struct lmsect_s *lms;
|
||||||
|
@ -490,6 +515,7 @@ void Terr_PurgeTerrainModel(model_t *mod, qboolean lightmapsonly)
|
||||||
hm->unusedlmsects = lms->next;
|
hm->unusedlmsects = lms->next;
|
||||||
free(lms);
|
free(lms);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#ifndef SERVERONLY
|
#ifndef SERVERONLY
|
||||||
void Terr_DrawTerrainModel (batch_t **batches, entity_t *e)
|
void Terr_DrawTerrainModel (batch_t **batches, entity_t *e)
|
||||||
|
@ -551,7 +577,7 @@ void Terr_DrawTerrainModel (batch_t **batches, entity_t *e)
|
||||||
culldist += 4096;
|
culldist += 4096;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
culldist = 999999999999999;
|
culldist = 999999999999999f;
|
||||||
|
|
||||||
if (culldist > gl_maxdist.value && gl_maxdist.value>0)
|
if (culldist > gl_maxdist.value && gl_maxdist.value>0)
|
||||||
culldist = gl_maxdist.value;
|
culldist = gl_maxdist.value;
|
||||||
|
@ -597,8 +623,8 @@ void Terr_DrawTerrainModel (batch_t **batches, entity_t *e)
|
||||||
Terr_InitLightmap(s);
|
Terr_InitLightmap(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
s->minh = 9999999999999999;
|
s->minh = 9999999999999999f;
|
||||||
s->maxh = -9999999999999999;
|
s->maxh = -9999999999999999f;
|
||||||
|
|
||||||
if (!mesh->xyz_array)
|
if (!mesh->xyz_array)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
model_t *loadmodel;
|
model_t *loadmodel;
|
||||||
char loadname[32]; // for hunk tags
|
char loadname[32]; // for hunk tags
|
||||||
|
|
||||||
qboolean GL_LoadHeightmapModel (model_t *mod, void *buffer);
|
qboolean Terr_LoadTerrainModel (model_t *mod, void *buffer);
|
||||||
qboolean Mod_LoadBrushModel (model_t *mod, void *buffer);
|
qboolean Mod_LoadBrushModel (model_t *mod, void *buffer);
|
||||||
qboolean Mod_LoadQ2BrushModel (model_t *mod, void *buffer);
|
qboolean Mod_LoadQ2BrushModel (model_t *mod, void *buffer);
|
||||||
qboolean D3_LoadMap_CollisionMap(model_t *mod, char *buf);
|
qboolean D3_LoadMap_CollisionMap(model_t *mod, char *buf);
|
||||||
|
@ -483,7 +483,7 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
|
||||||
#ifdef TERRAIN
|
#ifdef TERRAIN
|
||||||
if (!strcmp(com_token, "terrain")) //custom format, text based.
|
if (!strcmp(com_token, "terrain")) //custom format, text based.
|
||||||
{
|
{
|
||||||
if (!GL_LoadHeightmapModel(mod, buf))
|
if (!Terr_LoadTerrainModel(mod, buf))
|
||||||
goto couldntload;
|
goto couldntload;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue