Move all skybox page handling to display3d.c to prepare for skybox scriptability.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3438 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
13ccc44599
commit
49cc91b0ef
|
@ -28,8 +28,6 @@
|
|||
#define iV_TEX_INVALID -1
|
||||
#define iV_TEXNAME_MAX 64
|
||||
|
||||
#define SKY_TEXPAGE "page-25"
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
#define iV_TEXNAME(i) ((char *) (&_TEX_PAGE[(i)].name))
|
||||
|
@ -57,6 +55,8 @@ extern int pie_ReplaceTexPage(iV_Image *s, const char *texPage);
|
|||
extern int pie_AddTexPage(iV_Image *s, const char *filename, int slot);
|
||||
extern void pie_TexInit(void);
|
||||
|
||||
void pie_PrepareSkybox(const char *pageName);
|
||||
|
||||
/*!
|
||||
* Turns filename into a pagename if possible
|
||||
* \param[in,out] filename Filename to pagify
|
||||
|
|
|
@ -114,14 +114,7 @@ int pie_AddTexPage(iV_Image *s, const char* filename, int slot)
|
|||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, MIN(4.0f, max));
|
||||
}
|
||||
|
||||
if( strncmp( filename, SKY_TEXPAGE, iV_TEXNAME_MAX ) == 0 )
|
||||
{
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
}
|
||||
else
|
||||
{
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
}
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
|
||||
/* Send back the texpage number so we can store it in the IMD */
|
||||
|
@ -131,6 +124,12 @@ int pie_AddTexPage(iV_Image *s, const char* filename, int slot)
|
|||
return i;
|
||||
}
|
||||
|
||||
void pie_PrepareSkybox(const char *pageName)
|
||||
{
|
||||
pie_SetTexturePage(iV_GetTexture(pageName));
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
}
|
||||
|
||||
void pie_MakeTexPageName(char * filename)
|
||||
{
|
||||
if (strncmp(filename, "page-", 5) == 0)
|
||||
|
|
|
@ -157,6 +157,8 @@ static BOOL bDrawBlips=TRUE;
|
|||
static BOOL bDrawProximitys=TRUE;
|
||||
BOOL godMode;
|
||||
|
||||
static char skyboxPageName[PATH_MAX] = "page-25";
|
||||
|
||||
static float waterRealValue = 0.0f;
|
||||
#define WAVE_SPEED 0.015f
|
||||
|
||||
|
@ -897,6 +899,8 @@ BOOL init3DView(void)
|
|||
|
||||
memset(directionSet, FALSE, sizeof(directionSet));
|
||||
|
||||
pie_PrepareSkybox(skyboxPageName);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -3572,7 +3576,7 @@ static void renderSurroundings(void)
|
|||
pie_TRANSLATE(0, -skybox_scale/8, 0);
|
||||
|
||||
// Set the texture page
|
||||
pie_SetTexturePage( iV_GetTexture(SKY_TEXPAGE) );
|
||||
pie_SetTexturePage(iV_GetTexture(skyboxPageName));
|
||||
|
||||
if(!gamePaused())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue