- (__STDC_VERSION__ >= 199901L) -> defined(_ISOC99_SOURCE)
- Tune lighting and enable by default (This doesn't seem to affect the terrain) - Declaration updates (Trolltech says that attributes need to go after the "static inline", the GCC manual is a bit unspecific about this) git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1744 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
7241d5f1e8
commit
fde0d68082
|
@ -72,7 +72,7 @@ typedef struct
|
|||
#endif /* !WZ_OS_WIN */
|
||||
|
||||
// If we are C99 compatible, the "bool" macro will be defined in <stdbool.h> (as _Bool)
|
||||
#if __STDC_VERSION__ >= 199901L
|
||||
#if defined(_ISOC99_SOURCE)
|
||||
# include <stdbool.h>
|
||||
#else
|
||||
// Pretend we are C99 compatible (well, for the bool type then)
|
||||
|
|
|
@ -21,49 +21,50 @@
|
|||
#define __INCLUDED_BITIMAGE__
|
||||
|
||||
|
||||
WZ_DECL_PURE static inline unsigned short iV_GetImageWidth(const IMAGEFILE *ImageFile, const unsigned short ID)
|
||||
static inline WZ_DECL_PURE unsigned short iV_GetImageWidth(const IMAGEFILE *ImageFile, const unsigned short ID)
|
||||
{
|
||||
assert(ID < ImageFile->Header.NumImages);
|
||||
return ImageFile->ImageDefs[ID].Width;
|
||||
}
|
||||
|
||||
|
||||
WZ_DECL_PURE static inline unsigned short iV_GetImageHeight(const IMAGEFILE *ImageFile, const unsigned short ID)
|
||||
static inline WZ_DECL_PURE unsigned short iV_GetImageHeight(const IMAGEFILE *ImageFile, const unsigned short ID)
|
||||
{
|
||||
assert(ID < ImageFile->Header.NumImages);
|
||||
return ImageFile->ImageDefs[ID].Height;
|
||||
}
|
||||
|
||||
|
||||
WZ_DECL_PURE static inline short iV_GetImageXOffset(const IMAGEFILE *ImageFile, const unsigned short ID)
|
||||
static inline WZ_DECL_PURE short iV_GetImageXOffset(const IMAGEFILE *ImageFile, const unsigned short ID)
|
||||
{
|
||||
assert(ID < ImageFile->Header.NumImages);
|
||||
return ImageFile->ImageDefs[ID].XOffset;
|
||||
}
|
||||
|
||||
|
||||
WZ_DECL_PURE static inline short iV_GetImageYOffset(const IMAGEFILE *ImageFile, const unsigned short ID)
|
||||
static inline WZ_DECL_PURE short iV_GetImageYOffset(const IMAGEFILE *ImageFile, const unsigned short ID)
|
||||
{
|
||||
assert(ID < ImageFile->Header.NumImages);
|
||||
return ImageFile->ImageDefs[ID].YOffset;
|
||||
}
|
||||
|
||||
|
||||
WZ_DECL_PURE static inline unsigned short iV_GetImageCenterX(const IMAGEFILE *ImageFile, const unsigned short ID)
|
||||
static inline WZ_DECL_PURE unsigned short iV_GetImageCenterX(const IMAGEFILE *ImageFile, const unsigned short ID)
|
||||
{
|
||||
assert(ID < ImageFile->Header.NumImages);
|
||||
return ImageFile->ImageDefs[ID].XOffset + ImageFile->ImageDefs[ID].Width/2;
|
||||
}
|
||||
|
||||
|
||||
WZ_DECL_PURE static inline unsigned short iV_GetImageCenterY(const IMAGEFILE *ImageFile, const unsigned short ID)
|
||||
static inline WZ_DECL_PURE unsigned short iV_GetImageCenterY(const IMAGEFILE *ImageFile, const unsigned short ID)
|
||||
{
|
||||
assert(ID < ImageFile->Header.NumImages);
|
||||
return ImageFile->ImageDefs[ID].YOffset + ImageFile->ImageDefs[ID].Height/2;
|
||||
}
|
||||
|
||||
|
||||
IMAGEFILE *iV_LoadImageFile(const char *fileName);
|
||||
void iV_FreeImageFile(IMAGEFILE *ImageFile);
|
||||
extern IMAGEFILE *iV_LoadImageFile(const char *FileData);
|
||||
extern void iV_FreeImageFile(IMAGEFILE *ImageFile);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -48,13 +48,13 @@
|
|||
* Global ProtoTypes
|
||||
*/
|
||||
/***************************************************************************/
|
||||
void pie_Set2DClip(int x0, int y0, int x1, int y1);
|
||||
int pie_ClipTextured(int npoints, PIEVERTEX *points, PIEVERTEX *clip);
|
||||
BOOL pie_SetVideoBufferDepth(UDWORD depth);
|
||||
BOOL pie_SetVideoBufferWidth(UDWORD width);
|
||||
BOOL pie_SetVideoBufferHeight(UDWORD height);
|
||||
UDWORD pie_GetVideoBufferDepth( void ) WZ_DECL_PURE;
|
||||
UDWORD pie_GetVideoBufferWidth( void ) WZ_DECL_PURE;
|
||||
UDWORD pie_GetVideoBufferHeight( void ) WZ_DECL_PURE;
|
||||
extern void pie_Set2DClip(int x0, int y0, int x1, int y1);
|
||||
extern int pie_ClipTextured(int npoints, PIEVERTEX *points, PIEVERTEX *clip);
|
||||
extern BOOL pie_SetVideoBufferDepth(UDWORD depth);
|
||||
extern BOOL pie_SetVideoBufferWidth(UDWORD width);
|
||||
extern BOOL pie_SetVideoBufferHeight(UDWORD height);
|
||||
extern UDWORD pie_GetVideoBufferDepth( void ) WZ_DECL_PURE;
|
||||
extern UDWORD pie_GetVideoBufferWidth( void ) WZ_DECL_PURE;
|
||||
extern UDWORD pie_GetVideoBufferHeight( void ) WZ_DECL_PURE;
|
||||
|
||||
#endif // _pieclip_h
|
||||
|
|
|
@ -167,9 +167,9 @@ void pie_BeginLighting(const Vector3f * light)
|
|||
{
|
||||
const float pos[4] = {light->x, light->y, light->z, 0.0f};
|
||||
const float zero[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
const float ambient[4] = {0.4f, 0.4f, 0.4f, 0.0f};
|
||||
const float diffuse[4] = {0.5f, 0.5f, 0.5f, 0.0f};
|
||||
const float specular[4] = {1.0f, 1.0f, 1.0f, 0.0f};
|
||||
const float ambient[4] = {0.3f, 0.3f, 0.3f, 1.0f};
|
||||
const float diffuse[4] = {0.8f, 0.8f, 0.8f, 1.0f};
|
||||
const float specular[4] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
|
||||
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, zero);
|
||||
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_FALSE);
|
||||
|
@ -179,7 +179,7 @@ void pie_BeginLighting(const Vector3f * light)
|
|||
glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
|
||||
glEnable(GL_LIGHT0);
|
||||
|
||||
// lighting = TRUE; // Globaly disable lighting!
|
||||
lighting = TRUE;
|
||||
shadows = TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ soundDataBuffer* sound_DecodeOggVorbis(struct OggVorbisDecoderState* decoder, si
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#if !(__STDC_VERSION__ >= 199901L)
|
||||
#if !defined(_ISOC99_SOURCE)
|
||||
buffer->data = (char*)(buffer + 1);
|
||||
#endif
|
||||
buffer->bufferSize = bufferSize;
|
||||
|
|
|
@ -37,7 +37,7 @@ typedef struct
|
|||
unsigned int frequency;
|
||||
|
||||
// the raw PCM data
|
||||
#if __STDC_VERSION__ >= 199901L
|
||||
#if defined(_ISOC99_SOURCE)
|
||||
char data[];
|
||||
#else
|
||||
char* data;
|
||||
|
|
|
@ -605,7 +605,7 @@ static void handleActiveEvent(SDL_Event * event)
|
|||
{
|
||||
// Ignore focus loss through SDL_APPMOUSEFOCUS, since it mostly happens accidentialy
|
||||
// active.state is a bitflag! Mixed events (eg. APPACTIVE|APPMOUSEFOCUS) will thus not be ignored.
|
||||
if (!bMultiPlayer && event->active.state != SDL_APPMOUSEFOCUS )
|
||||
if ( event->active.state != SDL_APPMOUSEFOCUS )
|
||||
{
|
||||
if ( event->active.gain == 1 )
|
||||
{
|
||||
|
@ -665,7 +665,11 @@ static void mainLoop(void)
|
|||
inputHandleMouseMotionEvent(&event);
|
||||
break;
|
||||
case SDL_ACTIVEEVENT:
|
||||
handleActiveEvent(&event);
|
||||
// Ignore this event during multiplayer games since it breaks the game when one player suddenly pauses!
|
||||
if (!bMultiPlayer)
|
||||
{
|
||||
handleActiveEvent(&event);
|
||||
}
|
||||
break;
|
||||
case SDL_QUIT:
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue