From 7778e8c161e3e0ab4be95bc26232b18ca2163913 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 25 Sep 2010 15:53:28 +0200 Subject: [PATCH] Fixed: tile_edit compilation --- code/nel/tools/3d/tile_edit/Browse.cpp | 19 ++++----- code/nel/tools/3d/tile_edit/CMakeLists.txt | 17 ++++---- .../PIC/{PIC_System.c => PIC_System.cpp} | 12 +++--- .../tile_edit/PIC/{Pic_BMP.c => Pic_BMP.cpp} | 20 ++++----- .../tile_edit/PIC/{Pic_JPG.c => Pic_JPG.cpp} | 14 +++---- .../PIC/{Pic_Manage.c => Pic_Manage.cpp} | 42 +++++++++---------- .../tile_edit/PIC/{Pic_TGA.c => Pic_TGA.cpp} | 20 ++++----- code/nel/tools/3d/tile_edit/PIC/pic.h | 10 +---- code/nel/tools/3d/tile_edit/PIC/pic_private.h | 36 +++++++--------- code/nel/tools/3d/tile_edit/PIC/readpic.cpp | 3 +- code/nel/tools/3d/tile_edit/PIC/readpic.h | 4 +- .../3d/tile_edit/SelectionTerritoire.cpp | 5 +-- code/nel/tools/3d/tile_edit/View.cpp | 8 ++-- code/nel/tools/3d/tile_edit/View.h | 4 +- code/nel/tools/3d/tile_edit/stdafx.h | 25 ++++++++++- .../tools/3d/tile_edit/tile_edit_exe.vcproj | 10 ++--- 16 files changed, 126 insertions(+), 123 deletions(-) rename code/nel/tools/3d/tile_edit/PIC/{PIC_System.c => PIC_System.cpp} (86%) rename code/nel/tools/3d/tile_edit/PIC/{Pic_BMP.c => Pic_BMP.cpp} (87%) rename code/nel/tools/3d/tile_edit/PIC/{Pic_JPG.c => Pic_JPG.cpp} (85%) rename code/nel/tools/3d/tile_edit/PIC/{Pic_Manage.c => Pic_Manage.cpp} (88%) rename code/nel/tools/3d/tile_edit/PIC/{Pic_TGA.c => Pic_TGA.cpp} (87%) diff --git a/code/nel/tools/3d/tile_edit/Browse.cpp b/code/nel/tools/3d/tile_edit/Browse.cpp index 4d203099b..4b6c61595 100644 --- a/code/nel/tools/3d/tile_edit/Browse.cpp +++ b/code/nel/tools/3d/tile_edit/Browse.cpp @@ -9,11 +9,6 @@ #include "custom.h" #include "getval.h" -#include "nel/3d/tile_bank.h" - -#include "nel/misc/bitmap.h" -#include "nel/misc/file.h" - using namespace NL3D; using namespace NLMISC; @@ -178,7 +173,7 @@ LRESULT Browse::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) CDC *pDC = GetDC(); m_ctrl.DrawDragRect(pDC,NULL,size,&last_sel,size); //on efface l'ancien carre - m_ctrl.UpdateSelection(¤t, wParam, m_128x128); //on affiche les modifes + m_ctrl.UpdateSelection(¤t, (int)wParam, m_128x128); //on affiche les modifes m_ctrl.DrawDragRect(pDC,¤t,size,NULL,size); //on affiche le nouveau carre ::ReleaseDC(*this,*pDC); @@ -239,7 +234,7 @@ LRESULT Browse::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) CDC *pDC = GetDC(); m_ctrl.DrawDragRect(pDC,NULL,size,&last_sel,size); //on efface l'ancien carre - m_ctrl.UpdateSelection(¤t,wParam, m_128x128); //on affiche les modifes + m_ctrl.UpdateSelection(¤t,(int)wParam, m_128x128); //on affiche les modifes ::ReleaseDC(*this,*pDC); @@ -362,8 +357,8 @@ LRESULT Browse::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) int x = LOWORD(lParam); int y = HIWORD(lParam); - int i = max (1, m_ctrl.GetNbTileLine()); - int j = max (1, m_ctrl.GetNbTileColumn()); + int i = std::max (1, m_ctrl.GetNbTileLine()); + int j = std::max (1, m_ctrl.GetNbTileColumn()); int pos = m_ctrl.GetScrollPos(SB_VERT); int hview = (m_ctrl.InfoList.GetSize(m_128x128)/i + 1)*(m_ctrl.sizeicon_y + m_ctrl.spacing_y) + m_ctrl.spacing_y; m_ctrl.scrollpos = (pos*hview)/SCROLL_MAX; @@ -372,7 +367,7 @@ LRESULT Browse::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) m_ctrl.GetWindowRect(&clientrect); InvalidateRect(NULL,false); GetWindowRect(&rect); - m_ctrl.SetWindowPos(NULL, 0, 0, max (100, x - 120), y - 20, SWP_NOMOVE); + m_ctrl.SetWindowPos(NULL, 0, 0, std::max (100, x - 120), y - 20, SWP_NOMOVE); int iFirst,iLast; m_ctrl.GetVisibility(iFirst, iLast, m_128x128); m_ctrl.UpdateBar(iFirst, iLast, m_128x128); @@ -800,8 +795,8 @@ void Browse::OnDestroy() if (RegCreateKey(HKEY_CURRENT_USER,REGKEY_TILEDIT,®key)==ERROR_SUCCESS) { //int sel = ((CComboBox*)GetDlgItem(IDC_LISTTYPE))->GetCurSel(); - RegSetValueEx(regkey,REGKEY_WNDPL,0,REG_SZ,(const unsigned char*)sWindowpl,strlen(sWindowpl)); - RegSetValueEx(regkey,REGKEY_LASTPATH,0,REG_SZ,(const unsigned char*)m_ctrl.LastPath.c_str(),strlen(m_ctrl.LastPath.c_str())); + RegSetValueEx(regkey,REGKEY_WNDPL,0,REG_SZ,(const unsigned char*)sWindowpl,(DWORD)strlen(sWindowpl)); + RegSetValueEx(regkey,REGKEY_LASTPATH,0,REG_SZ,(const unsigned char*)m_ctrl.LastPath.c_str(),(DWORD)strlen(m_ctrl.LastPath.c_str())); RegSetValueEx(regkey,REGKEY_BUTTONZOOM,0,REG_DWORD,(const unsigned char*)&m_ctrl.Zoom,4); RegSetValueEx(regkey,REGKEY_BUTTONVARIETY,0,REG_DWORD,(const unsigned char*)&m_128x128,4); RegSetValueEx(regkey,REGKEY_BUTTONTEXTURE,0,REG_DWORD,(const unsigned char*)&m_ctrl.Texture,4); diff --git a/code/nel/tools/3d/tile_edit/CMakeLists.txt b/code/nel/tools/3d/tile_edit/CMakeLists.txt index e81e940b5..7d7117a77 100644 --- a/code/nel/tools/3d/tile_edit/CMakeLists.txt +++ b/code/nel/tools/3d/tile_edit/CMakeLists.txt @@ -1,6 +1,9 @@ -FILE(GLOB SRC *.cpp *.h PIC/*.c PIC/*.h) +FILE(GLOB SRC *.cpp *.h PIC/*.cpp PIC/*.h) -ENABLE_LANGUAGE(RC) +FILE(GLOB SRC2 cpu.cpp DllEntry.cpp Popup.* thread_win32.* TileCtrl.* TileList.* TileView.*) +LIST(REMOVE_ITEM SRC ${SRC2}) + +#ENABLE_LANGUAGE(RC) ADD_EXECUTABLE(tile_edit WIN32 ${SRC} tile_edit_exe.rc) @@ -8,10 +11,10 @@ TARGET_LINK_LIBRARIES(tile_edit ${PLATFORM_LINKFLAGS} nelmisc nel3d) NL_DEFAULT_PROPS(tile_edit "NeL, Tools, 3D: Tile Editor") NL_ADD_RUNTIME_FLAGS(tile_edit) -ADD_DEFINITIONS(-D_AFXDLL) +ADD_DEFINITIONS(${MFC_DEFINITIONS}) -IF(WIN32) - SET_TARGET_PROPERTIES(tile_edit PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1) -ENDIF(WIN32) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(tile_edit ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.h ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.cpp) +ENDIF(WITH_PCH) -#INSTALL(TARGETS tile_edit RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS tile_edit RUNTIME DESTINATION bin COMPONENT tools3d) diff --git a/code/nel/tools/3d/tile_edit/PIC/PIC_System.c b/code/nel/tools/3d/tile_edit/PIC/PIC_System.cpp similarity index 86% rename from code/nel/tools/3d/tile_edit/PIC/PIC_System.c rename to code/nel/tools/3d/tile_edit/PIC/PIC_System.cpp index b8b379a4f..3cf25e214 100644 --- a/code/nel/tools/3d/tile_edit/PIC/PIC_System.c +++ b/code/nel/tools/3d/tile_edit/PIC/PIC_System.cpp @@ -38,7 +38,7 @@ void *Pic_calloc(unsigned long count, unsigned long size) void Pic_free(void *memblock) { unsigned long size; - size=_msize(memblock); + size=(unsigned long)_msize(memblock); PIC_Sys_MEM_Allocated-=size; PIC_Sys_MEM_NbAllocs--; free(memblock); @@ -46,7 +46,7 @@ void Pic_free(void *memblock) // ----- unsigned long Pic__msize(void *memblock) { - return(_msize(memblock)); + return(unsigned long)(_msize(memblock)); } // ----- unsigned long PIC_GetMemNbAllocs(void) @@ -61,14 +61,14 @@ unsigned long PIC_GetMemAllocated(void) // ---------------------------------------------------------------------------------------------------------------------------------- -static unsigned char PIC_ErrorFlag; -static unsigned char PIC_ErrorString[PIC_ERRSIZE]; +static char PIC_ErrorFlag; +static char PIC_ErrorString[PIC_ERRSIZE]; static unsigned char PIC_Sys_FnctActive=0; static void (*PIC_Sys_Fnct)(void); -void Pic_SetError(unsigned char *msg, ...) +void Pic_SetError(const char *msg, ...) { - unsigned char curerr[PIC_ERRSIZE],olderr[PIC_ERRSIZE]; + char curerr[PIC_ERRSIZE],olderr[PIC_ERRSIZE]; va_list args; va_start(args,msg); diff --git a/code/nel/tools/3d/tile_edit/PIC/Pic_BMP.c b/code/nel/tools/3d/tile_edit/PIC/Pic_BMP.cpp similarity index 87% rename from code/nel/tools/3d/tile_edit/PIC/Pic_BMP.c rename to code/nel/tools/3d/tile_edit/PIC/Pic_BMP.cpp index 56bfd9ed7..dfd3341ce 100644 --- a/code/nel/tools/3d/tile_edit/PIC/Pic_BMP.c +++ b/code/nel/tools/3d/tile_edit/PIC/Pic_BMP.cpp @@ -31,8 +31,8 @@ typedef struct BMP_HEADER // ---------------------------------------------------------------------------------------------------------------------------------- -unsigned long Pic_BMP_Write( unsigned char *FileName, - unsigned char *pPal,unsigned char *pDatas, +unsigned long Pic_BMP_Write( const char *FileName, + char *pPal, char *pDatas, unsigned long w, unsigned long h, unsigned long d) { @@ -82,7 +82,7 @@ unsigned long Pic_BMP_Write( unsigned char *FileName, } } slsize=w*d/8; - scanline=Pic_calloc(1,slsize); + scanline=(unsigned char*)Pic_calloc(1,slsize); if (!scanline) { Pic_SetError("BMP_Write, not enough memory for scanline"); @@ -117,15 +117,15 @@ unsigned long Pic_BMP_Write( unsigned char *FileName, // ---------------------------------------------------------------------------------------------------------------------------------- -unsigned long Pic_BMP_Read( unsigned char *FileName, - unsigned char **ppPal, unsigned char **ppDatas, +unsigned long Pic_BMP_Read( const char *FileName, + char **ppPal, char **ppDatas, unsigned long *pWidth, unsigned long *pHeight, unsigned long *pDepth) { FILE *file; BMP_HEADER bmph; - unsigned char *pPal; - unsigned char *pDatas; + char *pPal; + char *pDatas; unsigned char *scanline; long w,h,d; long i,x,y,rest; @@ -151,7 +151,7 @@ unsigned long Pic_BMP_Read( unsigned char *FileName, } if (*pDepth==8) { - pPal=Pic_calloc(1,256*3); + pPal=(char*)Pic_calloc(1,256*3); if (!pPal) { Pic_SetError("BMP_Read, not enough memory for palette"); @@ -165,7 +165,7 @@ unsigned long Pic_BMP_Read( unsigned char *FileName, fread(&pad[0],1,1,file); } } - pDatas=Pic_calloc(1,w*h*d/8); + pDatas=(char*)Pic_calloc(1,w*h*d/8); if (!pDatas) { if (pPal) @@ -175,7 +175,7 @@ unsigned long Pic_BMP_Read( unsigned char *FileName, Pic_SetError("BMP_Read, not enough memory for datas"); return(0); } - scanline=Pic_calloc(1,w*h*d/8); + scanline=(unsigned char*)Pic_calloc(1,w*h*d/8); if (!scanline) { if (pPal) diff --git a/code/nel/tools/3d/tile_edit/PIC/Pic_JPG.c b/code/nel/tools/3d/tile_edit/PIC/Pic_JPG.cpp similarity index 85% rename from code/nel/tools/3d/tile_edit/PIC/Pic_JPG.c rename to code/nel/tools/3d/tile_edit/PIC/Pic_JPG.cpp index 337c293a9..9bf3d9b05 100644 --- a/code/nel/tools/3d/tile_edit/PIC/Pic_JPG.c +++ b/code/nel/tools/3d/tile_edit/PIC/Pic_JPG.cpp @@ -31,14 +31,14 @@ void my_error_exit(j_common_ptr cinfo) // ---------------------------------------------------------------------------------------------------------------------------------- -unsigned long Pic_JPG_Read(unsigned char *FileName, unsigned char **ppPal, unsigned char **ppDatas, unsigned long *w, unsigned long *h) +unsigned long Pic_JPG_Read(const char *FileName, char **ppPal, char **ppDatas, unsigned long *w, unsigned long *h) { struct jpeg_decompress_struct cinfo; struct my_error_mgr jerr; FILE *file; JSAMPARRAY buffer; int row_stride,i; - unsigned char *pDatas,*pPal; + char *pDatas,*pPal; unsigned long ptr; error=0; @@ -65,12 +65,12 @@ unsigned long Pic_JPG_Read(unsigned char *FileName, unsigned char **ppPal, unsig *h=cinfo.image_height; if (!ppPal) { - pDatas=Pic_calloc(1,(*w)*(*h)*3); + pDatas=(char*)Pic_calloc(1,(*w)*(*h)*3); } else { - pDatas=Pic_calloc(1,(*w)*(*h)); - pPal=Pic_calloc(1,256*3); + pDatas=(char*)Pic_calloc(1,(*w)*(*h)); + pPal=(char*)Pic_calloc(1,256*3); if (!pPal) { Pic_SetError("JPG_Read, not enough memory for palette"); @@ -114,7 +114,7 @@ unsigned long Pic_JPG_Read(unsigned char *FileName, unsigned char **ppPal, unsig // ---------------------------------------------------------------------------------------------------------------------------------- -unsigned long Pic_JPG_Write(unsigned char *FileName, unsigned long Qual, unsigned char *pDatas, unsigned long w, unsigned long h) +unsigned long Pic_JPG_Write(const char *FileName, unsigned long Qual, char *pDatas, unsigned long w, unsigned long h) { struct jpeg_compress_struct cinfo; struct my_error_mgr jerr; @@ -150,7 +150,7 @@ unsigned long Pic_JPG_Write(unsigned char *FileName, unsigned long Qual, unsigne row_stride = w * 3; while(cinfo.next_scanlineWidth*pic->Height*3); + buf=(char *)Pic_malloc(pic->Width*pic->Height*3); if (!buf) { Pic_SetError("Conv8To24, not enough memory for temporary buffer"); @@ -330,7 +330,7 @@ static char* Conv8To16(unsigned long id) pix16=(r<<10)+(g<<5)+b; buf[i]=pix16; } - return((unsigned char*)buf); + return (char*)buf; } // ---------------------------------------- @@ -349,7 +349,7 @@ static char* Conv16To24(unsigned long id) Pic_SetError("Conv16To24, picture internal structure not found"); return(NULL); } - buf=Pic_malloc(pic->Width*pic->Height*3); + buf=(unsigned char *)Pic_malloc(pic->Width*pic->Height*3); if (!buf) { Pic_SetError("Conv16To24, not enough memory for temporary buffer"); @@ -365,7 +365,7 @@ static char* Conv16To24(unsigned long id) buf[i*3+1]=(unsigned char)g; buf[i*3+2]=(unsigned char)b; } - return(buf); + return (char*)buf; } // ---------------------------------------- @@ -404,14 +404,14 @@ static char* Conv24To16(unsigned long id) pix16=(r<<10)+(g<<5)+b; buf[i]=pix16; } - return((unsigned char*)buf); + return (char*)buf; } // ---------------------------------------- static char* ConvPic(PIC_PICTURE *pic, unsigned long type, char* pErr) { - unsigned char *buf; + char *buf; unsigned long src,dst; *pErr=0; @@ -471,7 +471,7 @@ static char* ConvPic(PIC_PICTURE *pic, unsigned long type, char* pErr) { *pErr=1; } - return(buf); + return buf; } // --- if (src==24 && dst==8) @@ -490,9 +490,9 @@ static char* ConvPic(PIC_PICTURE *pic, unsigned long type, char* pErr) unsigned long PIC_Save(unsigned long id, char* FileName, unsigned long type, unsigned long qual) { PIC_PICTURE *pic; - unsigned char err; - unsigned char *buf; - unsigned char *freeit; + char err; + char *buf; + char *freeit; unsigned long depth; freeit=NULL; @@ -502,7 +502,7 @@ unsigned long PIC_Save(unsigned long id, char* FileName, unsigned long type, uns Pic_SetError("Save %s, picture internal structure not found",FileName); return(0); } - freeit=ConvPic(pic,type,&err); + freeit = ConvPic(pic,type,&err); if (err) { Pic_SetError("Save %s, error while converting picture",FileName); diff --git a/code/nel/tools/3d/tile_edit/PIC/Pic_TGA.c b/code/nel/tools/3d/tile_edit/PIC/Pic_TGA.cpp similarity index 87% rename from code/nel/tools/3d/tile_edit/PIC/Pic_TGA.c rename to code/nel/tools/3d/tile_edit/PIC/Pic_TGA.cpp index 441b1eaa9..143a3385d 100644 --- a/code/nel/tools/3d/tile_edit/PIC/Pic_TGA.c +++ b/code/nel/tools/3d/tile_edit/PIC/Pic_TGA.cpp @@ -27,8 +27,8 @@ typedef struct TGA_HEADER // ---------------------------------------------------------------------------------------------------------------------------------- -unsigned long Pic_TGA_Read( unsigned char *FileName, - unsigned char **ppPal, unsigned char **ppDatas, +unsigned long Pic_TGA_Read( const char *FileName, + char **ppPal, char **ppDatas, unsigned long *pWidth, unsigned long *pHeight, unsigned long *pDepth) { @@ -36,8 +36,8 @@ unsigned long Pic_TGA_Read( unsigned char *FileName, TGA_HEADER tgah; long w,h,d; unsigned long size; - unsigned char *pDatas; - unsigned char *pPal; + char *pDatas; + char *pPal; long x,y; long slsize; unsigned char *scanline; @@ -65,7 +65,7 @@ unsigned long Pic_TGA_Read( unsigned char *FileName, upSideDown = ((tgah.Desc & (1 << 5))==0); size=tgah.Width*tgah.Height*(tgah.ImageDepth/8); - pDatas=Pic_malloc(size); + pDatas=(char*)Pic_malloc(size); if (!pDatas) { Pic_SetError("TGA_Read, not enough memory"); @@ -79,7 +79,7 @@ unsigned long Pic_TGA_Read( unsigned char *FileName, Pic_SetError("TGA_Read, need a pointer to palette"); return(0); } - pPal=Pic_calloc(1,256*3); + pPal=(char*)Pic_calloc(1,256*3); if (!pPal) { Pic_SetError("TGA_Read, not enough memory for palette"); @@ -98,7 +98,7 @@ unsigned long Pic_TGA_Read( unsigned char *FileName, } slsize=w*d/8; - scanline=Pic_calloc(1,slsize); + scanline=(unsigned char*)Pic_calloc(1,slsize); if (!scanline) { if (pPal) @@ -140,8 +140,8 @@ unsigned long Pic_TGA_Read( unsigned char *FileName, // ---------------------------------------------------------------------------------------------------------------------------------- -unsigned long Pic_TGA_Write( unsigned char *FileName, - unsigned char *pPal,unsigned char *pDatas, +unsigned long Pic_TGA_Write( const char *FileName, + char *pPal, char *pDatas, unsigned long w, unsigned long h, unsigned long d) { FILE *file; @@ -186,7 +186,7 @@ unsigned long Pic_TGA_Write( unsigned char *FileName, fwrite(pPal,1,256*3,file); } slsize=w*d/8; - scanline=Pic_calloc(1,slsize); + scanline=(unsigned char*)Pic_calloc(1,slsize); if (!scanline) { Pic_SetError("TGA_Write, not enough memory for scanline"); diff --git a/code/nel/tools/3d/tile_edit/PIC/pic.h b/code/nel/tools/3d/tile_edit/PIC/pic.h index 578ab89c0..a3207042f 100644 --- a/code/nel/tools/3d/tile_edit/PIC/pic.h +++ b/code/nel/tools/3d/tile_edit/PIC/pic.h @@ -1,8 +1,5 @@ #ifndef _PIC_H_ #define _PIC_H_ -#ifdef __cplusplus -extern "C" { -#endif // ---------------------------------------------------------------------------------------------------------------------------------- @@ -20,12 +17,12 @@ extern "C" { // extern unsigned long PIC_Load(char* FileName, unsigned char Quantize); -extern unsigned long PIC_Create(unsigned char* pPal, unsigned char* pDatas, unsigned long w, unsigned long h, unsigned long d); +extern unsigned long PIC_Create(char* pPal, char* pDatas, unsigned long w, unsigned long h, unsigned long d); extern unsigned long PIC_Save(unsigned long id, char* FileName, unsigned long type, unsigned long qual); extern unsigned long PIC_GetInfos( unsigned long id, - unsigned char* *ppPal, unsigned char* *ppDatas, + char **ppPal, char **ppDatas, unsigned long *pW, unsigned long *pH, unsigned long *pD); @@ -42,7 +39,4 @@ extern unsigned char PIC_OnErrorCall( void pFnct(void) ); // ---------------------------------------------------------------------------------------------------------------------------------- -#ifdef __cplusplus -} -#endif #endif diff --git a/code/nel/tools/3d/tile_edit/PIC/pic_private.h b/code/nel/tools/3d/tile_edit/PIC/pic_private.h index 18089e04e..4a6a5eee4 100644 --- a/code/nel/tools/3d/tile_edit/PIC/pic_private.h +++ b/code/nel/tools/3d/tile_edit/PIC/pic_private.h @@ -1,8 +1,5 @@ #ifndef _PIC_PRIVATE_H_ #define _PIC_PRIVATE_H_ -#ifdef __cplusplus -extern "C" { -#endif // ---------------------------------------------------------------------------------------------------------------------------------- @@ -12,8 +9,8 @@ typedef struct PIC_PICTURE unsigned long Width; unsigned long Height; unsigned long Depth; - unsigned char *pDatas; - unsigned char *pPal; + char *pDatas; + char *pPal; struct PIC_PICTURE *Next; } PIC_PICTURE; @@ -25,34 +22,34 @@ typedef struct PIC_PICTURE // -extern unsigned long Pic_JPG_Read( unsigned char *FileName, - unsigned char **ppPal, unsigned char **ppDatas, +extern unsigned long Pic_JPG_Read( const char *FileName, + char **ppPal, char **ppDatas, unsigned long *w, unsigned long *h); -extern unsigned long Pic_JPG_Write( unsigned char *FileName, +extern unsigned long Pic_JPG_Write( const char *FileName, unsigned long Qual, - unsigned char *pDatas, + char *pDatas, unsigned long w, unsigned long h); // // TGA // -extern unsigned long Pic_TGA_Read( unsigned char *FileName, - unsigned char **ppPal, unsigned char **ppDatas, +extern unsigned long Pic_TGA_Read( const char *FileName, + char **ppPal, char **ppDatas, unsigned long *pWidth, unsigned long *pHeight, unsigned long *pDepth); -extern unsigned long Pic_TGA_Write( unsigned char *FileName, - unsigned char *pPal,unsigned char *pDatas, +extern unsigned long Pic_TGA_Write( const char *FileName, + char *pPal, char *pDatas, unsigned long w, unsigned long h, unsigned long d); // // BMP // -extern unsigned long Pic_BMP_Read( unsigned char *FileName, - unsigned char **ppPal, unsigned char **ppDatas, +extern unsigned long Pic_BMP_Read( const char *FileName, + char **ppPal, char **ppDatas, unsigned long *pWidth, unsigned long *pHeight, unsigned long *pDepth); -extern unsigned long Pic_BMP_Write( unsigned char *FileName, - unsigned char *pPal,unsigned char *pDatas, +extern unsigned long Pic_BMP_Write( const char *FileName, + char *pPal, char *pDatas, unsigned long w, unsigned long h, unsigned long d); // // System @@ -61,11 +58,8 @@ 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, ...); +extern void Pic_SetError(const char *msg, ...); // ---------------------------------------------------------------------------------------------------------------------------------- -#ifdef __cplusplus -} -#endif #endif \ No newline at end of file diff --git a/code/nel/tools/3d/tile_edit/PIC/readpic.cpp b/code/nel/tools/3d/tile_edit/PIC/readpic.cpp index 6e9e56911..1b96ebefa 100644 --- a/code/nel/tools/3d/tile_edit/PIC/readpic.cpp +++ b/code/nel/tools/3d/tile_edit/PIC/readpic.cpp @@ -6,6 +6,7 @@ #include "pic.h" #include +using namespace std; //============================================================ // Image API. @@ -15,7 +16,7 @@ bool PIC_LoadPic(string path, vector &tampon, uint &Width, uint &Height) { uint32 id; - unsigned char *pal, *data; + char *pal, *data; unsigned long w,h,depth; uint i; diff --git a/code/nel/tools/3d/tile_edit/PIC/readpic.h b/code/nel/tools/3d/tile_edit/PIC/readpic.h index 9d8908c6c..3934d63b4 100644 --- a/code/nel/tools/3d/tile_edit/PIC/readpic.h +++ b/code/nel/tools/3d/tile_edit/PIC/readpic.h @@ -10,7 +10,7 @@ #include #include -using namespace std; + #include #include @@ -19,7 +19,7 @@ using namespace std; //============================================================ -bool PIC_LoadPic(string Path, vector &Tampon, uint &Width, uint &Height); +bool PIC_LoadPic(std::string Path, std::vector &Tampon, uint &Width, uint &Height); diff --git a/code/nel/tools/3d/tile_edit/SelectionTerritoire.cpp b/code/nel/tools/3d/tile_edit/SelectionTerritoire.cpp index 6194411df..f31ba4ed8 100644 --- a/code/nel/tools/3d/tile_edit/SelectionTerritoire.cpp +++ b/code/nel/tools/3d/tile_edit/SelectionTerritoire.cpp @@ -9,9 +9,6 @@ #include "GetVal.h" #include "Browse.h" #include "choose_veget_set.h" -#include "nel/3d/tile_bank.h" -#include "nel/misc/stream.h" -#include "nel/misc/file.h" #include using namespace NL3D; @@ -657,7 +654,7 @@ void SelectionTerritoire::OnPath() for (uint noise=1; noise //#include "ListGroup.h" -#include "nel/3d/tile_bank.h" //#include "ViewPopup.h" -#include "pic\readpic.h" +#include "pic/readpic.h" +using namespace std; using namespace NL3D; extern CTileBank tileBank2; @@ -602,7 +602,7 @@ tilelist::iterator TileList::GetLast(int n) int TileList::GetSize(int n) { //UpdateLF(); - return theList[n].size(); + return (int)theList[n].size(); } void TileInfo::Delete () @@ -1257,7 +1257,7 @@ void CTView::DrawTile(tilelist::iterator i,CDC *pDC,int clear, int n) rect_txt.top = pt.y + sizetile_y + spacing_tile_text; rect_txt.bottom += rect_txt.top + sizetext_y; rect_txt.left -= spacing_x; - pDC->DrawText(Name,strlen(Name),&rect_txt,DT_CENTER | DT_SINGLELINE); + pDC->DrawText(Name,(int)strlen(Name),&rect_txt,DT_CENTER | DT_SINGLELINE); // Restore the device context pDC->SetBkColor( clrBk ); diff --git a/code/nel/tools/3d/tile_edit/View.h b/code/nel/tools/3d/tile_edit/View.h index 311b3f01b..6c8667ffe 100644 --- a/code/nel/tools/3d/tile_edit/View.h +++ b/code/nel/tools/3d/tile_edit/View.h @@ -67,9 +67,7 @@ public: int id; //numero du tile }; -using namespace std; - -typedef vector tilelist; +typedef std::vector tilelist; diff --git a/code/nel/tools/3d/tile_edit/stdafx.h b/code/nel/tools/3d/tile_edit/stdafx.h index d7b49a7a9..e96ced3b4 100644 --- a/code/nel/tools/3d/tile_edit/stdafx.h +++ b/code/nel/tools/3d/tile_edit/stdafx.h @@ -2,5 +2,26 @@ #include "afxcmn.h" #include "afxdlgs.h" -#undef min -#undef max +#ifndef STDAFX_H +#define STDAFX_H + +#define NOMINMAX +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "nel/3d/tile_bank.h" +#include "nel/3d/tile_bank.h" + +#include "nel/misc/bitmap.h" +#include "nel/misc/file.h" +#include "nel/misc/stream.h" +#include "nel/misc/rgba.h" + +#endif diff --git a/code/nel/tools/3d/tile_edit/tile_edit_exe.vcproj b/code/nel/tools/3d/tile_edit/tile_edit_exe.vcproj index 694c7b9d7..017c650c9 100644 --- a/code/nel/tools/3d/tile_edit/tile_edit_exe.vcproj +++ b/code/nel/tools/3d/tile_edit/tile_edit_exe.vcproj @@ -452,7 +452,7 @@ Name="pic" >