From 03a307b58ddc6244d3fad8d77d7f0bac0a24e05d Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 17 Aug 2015 22:40:33 +0800 Subject: Fix crashes in smAnmFile. Do not crash if a non-exist file is requested in a DTP file. Fix several stupid typos. Fix missing smEntity3D constructor. Fix line spacing in smTTFont. --- include/smanim.hpp | 4 ++-- include/smbmfont.hpp | 4 ++-- include/smdatapack.hpp | 4 ++-- include/smelt.hpp | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/smanim.hpp b/include/smanim.hpp index 8cc4eef..c203961 100644 --- a/include/smanim.hpp +++ b/include/smanim.hpp @@ -35,12 +35,12 @@ class smAnmFile private: static SMELT *sm; smDtpFileR anm; - void parseMeta(char* meta,DWORD size); + void parseMeta(const char* meta,DWORD size); std::map tm; std::map am; std::map xm; public: - bool loadAnmFromMemory(char* ptr,DWORD size); + bool loadAnmFromMemory(const char* ptr,DWORD size); void close(); smTexInfo* getTextureInfo(const char* name); smAnmInfo* getAnimationInfo(const char* name); diff --git a/include/smbmfont.hpp b/include/smbmfont.hpp index 6a0f1c1..44f2e2f 100644 --- a/include/smbmfont.hpp +++ b/include/smbmfont.hpp @@ -27,9 +27,9 @@ private: int pdb[256],pda[256],b; DWORD color; std::map xm; - void parseMeta(char* meta,DWORD size); + void parseMeta(const char* meta,DWORD size); public: - bool loadAnmFromMemory(char* ptr,DWORD size); + bool loadAnmFromMemory(const char* ptr,DWORD size); void close(); void render(float x,float y,float z,int align,float *rw,const char* text); void printf(float x,float y,float z,int align,float *rw,const char* format,...); diff --git a/include/smdatapack.hpp b/include/smdatapack.hpp index 8431b58..2689eb3 100644 --- a/include/smdatapack.hpp +++ b/include/smdatapack.hpp @@ -30,10 +30,10 @@ private: bool enmemory; DWORD msize; - char *cp,*bp; + const char *cp,*bp; public: bool openDtp(const char* path); - bool openDtpFromMemory(char* ptr,DWORD size); + bool openDtpFromMemory(const char* ptr,DWORD size); void closeDtp(); char* getFirstFile(); char* getLastFile(); diff --git a/include/smelt.hpp b/include/smelt.hpp index b5c324e..95b3934 100644 --- a/include/smelt.hpp +++ b/include/smelt.hpp @@ -42,7 +42,7 @@ typedef uint8_t BYTE; //Handles typedef size_t SMTEX;//Texture Handle typedef size_t SMTRG;//Target Handle -typedef size_t SMSFX;//Sound/FX Handle +typedef size_t SMSFX;//SoundFX Handle typedef size_t SMCHN;//Channel Handle //Color Marcos @@ -58,15 +58,15 @@ typedef size_t SMCHN;//Channel Handle #define SETB(col,b) (((col)&0xFFFFFF00)+DWORD(b)) //Blend Modes -#define BLEND_COLORINV 0x8 #define BLEND_COLORADD 0x1 #define BLEND_COLORMUL 0x0 +#define BLEND_COLORINV 0x8 #define BLEND_ALPHABLEND 0x2 #define BLEND_ALPHAADD 0x0 #define BLEND_ZWRITE 0x4 #define BLEND_NOZWRITE 0x0 -typedef bool (*SMHook)(); +typedef bool (*smHook)(); #define FPS_FREE 0 #define FPS_VSYNC -1 @@ -120,10 +120,10 @@ public: virtual bool smInit()=0; virtual void smFinale()=0; virtual void smMainLoop()=0; - virtual void smUpdateFunc(SMHook func)=0; - virtual void smUnFocFunc(SMHook func)=0; - virtual void smFocFunc(SMHook func)=0; - virtual void smQuitFunc(SMHook func)=0; + virtual void smUpdateFunc(smHook func)=0; + virtual void smUnFocFunc(smHook func)=0; + virtual void smFocFunc(smHook func)=0; + virtual void smQuitFunc(smHook func)=0; virtual void smWinTitle(const char* title)=0; virtual bool smIsActive()=0; virtual void smNoSuspend(bool para)=0; -- cgit v1.2.3