1
0
Fork 0
forked from fte/fteqw

Fix a couple of bugs that I didn't catch.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4597 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2014-02-07 09:36:04 +00:00
parent 1bb752b582
commit 9140cccb9f
4 changed files with 30 additions and 28 deletions

View file

@ -761,7 +761,9 @@ struct ziplocalentry
#define SIZE_LOCALENTRY 30 #define SIZE_LOCALENTRY 30
#define SIZE_ENDOFCENTRALDIRECTORY 22 #define SIZE_ENDOFCENTRALDIRECTORY 22
#define SIZE_ZIP64ENDOFCENTRALDIRECTORY 56 #define SIZE_ZIP64ENDOFCENTRALDIRECTORY_V1 56
#define SIZE_ZIP64ENDOFCENTRALDIRECTORY_V2 84
#define SIZE_ZIP64ENDOFCENTRALDIRECTORY SIZE_ZIP64ENDOFCENTRALDIRECTORY_V2
#define SIZE_ZIP64ENDOFCENTRALDIRECTORYLOCATOR 20 #define SIZE_ZIP64ENDOFCENTRALDIRECTORYLOCATOR 20
//check the local header and determine the place the data actually starts. //check the local header and determine the place the data actually starts.

View file

@ -2157,11 +2157,11 @@ int FTENET_GetLocalAddress(int port, qboolean ipx, qboolean ipv4, qboolean ipv6,
static struct ifaddrs *iflist; static struct ifaddrs *iflist;
unsigned int iftime; //requery sometimes. unsigned int iftime; //requery sometimes.
int FTENET_GetLocalAddress(netadr_t *out, int port, int count, qboolean ipx, qboolean ipv4, qboolean ipv6) int FTENET_GetLocalAddress(int port, qboolean ipx, qboolean ipv4, qboolean ipv6, unsigned int *adrflags, netadr_t *addresses, int maxaddresses)
{ {
struct ifaddrs *ifa; struct ifaddrs *ifa;
int fam; int fam;
int idx; int idx = 0;
unsigned int time = Sys_Milliseconds(); unsigned int time = Sys_Milliseconds();
if (time - iftime > 1000 && iflist) if (time - iftime > 1000 && iflist)
{ {
@ -2174,7 +2174,7 @@ int FTENET_GetLocalAddress(netadr_t *out, int port, int count, qboolean ipx, qbo
getifaddrs(&iflist); getifaddrs(&iflist);
} }
for (ifa = iflist; ifa; ifa = ifa->ifa_next) for (ifa = iflist; ifa && idx < maxaddresses; ifa = ifa->ifa_next)
{ {
//can happen if the interface is not bound. //can happen if the interface is not bound.
if (ifa->ifa_addr == NULL) if (ifa->ifa_addr == NULL)
@ -2194,17 +2194,16 @@ int FTENET_GetLocalAddress(netadr_t *out, int port, int count, qboolean ipx, qbo
#endif #endif
0) 0)
{ {
if (idx++ == count) SockadrToNetadr(&ifa->ifa_addr, addresses[idx]);
{ addresses[idx]->port = port;
SockadrToNetadr(&ifa->ifa_addr, out); adrflags[idx] = 0;
out->port = port; idx++;
}
} }
} }
return idx; return idx;
} }
#else #else
int FTENET_GetLocalAddress(netadr_t *out, int count) int FTENET_GetLocalAddress(int port, qboolean ipx, qboolean ipv4, qboolean ipv6, unsigned int *adrflags, netadr_t *addresses, int maxaddresses)
{ {
return 0; return 0;
} }

View file

@ -221,10 +221,10 @@ void GLVID_DeInit (void)
SDL_SetWindowGammaRamp(sdlwindow, NULL, NULL, NULL); SDL_SetWindowGammaRamp(sdlwindow, NULL, NULL, NULL);
SDL_GL_DeleteContext(sdlcontext); SDL_GL_DeleteContext(sdlcontext);
SDL_DestroyWindow(sdlwindow); SDL_DestroyWindow(sdlwindow);
sdlwindow = NULL;
#else #else
SDL_SetGammaRamp (intitialgammaramps[0], intitialgammaramps[1], intitialgammaramps[2]); SDL_SetGammaRamp (intitialgammaramps[0], intitialgammaramps[1], intitialgammaramps[2]);
#endif #endif
sdlwindow = NULL;
SDL_QuitSubSystem(SDL_INIT_VIDEO); SDL_QuitSubSystem(SDL_INIT_VIDEO);
} }

View file

@ -586,6 +586,24 @@ mfog_t *CM_FogForOrigin(vec3_t org);
#define BEF_FORCECOLOURMOD 256 //q3 shaders default to 'rgbgen identity', and ignore ent colours. this forces ent colours to be considered #define BEF_FORCECOLOURMOD 256 //q3 shaders default to 'rgbgen identity', and ignore ent colours. this forces ent colours to be considered
#define BEF_LINES 512 //draw line pairs instead of triangles. #define BEF_LINES 512 //draw line pairs instead of triangles.
typedef struct
{
int fbo;
int rb_size[2];
int rb_depth;
int rb_stencil;
int rb_depthstencil;
texid_t colour;
unsigned int enables;
} fbostate_t;
#define FBO_RB_COLOUR 1
#define FBO_RB_DEPTH 2
#define FBO_RB_STENCIL 4
#define FBO_RESET 8 //resize all renderbuffers / free any that are not active. implied if the sizes differ
#define FBO_TEX_COLOUR 16 //internal
#define FBO_TEX_DEPTH 32 //internal
#define FBO_TEX_STENCIL 64 //internal
#ifdef GLQUAKE #ifdef GLQUAKE
void GLBE_Init(void); void GLBE_Init(void);
void GLBE_Shutdown(void); void GLBE_Shutdown(void);
@ -610,23 +628,6 @@ void GLBE_VBO_Data(vbobctx_t *ctx, void *data, unsigned int size, vboarray_t *va
void GLBE_VBO_Finish(vbobctx_t *ctx, void *edata, unsigned int esize, vboarray_t *earray); void GLBE_VBO_Finish(vbobctx_t *ctx, void *edata, unsigned int esize, vboarray_t *earray);
void GLBE_VBO_Destroy(vboarray_t *vearray); void GLBE_VBO_Destroy(vboarray_t *vearray);
typedef struct
{
int fbo;
int rb_size[2];
int rb_depth;
int rb_stencil;
int rb_depthstencil;
texid_t colour;
unsigned int enables;
} fbostate_t;
#define FBO_RB_COLOUR 1
#define FBO_RB_DEPTH 2
#define FBO_RB_STENCIL 4
#define FBO_RESET 8 //resize all renderbuffers / free any that are not active. implied if the sizes differ
#define FBO_TEX_COLOUR 16 //internal
#define FBO_TEX_DEPTH 32 //internal
#define FBO_TEX_STENCIL 64 //internal
void GLBE_FBO_Sources(texid_t sourcecolour, texid_t sourcedepth); void GLBE_FBO_Sources(texid_t sourcecolour, texid_t sourcedepth);
int GLBE_FBO_Push(fbostate_t *state); int GLBE_FBO_Push(fbostate_t *state);
void GLBE_FBO_Pop(int oldfbo); void GLBE_FBO_Pop(int oldfbo);