Fixed: tile_edit compilation
This commit is contained in:
parent
d77cccad49
commit
7f6b6ed12d
16 changed files with 126 additions and 123 deletions
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
|
@ -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)
|
|
@ -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_scanline<cinfo.image_height)
|
||||
{
|
||||
row_pointer[0] = & pDatas[cinfo.next_scanline * row_stride];
|
||||
row_pointer[0] = (JSAMPROW)& pDatas[cinfo.next_scanline * row_stride];
|
||||
(void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
|
||||
}
|
||||
jpeg_finish_compress(&cinfo);
|
|
@ -25,12 +25,12 @@ static PIC_PICTURE *GetPic(unsigned long id)
|
|||
|
||||
unsigned long PIC_Load(char* FileName, unsigned char Quantize)
|
||||
{
|
||||
unsigned char ext[4];
|
||||
char ext[4];
|
||||
unsigned long type;
|
||||
unsigned long i,taken,id;
|
||||
PIC_PICTURE *pic;
|
||||
unsigned char *pDatas;
|
||||
unsigned char *pPal;
|
||||
char *pDatas;
|
||||
char *pPal;
|
||||
unsigned long w,h,Depth;
|
||||
unsigned long ret;
|
||||
|
||||
|
@ -135,7 +135,7 @@ unsigned long PIC_Load(char* FileName, unsigned char Quantize)
|
|||
}
|
||||
|
||||
// --- Create and place new pic struct
|
||||
pic=Pic_calloc(1,sizeof(PIC_PICTURE));
|
||||
pic=(PIC_PICTURE *)Pic_calloc(1,sizeof(PIC_PICTURE));
|
||||
if (!pic)
|
||||
{
|
||||
Pic_SetError("Load, not enough memory for internal structure");
|
||||
|
@ -155,7 +155,7 @@ unsigned long PIC_Load(char* FileName, unsigned char Quantize)
|
|||
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
unsigned long PIC_Create(unsigned char* pPal, unsigned char* pDatas, unsigned long w, unsigned long h, unsigned long d)
|
||||
unsigned long PIC_Create(char* pPal, char* pDatas, unsigned long w, unsigned long h, unsigned long d)
|
||||
{
|
||||
unsigned long i,taken,id;
|
||||
PIC_PICTURE *pic;
|
||||
|
@ -190,7 +190,7 @@ unsigned long PIC_Create(unsigned char* pPal, unsigned char* pDatas, unsigned lo
|
|||
// --- Create pic
|
||||
if (!pDatas)
|
||||
{
|
||||
pDatas=Pic_calloc(1,w*h*d/8);
|
||||
pDatas=(char *)Pic_calloc(1,w*h*d/8);
|
||||
if (!pDatas)
|
||||
{
|
||||
Pic_SetError("Create, not enough memory for datas");
|
||||
|
@ -201,7 +201,7 @@ unsigned long PIC_Create(unsigned char* pPal, unsigned char* pDatas, unsigned lo
|
|||
{
|
||||
if (!pPal)
|
||||
{
|
||||
pPal=Pic_calloc(1,256*3);
|
||||
pPal=(char *)Pic_calloc(1,256*3);
|
||||
if (!pPal)
|
||||
{
|
||||
Pic_SetError("Create, not enough memory for palette");
|
||||
|
@ -214,7 +214,7 @@ unsigned long PIC_Create(unsigned char* pPal, unsigned char* pDatas, unsigned lo
|
|||
pPal=NULL;
|
||||
}
|
||||
// --- Create and place new pic struct
|
||||
pic=Pic_calloc(1,sizeof(PIC_PICTURE));
|
||||
pic=(PIC_PICTURE *)Pic_calloc(1,sizeof(PIC_PICTURE));
|
||||
if (!pic)
|
||||
{
|
||||
Pic_SetError("Create, not enough memory for internal structure");
|
||||
|
@ -236,7 +236,7 @@ unsigned long PIC_Create(unsigned char* pPal, unsigned char* pDatas, unsigned lo
|
|||
// ----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
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)
|
||||
{
|
||||
PIC_PICTURE *pic;
|
||||
|
@ -275,7 +275,7 @@ unsigned long PIC_GetInfos( unsigned long id,
|
|||
static char* Conv8To24(unsigned long id)
|
||||
{
|
||||
PIC_PICTURE *pic;
|
||||
unsigned char *buf;
|
||||
char *buf;
|
||||
unsigned long i;
|
||||
|
||||
pic=GetPic(id);
|
||||
|
@ -284,7 +284,7 @@ static char* Conv8To24(unsigned long id)
|
|||
Pic_SetError("Conv8To24, picture internal structure not found");
|
||||
return(NULL);
|
||||
}
|
||||
buf=Pic_malloc(pic->Width*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);
|
|
@ -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");
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -6,6 +6,7 @@
|
|||
#include "pic.h"
|
||||
#include <nel/misc/rgba.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
//============================================================
|
||||
// Image API.
|
||||
|
@ -15,7 +16,7 @@
|
|||
bool PIC_LoadPic(string path, vector<NLMISC::CBGRA> &tampon, uint &Width, uint &Height)
|
||||
{
|
||||
uint32 id;
|
||||
unsigned char *pal, *data;
|
||||
char *pal, *data;
|
||||
unsigned long w,h,depth;
|
||||
uint i;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#include <nel/misc/types_nl.h>
|
||||
#include <nel/misc/rgba.h>
|
||||
|
||||
|
@ -19,7 +19,7 @@ using namespace std;
|
|||
//============================================================
|
||||
|
||||
|
||||
bool PIC_LoadPic(string Path, vector<NLMISC::CBGRA> &Tampon, uint &Width, uint &Height);
|
||||
bool PIC_LoadPic(std::string Path, std::vector<NLMISC::CBGRA> &Tampon, uint &Width, uint &Height);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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 <shlobj.h>
|
||||
|
||||
using namespace NL3D;
|
||||
|
@ -657,7 +654,7 @@ void SelectionTerritoire::OnPath()
|
|||
for (uint noise=1; noise<tileBank.getDisplacementMapCount (); noise++)
|
||||
{
|
||||
// Bitmap string
|
||||
string bitmapPath=tileBank.getDisplacementMap (noise);
|
||||
std::string bitmapPath=tileBank.getDisplacementMap (noise);
|
||||
|
||||
// not empty ?
|
||||
if (bitmapPath!="")
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
#include "popup.h"
|
||||
#include <direct.h>
|
||||
//#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 );
|
||||
|
|
|
@ -67,9 +67,7 @@ public:
|
|||
int id; //numero du tile
|
||||
};
|
||||
|
||||
using namespace std;
|
||||
|
||||
typedef vector<TileInfo> tilelist;
|
||||
typedef std::vector<TileInfo> tilelist;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,5 +2,26 @@
|
|||
#include "afxcmn.h"
|
||||
#include "afxdlgs.h"
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
#ifndef STDAFX_H
|
||||
#define STDAFX_H
|
||||
|
||||
#define NOMINMAX
|
||||
#include <afxwin.h>
|
||||
#include <afxcmn.h>
|
||||
#include <afxdlgs.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
||||
#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
|
||||
|
|
|
@ -452,7 +452,7 @@
|
|||
Name="pic"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Pic\Pic_BMP.c"
|
||||
RelativePath=".\Pic\Pic_BMP.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
|
@ -488,7 +488,7 @@
|
|||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Pic\Pic_JPG.c"
|
||||
RelativePath=".\Pic\Pic_JPG.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
|
@ -524,7 +524,7 @@
|
|||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Pic\Pic_Manage.c"
|
||||
RelativePath=".\Pic\Pic_Manage.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
|
@ -560,7 +560,7 @@
|
|||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Pic\PIC_System.c"
|
||||
RelativePath=".\Pic\PIC_System.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
|
@ -596,7 +596,7 @@
|
|||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Pic\Pic_TGA.c"
|
||||
RelativePath=".\Pic\Pic_TGA.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
|
|
Loading…
Reference in a new issue