Removed some unused bits.
This commit is contained in:
parent
78cdb29e7a
commit
fc5b084897
6 changed files with 12 additions and 646 deletions
|
@ -1,5 +1,5 @@
|
|||
#ifndef EQUATES_INCLUDED
|
||||
|
||||
#define EQUATES_INCLUDED
|
||||
|
||||
/*
|
||||
|
||||
|
@ -11,22 +11,11 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define default_global_h1 5000000
|
||||
#define default_global_h2 (5000000 + (ONE_FIXED << 5))
|
||||
#define default_global_hs 5
|
||||
|
||||
|
||||
#define default_zratio_threshold 320 /* 1.25 */
|
||||
|
||||
#define MaxObjectLights 50 /* Sources attached to the object */
|
||||
|
||||
#define maxlightblocks 100 /* This ought to be MORE than enough */
|
||||
|
||||
#if PSX
|
||||
#define MaxLightsPerObject 10 /* Sources lighting the object */
|
||||
#else
|
||||
#define MaxLightsPerObject 100 /* Sources lighting the object */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
@ -35,6 +24,7 @@ extern "C" {
|
|||
|
||||
*/
|
||||
|
||||
#if 0 /* only used by krender.c */
|
||||
#define lin_s_max 5
|
||||
|
||||
#if 0
|
||||
|
@ -54,58 +44,28 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* AH Table */
|
||||
|
||||
|
||||
|
||||
|
||||
#define RScale 2
|
||||
#define VScale (6 + 3)
|
||||
|
||||
#define Wibble Yes
|
||||
|
||||
#define GlobalScale 1
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Scenes and View Types
|
||||
*/
|
||||
|
||||
|
||||
/* not really used */
|
||||
typedef enum {
|
||||
|
||||
AVP_Scene0, /* environments*/
|
||||
AVP_Scene1,
|
||||
AVP_Scene2,
|
||||
AVP_Scene3,
|
||||
AVP_Scene4,
|
||||
AVP_Scene5,
|
||||
AVP_Scene6,
|
||||
AVP_Scene7,
|
||||
AVP_Scene8,
|
||||
AVP_Scene9,
|
||||
AVP_Scene10
|
||||
|
||||
AVP_Scene0
|
||||
} SCENE;
|
||||
|
||||
|
||||
typedef enum {
|
||||
|
||||
AVP_ViewType0, /* worlds within env*/
|
||||
|
||||
} VIEWTYPE;
|
||||
|
||||
/*
|
||||
|
||||
View Handler Function Array Indices
|
||||
|
||||
*/
|
||||
|
||||
/* VIEWSTATES isn't really used either */
|
||||
typedef enum {
|
||||
|
||||
VState_Inside,
|
||||
|
@ -121,13 +81,6 @@ typedef enum {
|
|||
|
||||
} VIEWSTATES;
|
||||
|
||||
#define CameraTrackingNormal 0x00000000
|
||||
#define CameraTrackingSlew 0x00000001
|
||||
#define CameraTrackingFollow 0x00000002
|
||||
#define CameraTrackingTrakBak 0x00000004
|
||||
|
||||
#define PanChange 128
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
@ -135,6 +88,7 @@ typedef enum {
|
|||
|
||||
*/
|
||||
|
||||
/* ITYPES isn't really used either */
|
||||
typedef enum {
|
||||
|
||||
IType_Default,
|
||||
|
@ -147,35 +101,6 @@ typedef enum {
|
|||
} ITYPES;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Shape enum for mainshapelist[]
|
||||
|
||||
We don't need this except for compiled in
|
||||
shapes. For pc riff loading the comipled in
|
||||
shape enum is in cnkhmaps.c in avp\win95
|
||||
|
||||
*/
|
||||
|
||||
#if PSX
|
||||
#if BinaryLoading
|
||||
#else
|
||||
typedef enum {
|
||||
|
||||
Shape_bob,
|
||||
Shape_Default,
|
||||
Shape_Alien,
|
||||
Shape_weapon,
|
||||
Shape_terminal,
|
||||
Shape_mmseg1,
|
||||
Shape_Cube,
|
||||
|
||||
} AVP_SHAPES;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Map Types */
|
||||
|
||||
typedef enum {
|
||||
|
@ -208,21 +133,10 @@ typedef enum {
|
|||
|
||||
} AVP_STRATEGIES;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define MaxSint5SortArraySize 50 /* was 100, must be at least ml_shm_maxheights */
|
||||
|
||||
|
||||
|
||||
/***********end for C++************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#define EQUATES_INCLUDED
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#ifndef SYSTEM_INCLUDED
|
||||
#define SYSTEM_INCLUDED
|
||||
|
||||
/* AVP - WIN95
|
||||
|
||||
|
@ -31,9 +32,9 @@ extern "C" {
|
|||
#define SuppressWarnings Yes
|
||||
|
||||
#define SupportWindows95 Yes
|
||||
#define Saturn No
|
||||
#define PSX No
|
||||
#define platform_pc Yes
|
||||
#define Saturn No
|
||||
#define PSX No
|
||||
#define platform_pc Yes
|
||||
#define InterfaceEngine No
|
||||
|
||||
#define Term -1
|
||||
|
@ -43,7 +44,7 @@ extern "C" {
|
|||
/******************** General *****************************/
|
||||
|
||||
#define SupportFPMathsFunctions Yes
|
||||
#define SupportFPSquareRoot Yes
|
||||
#define SupportFPSquareRoot Yes
|
||||
|
||||
#define GlobalScale 1
|
||||
|
||||
|
@ -128,8 +129,6 @@ typedef struct oc_entry {
|
|||
#define Texture2dClamping No
|
||||
#define Texture3dSubdivide No
|
||||
|
||||
#define SaturnHazing No
|
||||
|
||||
/***************** Angles and VALUES ******************/
|
||||
|
||||
#define deg10 114
|
||||
|
@ -205,18 +204,11 @@ extern int maxshapes;
|
|||
|
||||
#define pc_backdrops No
|
||||
|
||||
#define flic_player Yes
|
||||
|
||||
#define SaturnCDQueueSystem No
|
||||
|
||||
#define DynamicAdaptationToFrameRate No
|
||||
|
||||
|
||||
/***************** DRAW SORT *******************/
|
||||
|
||||
|
||||
|
||||
|
||||
#define SupportTrackOptimisation No
|
||||
|
||||
|
||||
|
@ -226,9 +218,6 @@ extern int maxshapes;
|
|||
#define ZBufferTest No
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/***************** SHAPE DATA DEFINES************/
|
||||
|
||||
#define StandardShapeLanguage Yes
|
||||
|
@ -249,7 +238,6 @@ extern int maxshapes;
|
|||
#define pscale 1
|
||||
|
||||
|
||||
|
||||
/***************** COLLISION DEFINES*************/
|
||||
#define StandardStrategyAndCollisions No
|
||||
#define IntermediateSSACM No /* User preference */
|
||||
|
@ -320,9 +308,6 @@ extern int maxshapes;
|
|||
#define SupportGouraud3dTextures Yes
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*************************** WINDOWS 95 *********************/
|
||||
|
||||
#define SUPPORT_MMX 0
|
||||
|
@ -334,20 +319,11 @@ extern int maxshapes;
|
|||
#define optimiseblit Yes /* unstable at present */
|
||||
|
||||
|
||||
|
||||
/******************** PLAYSTATION ********************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#define SYSTEM_INCLUDED
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -34,24 +34,8 @@
|
|||
/* Grrr!! That's the last time these will be missing! */
|
||||
/* Oh, CDF 18/12/97 */
|
||||
|
||||
#if platform_pc
|
||||
extern int sine[];
|
||||
extern int cosine[];
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
A general system file header structure, storing the TYPE of the file as a
|
||||
four character string, and the SIZE of the file as an unsigned 32-bit value.
|
||||
|
||||
*/
|
||||
|
||||
typedef struct fileheaderch {
|
||||
|
||||
char fh_type[4];
|
||||
unsigned int fh_size;
|
||||
|
||||
} FILEHEADERCH;
|
||||
|
||||
|
||||
typedef struct vectorch {
|
||||
|
@ -117,9 +101,6 @@ typedef struct line {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct euler {
|
||||
|
||||
int EulerX;
|
||||
|
@ -724,15 +705,6 @@ typedef struct viewdescriptorblock {
|
|||
#define ViewDB_Flag_drawtx3das2d 0x00080000
|
||||
|
||||
|
||||
/*
|
||||
Neal - for starfields (currently only available
|
||||
on Windows 95, all modes)
|
||||
*/
|
||||
|
||||
|
||||
#define ViewDB_Flag_Starfield 0x00100000
|
||||
|
||||
|
||||
/* test the flags with "& VDB_Trunc" to see if any truncation occurred */
|
||||
|
||||
#define VDB_Trunc (ViewDB_Flag_LTrunc | ViewDB_Flag_RTrunc | ViewDB_Flag_UTrunc | ViewDB_Flag_DTrunc)
|
||||
|
@ -1130,50 +1102,6 @@ typedef struct p3d {
|
|||
|
||||
} P3D;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Standard Points - Z-Buffered
|
||||
|
||||
*/
|
||||
|
||||
#if ZBufferTest
|
||||
|
||||
typedef struct p2d_zb {
|
||||
|
||||
VECTOR2D point2d;
|
||||
int z2d;
|
||||
|
||||
} P2D_ZB;
|
||||
|
||||
typedef struct p3d_zb {
|
||||
|
||||
VECTORCH point3d;
|
||||
int z3d;
|
||||
|
||||
} P3D_ZB;
|
||||
|
||||
#endif
|
||||
|
||||
#if SupportZBuffering
|
||||
|
||||
typedef struct p2d_zb {
|
||||
|
||||
VECTOR2D point2d;
|
||||
float z2d;
|
||||
|
||||
} P2D_ZB;
|
||||
|
||||
typedef struct p3d_zb {
|
||||
|
||||
VECTORCH point3d;
|
||||
float z3d;
|
||||
|
||||
} P3D_ZB;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Gouraud Points
|
||||
|
@ -1194,55 +1122,6 @@ typedef struct p3d_gouraud {
|
|||
|
||||
} P3D_GOURAUD;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Gouraud Points - Z-Buffered
|
||||
|
||||
*/
|
||||
|
||||
#if ZBufferTest
|
||||
|
||||
typedef struct p2d_gouraud_zb {
|
||||
|
||||
VECTOR2D point2d;
|
||||
int i2d;
|
||||
int zg2d;
|
||||
|
||||
} P2D_GOURAUD_ZB;
|
||||
|
||||
typedef struct p3d_gouraud_zb {
|
||||
|
||||
VECTORCH point3d;
|
||||
int i3d;
|
||||
int zg3d;
|
||||
|
||||
} P3D_GOURAUD_ZB;
|
||||
|
||||
#endif
|
||||
|
||||
#if SupportZBuffering
|
||||
|
||||
typedef struct p2d_gouraud_zb {
|
||||
|
||||
VECTOR2D point2d;
|
||||
int i2d;
|
||||
float zg2d;
|
||||
|
||||
} P2D_GOURAUD_ZB;
|
||||
|
||||
typedef struct p3d_gouraud_zb {
|
||||
|
||||
VECTORCH point3d;
|
||||
int i3d;
|
||||
float zg3d;
|
||||
|
||||
} P3D_GOURAUD_ZB;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Phong Points
|
||||
|
@ -1371,39 +1250,6 @@ typedef struct p3d_texture3d {
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Texture 3d Points - Z-Buffered
|
||||
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#if (support3dtextures && SupportZBuffering)
|
||||
|
||||
typedef struct p2d_texture3d_zb {
|
||||
|
||||
VECTOR2D point2d;
|
||||
float u2d_tx3d;
|
||||
float v2d_tx3d;
|
||||
float z2d_tx3d;
|
||||
|
||||
} P2D_TEXTURE3D_ZB;
|
||||
|
||||
|
||||
typedef struct p3d_texture3d_zb {
|
||||
|
||||
VECTORCH point3d;
|
||||
float u3d_tx3d;
|
||||
float v3d_tx3d;
|
||||
float z3d_tx3d;
|
||||
|
||||
} P3D_TEXTURE3D_ZB;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Gouraud Texture 2d Points
|
||||
|
@ -2203,36 +2049,6 @@ void UpdateGame(void);
|
|||
SHAPEHEADER* GetShapeData(int shapenum);
|
||||
|
||||
|
||||
#if flic_player
|
||||
|
||||
/*
|
||||
|
||||
FLIC File Player and Options
|
||||
|
||||
*/
|
||||
|
||||
int PlayFLICFile(char *fname, int fflags, int floops, unsigned char *pal);
|
||||
|
||||
#define FFlag_DiskPlay 0x00000001 /* Force a disk play */
|
||||
|
||||
#define FFlag_FadeDownFirst 0x00000002 /* First FLIC only */
|
||||
|
||||
#define FFlag_RestoreScreen 0x00000004 /* Last FLIC only -
|
||||
Copy the current contents
|
||||
of the screen buffer back to
|
||||
the video memory and fade up
|
||||
the old palette */
|
||||
|
||||
#define FFlag_EnableFade 0x00000008 /* NOT fading is the default */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void InitialiseObjectBlocks(void);
|
||||
|
||||
DISPLAYBLOCK* AllocateObjectBlock(void);
|
||||
|
@ -2754,13 +2570,9 @@ int LoadBackdrop(char *image, IMAGEHEADER *ihdr);
|
|||
void GetProjectFilename(char *fname, char *image);
|
||||
|
||||
|
||||
int CompareStringCH(char *string1, char *string2);
|
||||
|
||||
void GetDOSFilename(char *fnameptr);
|
||||
int CompareFilenameCH(char *string1, char *string2);
|
||||
|
||||
void CopyMemoryCH(void *source, void *dest, int c);
|
||||
|
||||
TEXTURE* LoadImageCH(char *fname, IMAGEHEADER *iheader);
|
||||
TEXTURE* LoadBMP(char *fname, IMAGEHEADER *iheader);
|
||||
TEXTURE* LoadPGM(char *fname, IMAGEHEADER *iheader);
|
||||
|
@ -2771,20 +2583,9 @@ void MakeTextureLightingTableRaw256(unsigned char *palette);
|
|||
void Create_MIP_Map(IMAGEHEADER *iheader);
|
||||
|
||||
|
||||
int** ShadingTables(SHAPEHEADER **sh_list);
|
||||
PALCREATIONDATA* CreatePaletteCH(SHAPEHEADER **sh_list, int pstart, int pent, unsigned char *pal);
|
||||
PALCREATIONDATA* CreateRaw256PaletteCH(SHAPEHEADER **sh_list, unsigned char *pal);
|
||||
void RemapShapesForCreatePaletteCH(SHAPEHEADER **sh_list);
|
||||
|
||||
void ClearShadingTables(void);
|
||||
void ClearPaletteShadingTables(void);
|
||||
|
||||
int NextLowPower2(int i);
|
||||
|
||||
|
||||
void PlotPixelTest(int x, int y, unsigned char col);
|
||||
|
||||
|
||||
/* User Input */
|
||||
|
||||
void ReadUserInput(void);
|
||||
|
@ -2894,15 +2695,6 @@ void DrawPalette(int x0, int y0, int x1, int y1);
|
|||
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
|
||||
DrawPerFrame,
|
||||
DrawPerVDB,
|
||||
DrawPerObject
|
||||
|
||||
} DRAWMODES;
|
||||
|
||||
|
||||
typedef enum {
|
||||
|
||||
Boundary_Left,
|
||||
|
|
|
@ -34,38 +34,6 @@
|
|||
#define col24(r, g, b) ((r << 16) + (g << 8) + b)
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Maximum number shading tables.
|
||||
|
||||
This equate might have to be moved to "system.h"
|
||||
|
||||
*/
|
||||
|
||||
#define MaxShadingTables 4096
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Palette Creation Function Structure
|
||||
|
||||
*/
|
||||
|
||||
typedef struct palcreationdata {
|
||||
|
||||
unsigned char** PCD_ArrayPtr;
|
||||
int PCD_NumHues;
|
||||
int PCD_ShadesPerHue;
|
||||
int PCD_NumColsUsed;
|
||||
|
||||
} PALCREATIONDATA;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Shape Item Function Array Indices
|
||||
|
|
103
src/win95/io.c
103
src/win95/io.c
|
@ -15,17 +15,6 @@
|
|||
|
||||
#undef textprint
|
||||
|
||||
|
||||
#if SupportTLTFiles
|
||||
#define Output_TLT_File No
|
||||
#endif
|
||||
|
||||
#define Output_VEA_File No
|
||||
|
||||
#define Proper_8Bit_MIP No
|
||||
|
||||
#define DontLet222ColoursGoToBlack Yes
|
||||
|
||||
#define textprintOn Yes
|
||||
|
||||
#define DHMtextprint Yes
|
||||
|
@ -70,7 +59,6 @@
|
|||
|
||||
*/
|
||||
|
||||
extern SCENE Global_Scene;
|
||||
extern SHAPEHEADER **mainshapelist;
|
||||
extern SHAPEHEADER *testpaletteshapelist[];
|
||||
extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock;
|
||||
|
@ -110,15 +98,10 @@ extern IMAGEHEADER ImageHeaderArray[]; /* Array of Image Headers */
|
|||
|
||||
*/
|
||||
|
||||
int DrawMode = DrawPerVDB;
|
||||
/* Win95 default ought to be per frame */
|
||||
|
||||
/* Timer */
|
||||
long lastTickCount;
|
||||
|
||||
unsigned char *ScreenBuffer = 0; /* Ensure initialised to Null */
|
||||
unsigned char *ScreenBuffer2 = 0;
|
||||
|
||||
|
||||
unsigned char LPTestPalette[1024]; /* to cast to lp*/
|
||||
|
||||
|
@ -141,10 +124,8 @@ extern IMAGEHEADER ImageHeaderArray[]; /* Array of Image Headers */
|
|||
|
||||
unsigned char *PaletteRemapTable = 0;
|
||||
|
||||
int **ShadingTableArray = 0;
|
||||
int NumShadingTables = 0;
|
||||
|
||||
unsigned char **PaletteShadingTableArray = 0;
|
||||
int NumPaletteShadingTables = 0;
|
||||
|
||||
int FrameRate;
|
||||
|
@ -294,63 +275,6 @@ void GetDOSFilename(char *fnameptr)
|
|||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Compare two strings.
|
||||
|
||||
Return Yes if they're the same, else No.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
IMPORTANT!!!
|
||||
This function is not ideal!!! It is used
|
||||
here because this is only an initialisation
|
||||
stage, but if you want to compare strings
|
||||
elsewhere you should either use the C library
|
||||
function or (if there's a problem with that)
|
||||
write your own.
|
||||
*/
|
||||
|
||||
int CompareStringCH(char *string1, char *string2)
|
||||
|
||||
{
|
||||
|
||||
char *srtmp;
|
||||
char *srtmp2;
|
||||
int slen1 = 0;
|
||||
int slen2 = 0;
|
||||
int i;
|
||||
|
||||
|
||||
srtmp = string1;
|
||||
|
||||
while(*srtmp++ != 0)
|
||||
slen1++;
|
||||
|
||||
srtmp = string2;
|
||||
|
||||
while(*srtmp++ != 0)
|
||||
slen2++;
|
||||
|
||||
if(slen1 != slen2) return No;
|
||||
|
||||
else {
|
||||
|
||||
srtmp = string1;
|
||||
srtmp2 = string2;
|
||||
|
||||
for(i=slen1; i!=0; i--)
|
||||
if(*srtmp++ != *srtmp2++) return No;
|
||||
|
||||
return Yes;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Compare two filenames.
|
||||
|
@ -839,19 +763,6 @@ void (*UpdateScreen[]) (void) = {
|
|||
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Not supported in Windows 95 !!!
|
||||
*/
|
||||
|
||||
|
||||
void PlotPixelTest(int x, int y, unsigned char col)
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Wait for Return Key
|
||||
|
@ -963,11 +874,6 @@ void GetProjectFilename(char *fname, char *image)
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Attempts to load the image file.
|
||||
|
@ -989,13 +895,6 @@ TEXTURE* LoadImageCH(char *fname, IMAGEHEADER *iheader)
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ConvertToDDPalette(unsigned char* src, unsigned char* dst, int length, int flags)
|
||||
{
|
||||
int i;
|
||||
|
@ -1943,5 +1842,3 @@ void ConvertDDToInternalPalette(unsigned char* src, unsigned char* dst, int leng
|
|||
*dst++ = (*src++) >> 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -149,184 +149,6 @@ void InitialiseImageHeaders(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
int LoadImageCHsForShapes(SHAPEHEADER **shapelist)
|
||||
|
||||
{
|
||||
|
||||
SHAPEHEADER **shlistptr;
|
||||
SHAPEHEADER *shptr;
|
||||
char **txfiles;
|
||||
int TxIndex;
|
||||
int LTxIndex;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Build the Texture List
|
||||
|
||||
*/
|
||||
|
||||
shlistptr = shapelist;
|
||||
|
||||
while(*shlistptr) {
|
||||
|
||||
shptr = *shlistptr++;
|
||||
|
||||
/* If the shape has textures */
|
||||
|
||||
if(shptr->sh_localtextures) {
|
||||
|
||||
txfiles = shptr->sh_localtextures;
|
||||
|
||||
LTxIndex = 0;
|
||||
|
||||
while(*txfiles) {
|
||||
|
||||
/* The RIFF Image loaders have changed to support not loading the same image twice - JH 17-2-96 */
|
||||
|
||||
char *src;
|
||||
char *dst;
|
||||
char fname[ImageNameSize];
|
||||
char *texfilesptr;
|
||||
#ifndef RIFF_SYSTEM
|
||||
int i, j, NewImage;
|
||||
char *iname;
|
||||
IMAGEHEADER *ihptr;
|
||||
IMAGEHEADER *new_ihptr;
|
||||
void* im;
|
||||
#endif
|
||||
|
||||
txfilesptr = *txfiles++;
|
||||
|
||||
/*
|
||||
|
||||
"txfilesptr" is in the form "textures\<fname>". We need to
|
||||
prefix that text with the name of the current textures path.
|
||||
|
||||
Soon this path may be varied but for now it is just the name of
|
||||
the current project subdirectory.
|
||||
|
||||
*/
|
||||
|
||||
src = projectsubdirectory;
|
||||
dst = fname;
|
||||
|
||||
while(*src)
|
||||
*dst++ = *src++;
|
||||
|
||||
src = txfilesptr;
|
||||
|
||||
while(*src)
|
||||
*dst++ = *src++;
|
||||
|
||||
*dst = 0;
|
||||
|
||||
#ifdef RIFF_SYSTEM
|
||||
|
||||
/* This function calls GetExistingImageHeader to figure out if the image is already loaded */
|
||||
TxIndex = CL_LoadImageOnce(fname,(ScanDrawDirectDraw == ScanDrawMode ? LIO_CHIMAGE : LIO_D3DTEXTURE)|LIO_TRANSPARENT|LIO_RELATIVEPATH|LIO_RESTORABLE);
|
||||
GLOBALASSERT(GEI_NOTLOADED != TxIndex);
|
||||
|
||||
#else
|
||||
|
||||
/* If there are already images, try and find this one */
|
||||
|
||||
NewImage = Yes;
|
||||
|
||||
#ifdef MaxImageGroups
|
||||
|
||||
TxIndex = CurrentImageGroup * MaxImages; /* Assume image 0 */
|
||||
|
||||
if(NumImagesArray[CurrentImageGroup]) {
|
||||
|
||||
for(i=NumImagesArray[CurrentImageGroup]; i!=0 && NewImage!=No; i--) {
|
||||
|
||||
#else
|
||||
|
||||
TxIndex = 0; /* Assume image 0 */
|
||||
|
||||
if(NumImages) {
|
||||
|
||||
for(i=NumImages; i!=0 && NewImage!=No; i--) {
|
||||
|
||||
#endif
|
||||
|
||||
ihptr = ImageHeaderPtrs[TxIndex];
|
||||
|
||||
iname = &ihptr->ImageName[0];
|
||||
|
||||
j = CompareFilenameCH(txfilesptr, iname);
|
||||
|
||||
if(j) NewImage = No;
|
||||
|
||||
else TxIndex++;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* If this is a new image, add it */
|
||||
|
||||
if(NewImage) {
|
||||
|
||||
/* Get an Image Header */
|
||||
|
||||
new_ihptr = GetImageHeader();
|
||||
|
||||
if(new_ihptr) {
|
||||
|
||||
if (ScanDrawMode == ScanDrawDirectDraw)
|
||||
im = (void*) LoadImageCH(&fname[0], new_ihptr);
|
||||
else
|
||||
im = LoadImageIntoD3DImmediateSurface
|
||||
(&fname[0], new_ihptr, DefinedTextureType);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
The local index for this image in this shape is
|
||||
"LTxIndex".
|
||||
|
||||
The global index for the image is "TxIndex".
|
||||
|
||||
We must go through the shape's items and change all the
|
||||
local references to global.
|
||||
|
||||
*/
|
||||
|
||||
MakeShapeTexturesGlobal(shptr, TxIndex, LTxIndex);
|
||||
|
||||
LTxIndex++; /* Next Local Texture */
|
||||
|
||||
}
|
||||
|
||||
/* Is this shape a sprite that requires resizing? */
|
||||
|
||||
if((shptr->shapeflags & ShapeFlag_Sprite) &&
|
||||
(shptr->shapeflags & ShapeFlag_SpriteResizing)) {
|
||||
|
||||
SpriteResizing(shptr);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return Yes;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
|
||||
|
@ -575,10 +397,7 @@ int InitialiseTextures(void)
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
return Yes;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue