More cleanup...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1876 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
3f2786c030
commit
1f723e656c
|
@ -85,7 +85,7 @@ BOOL iV_IMDSave(char *filename, iIMDShape *s, BOOL PieIMD)
|
|||
fprintf(fp,"TYPE %x\n",s->flags);
|
||||
|
||||
// if textured write tex page file info
|
||||
if (s->texpage != -1)
|
||||
if (s->texpage != -1)
|
||||
{
|
||||
fprintf(fp,"TEXTURE %d %s %d %d\n",iV_TEXTYPE(s->texpage),
|
||||
iV_TEXNAME(s->texpage),iV_TEXWIDTH(s->texpage),
|
||||
|
@ -131,7 +131,7 @@ BOOL iV_IMDSave(char *filename, iIMDShape *s, BOOL PieIMD)
|
|||
}
|
||||
|
||||
// if textured write texture uv's
|
||||
if (poly->flags & iV_IMD_TEX)
|
||||
if (poly->flags & iV_IMD_TEX)
|
||||
{
|
||||
for (d=0; d<poly->npnts; d++) {
|
||||
fprintf(fp," %d %d",poly->vrt[d].u,poly->vrt[d].v);
|
||||
|
@ -189,7 +189,7 @@ void iV_IMDRelease(iIMDShape *s)
|
|||
free(s->shadowEdgeList);
|
||||
s->shadowEdgeList = NULL;
|
||||
}
|
||||
iV_DEBUG0("imd[IMDRelease] = release successful\n");
|
||||
debug(LOG_3D, "imd[IMDRelease] = release successful\n");
|
||||
d = s->next;
|
||||
free(s);
|
||||
iV_IMDRelease(d);
|
||||
|
|
|
@ -101,7 +101,7 @@ static BOOL _imd_load_polys( const char **ppFileData, iIMDShape *s )
|
|||
|
||||
if (sscanf(pFileData, "%x %d%n", &flags, &npnts, &cnt) != 2)
|
||||
{
|
||||
iV_Error(0xff, "(_load_polys) [poly %d] error loading flags and npoints", i);
|
||||
debug(LOG_ERROR, "(_load_polys) [poly %d] error loading flags and npoints", i);
|
||||
}
|
||||
pFileData += cnt;
|
||||
|
||||
|
@ -111,13 +111,13 @@ static BOOL _imd_load_polys( const char **ppFileData, iIMDShape *s )
|
|||
poly->pindex = (VERTEXID*)malloc(sizeof(VERTEXID) * poly->npnts);
|
||||
if (poly->pindex == NULL)
|
||||
{
|
||||
iV_Error(0xff, "(_load_polys) [poly %d] memory alloc fail (poly indices)", i);
|
||||
debug(LOG_ERROR, "(_load_polys) [poly %d] memory alloc fail (poly indices)", i);
|
||||
return FALSE;
|
||||
}
|
||||
poly->vrt = (fVertex*)malloc(sizeof(fVertex) * poly->npnts);
|
||||
if (poly->vrt == NULL)
|
||||
{
|
||||
iV_Error(0xff, "(_load_polys) [poly %d] memory alloc fail (vertex struct)", i);
|
||||
debug(LOG_ERROR, "(_load_polys) [poly %d] memory alloc fail (vertex struct)", i);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -164,14 +164,14 @@ static BOOL _imd_load_polys( const char **ppFileData, iIMDShape *s )
|
|||
poly->pTexAnim = (iTexAnim*)malloc(sizeof(iTexAnim));
|
||||
if (poly->pTexAnim == NULL)
|
||||
{
|
||||
iV_Error(0xff, "(_load_polys) [poly %d] memory alloc fail (iTexAnim struct)", i);
|
||||
debug(LOG_ERROR, "(_load_polys) [poly %d] memory alloc fail (iTexAnim struct)", i);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// even the psx needs to skip the data
|
||||
if (sscanf(pFileData, "%d %d %d %d%n", &nFrames, &pbRate, &tWidth, &tHeight, &cnt) != 4)
|
||||
{
|
||||
iV_Error(0xff, "(_load_polys) [poly %d] error reading texanim data", i);
|
||||
debug(LOG_ERROR, "(_load_polys) [poly %d] error reading texanim data", i);
|
||||
return FALSE;
|
||||
}
|
||||
pFileData += cnt;
|
||||
|
@ -202,14 +202,14 @@ static BOOL _imd_load_polys( const char **ppFileData, iIMDShape *s )
|
|||
float VertexU, VertexV;
|
||||
if (sscanf(pFileData, "%f %f%n", &VertexU, &VertexV, &cnt) != 2)
|
||||
{
|
||||
iV_Error(0xff, "(_load_polys) [poly %d] error reading tex outline", i);
|
||||
debug(LOG_ERROR, "(_load_polys) [poly %d] error reading tex outline", i);
|
||||
return FALSE;
|
||||
}
|
||||
pFileData += cnt;
|
||||
|
||||
poly->vrt[j].u = VertexU;
|
||||
poly->vrt[j].v = VertexV;
|
||||
poly->vrt[j].g = 255;
|
||||
poly->vrt[j].g = UINT8_MAX;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ static BOOL ReadPoints( const char **ppFileData, iIMDShape *s )
|
|||
{
|
||||
if (sscanf(pFileData, "%f %f %f%n", &newVector.x, &newVector.y, &newVector.z, &cnt) != 3)
|
||||
{
|
||||
iV_Error(0xff, "(_load_points) file corrupt -K");
|
||||
debug(LOG_ERROR, "(_load_points) file corrupt -K");
|
||||
return FALSE;
|
||||
}
|
||||
pFileData += cnt;
|
||||
|
@ -482,14 +482,14 @@ static BOOL _imd_load_points( const char **ppFileData, iIMDShape *s )
|
|||
cen.x = (rad*cen.x + old_to_new*p->x) / old_to_p;
|
||||
cen.y = (rad*cen.y + old_to_new*p->y) / old_to_p;
|
||||
cen.z = (rad*cen.z + old_to_new*p->z) / old_to_p;
|
||||
iV_DEBUG4("NEW SPHERE: cen,rad = %d %d %d, %d\n", cen.x, cen.y, cen.z, rad);
|
||||
debug(LOG_3D, "NEW SPHERE: cen,rad = %f %f %f, %f\n", cen.x, cen.y, cen.z, rad);
|
||||
}
|
||||
}
|
||||
|
||||
s->ocen = cen;
|
||||
s->oradius = rad;
|
||||
iV_DEBUG2("radius, sradius, %d, %d\n", s->radius, s->sradius);
|
||||
iV_DEBUG4("SPHERE: cen,rad = %d %d %d, %d\n", s->ocen.x, s->ocen.y, s->ocen.z, s->oradius);
|
||||
debug(LOG_3D, "radius, sradius, %d, %d\n", s->radius, s->sradius);
|
||||
debug(LOG_3D, "SPHERE: cen,rad = %f %f %f, %d\n", s->ocen.x, s->ocen.y, s->ocen.z, s->oradius);
|
||||
|
||||
// END: tight bounding sphere
|
||||
|
||||
|
@ -516,7 +516,7 @@ static BOOL _imd_load_connectors(const char **ppFileData, iIMDShape *s)
|
|||
s->connectors = (Vector3f*)malloc(sizeof(Vector3f) * s->nconnectors);
|
||||
if (s->connectors == NULL)
|
||||
{
|
||||
iV_Error(0xff, "(_load_connectors) MALLOC fail");
|
||||
debug(LOG_ERROR, "(_load_connectors) MALLOC fail");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -524,7 +524,7 @@ static BOOL _imd_load_connectors(const char **ppFileData, iIMDShape *s)
|
|||
{
|
||||
if (sscanf(pFileData, "%f %f %f%n", &newVector.x, &newVector.y, &newVector.z, &cnt) != 3)
|
||||
{
|
||||
iV_Error(0xff, "(_load_connectors) file corrupt -M");
|
||||
debug(LOG_ERROR, "(_load_connectors) file corrupt -M");
|
||||
return FALSE;
|
||||
}
|
||||
pFileData += cnt;
|
||||
|
@ -632,7 +632,7 @@ static iIMDShape *_imd_load_level(const char **ppFileData, const char *FileDataE
|
|||
// might be "BSP" or "LEVEL"
|
||||
if (strcmp(buffer, "LEVEL") == 0)
|
||||
{
|
||||
iV_DEBUG2("imd[_load_level] = npoints %d, npolys %d\n", s->npoints, s->npolys);
|
||||
debug(LOG_3D, "imd[_load_level] = npoints %d, npolys %d\n", s->npoints, s->npolys);
|
||||
s->next = _imd_load_level(&pFileData, FileDataEnd, nlevels - 1);
|
||||
}
|
||||
else if (strcmp(buffer, "CONNECTORS") == 0)
|
||||
|
@ -643,7 +643,7 @@ static iIMDShape *_imd_load_level(const char **ppFileData, const char *FileDataE
|
|||
}
|
||||
else
|
||||
{
|
||||
iV_Error(0xff, "(_load_level) unexpected directive %s %d", buffer, &n);
|
||||
debug(LOG_ERROR, "(_load_level) unexpected directive %s %d", buffer, n);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -769,7 +769,7 @@ iIMDShape *iV_ProcessIMD( const char **ppFileData, const char *FileDataEnd )
|
|||
/* Read first LEVEL directive */
|
||||
if (sscanf(pFileData, "%s %d%n", buffer, &level, &cnt) != 2)
|
||||
{
|
||||
iV_Error(0xff, "(_load_level) file corrupt -J");
|
||||
debug(LOG_ERROR, "(_load_level) file corrupt -J");
|
||||
return NULL;
|
||||
}
|
||||
pFileData += cnt;
|
||||
|
|
|
@ -28,68 +28,12 @@
|
|||
|
||||
#include "piedef.h"
|
||||
|
||||
#define iV_DIVSHIFT 15
|
||||
#define iV_DIVMULTP (1<<iV_DIVSHIFT)
|
||||
#define iV_DIVMULTP_2 (1<<(iV_DIVSHIFT-1))
|
||||
#define iV_DIVSHIFT 15
|
||||
#define iV_DIVMULTP (1 << iV_DIVSHIFT)
|
||||
|
||||
extern void iV_Error(long n, const char *msge, ...);
|
||||
#define iV_POLY_MAX_POINTS pie_MAX_POLY_SIZE
|
||||
|
||||
// If its a final build we need to undefine iv_error so that it doesn't generate any code !
|
||||
#ifdef FINALBUILD
|
||||
|
||||
#undef iV_Error
|
||||
#define iV_Error(fmt...) ;
|
||||
|
||||
#endif
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
/***************************************************************************/
|
||||
/*
|
||||
* Global Macros
|
||||
*/
|
||||
/***************************************************************************/
|
||||
//* Macros:
|
||||
//*
|
||||
|
||||
#define iV_RSHIFT 12
|
||||
#define iV_RMULTP (1L<<iV_RSHIFT)
|
||||
|
||||
#define iV_POLY_MAX_POINTS pie_MAX_POLY_SIZE
|
||||
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/*
|
||||
* Global Type Definitions
|
||||
*/
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
|
||||
extern iError _iVERROR;
|
||||
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
extern void iV_Reset( void );
|
||||
extern void iV_Reset(void);
|
||||
extern void iV_ShutDown(void);
|
||||
extern void iV_Stop(char *string, ...);
|
||||
extern void iV_Abort(char *string, ...);
|
||||
|
||||
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
/* Unused debug functions of dubious design and usefulness */
|
||||
|
||||
#define iV_DEBUG0(S)
|
||||
#define iV_DEBUG1(S,A)
|
||||
#define iV_DEBUG2(S,A,B)
|
||||
#define iV_DEBUG3(S,A,B,C)
|
||||
#define iV_DEBUG4(S,A,B,C,D)
|
||||
#define iV_DEBUG5(S,A,B,C,D,E)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
* Global Definitions
|
||||
*/
|
||||
/***************************************************************************/
|
||||
#define iV_POLY_MAX_POINTS pie_MAX_POLY_SIZE
|
||||
|
||||
//palette definitions
|
||||
#define iV_PALETTE_SIZE PALETTE_SIZE
|
||||
|
@ -81,45 +80,4 @@
|
|||
#define iV_SIN SIN
|
||||
#define iV_COS COS
|
||||
|
||||
//#define iV_Clipping2D pie_Set2DClip
|
||||
|
||||
//#define iV_PolyClipTex2D pie_PolyClipTex2D
|
||||
//#define iV_PolyClip2D pie_PolyClip2D
|
||||
|
||||
/***************************************************************************/
|
||||
/*
|
||||
* Global Macros
|
||||
*/
|
||||
/***************************************************************************/
|
||||
|
||||
/***************************************************************************/
|
||||
/*
|
||||
* Global Type Definitions
|
||||
*/
|
||||
/***************************************************************************/
|
||||
//*************************************************************************
|
||||
//
|
||||
// Basic types (now defined in pieTypes.h)
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
//*************************************************************************
|
||||
//
|
||||
// Simple derived types (now defined in pieTypes.h)
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
//*************************************************************************
|
||||
//
|
||||
// screen surface structure
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/*
|
||||
* Global Variables
|
||||
*/
|
||||
/***************************************************************************/
|
||||
|
||||
#endif // _ivispatch_h
|
||||
|
|
|
@ -48,19 +48,15 @@
|
|||
|
||||
#define FP12_SHIFT 12
|
||||
#define FP12_MULTIPLIER (1<<12)
|
||||
#define STRETCHED_Z_SHIFT 10 //stretchs z range for (1000 to 4000) to (8000 to 32000)
|
||||
#define MAX_Z (32000.0f) //raised to 32000 from 6000 when stretched
|
||||
#define INV_MAX_Z (0.00003125f) //1/32000
|
||||
#define STRETCHED_Z_SHIFT 10 // stretchs z range for (1000 to 4000) to (8000 to 32000)
|
||||
#define MAX_Z (32000.0f) // raised to 32000 from 6000 when stretched
|
||||
#define MIN_STRETCHED_Z 256
|
||||
#define LONG_WAY (1<<15)
|
||||
#define LONG_TEST (1<<14)
|
||||
#define INTERFACE_DEPTH (MAX_Z - 1.0f)
|
||||
#define INTERFACE_DEPTH_3DFX (65535)
|
||||
#define INV_INTERFACE_DEPTH_3DFX (1.0f/65535.0f)
|
||||
#define BUTTON_DEPTH (2000) //will be stretched to 16000
|
||||
#define LONG_WAY (1<<15)
|
||||
#define LONG_TEST (1<<14)
|
||||
#define INTERFACE_DEPTH (MAX_Z - 1.0f)
|
||||
#define BUTTON_DEPTH 2000 // will be stretched to 16000
|
||||
|
||||
#define TEXTURE_SIZE (256.0f)
|
||||
#define INV_TEX_SIZE (0.00390625f)
|
||||
#define OLD_TEXTURE_SIZE_FIX 256.0f
|
||||
|
||||
|
||||
#define pie_MAX_POLY_SIZE 16
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#define iV_TransBoxFill pie_TransBoxFill
|
||||
#define iV_DrawImage pie_ImageFileID
|
||||
#define iV_DrawImageRect pie_ImageFileIDTile
|
||||
#define iV_DrawImage pie_ImageFileID
|
||||
|
||||
//*************************************************************************
|
||||
// polygon flags b0..b7: col, b24..b31: anim index
|
||||
|
|
|
@ -20,13 +20,10 @@
|
|||
#ifndef _tex_
|
||||
#define _tex_
|
||||
|
||||
#include "ivi.h"
|
||||
#include "png_util.h"
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
|
||||
|
||||
#define iV_TEX_MAX 64
|
||||
#define iV_TEXNAME_MAX 64
|
||||
|
||||
|
|
|
@ -17,99 +17,22 @@
|
|||
along with Warzone 2100; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "lib/ivis_common/ivisdef.h"
|
||||
#include "lib/ivis_common/piestate.h"
|
||||
#include "lib/ivis_common/rendmode.h"
|
||||
#include "lib/ivis_common/piemode.h"
|
||||
#include "lib/ivis_common/piepalette.h"
|
||||
#include "piematrix.h"
|
||||
#include "lib/ivis_common/tex.h"
|
||||
#include "lib/ivis_common/ivispatch.h"
|
||||
#include "lib/ivis_common/textdraw.h"
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
iError _iVERROR;
|
||||
|
||||
//*************************************************************************
|
||||
// pass in true to reset the palette too.
|
||||
void iV_Reset(void)
|
||||
{
|
||||
_TEX_INDEX = 0;
|
||||
iV_ClearFonts(); // Initialise the IVIS font module.
|
||||
iV_ClearFonts(); // Initialise the IVIS font module.
|
||||
}
|
||||
|
||||
|
||||
void iV_ShutDown(void)
|
||||
|
||||
{
|
||||
|
||||
iV_DEBUG0("1\n");
|
||||
|
||||
#ifdef iV_DEBUG
|
||||
iV_HeapLog();
|
||||
#endif
|
||||
|
||||
iV_DEBUG0("4\n");
|
||||
pie_ShutDown();
|
||||
iV_DEBUG0("5\n");
|
||||
|
||||
iV_DEBUG0("6\n");
|
||||
|
||||
pie_TexShutDown();
|
||||
|
||||
iV_DEBUG0("7\n");
|
||||
|
||||
// _iv_heap_tidy();
|
||||
|
||||
iV_DEBUG0("8\n");
|
||||
|
||||
iV_DEBUG0("9\n");
|
||||
|
||||
iV_DEBUG0("iVi[ShutDown] = successful\n");
|
||||
debug(LOG_3D, "iVi[ShutDown] = successful\n");
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
void iV_Stop(char *string, ...)
|
||||
|
||||
{
|
||||
va_list argptr;
|
||||
|
||||
iV_ShutDown();
|
||||
va_start(argptr,string);
|
||||
vprintf(string,argptr);
|
||||
va_end(argptr);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
void iV_Abort(char *string, ...)
|
||||
|
||||
{
|
||||
va_list argptr;
|
||||
|
||||
va_start(argptr,string);
|
||||
vprintf(string,argptr);
|
||||
va_end(argptr);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
#ifndef FINALBUILD
|
||||
void iV_Error(long errorn, const char *msge, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
|
||||
va_start(argptr,msge);
|
||||
vsprintf(&_iVERROR.msge[0],msge,argptr);
|
||||
va_end(argptr);
|
||||
_iVERROR.n = errorn;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ void pie_ImageFileIDTile(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Width
|
|||
}
|
||||
}
|
||||
|
||||
void pie_ImageFileIDStretch(IMAGEFILE *ImageFile,UWORD ID,int x,int y,int Width,int Height)
|
||||
void pie_ImageFileIDStretch(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Width, int Height)
|
||||
{
|
||||
IMAGEDEF *Image;
|
||||
PIEIMAGE pieImage;
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include <SDL/SDL_opengl.h>
|
||||
|
||||
#include "lib/ivis_common/ivi.h"
|
||||
#include "lib/ivis_common/piedef.h"
|
||||
#include "lib/ivis_common/pieclip.h"
|
||||
#include "piematrix.h"
|
||||
|
@ -523,5 +522,5 @@ void pie_MatInit(void)
|
|||
pie_MatReset();
|
||||
|
||||
|
||||
iV_DEBUG0("geo[_geo_setup] = setup successful\n");
|
||||
debug(LOG_3D, "geo[_geo_setup] = setup successful\n");
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "lib/ivis_common/piestate.h"
|
||||
#include "lib/ivis_common/piemode.h"
|
||||
#include "piematrix.h"
|
||||
#include "lib/ivis_common/ivi.h"
|
||||
#include "lib/ivis_common/piefunc.h"
|
||||
#include "lib/ivis_common/tex.h"
|
||||
#include "lib/ivis_common/rendmode.h"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
#include "lib/ivis_common/ivi.h"
|
||||
#include "lib/ivis_common/piestate.h"
|
||||
#include "lib/ivis_common/piepalette.h"
|
||||
#include "lib/ivis_common/rendmode.h"
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "lib/ivis_common/ivi.h"
|
||||
#include "lib/ivis_common/rendmode.h"
|
||||
#include "lib/ivis_common/pieclip.h"
|
||||
#include "lib/ivis_common/textdraw.h"
|
||||
|
@ -68,7 +67,7 @@ iSurface *iV_SurfaceCreate(Uint32 flags, int width, int height, int xp, int yp,
|
|||
s->clip.top = 0;
|
||||
s->clip.bottom = height-1;
|
||||
|
||||
iV_DEBUG2("vid[SurfaceCreate] = created surface width %d, height %d\n",width,height);
|
||||
debug(LOG_3D, "vid[SurfaceCreate] = created surface width %d, height %d\n",width,height);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
@ -97,7 +96,7 @@ void iV_RenderAssign(iSurface *s)
|
|||
/* Need to look into this - won't the unwanted called still set render surface? */
|
||||
psRendSurface = s;
|
||||
|
||||
iV_DEBUG0("vid[RenderAssign] = assigned renderer :\n");
|
||||
iV_DEBUG5("usr %d\nflags %x\nxcentre, ycentre %d\nbuffer %p\n",
|
||||
s->usr,s->flags,s->xcentre,s->ycentre,s->buffer);
|
||||
debug(LOG_3D, "vid[RenderAssign] = assigned renderer :\n");
|
||||
debug(LOG_3D, "flags %x\nxcentre %d, ycentre %d\nbuffer %p\n",
|
||||
s->flags, s->xcentre, s->ycentre, s->buffer);
|
||||
}
|
||||
|
|
|
@ -1911,17 +1911,16 @@ static inline void dealWithLMBDroid(DROID* psDroid, SELECTION_TYPE selection)
|
|||
|
||||
FeedbackOrderGiven();
|
||||
driveDisableTactical();
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (ctrlShiftDown())
|
||||
{
|
||||
// select/deselect etc. the droid
|
||||
dealWithDroidSelect(psDroid, FALSE);
|
||||
}
|
||||
else
|
||||
if (psDroid->droidType == DROID_TRANSPORTER)
|
||||
else if (psDroid->droidType == DROID_TRANSPORTER)
|
||||
{
|
||||
if (selection == SC_INVALID)
|
||||
{
|
||||
|
@ -1950,7 +1949,7 @@ static inline void dealWithLMBDroid(DROID* psDroid, SELECTION_TYPE selection)
|
|||
{
|
||||
// try to attack your own unit
|
||||
DROID* psCurr;
|
||||
|
||||
|
||||
for(psCurr = apsDroidLists[selectedPlayer]; psCurr; psCurr = psCurr->psNext)
|
||||
{
|
||||
if ((psCurr != psDroid) && // can't attack yourself
|
||||
|
@ -2043,7 +2042,7 @@ static inline void dealWithLMBDroid(DROID* psDroid, SELECTION_TYPE selection)
|
|||
if(psDroid->droidType == DROID_SENSOR)
|
||||
{
|
||||
DROID* psCurr;
|
||||
|
||||
|
||||
//bWeapDroidSelected = FALSE;
|
||||
bSensorAssigned = FALSE;
|
||||
for(psCurr = apsDroidLists[selectedPlayer]; psCurr; psCurr = psCurr->psNext)
|
||||
|
@ -2162,7 +2161,7 @@ static inline void dealWithLMBStructure(STRUCTURE* psStructure, SELECTION_TYPE s
|
|||
selection == SC_INVALID)
|
||||
{
|
||||
STRUCTURE* psCurr;
|
||||
|
||||
|
||||
/* Clear old building selection(s) - should only be one */
|
||||
for(psCurr = apsStructLists[selectedPlayer]; psCurr; psCurr = psCurr->psNext)
|
||||
{
|
||||
|
@ -2174,7 +2173,7 @@ static inline void dealWithLMBStructure(STRUCTURE* psStructure, SELECTION_TYPE s
|
|||
if (keyDown(KEY_LALT) || keyDown(KEY_RALT))
|
||||
{
|
||||
DROID* psCurr;
|
||||
|
||||
|
||||
// try to attack your own structure
|
||||
for(psCurr = apsDroidLists[selectedPlayer]; psCurr; psCurr = psCurr->psNext)
|
||||
{
|
||||
|
@ -2252,7 +2251,7 @@ static inline void dealWithLMBFeature(FEATURE* psFeature)
|
|||
(apStructTypeLists[selectedPlayer][i] == AVAILABLE) ) // dont go any further if no derrick stat found.
|
||||
{
|
||||
DROID* psCurr;
|
||||
|
||||
|
||||
// for each droid
|
||||
for(psCurr = apsDroidLists[selectedPlayer]; psCurr; psCurr = psCurr->psNext)
|
||||
{
|
||||
|
@ -2266,7 +2265,7 @@ static inline void dealWithLMBFeature(FEATURE* psFeature)
|
|||
AddDerrickBurningMessage();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (ctrlShiftDown())
|
||||
{
|
||||
orderDroidStatsLocAdd(psCurr, DORDER_BUILD,
|
||||
|
@ -2357,7 +2356,7 @@ static inline void dealWithLMBObject(BASE_OBJECT* psClickedOn)
|
|||
case OBJ_DROID:
|
||||
dealWithLMBDroid((DROID*)psClickedOn, selection);
|
||||
break;
|
||||
|
||||
|
||||
case OBJ_STRUCTURE:
|
||||
dealWithLMBStructure((STRUCTURE*)psClickedOn, selection);
|
||||
break;
|
||||
|
@ -2417,7 +2416,7 @@ void dealWithLMB( void )
|
|||
Pos.y = 100;
|
||||
#if 0
|
||||
addEffect(&Pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_SPECIFIED,TRUE,resGetData("IMD","fxlswave.pie"));
|
||||
DBPRINTF(("Added test effect %p : %d,%d,%d\n",resGetData("IMD","fxlswave.pie"),Pos.x,Pos.y,Pos.z);
|
||||
debug(LOG_NEVER, "Added test effect %p : %d,%d,%d\n",resGetData("IMD","fxlswave.pie"),Pos.x,Pos.y,Pos.z);
|
||||
addEffect(&Pos,EFFECT_GRAVITON,GRAVITON_TYPE_EMITTING_DR,TRUE,debrisImds[rand()%MAX_DEBRIS]);
|
||||
#endif
|
||||
addEffect(&Pos,EFFECT_EXPLOSION,EXPLOSION_TYPE_MEDIUM,FALSE,NULL,0);
|
||||
|
@ -2451,7 +2450,7 @@ void dealWithLMB( void )
|
|||
|
||||
//addConsoleMessage("Droid ordered to new location",DEFAULT_JUSTIFY);
|
||||
}
|
||||
|
||||
|
||||
driveDisableTactical();
|
||||
|
||||
return;
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "lib/ivis_common/piestate.h"
|
||||
#include "lib/ivis_common/rendmode.h"
|
||||
#include "lib/ivis_common/tex.h"
|
||||
#include "lib/ivis_common/ivi.h"
|
||||
#include "lib/netplay/netplay.h"
|
||||
#include "lib/script/script.h"
|
||||
#include "lib/sound/cdaudio.h"
|
||||
|
@ -1265,7 +1266,7 @@ BOOL stageOneInitialise(void)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
iV_Reset(); // Reset the IV library
|
||||
iV_Reset(); // Reset the IV library
|
||||
|
||||
if (!stringsInitialise()) /* Initialise the string system */
|
||||
{
|
||||
|
|
|
@ -961,12 +961,12 @@ void intDisplayStatusButton(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UD
|
|||
|
||||
case OBJ_STRUCTURE: // If it's a structure...
|
||||
Structure = (STRUCTURE*)psObj;
|
||||
switch(Structure->pStructureType->type)
|
||||
switch(Structure->pStructureType->type)
|
||||
{
|
||||
case REF_FACTORY:
|
||||
case REF_CYBORG_FACTORY:
|
||||
case REF_VTOL_FACTORY:
|
||||
if (StructureIsManufacturing(Structure))
|
||||
if (StructureIsManufacturing(Structure))
|
||||
{
|
||||
IMDType = IMDTYPE_DROIDTEMPLATE;
|
||||
Object = (void*)FactoryGetTemplate(StructureGetFactory(Structure));
|
||||
|
@ -980,7 +980,7 @@ void intDisplayStatusButton(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UD
|
|||
break;
|
||||
|
||||
case REF_RESEARCH:
|
||||
if (StructureIsResearching(Structure))
|
||||
if (StructureIsResearching(Structure))
|
||||
{
|
||||
Stats = (BASE_STATS*)Buffer->Data2;
|
||||
if (!Stats)
|
||||
|
@ -3432,7 +3432,6 @@ void intDisplayDesignPowerBar(WIDGET *psWidget, UDWORD xOffset,
|
|||
|
||||
//draw current value section
|
||||
iV_DrawImageRect(IntImages,IMAGE_DES_STATSCURR, iX, y0,
|
||||
//BarGraph->majorSize, iV_GetImageHeight(IntImages,IMAGE_DES_STATSCURR));
|
||||
width, iV_GetImageHeight(IntImages,IMAGE_DES_STATSCURR));
|
||||
|
||||
/* draw text value */
|
||||
|
|
|
@ -948,7 +948,7 @@ static void moveCalcTurn(float *pCurr, float target, UDWORD rate)
|
|||
}
|
||||
retval = fmodf(retval, 360);
|
||||
|
||||
ASSERT(retval < 360 && retval >= 0, "moveCalcTurn: bad angle %f from (%f, %f, %u)\n",
|
||||
ASSERT(retval < 360 && retval >= 0, "moveCalcTurn: bad angle %f from (%f, %f, %u)\n",
|
||||
retval, *pCurr, target, rate);
|
||||
|
||||
*pCurr = retval;
|
||||
|
@ -2905,7 +2905,7 @@ static void moveUpdateVtolModel(DROID *psDroid, SDWORD speed, SDWORD direction)
|
|||
moveAdjustVtolHeight( psDroid, iMapZ );
|
||||
}
|
||||
|
||||
#ifndef FINALBUILD
|
||||
#ifdef DEBUG
|
||||
|
||||
WZ_DECL_UNUSED static void moveGetStatusStr( UBYTE status, char *szStr )
|
||||
{
|
||||
|
|
57
src/oprint.c
57
src/oprint.c
|
@ -30,10 +30,6 @@
|
|||
#include "console.h"
|
||||
#include "oprint.h"
|
||||
|
||||
#ifndef FINALBUILD
|
||||
#define OPRINTF CONPRINTF
|
||||
//#define OPRINTF DBPRINTF
|
||||
|
||||
// print out information about a base object
|
||||
void printBaseObjInfo(BASE_OBJECT *psObj)
|
||||
{
|
||||
|
@ -54,7 +50,7 @@ void printBaseObjInfo(BASE_OBJECT *psObj)
|
|||
break;
|
||||
}
|
||||
|
||||
OPRINTF( ConsoleString, (ConsoleString, "%s id %d at (%d,%d,%d) dpr (%f,%d,%d)\n", pType, psObj->id, psObj->x, psObj->y, psObj->z, psObj->direction, psObj->pitch, psObj->roll) );
|
||||
CONPRINTF( ConsoleString, (ConsoleString, "%s id %d at (%d,%d,%d) dpr (%f,%d,%d)\n", pType, psObj->id, psObj->x, psObj->y, psObj->z, psObj->direction, psObj->pitch, psObj->roll) );
|
||||
}
|
||||
|
||||
// print out information about a general component
|
||||
|
@ -62,7 +58,7 @@ void printComponentInfo(COMP_BASE_STATS *psStats)
|
|||
{
|
||||
psStats = psStats;
|
||||
|
||||
OPRINTF(ConsoleString,(ConsoleString,"%s ref %d tl %d\n"
|
||||
CONPRINTF(ConsoleString,(ConsoleString,"%s ref %d tl %d\n"
|
||||
" bPwr %d bPnts %d wt %d hp %d sp %d bdy %d imd %p\n",
|
||||
getStatName(psStats), psStats->ref, psStats->techLevel,
|
||||
psStats->buildPower, psStats->buildPoints, psStats->weight,
|
||||
|
@ -183,9 +179,9 @@ void printWeaponInfo(WEAPON_STATS *psStats)
|
|||
}
|
||||
|
||||
|
||||
OPRINTF(ConsoleString,(ConsoleString,"Weapon: "));
|
||||
CONPRINTF(ConsoleString,(ConsoleString,"Weapon: "));
|
||||
printComponentInfo((COMP_BASE_STATS *)psStats);
|
||||
OPRINTF(ConsoleString,(ConsoleString," sRng %d lRng %d mRng %d %s\n"
|
||||
CONPRINTF(ConsoleString,(ConsoleString," sRng %d lRng %d mRng %d %s\n"
|
||||
" sHt %d lHt %d pause %d dam %d\n",
|
||||
psStats->shortRange, proj_GetLongRange(psStats,0), psStats->minRange,
|
||||
proj_Direct(psStats) ? "direct" : "indirect",
|
||||
|
@ -193,19 +189,19 @@ void printWeaponInfo(WEAPON_STATS *psStats)
|
|||
weaponShortHit(psStats,(UBYTE)selectedPlayer), weaponLongHit(psStats,
|
||||
(UBYTE)selectedPlayer), weaponFirePause(psStats,(UBYTE)selectedPlayer),
|
||||
weaponDamage(psStats, (UBYTE)selectedPlayer)));
|
||||
OPRINTF(ConsoleString,(ConsoleString," rad %d radHt %d radDam %d\n"
|
||||
CONPRINTF(ConsoleString,(ConsoleString," rad %d radHt %d radDam %d\n"
|
||||
" inTime %d inDam %d inRad %d\n",
|
||||
psStats->radius, psStats->radiusHit, psStats->radiusDamage,
|
||||
psStats->incenTime, psStats->incenDamage, psStats->incenRadius));
|
||||
OPRINTF(ConsoleString,(ConsoleString," flSpd %d inHt %d %s\n",
|
||||
CONPRINTF(ConsoleString,(ConsoleString," flSpd %d inHt %d %s\n",
|
||||
psStats->flightSpeed, psStats->indirectHeight,
|
||||
psStats->fireOnMove ? "fireOnMove" : "not fireOnMove"));
|
||||
OPRINTF(ConsoleString,(ConsoleString," %s %s %s\n", pWC, pWSC, pMM));
|
||||
/*OPRINTF(ConsoleString,(ConsoleString," %shoming %srotate recoil %d\n"
|
||||
CONPRINTF(ConsoleString,(ConsoleString," %s %s %s\n", pWC, pWSC, pMM));
|
||||
/*CONPRINTF(ConsoleString,(ConsoleString," %shoming %srotate recoil %d\n"
|
||||
" dLife %d radLife %d\n",
|
||||
psStats->homingRound ? "" : "not ", psStats->rotate ? "" : "not ",
|
||||
psStats->recoilValue, psStats->directLife, psStats->radiusLife));*/
|
||||
OPRINTF(ConsoleString,(ConsoleString," %srotate recoil %d\n"
|
||||
CONPRINTF(ConsoleString,(ConsoleString," %srotate recoil %d\n"
|
||||
" dLife %d radLife %d\n",
|
||||
psStats->rotate ? "" : "not ",
|
||||
psStats->recoilValue, psStats->directLife, psStats->radiusLife));
|
||||
|
@ -225,7 +221,7 @@ void printDroidInfo(DROID *psDroid)
|
|||
|
||||
printBaseObjInfo((BASE_OBJECT *)psDroid);
|
||||
|
||||
OPRINTF(ConsoleString,(ConsoleString," wt %d bSpeed %d sRng %d sPwr %d ECM %d bdy %d\n",
|
||||
CONPRINTF(ConsoleString,(ConsoleString," wt %d bSpeed %d sRng %d sPwr %d ECM %d bdy %d\n",
|
||||
psDroid->weight, psDroid->baseSpeed, psDroid->sensorRange,
|
||||
psDroid->sensorPower,psDroid->ECMMod, psDroid->body));
|
||||
|
||||
|
@ -247,13 +243,13 @@ void printDroidInfo(DROID *psDroid)
|
|||
case COMP_BODY:
|
||||
if (psDroid->asBits[i].nStat > 0)
|
||||
{
|
||||
OPRINTF(ConsoleString,(ConsoleString,"Body: "));
|
||||
CONPRINTF(ConsoleString,(ConsoleString,"Body: "));
|
||||
psBdyStats = asBodyStats + psDroid->asBits[i].nStat;
|
||||
printComponentInfo((COMP_BASE_STATS *)psBdyStats);
|
||||
}
|
||||
else
|
||||
{
|
||||
OPRINTF(ConsoleString,(ConsoleString,"ZNULL BODY\n"));
|
||||
CONPRINTF(ConsoleString,(ConsoleString,"ZNULL BODY\n"));
|
||||
}
|
||||
break;
|
||||
case COMP_BRAIN:
|
||||
|
@ -261,38 +257,38 @@ void printDroidInfo(DROID *psDroid)
|
|||
case COMP_PROPULSION:
|
||||
if (psDroid->asBits[i].nStat > 0)
|
||||
{
|
||||
OPRINTF(ConsoleString,(ConsoleString,"Prop: "));
|
||||
CONPRINTF(ConsoleString,(ConsoleString,"Prop: "));
|
||||
psPropStats = asPropulsionStats + psDroid->asBits[i].nStat;
|
||||
printComponentInfo((COMP_BASE_STATS *)psPropStats);
|
||||
}
|
||||
else
|
||||
{
|
||||
OPRINTF(ConsoleString,(ConsoleString,"ZNULL PROPULSION\n"));
|
||||
CONPRINTF(ConsoleString,(ConsoleString,"ZNULL PROPULSION\n"));
|
||||
}
|
||||
break;
|
||||
case COMP_ECM:
|
||||
if (psDroid->asBits[i].nStat > 0)
|
||||
{
|
||||
OPRINTF(ConsoleString,(ConsoleString,"ECM: "));
|
||||
CONPRINTF(ConsoleString,(ConsoleString,"ECM: "));
|
||||
psECMStats = asECMStats + psDroid->asBits[i].nStat;
|
||||
printComponentInfo((COMP_BASE_STATS *)psECMStats);
|
||||
OPRINTF(ConsoleString,(ConsoleString," pwr %d loc %d imd %p\n",
|
||||
CONPRINTF(ConsoleString,(ConsoleString," pwr %d loc %d imd %p\n",
|
||||
//psECMStats->power, psECMStats->location, psECMStats->pMountGraphic));
|
||||
ecmPower(psECMStats, psDroid->player), psECMStats->location,
|
||||
psECMStats->pMountGraphic));
|
||||
}
|
||||
else
|
||||
{
|
||||
OPRINTF(ConsoleString,(ConsoleString,"ZNULL ECM\n"));
|
||||
CONPRINTF(ConsoleString,(ConsoleString,"ZNULL ECM\n"));
|
||||
}
|
||||
break;
|
||||
case COMP_SENSOR:
|
||||
if (psDroid->asBits[i].nStat > 0)
|
||||
{
|
||||
OPRINTF(ConsoleString,(ConsoleString,"Sensor: "));
|
||||
CONPRINTF(ConsoleString,(ConsoleString,"Sensor: "));
|
||||
psSensStats = asSensorStats + psDroid->asBits[i].nStat;
|
||||
printComponentInfo((COMP_BASE_STATS *)psSensStats);
|
||||
OPRINTF(ConsoleString,(ConsoleString," rng %d pwr %d loc %d imd %p\n",
|
||||
CONPRINTF(ConsoleString,(ConsoleString," rng %d pwr %d loc %d imd %p\n",
|
||||
//psSensStats->range, psSensStats->power,
|
||||
sensorRange(psSensStats,psDroid->player),
|
||||
sensorPower(psSensStats,psDroid->player),
|
||||
|
@ -300,16 +296,16 @@ void printDroidInfo(DROID *psDroid)
|
|||
}
|
||||
else
|
||||
{
|
||||
OPRINTF(ConsoleString,(ConsoleString,"ZNULL SENSOR\n"));
|
||||
CONPRINTF(ConsoleString,(ConsoleString,"ZNULL SENSOR\n"));
|
||||
}
|
||||
break;
|
||||
case COMP_CONSTRUCT:
|
||||
if (psDroid->asBits[i].nStat > 0)
|
||||
{
|
||||
OPRINTF(ConsoleString,(ConsoleString,"Construct: "));
|
||||
CONPRINTF(ConsoleString,(ConsoleString,"Construct: "));
|
||||
psConstStats = asConstructStats + psDroid->asBits[i].nStat;
|
||||
printComponentInfo((COMP_BASE_STATS *)psConstStats);
|
||||
OPRINTF(ConsoleString,(ConsoleString," cPnts %d imd %p\n",
|
||||
CONPRINTF(ConsoleString,(ConsoleString," cPnts %d imd %p\n",
|
||||
//psConstStats->constructPoints, psConstStats->pMountGraphic));
|
||||
constructorPoints(psConstStats, psDroid->player),
|
||||
psConstStats->pMountGraphic));
|
||||
|
@ -318,10 +314,10 @@ void printDroidInfo(DROID *psDroid)
|
|||
case COMP_REPAIRUNIT:
|
||||
if (psDroid->asBits[i].nStat > 0)
|
||||
{
|
||||
OPRINTF(ConsoleString,(ConsoleString,"Repair: "));
|
||||
CONPRINTF(ConsoleString,(ConsoleString,"Repair: "));
|
||||
psRepairStats = asRepairStats + psDroid->asBits[i].nStat;
|
||||
printComponentInfo((COMP_BASE_STATS *)psRepairStats);
|
||||
OPRINTF(ConsoleString,(ConsoleString," repPnts %d loc %d imd %p\n",
|
||||
CONPRINTF(ConsoleString,(ConsoleString," repPnts %d loc %d imd %p\n",
|
||||
//psRepairStats->repairPoints, psRepairStats->location,
|
||||
repairPoints(psRepairStats, psDroid->player),
|
||||
psRepairStats->location,
|
||||
|
@ -333,8 +329,3 @@ void printDroidInfo(DROID *psDroid)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -273,7 +273,7 @@ static void putRectIntoPage(UDWORD width, UDWORD height, unsigned char *dest, UD
|
|||
{
|
||||
unsigned int i, j;
|
||||
|
||||
for(i = 0; i<height; i++)
|
||||
for(i = 0; i < height; i++)
|
||||
{
|
||||
for(j = 0; j < width * PAGE_DEPTH; j++)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue