1
0
Fork 0
forked from fte/fteqw

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:
Spoike 2012-07-14 17:25:21 +00:00
parent 2c7220af2e
commit 71dce10318
3 changed files with 38 additions and 10 deletions

View file

@ -1007,6 +1007,7 @@ void NET_IntegerToMask (netadr_t *a, netadr_t *amask, int bits)
case NA_LOOPBACK:
break;
// warning: enumeration value âNA_*â not handled in switch
case NA_WEBSOCKET:
case NA_TCP:
case NA_TCPV6:
case NA_IRC:
@ -2114,7 +2115,7 @@ typedef struct {
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',
'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
// warning: enumeration value NA_* not handled in switch
case NA_WEBSOCKET:
case NA_INVALID:
case NA_LOOPBACK:
case NA_BROADCAST_IP:
@ -4667,12 +4669,12 @@ vfsfile_t *FS_OpenTCP(const char *name)
}
#elif 0 //defined(HAVE_WEBSOCKCL)
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.
All I can determine is that the connection has a gap.
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
{

View file

@ -47,6 +47,8 @@ typedef struct
float heights[SECTHEIGHTSIZE*SECTHEIGHTSIZE];
unsigned short holes;
float waterheight;
float minh;
float maxh;
} dsection_t;
typedef struct
{
@ -54,6 +56,7 @@ typedef struct
unsigned short holes;
unsigned int flags;
float waterheight;
float minh, maxh;
struct heightmap_s *hmmod;
#ifndef SERVERONLY
@ -63,7 +66,6 @@ typedef struct
texnums_t textures;
vbo_t vbo;
float minh, maxh;
mesh_t mesh;
mesh_t *amesh;
qboolean modified:1;
@ -85,11 +87,13 @@ typedef struct heightmap_s {
mesh_t *askymesh;
unsigned int exteriorcontents;
#ifndef SERVERONLY
struct lmsect_s
{
struct lmsect_s *next;
int lm, x, y;
} *unusedlmsects;
#endif
} heightmap_t;
static void Terr_LoadSectionTextures(hmsection_t *s)
@ -109,6 +113,7 @@ static void Terr_LoadSectionTextures(hmsection_t *s)
#endif
}
#ifndef SERVERONLY
static void Terr_InitLightmap(hmsection_t *s)
{
heightmap_t *hm = s->hmmod;
@ -140,6 +145,7 @@ static void Terr_InitLightmap(hmsection_t *s)
free(lms);
}
#endif
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
/*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
&& !sv.state
#endif
)
{
#ifndef SERVERONLY
CL_CheckOrEnqueDownloadFile(Terr_DiskSectionName(hm, sx, sy), NULL, 0);
#endif
return NULL;
}
@ -186,7 +194,10 @@ static hmsection_t *Terr_LoadSection(heightmap_t *hm, hmsection_t *s, int sx, in
return NULL;
}
memset(s, 0, sizeof(*s));
#ifndef SERVERONLY
s->lightmap = -1;
#endif
}
s->hmmod = hm;
@ -200,6 +211,7 @@ static hmsection_t *Terr_LoadSection(heightmap_t *hm, hmsection_t *s, int sx, in
if (ds)
{
s->flags = ds->flags;
#ifndef SERVERONLY
Q_strncpyz(s->texname[0], ds->texname[0], sizeof(s->texname[0]));
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->minh = ds->minh;
s->maxh = ds->maxh;
s->waterheight = ds->waterheight;
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.holes = s->holes;
ds.minh = s->minh:
ds.maxh = s->maxh:
FS_WriteFile(Terr_DiskSectionName(hm, sx, sy), &ds, sizeof(ds), FS_GAMEONLY);
#endif
@ -417,6 +434,7 @@ void HeightMap_Save(heightmap_t *hm)
void Terr_DestroySection(heightmap_t *hm, hmsection_t *s)
{
#ifndef SERVERONLY
if (hm && s->lightmap >= 0)
{
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.indexes);
#endif
free(s);
}
@ -469,7 +489,11 @@ void Terr_PurgeTerrainModel(model_t *mod, qboolean lightmapsonly)
{
}
else if (lightmapsonly)
{
#ifndef SERVERONLY
s->lightmap = -1;
#endif
}
else
{
c->section[sx+sy*MAXSECTIONS] = NULL;
@ -483,6 +507,7 @@ void Terr_PurgeTerrainModel(model_t *mod, qboolean lightmapsonly)
free(c);
}
}
#ifndef SERVERONLY
while (hm->unusedlmsects)
{
struct lmsect_s *lms;
@ -490,6 +515,7 @@ void Terr_PurgeTerrainModel(model_t *mod, qboolean lightmapsonly)
hm->unusedlmsects = lms->next;
free(lms);
}
#endif
}
#ifndef SERVERONLY
void Terr_DrawTerrainModel (batch_t **batches, entity_t *e)
@ -551,7 +577,7 @@ void Terr_DrawTerrainModel (batch_t **batches, entity_t *e)
culldist += 4096;
}
else
culldist = 999999999999999;
culldist = 999999999999999f;
if (culldist > gl_maxdist.value && gl_maxdist.value>0)
culldist = gl_maxdist.value;
@ -597,8 +623,8 @@ void Terr_DrawTerrainModel (batch_t **batches, entity_t *e)
Terr_InitLightmap(s);
}
s->minh = 9999999999999999;
s->maxh = -9999999999999999;
s->minh = 9999999999999999f;
s->maxh = -9999999999999999f;
if (!mesh->xyz_array)
{

View file

@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
model_t *loadmodel;
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_LoadQ2BrushModel (model_t *mod, void *buffer);
qboolean D3_LoadMap_CollisionMap(model_t *mod, char *buf);
@ -483,7 +483,7 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
#ifdef TERRAIN
if (!strcmp(com_token, "terrain")) //custom format, text based.
{
if (!GL_LoadHeightmapModel(mod, buf))
if (!Terr_LoadTerrainModel(mod, buf))
goto couldntload;
break;
}