diff --git a/code/nel/tools/3d/tile_edit/PIC/Pic_Manage.c b/code/nel/tools/3d/tile_edit/PIC/Pic_Manage.c index da4de18ff..e22005d79 100644 --- a/code/nel/tools/3d/tile_edit/PIC/Pic_Manage.c +++ b/code/nel/tools/3d/tile_edit/PIC/Pic_Manage.c @@ -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) diff --git a/code/nel/tools/3d/tile_edit_qt/browser_model.cpp b/code/nel/tools/3d/tile_edit_qt/browser_model.cpp index edf6068cb..f1946d0f1 100644 --- a/code/nel/tools/3d/tile_edit_qt/browser_model.cpp +++ b/code/nel/tools/3d/tile_edit_qt/browser_model.cpp @@ -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 { diff --git a/code/nel/tools/3d/tile_edit_qt/pic/PIC_System.c b/code/nel/tools/3d/tile_edit_qt/pic/PIC_System.c index f47bc7064..4ef946b2f 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/PIC_System.c +++ b/code/nel/tools/3d/tile_edit_qt/pic/PIC_System.c @@ -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); } -/* ---------------------------------------------------------------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------------------------------------------------------------- diff --git a/code/nel/tools/3d/tile_edit_qt/pic/Pic_Manage.c b/code/nel/tools/3d/tile_edit_qt/pic/Pic_Manage.c index 607b7508d..a972cccce 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/Pic_Manage.c +++ b/code/nel/tools/3d/tile_edit_qt/pic/Pic_Manage.c @@ -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); } -/* ---------------------------------------------------------------------------------------------------------------------------------- */ - +// ---------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c b/code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c index 5f598d4eb..441b1eaa9 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c +++ b/code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c @@ -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, diff --git a/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h b/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h index 43f784c71..18089e04e 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h +++ b/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h @@ -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 \ No newline at end of file diff --git a/code/nel/tools/3d/tile_edit_qt/tile_edit.vcproj b/code/nel/tools/3d/tile_edit_qt/tile_edit.vcproj index ca98218d0..a54243290 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_edit.vcproj +++ b/code/nel/tools/3d/tile_edit_qt/tile_edit.vcproj @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,7 +990,7 @@ Description="RCC $(InputName).qrc" CommandLine="rcc.exe -name $(InputName) $(InputName).qrc -o $(InputDir)\qrc_$(InputName).cpp " AdditionalDependencies="rcc.exe;nel.png;$(InputName).qrc" - Outputs="Release\qrc_$(InputName).cpp" + Outputs="Debug\qrc_$(InputName).cpp" /> - - -