Fixed: tile_edit_qt compilation

This commit is contained in:
kervala 2010-07-10 16:52:06 +02:00
parent 58e4c18238
commit 752dc387fe
7 changed files with 57 additions and 253 deletions

View file

@ -80,14 +80,15 @@ unsigned long PIC_Load(char* FileName, unsigned char Quantize)
{
type=1;
}
if ( !strcmp(ext,"TGA") )
else if ( !strcmp(ext,"TGA") )
{
type=2;
}
if ( !strcmp(ext,"BMP") )
else if ( !strcmp(ext,"BMP") )
{
type=3;
}
switch(type)
{
// - JPG
@ -132,9 +133,7 @@ unsigned long PIC_Load(char* FileName, unsigned char Quantize)
return(0);
}
}
else
{
}
// --- Create and place new pic struct
pic=Pic_calloc(1,sizeof(PIC_PICTURE));
if (!pic)

View file

@ -333,8 +333,8 @@ bool TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitm
else
{
// Error: bitmap not in the absolute path..
QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No));
QString notInAbsolutePathMessage = QObject::tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No));
}
return true;
@ -351,7 +351,7 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm
uint Height;
if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height))
{
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
}
else
@ -369,8 +369,8 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm
error=tileBankBrowser.getTileSet(_tileSet)->checkTile256 (type, border, pixel, composante);
if ((error!=CTileSet::ok)&&!zouille())
{
QString pixelMessage = tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]);
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) );
QString pixelMessage = QObject::tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]);
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -394,8 +394,8 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm
else
{
// Error: bitmap not in the absolute path..
QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No));
QString notInAbsolutePathMessage = QObject::tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No));
}
return true;
@ -415,7 +415,7 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile
uint Height;
if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height))
{
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -431,8 +431,8 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile
error=tileBankBrowser.getTileSet(_tileSet)->checkTile128 (type, border, pixel, composante);
if ((error!=CTileSet::ok)&&(error!=CTileSet::addFirstA128128)&&!zouille ())
{
QString pixelMessage = tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]);
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) );
QString pixelMessage = QObject::tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]);
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -458,8 +458,8 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile
else
{
// Error: bitmap not in the absolute path..
QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) );
QString notInAbsolutePathMessage = QObject::tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) );
}
return true;
@ -477,7 +477,7 @@ bool TileList::setDisplacement (int tile, const std::string& name, NL3D::CTile::
uint Height;
if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height))
{
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap"), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't load bitmap"), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -485,7 +485,7 @@ bool TileList::setDisplacement (int tile, const std::string& name, NL3D::CTile::
if ( (Width!=32) || (Height!=32) )
{
// Error message
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't set Bitmap"), QString( (troncated+"\nInvalid size: displacement map must be 32x32 8 bits.\nContinue ?").c_str()), QMessageBox::Yes | QMessageBox::No) );
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't set Bitmap"), QString( (troncated+"\nInvalid size: displacement map must be 32x32 8 bits.\nContinue ?").c_str()), QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -502,8 +502,8 @@ bool TileList::setDisplacement (int tile, const std::string& name, NL3D::CTile::
else
{
// Error: bitmap not in the absolute path..
QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) );
QString notInAbsolutePathMessage = QObject::tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) );
}
return true;
@ -520,7 +520,7 @@ bool TileList::setTileTransitionAlpha (int tile, const std::string& name, int ro
uint Height;
if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height))
{
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap"), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't load bitmap"), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
}
else
{

View file

@ -13,7 +13,7 @@ static unsigned long PIC_Sys_MEM_NbAllocs;
#define _msize malloc_usable_size
#endif /* __GNUC__ */
/* ---------------------------------------------------------------------------------------------------------------------------------- */
// ----------------------------------------------------------------------------------------------------------------------------------
void *Pic_malloc(unsigned long size)
{
@ -26,7 +26,7 @@ void *Pic_malloc(unsigned long size)
}
return(mem);
}
/* ----- */
// -----
void *Pic_calloc(unsigned long count, unsigned long size)
{
void *mem;
@ -38,7 +38,7 @@ void *Pic_calloc(unsigned long count, unsigned long size)
}
return(mem);
}
/* ----- */
// -----
void Pic_free(void *memblock)
{
unsigned long size;
@ -47,23 +47,23 @@ void Pic_free(void *memblock)
PIC_Sys_MEM_NbAllocs--;
free(memblock);
}
/* ----- */
// -----
unsigned long Pic__msize(void *memblock)
{
return(_msize(memblock));
}
/* ----- */
// -----
unsigned long PIC_GetMemNbAllocs(void)
{
return(PIC_Sys_MEM_NbAllocs);
}
/* ----- */
// -----
unsigned long PIC_GetMemAllocated(void)
{
return(PIC_Sys_MEM_Allocated);
}
/* ---------------------------------------------------------------------------------------------------------------------------------- */
// ----------------------------------------------------------------------------------------------------------------------------------
static unsigned char PIC_ErrorFlag;
static unsigned char PIC_ErrorString[PIC_ERRSIZE];
@ -95,23 +95,23 @@ void Pic_SetError(unsigned char *msg, ...)
if (PIC_Sys_FnctActive) PIC_Sys_Fnct();
return;
}
/* ----- */
// -----
char* PIC_GetError(void)
{
return(PIC_ErrorString);
}
/* ----- */
// -----
unsigned char PIC_Error(void)
{
return(PIC_ErrorFlag);
}
/* ----- */
// -----
void PIC_ResetError(void)
{
strcpy(PIC_ErrorString,"");
PIC_ErrorFlag=0;
}
/* ----- */
// -----
unsigned char PIC_OnErrorCall( void pFnct(void) )
{
if (pFnct != NULL)
@ -126,5 +126,5 @@ unsigned char PIC_OnErrorCall( void pFnct(void) )
return(1);
}
/* ---------------------------------------------------------------------------------------------------------------------------------- */
// ----------------------------------------------------------------------------------------------------------------------------------

View file

@ -595,7 +595,7 @@ unsigned long PIC_Save(unsigned long id, char* FileName, unsigned long type, uns
err=1;
}
break;
/* --- */
// ---
default:
Pic_SetError("Save %s, unknow save format/type",FileName);
err=1;
@ -608,7 +608,7 @@ unsigned long PIC_Save(unsigned long id, char* FileName, unsigned long type, uns
return(err-1);
}
/* ---------------------------------------------------------------------------------------------------------------------------------- */
// ----------------------------------------------------------------------------------------------------------------------------------
unsigned long PIC_Destroy(unsigned long id)
{
@ -651,5 +651,4 @@ unsigned long PIC_Destroy(unsigned long id)
return(1);
}
/* ---------------------------------------------------------------------------------------------------------------------------------- */
// ----------------------------------------------------------------------------------------------------------------------------------

View file

@ -5,7 +5,7 @@
#include "pic_private.h"
#include "pic.h"
/* ---------------------------------------------------------------------------------------------------------------------------------- */
// ----------------------------------------------------------------------------------------------------------------------------------
#pragma pack(1)
typedef struct TGA_HEADER
@ -25,7 +25,7 @@ typedef struct TGA_HEADER
} TGA_HEADER;
#pragma pack()
/* ---------------------------------------------------------------------------------------------------------------------------------- */
// ----------------------------------------------------------------------------------------------------------------------------------
unsigned long Pic_TGA_Read( unsigned char *FileName,
unsigned char **ppPal, unsigned char **ppDatas,
@ -138,7 +138,7 @@ unsigned long Pic_TGA_Read( unsigned char *FileName,
}
/* ---------------------------------------------------------------------------------------------------------------------------------- */
// ----------------------------------------------------------------------------------------------------------------------------------
unsigned long Pic_TGA_Write( unsigned char *FileName,
unsigned char *pPal,unsigned char *pDatas,

View file

@ -4,7 +4,7 @@
extern "C" {
#endif
/* ---------------------------------------------------------------------------------------------------------------------------------- */
// ----------------------------------------------------------------------------------------------------------------------------------
typedef struct PIC_PICTURE
{
@ -17,12 +17,12 @@ typedef struct PIC_PICTURE
struct PIC_PICTURE *Next;
} PIC_PICTURE;
/* ---------------------------------------------------------------------------------------------------------------------------------- */
// ----------------------------------------------------------------------------------------------------------------------------------
/*
* JPG
*/
//
// JPG
//
extern unsigned long Pic_JPG_Read( unsigned char *FileName,
@ -33,9 +33,9 @@ extern unsigned long Pic_JPG_Write( unsigned char *FileName,
unsigned long Qual,
unsigned char *pDatas,
unsigned long w, unsigned long h);
/*
* TGA
*/
//
// TGA
//
extern unsigned long Pic_TGA_Read( unsigned char *FileName,
unsigned char **ppPal, unsigned char **ppDatas,
unsigned long *pWidth, unsigned long *pHeight,
@ -43,9 +43,9 @@ extern unsigned long Pic_TGA_Read( unsigned char *FileName,
extern unsigned long Pic_TGA_Write( unsigned char *FileName,
unsigned char *pPal,unsigned char *pDatas,
unsigned long w, unsigned long h, unsigned long d);
/*
* BMP
*/
//
// BMP
//
extern unsigned long Pic_BMP_Read( unsigned char *FileName,
unsigned char **ppPal, unsigned char **ppDatas,
unsigned long *pWidth, unsigned long *pHeight,
@ -54,18 +54,18 @@ extern unsigned long Pic_BMP_Read( unsigned char *FileName,
extern unsigned long Pic_BMP_Write( unsigned char *FileName,
unsigned char *pPal,unsigned char *pDatas,
unsigned long w, unsigned long h, unsigned long d);
/*
* System
*/
//
// System
//
extern void* Pic_malloc(unsigned long size);
extern void* Pic_calloc(unsigned long count, unsigned long size);
extern void Pic_free(void *memblock);
extern unsigned long Pic__msize(void *memblock);
extern void Pic_SetError(unsigned char *msg, ...);
/* ---------------------------------------------------------------------------------------------------------------------------------- */
// ----------------------------------------------------------------------------------------------------------------------------------
#ifdef __cplusplus
}
#endif
#endif
#endif

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Version="9,00"
Name="tile_edit_qt"
ProjectGUID="{5FE8CA04-92FB-4B43-A78E-26E283F587A1}"
RootNamespace="tile_edit_qt"
@ -400,190 +400,6 @@
<Filter
Name="pic"
>
<File
RelativePath=".\pic\jcapimin.c"
>
</File>
<File
RelativePath=".\pic\jcapistd.c"
>
</File>
<File
RelativePath=".\pic\jccoefct.c"
>
</File>
<File
RelativePath=".\pic\jccolor.c"
>
</File>
<File
RelativePath=".\pic\jcdctmgr.c"
>
</File>
<File
RelativePath=".\pic\jchuff.c"
>
</File>
<File
RelativePath=".\pic\jcinit.c"
>
</File>
<File
RelativePath=".\pic\jcmainct.c"
>
</File>
<File
RelativePath=".\pic\jcmarker.c"
>
</File>
<File
RelativePath=".\pic\jcmaster.c"
>
</File>
<File
RelativePath=".\pic\jcomapi.c"
>
</File>
<File
RelativePath=".\pic\jcparam.c"
>
</File>
<File
RelativePath=".\pic\jcphuff.c"
>
</File>
<File
RelativePath=".\pic\jcprepct.c"
>
</File>
<File
RelativePath=".\pic\jcsample.c"
>
</File>
<File
RelativePath=".\pic\jctrans.c"
>
</File>
<File
RelativePath=".\pic\jdapimin.c"
>
</File>
<File
RelativePath=".\pic\jdapistd.c"
>
</File>
<File
RelativePath=".\pic\jdatadst.c"
>
</File>
<File
RelativePath=".\pic\jdatasrc.c"
>
</File>
<File
RelativePath=".\pic\jdcoefct.c"
>
</File>
<File
RelativePath=".\pic\jdcolor.c"
>
</File>
<File
RelativePath=".\pic\jddctmgr.c"
>
</File>
<File
RelativePath=".\pic\jdhuff.c"
>
</File>
<File
RelativePath=".\pic\jdinput.c"
>
</File>
<File
RelativePath=".\pic\jdmainct.c"
>
</File>
<File
RelativePath=".\pic\jdmarker.c"
>
</File>
<File
RelativePath=".\pic\jdmaster.c"
>
</File>
<File
RelativePath=".\pic\jdmerge.c"
>
</File>
<File
RelativePath=".\pic\jdphuff.c"
>
</File>
<File
RelativePath=".\pic\jdpostct.c"
>
</File>
<File
RelativePath=".\pic\jdsample.c"
>
</File>
<File
RelativePath=".\pic\jdtrans.c"
>
</File>
<File
RelativePath=".\pic\jerror.c"
>
</File>
<File
RelativePath=".\pic\jfdctflt.c"
>
</File>
<File
RelativePath=".\pic\jfdctfst.c"
>
</File>
<File
RelativePath=".\pic\jfdctint.c"
>
</File>
<File
RelativePath=".\pic\jidctflt.c"
>
</File>
<File
RelativePath=".\pic\jidctfst.c"
>
</File>
<File
RelativePath=".\pic\jidctint.c"
>
</File>
<File
RelativePath=".\pic\jidctred.c"
>
</File>
<File
RelativePath=".\pic\jmemansi.c"
>
</File>
<File
RelativePath=".\pic\jmemmgr.c"
>
</File>
<File
RelativePath=".\pic\jquant1.c"
>
</File>
<File
RelativePath=".\pic\jquant2.c"
>
</File>
<File
RelativePath=".\pic\jutils.c"
>
</File>
<File
RelativePath=".\pic\Pic_BMP.c"
>
@ -1174,7 +990,7 @@
Description="RCC $(InputName).qrc"
CommandLine="rcc.exe -name $(InputName) $(InputName).qrc -o $(InputDir)\qrc_$(InputName).cpp&#x0D;&#x0A;"
AdditionalDependencies="rcc.exe;nel.png;$(InputName).qrc"
Outputs="Release\qrc_$(InputName).cpp"
Outputs="Debug\qrc_$(InputName).cpp"
/>
</FileConfiguration>
<FileConfiguration
@ -1188,16 +1004,6 @@
Outputs="Release\qrc_$(InputName).cpp"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
CommandLine="rcc.exe -name $(InputName) $(InputName).qrc -o $(InputDir)\qrc_$(InputName).cpp"
AdditionalDependencies="rcc.exe;nel.png;$(InputName).qrc"
Outputs="Debug\qrc_$(InputName).cpp"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\tile_edit_qt.ui"