Hi,
attached patch removes some unused parameters from function in ivis.
-extern iIMDShape *iV_IMDLoad(char *filename, iBool palkeep);
-extern iIMDShape *iV_ProcessIMD(char **ppFileData, char *FileDataEnd,
- char *IMDpath, char *PCXpath, iBool palkeep);
+extern iIMDShape *iV_IMDLoad(char *filename);
+extern iIMDShape *iV_ProcessIMD(char **ppFileData, char *FileDataEnd);
while removing these parameters some code in the callers is now also unused and
is removed: i.E. the iV_setImagePatch.
Please comment, if anyone plans to use this parms and they should stay...
Regards,
Stefan
Index: src/data.c
===================================================================
--- src/data.c (revision 510)
+++ src/data.c (working copy)
@@ -707,7 +707,7 @@
iIMDShape *psIMD;
char *pBufferPosition = pBuffer;
- psIMD = iV_ProcessIMD(&pBufferPosition, pBufferPosition + size, "", "",
FALSE);
+ psIMD = iV_ProcessIMD(&pBufferPosition, pBufferPosition + size);
if (psIMD == NULL) {
debug( LOG_ERROR, "IMD load failed - %s",
GetLastResourceFilename() );
abort();
Index: lib/ivis_common/imdload.c
===================================================================
--- lib/ivis_common/imdload.c (revision 510)
+++ lib/ivis_common/imdload.c (working copy)
@@ -32,7 +32,6 @@
static char _IMD_NAME[MAX_FILE_PATH];
static int32 _IMD_VER;
static VERTEXID vertexTable[iV_IMD_MAX_POINTS];
-static char imagePath[MAX_FILE_PATH] = {""};
// kludge
extern void pie_SurfaceNormal(iVector *p1, iVector *p2, iVector *p3, iVector
*v);
@@ -40,7 +39,6 @@
// local prototypes
static iIMDShape *_imd_load_level(char **FileData, char *FileDataEnd, int
nlevels,
int texpage);
-static char *_imd_get_path(char *filename, char *path);
BOOL CheckColourKey(iIMDShape *psShape);
@@ -87,13 +85,12 @@
BOOL TESTDEBUG = FALSE;
// load the polygon level ... then load the texture .... Gareths code
#define POST_LEVEL_TEXTURELOAD
-iIMDShape *iV_IMDLoad(char *filename, iBool palkeep)
+iIMDShape *iV_IMDLoad(char *filename)
{
iIMDShape *pIMD;
char *pFileData,*pFileDataStart;
UDWORD FileSize;
BOOL res;
- char path[MAX_FILE_PATH];
UDWORD *tp;
UDWORD tt;
@@ -104,18 +101,6 @@
strcpy(_IMD_NAME,filename);
strlwr(_IMD_NAME);
- _imd_get_path(filename,path);
-
- if (strlen(path) != 0) {
- if (strlen(imagePath) != 0) {
- if ((strlen(path) + strlen(imagePath)) > MAX_FILE_PATH)
{
- iV_Error(0xff,"(iv_IMDLoad) image path too long
for load file");
- return NULL;
- }
- strcat(imagePath,path);
- }
- }
-
res = loadFile(_IMD_NAME,&pFileData, &FileSize);
if (res == FALSE) {
iV_Error(0xff,"(iv_IMDLoad) unable to load file");
@@ -134,7 +119,7 @@
}
pFileDataStart = pFileData;
- pIMD = iV_ProcessIMD(&pFileData, pFileData + FileSize, path, imagePath,
palkeep);
+ pIMD = iV_ProcessIMD(&pFileData, pFileData + FileSize);
FREE(pFileDataStart); // free the file up
return (pIMD);
@@ -165,8 +150,7 @@
// ppFileData is incremented to the end of the file on exit!
-iIMDShape *iV_ProcessIMD(char **ppFileData, char *FileDataEnd, char *IMDpath,
- char *PCXpath,iBool palkeep)
+iIMDShape *iV_ProcessIMD(char **ppFileData, char *FileDataEnd)
{
char *pFileData = *ppFileData;
int cnt;
@@ -1168,40 +1152,6 @@
}
-BOOL iV_setImagePath(char *path)
-{
- int i;
- strcpy(imagePath,path);
- i = strlen(imagePath);
- if (imagePath[i] != '/')
- {
- imagePath[i] = '/';
- imagePath[i+1] = '\0';
- }
- return TRUE;
-}
-
-
-static char *_imd_get_path(char *filename, char *path)
-{
- int n, i;
-
- n = strlen(filename);
-
- for (i=n-1; i>=0 && (filename[i] != '/'); i--)
- ;
-
- if (i<0)
- path[0] = '\0';
- else {
- memcpy(path,filename,i+1);
- path[i+1] = '\0';
- }
-
- return path;
-}
-
-
/***************************************************************************/
BOOL CheckColourKey( iIMDShape *psShape ) {
Index: lib/ivis_common/imd.h
===================================================================
--- lib/ivis_common/imd.h (revision 510)
+++ lib/ivis_common/imd.h (working copy)
@@ -72,10 +72,8 @@
//*************************************************************************
-extern BOOL iV_setImagePath(char *path);
-extern iIMDShape *iV_IMDLoad(char *filename, iBool palkeep);
-extern iIMDShape *iV_ProcessIMD(char **ppFileData, char *FileDataEnd,
- char *IMDpath, char *PCXpath, iBool palkeep);
+extern iIMDShape *iV_IMDLoad(char *filename);
+extern iIMDShape *iV_ProcessIMD(char **ppFileData, char *FileDataEnd);
iIMDShape *iV_ProcessBPIE(iIMDShape *, UDWORD size);
extern iBool iV_IMDSave(char *filename, iIMDShape *s, BOOL PieIMD);
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev