diff --git a/ee.win.cbp b/ee.win.cbp
index 9cb1d6b14..7a457304e 100644
--- a/ee.win.cbp
+++ b/ee.win.cbp
@@ -12,6 +12,8 @@
+
+
@@ -40,229 +42,235 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/audio/tsoundmanager.hpp b/src/audio/tsoundmanager.hpp
index 19eb1e5d7..0be1eb698 100755
--- a/src/audio/tsoundmanager.hpp
+++ b/src/audio/tsoundmanager.hpp
@@ -110,7 +110,7 @@ void tSoundManager::Play( const T& id ) {
if ( it != tSounds.end() ) {
sSound * tSound = &it->second;
- Uint32 tSize = tSound->Snd.size();
+ Uint32 tSize = (Uint32)tSound->Snd.size();
for ( Uint32 i = 0; i < tSize; i++ ) {
// If there is a free slot, use it.
diff --git a/src/base.hpp b/src/base.hpp
index fd91f53bc..23d53e194 100644
--- a/src/base.hpp
+++ b/src/base.hpp
@@ -65,8 +65,10 @@
#define EE_API __declspec(dllimport)
#endif
- #ifdef _MSC_VER
+ #ifdef EE_COMPILER_MSVC
#pragma warning(disable : 4251)
+ #pragma warning(disable : 4244)
+ #pragma warning(disable : 4996)
#endif
#else
// No specific directive needed for static build
diff --git a/src/graphics/cbatchrenderer.cpp b/src/graphics/cbatchrenderer.cpp
index 351fa0352..56c48e8e5 100755
--- a/src/graphics/cbatchrenderer.cpp
+++ b/src/graphics/cbatchrenderer.cpp
@@ -74,7 +74,7 @@ void cBatchRenderer::Flush() {
if ( mCurrentMode == EE_GL_POINTS && NULL != mTexture ) {
glEnable( GL_POINT_SPRITE_ARB );
glTexEnvf( GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE );
- glPointSize( mTexture->Width() );
+ glPointSize( (GLfloat)mTexture->Width() );
}
if ( CreateMatrix ) {
diff --git a/src/graphics/cconsole.cpp b/src/graphics/cconsole.cpp
index 5a919a180..1f89687e9 100755
--- a/src/graphics/cconsole.cpp
+++ b/src/graphics/cconsole.cpp
@@ -101,7 +101,7 @@ void cConsole::Draw() {
Int16 LinesInScreen = (Int16) ( (mCurHeight / mFontSize) - 1 );
if ( static_cast( mCmdLog.size() ) > LinesInScreen )
- mEx = mCmdLog.size() - LinesInScreen;
+ mEx = (Uint32) ( mCmdLog.size() - LinesInScreen );
else
mEx = 0;
mTempY = -mCurHeight;
@@ -110,7 +110,7 @@ void cConsole::Draw() {
eeFloat CurY;
mCon.ConMin = mEx;
- mCon.ConMax = mCmdLog.size() - 1;
+ mCon.ConMax = (eeInt)mCmdLog.size() - 1;
mFont->Color( eeColorA ( mFontColor.R(), mFontColor.G(), mFontColor.B(), static_cast(mA) ) );
@@ -171,7 +171,7 @@ void cConsole::ProcessLine() {
std::vector < std::wstring > params = SplitString( wstr, L' ' );
mLastCommands.push_back( wstr );
- mLastLogPos = mLastCommands.size();
+ mLastLogPos = (eeInt)mLastCommands.size();
if ( mLastCommands.size() > 20 )
mLastCommands.pop_front();
@@ -312,7 +312,7 @@ void cConsole::PrintCommandsStartingWith( const std::wstring& start ) {
} else if ( cmds.size() ) {
mTBuf.Buffer( cmds.front() );
- mTBuf.CurPos( cmds.front().size() );
+ mTBuf.CurPos( (Uint32)cmds.front().size() );
}
}
@@ -334,7 +334,7 @@ void cConsole::PrivInputCallback( EE_Event* Event ) {
std::wstring part1 = mTBuf.Buffer().substr( 0, mTBuf.CurPos() );
std::wstring part2 = mTBuf.Buffer().substr( mTBuf.CurPos(), mTBuf.Buffer().size()-mTBuf.CurPos() );
mTBuf.Buffer( part1 + tStr + part2 );
- mTBuf.CurPos( part1.size() );
+ mTBuf.CurPos( (Uint32)part1.size() );
} else {
std::wstring Str = mTBuf.Buffer();
mTBuf.Buffer( Str + tStr );
@@ -351,11 +351,11 @@ void cConsole::PrivInputCallback( EE_Event* Event ) {
if ( Event->key.keysym.sym == SDLK_UP && mLastLogPos > 0 )
mLastLogPos--;
- if ( Event->key.keysym.sym == SDLK_DOWN && mLastLogPos < static_cast( mLastCommands.size() ) )
+ if ( Event->key.keysym.sym == SDLK_DOWN && mLastLogPos < static_cast( mLastCommands.size() ) )
mLastLogPos++;
if ( Event->key.keysym.sym == SDLK_UP || Event->key.keysym.sym == SDLK_DOWN ) {
- if ( mLastLogPos == static_cast( mLastCommands.size() ) ) {
+ if ( mLastLogPos == static_cast( mLastCommands.size() ) ) {
mTBuf.Buffer( L"" );
} else {
mTBuf.Buffer( mLastCommands[mLastLogPos] );
diff --git a/src/graphics/cconsole.hpp b/src/graphics/cconsole.hpp
index df86e464a..9e8330d66 100755
--- a/src/graphics/cconsole.hpp
+++ b/src/graphics/cconsole.hpp
@@ -127,7 +127,7 @@ class EE_API cConsole{
std::deque < std::wstring > mCmdLog;
std::deque < std::wstring > mLastCommands;
- Int16 mLastLogPos;
+ eeInt mLastLogPos;
bool mEnabled, mVisible, mFadeIn, mFadeOut, mExpand, mFading, mShowFps;
eeRGBA mConColor, mConLineColor, mFontColor, mFontLineColor;
diff --git a/src/graphics/cparticlesystem.cpp b/src/graphics/cparticlesystem.cpp
index cb4f71efb..b4c3c2a76 100755
--- a/src/graphics/cparticlesystem.cpp
+++ b/src/graphics/cparticlesystem.cpp
@@ -57,7 +57,7 @@ void cParticleSystem::Create(const EE_PARTICLE_EFFECT& Effect, const Uint32& Num
}
void cParticleSystem::Begin() {
- mPLeft = mParticle.size();
+ mPLeft = (Uint32)mParticle.size();
if ( mParticle.max_size() > mParticle.size() )
mParticle.resize( mPCount );
@@ -245,7 +245,7 @@ void cParticleSystem::Draw() {
glColorPointer( 4, GL_FLOAT, sizeof(cParticle), reinterpret_cast( &mParticle[0] ) + sizeof(eeFloat) * 2 );
glVertexPointer( 2, GL_FLOAT, sizeof(cParticle), reinterpret_cast( &mParticle[0] ) );
- glDrawArrays( GL_POINTS, 0, mParticle.size() );
+ glDrawArrays( GL_POINTS, 0, (GLsizei)mParticle.size() );
glDisable( GL_POINT_SPRITE_ARB );
} else {
diff --git a/src/graphics/cshape.cpp b/src/graphics/cshape.cpp
index da85a5bce..af0503150 100644
--- a/src/graphics/cshape.cpp
+++ b/src/graphics/cshape.cpp
@@ -104,7 +104,7 @@ void cShape::Name( const std::string& name ) {
mId = MakeHash( mName );
}
-const Uint32 cShape::Texture() {
+const Uint32& cShape::Texture() {
return mTexId;
}
@@ -113,7 +113,7 @@ void cShape::Texture( const Uint32& TexId ) {
mTexture = cTextureFactory::instance()->GetTexture( TexId );
}
-eeRecti cShape::SrcRect() const {
+const eeRecti& cShape::SrcRect() const {
return mSrcRect;
}
@@ -127,7 +127,7 @@ void cShape::SrcRect( const eeRecti& Rect ) {
CacheAlphaMask();
}
-const eeFloat cShape::DestWidth() const {
+const eeFloat& cShape::DestWidth() const {
return mDestWidth;
}
@@ -135,7 +135,7 @@ void cShape::DestWidth( const eeFloat& width ) {
mDestWidth = width;
}
-const eeFloat cShape::DestHeight() const {
+const eeFloat& cShape::DestHeight() const {
return mDestHeight;
}
@@ -143,7 +143,7 @@ void cShape::DestHeight( const eeFloat& height ) {
mDestHeight = height;
}
-const eeFloat cShape::OffsetX() const {
+const eeFloat& cShape::OffsetX() const {
return mOffSetX;
}
@@ -151,7 +151,7 @@ void cShape::OffsetX( const eeFloat& offsetx ) {
mOffSetX = offsetx;
}
-const eeFloat cShape::OffsetY() const {
+const eeFloat& cShape::OffsetY() const {
return mOffSetY;
}
diff --git a/src/graphics/cshape.hpp b/src/graphics/cshape.hpp
index 8c909380c..ec013d006 100644
--- a/src/graphics/cshape.hpp
+++ b/src/graphics/cshape.hpp
@@ -27,27 +27,27 @@ class EE_API cShape {
void Name( const std::string& name );
- const Uint32 Texture();
+ const Uint32& Texture();
void Texture( const Uint32& TexId );
- eeRecti SrcRect() const;
+ const eeRecti& SrcRect() const;
void SrcRect( const eeRecti& Rect );
- const eeFloat DestWidth() const;
+ const eeFloat& DestWidth() const;
void DestWidth( const eeFloat& width );
- const eeFloat DestHeight() const;
+ const eeFloat& DestHeight() const;
void DestHeight( const eeFloat& height );
- const eeFloat OffsetX() const;
+ const eeFloat& OffsetX() const;
void OffsetX( const eeFloat& offsetx );
- const eeFloat OffsetY() const;
+ const eeFloat& OffsetY() const;
void OffsetY( const eeFloat& offsety );
diff --git a/src/graphics/csprite.cpp b/src/graphics/csprite.cpp
index c9dd0d1cf..e2991f045 100755
--- a/src/graphics/csprite.cpp
+++ b/src/graphics/csprite.cpp
@@ -171,7 +171,7 @@ Uint32 cSprite::GetTexture(const eeUint& FrameNum, const eeUint& SubFrameNum) {
eeUint cSprite::FramePos() {
Frame.push_back( cFrame() );
- return Frame.size() - 1;
+ return (eeUint)Frame.size() - 1;
}
bool cSprite::CreateStatic(const Uint32& TexId, const eeFloat& DestWidth, const eeFloat& DestHeight, const eeFloat& offSetX, const eeFloat& offSetY, const eeRecti& TexSector) {
@@ -260,7 +260,7 @@ bool cSprite::AddSubFrame(const Uint32& TexId, const eeUint& NumFrame, const eeU
void cSprite::Animate( const eeFloat& ElapsedTime ) {
if ( mAnimated && mAutoAnim && !mAnimPaused ) {
- eeUint Size = Frame.size() - 1;
+ eeUint Size = (eeUint)Frame.size() - 1;
eeFloat Elapsed = ( ElapsedTime != -99999.f ) ? (eeFloat)ElapsedTime : (eeFloat)cEngine::instance()->Elapsed();
if ( mRepeations == 0 )
@@ -321,13 +321,13 @@ eeUint cSprite::GetEndFrame() {
if ( mReverseAnim ) {
return 0;
} else {
- return Frame.size() - 1;
+ return (eeUint)Frame.size() - 1;
}
}
void cSprite::SetReverseFromStart() {
mReverseAnim = true;
- eeUint Size = Frame.size() - 1;
+ eeUint Size = (eeUint)Frame.size() - 1;
mFrameData.fCurrentFrame = (eeFloat)Size;
mFrameData.CurrentFrame = Size;
@@ -381,7 +381,7 @@ eeUint cSprite::GetSubFrame( const eeUint& SubFrame ) {
return SFN;
}
-const eeFloat cSprite::OffSetX() {
+eeFloat cSprite::OffSetX() {
cShape* S = GetCurrentShape();
if ( S != NULL )
@@ -397,7 +397,7 @@ void cSprite::OffSetX( const eeFloat& offsetx ) {
S->OffsetX( offsetx );
}
-const eeFloat cSprite::OffSetY() {
+eeFloat cSprite::OffSetY() {
cShape* S = GetCurrentShape();
if ( S != NULL )
diff --git a/src/graphics/csprite.hpp b/src/graphics/csprite.hpp
index 1a3ff4cf9..79d9d80af 100755
--- a/src/graphics/csprite.hpp
+++ b/src/graphics/csprite.hpp
@@ -14,7 +14,7 @@ namespace EE { namespace Graphics {
class EE_API cSprite {
public:
cSprite();
-
+
~cSprite();
/** Set the x axis position */
@@ -40,7 +40,7 @@ class EE_API cSprite {
/** Get the Scale for the rendered sprite */
eeFloat Scale() const { return mScale; }
-
+
/** Set the Frame Number Sprite Width
* @param FrameNum If the Frame Number is 0 use the Current Frame Number
* @param SubFrame If the Sub Frame Number is 0 use the Current Sub Frame Number
@@ -55,22 +55,22 @@ class EE_API cSprite {
* @param SubFrame If the Sub Frame Number is 0 use the Current Sub Frame Number
*/
void Height( const eeFloat& Height, const eeUint& FrameNum, const eeUint& SubFrame );
-
+
/** Get the Frame Number Sprite Height */
eeFloat Height( const eeUint& FrameNum = 0, const eeUint& SubFrame = 0 );
-
+
/** Set the sprite animation speed */
void AnimSpeed( const eeFloat& AnimSpeed) { mAnimSpeed = AnimSpeed; }
-
+
/** Get the sprite animation speed */
eeFloat AnimSpeed() const { return mAnimSpeed; }
-
+
/** @return If the animation is paused */
bool AnimPause() const { return mAnimPaused; }
-
+
/** Set the animation paused or not */
void AnimPause( const bool& Pause ) { mAnimPaused = Pause; }
-
+
/** Set the sprite color */
void Color( const eeRGBA& Color) { mColor = Color; };
@@ -82,10 +82,10 @@ class EE_API cSprite {
mAlpha = Alpha;
mColor.Alpha = (Uint8)mAlpha;
}
-
+
/** Get the sprite Color Alpha */
eeFloat Alpha() const { return mAlpha; }
-
+
/** Get if the sprite it's scaled from the center */
bool ScaleCentered() const { return mScaleCentered; }
@@ -102,7 +102,7 @@ class EE_API cSprite {
* @return The eeFloat fpoint of the current frame, the exact position of the interpolation.
*/
eeFloat ExactCurrentFrame() const { return mFrameData.fCurrentFrame; }
-
+
/** Set the exact current FrameData */
void ExactCurrentFrame( const eeFloat& CurrentFrame ) { mFrameData.fCurrentFrame = CurrentFrame; }
@@ -120,25 +120,25 @@ class EE_API cSprite {
/** Reset the sprite as a new one. */
void Reset();
-
+
/** Get the current Source RECT of the sprite. The texture coordinates of the sprite. */
eeRecti SprSrcRect();
-
+
/** Get the current Destination RECT of the sprite. The sprite coordinates on the screen. (the AABB, axis-aligned bounding box) */
eeRectf SprDestRectf();
-
+
/** Get the current Destination RECT of the sprite. The sprite coordinates on the screen (the AABB, axis-aligned bounding box). */
eeRecti SprDestRECT();
/** @return The AABB (axis-aligned bounding box) */
eeAABB GetAABB();
-
+
/** Update the sprite position */
void UpdatePos( const eeFloat& x, const eeFloat& y );
-
+
/** Update the sprite position from a Vector */
void UpdatePos( const eeVector2f& NewPos );
-
+
/** Update the sprite size of a frame number */
void UpdateSize( const eeFloat& Width, const eeFloat& Height, const eeUint& FrameNum = 0 );
@@ -242,37 +242,37 @@ class EE_API cSprite {
/** Set if the class autoanimate the sprite ( default it's true ) */
void SetAutoAnimate( const bool& Autoanim );
-
+
/** @return The four vertex position of the Sprite */
eeQuad2f GetQuad();
-
+
/** @return The OffSetX of the current frame */
- const eeFloat OffSetX();
-
+ eeFloat OffSetX();
+
/** Set the OffSetX of the current frame */
void OffSetX( const eeFloat& offsetx );
-
+
/** @return The OffSetY of the current frame */
- const eeFloat OffSetY();
-
+ eeFloat OffSetY();
+
/** Set the OffSetY of the current frame */
void OffSetY( const eeFloat& offsety );
-
+
/** Set the OffSet of the current frame */
void OffSet( const eeVector2f& offset );
-
+
/** Reverse the animation from last frame to first frame. */
void ReverseAnim( const bool& Reverse ) { mReverseAnim = Reverse; }
-
+
/** @return If the animation is reversed */
bool ReverseAnim() const { return mReverseAnim; }
-
+
/** @return The current last frame */
eeUint GetEndFrame();
-
+
/** @return The number of frames */
- eeUint GetNumFrames() { return Frame.size(); }
-
+ eeUint GetNumFrames() { return (eeUint)Frame.size(); }
+
/** Will set Reverse active and set the first frame as the last frame */
void SetReverseFromStart();
@@ -289,32 +289,32 @@ class EE_API cSprite {
bool mAutoAnim, mAnimated, mScaleCentered;
EE_RENDERALPHAS mBlend;
EE_RENDERTYPE mEffect;
-
+
eeRGBA mColor, mColor0, mColor1, mColor2, mColor3;
Uint8 mAlpha;
Int16 mRepeations; //!< Number of repetions of the animation, default -1 that equals to loop.
bool mReverseAnim;
bool mAnimPaused;
-
+
struct FrameData {
eeUint CurrentFrame;
eeFloat fCurrentFrame;
eeUint CurrentSubFrame;
eeUint SubFrames;
} mFrameData;
-
+
class cFrame {
public:
std::vector Spr;
};
std::vector Frame;
-
+
eeUint FramePos();
void ClearFrame();
void Animate( const eeFloat& ElapsedTime = -99999.f );
-
+
eeVector2f GetRotationCenter( const eeRectf& DestRECT );
-
+
eeUint GetFrame( const eeUint& FrameNum );
eeUint GetSubFrame( const eeUint& SubFrame );
};
diff --git a/src/graphics/ctexturefactory.cpp b/src/graphics/ctexturefactory.cpp
index c51714c7c..ba19300a5 100755
--- a/src/graphics/ctexturefactory.cpp
+++ b/src/graphics/ctexturefactory.cpp
@@ -97,7 +97,7 @@ Uint32 cTextureFactory::FindFreeSlot() {
mTextures.push_back( NULL );
- return mTextures.size() - 1;
+ return (Uint32)mTextures.size() - 1;
}
void cTextureFactory::Bind( const cTexture* Tex ) {
@@ -294,7 +294,7 @@ cTexture * cTextureFactory::GetByName( const std::string& Name ) {
cTexture * cTextureFactory::GetByHash( const Uint32& Hash ) {
cTexture * tTex = NULL;
- for ( Uint32 i = mTextures.size() - 1; i > 0; i-- ) {
+ for ( Uint32 i = (Uint32)mTextures.size() - 1; i > 0; i-- ) {
tTex = mTextures[ i ];
if ( NULL != tTex && tTex->Id() == Hash )
diff --git a/src/graphics/ctexturefactory.hpp b/src/graphics/ctexturefactory.hpp
index ce599f908..32e6b8da2 100755
--- a/src/graphics/ctexturefactory.hpp
+++ b/src/graphics/ctexturefactory.hpp
@@ -113,7 +113,7 @@ class EE_API cTextureFactory: public cSingleton, protected cMut
void SetCurrentTexture( const GLint& TexId );
/** Returns the number of textures loaded */
- Uint32 GetNumTextures() const { return mTextures.size(); }
+ Uint32 GetNumTextures() const { return (Uint32)mTextures.size(); }
/** Set the Blend Function
* @param blend The Blend Mode
diff --git a/src/graphics/ctexturefont.cpp b/src/graphics/ctexturefont.cpp
index 9393cadd6..be1481545 100755
--- a/src/graphics/ctexturefont.cpp
+++ b/src/graphics/ctexturefont.cpp
@@ -27,8 +27,8 @@ bool cTextureFont::Load( const Uint32& TexId, const eeUint& StartChar, const eeU
mtX = ( 1 / static_cast( mTexColumns ) );
mtY = ( 1 / static_cast( mTexRows ) );
- mFWidth = ( Tex->Width() / mTexColumns );
- mFHeight = ( Tex->Height() / mTexRows );
+ mFWidth = (eeFloat)( Tex->Width() / mTexColumns );
+ mFHeight = (eeFloat)( Tex->Height() / mTexRows );
mHeight = mSize = (eeUint)mFHeight;
mVerticalDraw = VerticalDraw;
@@ -130,7 +130,7 @@ bool cTextureFont::Load( const Uint32& TexId, const std::string& CoordinatesDatP
FileGet( CoordinatesDatPath, TmpData );
- return LoadFromMemory( TexId, reinterpret_cast ( &TmpData[0] ), TmpData.size(), VerticalDraw );
+ return LoadFromMemory( TexId, reinterpret_cast ( &TmpData[0] ), (Uint32)TmpData.size(), VerticalDraw );
}
return false;
@@ -140,7 +140,7 @@ bool cTextureFont::LoadFromPack( const Uint32& TexId, cPack* Pack, const std::st
std::vector TmpData;
if ( Pack->IsOpen() && Pack->ExtractFileToMemory( FilePackPath, TmpData ) )
- return LoadFromMemory( TexId, reinterpret_cast (&TmpData[0]), TmpData.size(), VerticalDraw );
+ return LoadFromMemory( TexId, reinterpret_cast (&TmpData[0]), (Uint32)TmpData.size(), VerticalDraw );
return false;
}
diff --git a/src/graphics/ctexturefontloader.hpp b/src/graphics/ctexturefontloader.hpp
index 405965ef4..feaea6e2d 100644
--- a/src/graphics/ctexturefontloader.hpp
+++ b/src/graphics/ctexturefontloader.hpp
@@ -14,7 +14,7 @@ namespace EE { namespace Graphics {
#define TEF_LT_PACK (3)
#define TEF_LT_TEX (4)
-class cTextureFontLoader : public cObjectLoader {
+class EE_API cTextureFontLoader : public cObjectLoader {
public:
cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const eeUint& StartChar = 0, const eeUint& Spacing = 0, const bool& VerticalDraw = false, const eeUint& TexColumns = 16, const eeUint& TexRows = 16, const Uint16& NumChars = 256 );
diff --git a/src/graphics/ctextureloader.cpp b/src/graphics/ctextureloader.cpp
index d84cd2cca..3dd8c89e9 100644
--- a/src/graphics/ctextureloader.cpp
+++ b/src/graphics/ctextureloader.cpp
@@ -156,7 +156,7 @@ void cTextureLoader::LoadFromPack() {
if ( NULL != mPack && mPack->IsOpen() && mPack->ExtractFileToMemory( mFilepath, TmpData ) ) {
mImagePtr = reinterpret_cast (&TmpData[0]);
- mSize = TmpData.size();
+ mSize = (Uint32)TmpData.size();
LoadFromMemory();
}
diff --git a/src/graphics/ctextureloader.hpp b/src/graphics/ctextureloader.hpp
index 9add6e7d4..fed8e1c84 100644
--- a/src/graphics/ctextureloader.hpp
+++ b/src/graphics/ctextureloader.hpp
@@ -11,7 +11,7 @@ namespace EE { namespace Graphics {
#define TEX_LT_PACK (3)
#define TEX_LT_PIXELS (4)
-class cTextureLoader : public cObjectLoader {
+class EE_API cTextureLoader : public cObjectLoader {
public:
cTextureLoader( const std::string& Filepath, const bool& Mipmap = false, const eeRGB& ColorKey = eeRGB(true), const EE_CLAMP_MODE& ClampMode = EE_CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false );
diff --git a/src/graphics/cttffont.cpp b/src/graphics/cttffont.cpp
index 7f1b3d485..97260cbc0 100755
--- a/src/graphics/cttffont.cpp
+++ b/src/graphics/cttffont.cpp
@@ -23,7 +23,7 @@ bool cTTFFont::LoadFromPack( cPack* Pack, const std::string& FilePackPath, const
std::vector TmpData;
if ( Pack->IsOpen() && Pack->ExtractFileToMemory( FilePackPath, TmpData ) )
- return LoadFromMemory( reinterpret_cast (&TmpData[0]), TmpData.size(), Size, Style, VerticalDraw, NumCharsToGen, FontColor, OutlineSize, OutlineColor );
+ return LoadFromMemory( reinterpret_cast (&TmpData[0]), (eeUint)TmpData.size(), Size, Style, VerticalDraw, NumCharsToGen, FontColor, OutlineSize, OutlineColor );
TmpData.clear();
diff --git a/src/graphics/cttffontloader.hpp b/src/graphics/cttffontloader.hpp
index 8236f7698..ae241f94a 100644
--- a/src/graphics/cttffontloader.hpp
+++ b/src/graphics/cttffontloader.hpp
@@ -12,7 +12,7 @@ namespace EE { namespace Graphics {
#define TTF_LT_MEM (2)
#define TTF_LT_PACK (3)
-class cTTFFontLoader : public cObjectLoader {
+class EE_API cTTFFontLoader : public cObjectLoader {
public:
cTTFFontLoader( const std::string& FontName, const std::string& Filepath, const eeUint& Size, EE_TTF_FONTSTYLE Style = EE_TTF_STYLE_NORMAL, const bool& VerticalDraw = false, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0) );
diff --git a/src/helper/SOIL/SOIL.c b/src/helper/SOIL/SOIL.c
index 783c6e321..2d326cea7 100755
--- a/src/helper/SOIL/SOIL.c
+++ b/src/helper/SOIL/SOIL.c
@@ -998,6 +998,7 @@ unsigned int
int max_supported_size;
int iwidth = *width;
int iheight = *height;
+ int needCopy;
/* how large of a texture can this OpenGL implementation handle? */
/* texture_check_size_enum will be GL_MAX_TEXTURE_SIZE or SOIL_MAX_CUBE_MAP_TEXTURE_SIZE */
@@ -1034,7 +1035,7 @@ unsigned int
}
}
- int needCopy = ( flags & SOIL_FLAG_INVERT_Y ) || ( flags & SOIL_FLAG_NTSC_SAFE_RGB ) || ( flags & SOIL_FLAG_MULTIPLY_ALPHA ) || ( ( flags & SOIL_FLAG_POWER_OF_TWO ) || ( flags & SOIL_FLAG_MIPMAPS ) || ( iwidth > max_supported_size ) || ( iheight > max_supported_size ) ) || ( flags & SOIL_FLAG_CoCg_Y ) || ( flags & SOIL_FLAG_COMPRESS_TO_DXT );
+ needCopy = ( ( flags & SOIL_FLAG_INVERT_Y ) || ( flags & SOIL_FLAG_NTSC_SAFE_RGB ) || ( flags & SOIL_FLAG_MULTIPLY_ALPHA ) || ( ( flags & SOIL_FLAG_POWER_OF_TWO ) || ( flags & SOIL_FLAG_MIPMAPS ) || ( iwidth > max_supported_size ) || ( iheight > max_supported_size ) ) || ( flags & SOIL_FLAG_CoCg_Y ) || ( flags & SOIL_FLAG_COMPRESS_TO_DXT ) );
/* create a copy the image data
* only if needed
@@ -1892,7 +1893,7 @@ unsigned int SOIL_direct_load_DDS(
}
/* now try to do the loading */
tex_ID = SOIL_direct_load_DDS_from_memory(
- (const unsigned char *const)buffer, buffer_length,
+ (const unsigned char *const)buffer, (int)buffer_length,
reuse_texture_ID, flags, loading_as_cubemap );
SOIL_free_image_data( buffer );
return tex_ID;
diff --git a/src/helper/SOIL/stb_image.c b/src/helper/SOIL/stb_image.c
index 6e9df7370..6907820a2 100644
--- a/src/helper/SOIL/stb_image.c
+++ b/src/helper/SOIL/stb_image.c
@@ -49,19 +49,19 @@
============================ Contributors =========================
-
+
Image formats Optimizations & bugfixes
Sean Barrett (jpeg, png, bmp) Fabian "ryg" Giesen
- Nicolas Schulz (hdr, psd)
- Jonathan Dummer (tga) Bug fixes & warning fixes
- Jean-Marc Lienher (gif) Marc LeBlanc
- Tom Seddon (pic) Christpher Lloyd
- Thatcher Ulrich (psd) Dave Moore
- Won Chun
- the Horde3D community
- Extensions, features Janez Zemva
- Jetro Lauha (stbi_info) Jonathan Blow
- James "moose2000" Brown (iPhone PNG) Laurent Gomila
+ Nicolas Schulz (hdr, psd)
+ Jonathan Dummer (tga) Bug fixes & warning fixes
+ Jean-Marc Lienher (gif) Marc LeBlanc
+ Tom Seddon (pic) Christpher Lloyd
+ Thatcher Ulrich (psd) Dave Moore
+ Won Chun
+ the Horde3D community
+ Extensions, features Janez Zemva
+ Jetro Lauha (stbi_info) Jonathan Blow
+ James "moose2000" Brown (iPhone PNG) Laurent Gomila
If your name should be here but isn't, let Sean know.
@@ -303,7 +303,7 @@ unsigned char *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_c
#ifndef STBI_NO_DDS
if (stbi_dds_test_file(f)) return stbi_dds_load_from_file(f,x,y,comp,req_comp);
#endif
-
+
#ifndef STBI_NO_HDR
if (stbi_hdr_test_file(f)) {
float *hdr = stbi_hdr_load_from_file(f, x,y,comp,req_comp);
@@ -333,7 +333,7 @@ unsigned char *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int
#ifndef STBI_NO_DDS
if (stbi_dds_test_memory(buffer,len)) return stbi_dds_load_from_memory(buffer,len,x,y,comp,req_comp);
#endif
-
+
#ifndef STBI_NO_HDR
if (stbi_hdr_test_memory(buffer, len)) {
float *hdr = stbi_hdr_load_from_memory(buffer, len,x,y,comp,req_comp);
@@ -448,7 +448,7 @@ enum
{
SCAN_load=0,
SCAN_type,
- SCAN_header,
+ SCAN_header
};
typedef struct
@@ -489,7 +489,7 @@ static void start_mem(stbi *s, uint8 const *buffer, int len)
#ifndef STBI_NO_STDIO
static void refill_buffer(stbi *s)
{
- int n = fread(s->buffer_start, 1, s->buflen, s->img_file);
+ int n = (int)fread(s->buffer_start, 1, s->buflen, s->img_file);
if (n == 0) {
s->from_file = 0;
s->img_buffer = s->img_buffer_end-1;
@@ -524,7 +524,7 @@ __forceinline static int at_eof(stbi *s)
if (s->from_file == 0) return 1;
}
#endif
- return s->img_buffer >= s->img_buffer_end;
+ return s->img_buffer >= s->img_buffer_end;
}
__forceinline static uint8 get8u(stbi *s)
@@ -536,7 +536,7 @@ static void skip(stbi *s, int n)
{
#ifndef STBI_NO_STDIO
if (s->img_file) {
- int blen = s->img_buffer_end - s->img_buffer;
+ int blen = (int)( s->img_buffer_end - s->img_buffer );
if (blen < n) {
s->img_buffer = s->img_buffer_end;
fseek(s->img_file, n - blen, SEEK_CUR);
@@ -551,7 +551,7 @@ static int getn(stbi *s, stbi_uc *buffer, int n)
{
#ifndef STBI_NO_STDIO
if (s->img_file) {
- int blen = s->img_buffer_end - s->img_buffer;
+ int blen = (int)( s->img_buffer_end - s->img_buffer );
if (blen < n) {
int res;
memcpy(buffer, s->img_buffer, blen);
@@ -1578,7 +1578,7 @@ typedef struct
resample_row_func resample;
uint8 *line0,*line1;
int hs,vs; // expansion factor in each axis
- int w_lores; // horizontal pixels pre-expansion
+ int w_lores; // horizontal pixels pre-expansion
int ystep; // how far through vertical expansion we are
int ypos; // which pre-expansion row we're on
} stbi_resample;
@@ -1793,7 +1793,7 @@ typedef struct
int maxcode[17];
uint16 firstsymbol[16];
uint8 size[288];
- uint16 value[288];
+ uint16 value[288];
} zhuffman;
__forceinline static int bitreverse16(int n)
@@ -1821,7 +1821,7 @@ static int zbuild_huffman(zhuffman *z, uint8 *sizelist, int num)
// DEFLATE spec for generating codes
memset(sizes, 0, sizeof(sizes));
memset(z->fast, 255, sizeof(z->fast));
- for (i=0; i < num; ++i)
+ for (i=0; i < num; ++i)
++sizes[sizelist[i]];
sizes[0] = 0;
for (i=1; i < 16; ++i)
@@ -1900,7 +1900,7 @@ __forceinline static unsigned int zreceive(zbuf *z, int n)
k = z->code_buffer & ((1 << n) - 1);
z->code_buffer >>= n;
z->num_bits -= n;
- return k;
+ return k;
}
__forceinline static int zhuffman_decode(zbuf *a, zhuffman *z)
@@ -1952,7 +1952,7 @@ static int length_base[31] = {
15,17,19,23,27,31,35,43,51,59,
67,83,99,115,131,163,195,227,258,0,0 };
-static int length_extra[31]=
+static int length_extra[31]=
{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 };
static int dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,
@@ -2252,7 +2252,7 @@ typedef struct
enum {
F_none=0, F_sub=1, F_up=2, F_avg=3, F_paeth=4,
- F_avg_first, F_paeth_first,
+ F_avg_first, F_paeth_first
};
static uint8 first_row_filter[5] =
@@ -2491,7 +2491,7 @@ static void stbi_de_iphone(png *z)
} else {
p[0] = p[2];
p[2] = t;
- }
+ }
p += 4;
}
} else {
@@ -3009,7 +3009,7 @@ static stbi_uc *bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp)
out[z++] = (uint8) shiftsigned(v & mg, gshift, gcount);
out[z++] = (uint8) shiftsigned(v & mb, bshift, bcount);
a = (ma ? shiftsigned(v & ma, ashift, acount) : 255);
- if (target == 4) out[z++] = (uint8) a;
+ if (target == 4) out[z++] = (uint8) a;
}
}
skip(s, pad);
@@ -3455,7 +3455,7 @@ static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
// Read the rows and columns of the image.
h = get32(s);
w = get32(s);
-
+
// Make sure the depth is 8 bits.
if (get16(s) != 8)
return epuc("unsupported bit depth", "PSD bit depth is not 8 bit");
@@ -3497,7 +3497,7 @@ static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
// Initialize the data to zero.
//memset( out, 0, pixelCount * 4 );
-
+
// Finally, the image data.
if (compression) {
// RLE as used by .PSD and .TIFF
@@ -3515,7 +3515,7 @@ static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
// Read the RLE data by channel.
for (channel = 0; channel < 4; channel++) {
uint8 *p;
-
+
p = out+channel;
if (channel >= channelCount) {
// Fill this channel with default data.
@@ -3553,15 +3553,15 @@ static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
}
}
}
-
+
} else {
// We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...)
// where each channel consists of an 8-bit value for each pixel in the image.
-
+
// Read the data by channel.
for (channel = 0; channel < 4; channel++) {
uint8 *p;
-
+
p = out + channel;
if (channel > channelCount) {
// Fill this channel with default data.
@@ -3582,7 +3582,7 @@ static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
if (comp) *comp = channelCount;
*y = h;
*x = w;
-
+
return out;
}
@@ -3923,7 +3923,7 @@ static void stbi_gif_parse_colortable(stbi *s, uint8 pal[256][4], int num_entrie
pal[i][1] = get8u(s);
pal[i][0] = get8u(s);
pal[i][3] = transp ? 0 : 255;
- }
+ }
}
static int stbi_gif_header(stbi *s, stbi_gif *g, int *comp, int is_info)
@@ -3935,7 +3935,7 @@ static int stbi_gif_header(stbi *s, stbi_gif *g, int *comp, int is_info)
version = get8u(s);
if (version != '7' && version != '9') return e("not GIF", "Corrupt GIF");
if (get8(s) != 'a') return e("not GIF", "Corrupt GIF");
-
+
failure_reason = "";
g->w = get16le(s);
g->h = get16le(s);
@@ -3956,7 +3956,7 @@ static int stbi_gif_header(stbi *s, stbi_gif *g, int *comp, int is_info)
static int stbi_gif_info_raw(stbi *s, int *x, int *y, int *comp)
{
- stbi_gif g;
+ stbi_gif g;
if (!stbi_gif_header(s, &g, comp, 1)) return 0;
if (x) *x = g.w;
if (y) *y = g.h;
@@ -3973,7 +3973,7 @@ static void stbi_out_gif_code(stbi_gif *g, uint16 code)
stbi_out_gif_code(g, g->codes[code].prefix);
if (g->cur_y >= g->max_y) return;
-
+
p = &g->out[g->cur_x + g->cur_y];
c = &g->color_table[g->codes[code].suffix * 4];
@@ -4027,7 +4027,7 @@ static uint8 *stbi_process_gif_raster(stbi *s, stbi_gif *g)
if (valid_bits < codesize) {
if (len == 0) {
len = get8(s); // start new block
- if (len == 0)
+ if (len == 0)
return g->out;
}
--len;
@@ -4072,7 +4072,7 @@ static uint8 *stbi_process_gif_raster(stbi *s, stbi_gif *g)
} else {
return epuc("illegal code in raster", "Corrupt GIF");
}
- }
+ }
}
}
@@ -4110,7 +4110,7 @@ static uint8 *stbi_gif_load_next(stbi *s, stbi_gif *g, int *comp, int req_comp)
memcpy(g->out, old_out, g->w*g->h*4);
}
}
-
+
for (;;) {
switch (get8(s)) {
case 0x2C: /* Image Descriptor */
@@ -4145,16 +4145,16 @@ static uint8 *stbi_gif_load_next(stbi *s, stbi_gif *g, int *comp, int req_comp)
if (g->lflags & 0x80) {
stbi_gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1);
- g->color_table = (uint8 *) g->lpal;
+ g->color_table = (uint8 *) g->lpal;
} else if (g->flags & 0x80) {
for (i=0; i < 256; ++i) // @OPTIMIZE: reset only the previous transparent
- g->pal[i][3] = 255;
+ g->pal[i][3] = 255;
if (g->transparent >= 0 && (g->eflags & 0x01))
g->pal[g->transparent][3] = 0;
g->color_table = (uint8 *) g->pal;
} else
return epuc("missing color table", "Corrupt GIF");
-
+
o = stbi_process_gif_raster(s, g);
if (o == NULL) return NULL;
@@ -4368,7 +4368,7 @@ static float *hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp)
// Check identifier
if (strcmp(hdr_gettoken(s,buffer), "#?RADIANCE") != 0)
return epf("not HDR", "Corrupt HDR image");
-
+
// Parse header
for(;;) {
token = hdr_gettoken(s,buffer);
@@ -4436,7 +4436,7 @@ static float *hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp)
len |= get8(s);
if (len != width) { free(hdr_data); free(scanline); return epf("invalid decoded scanline length", "corrupt HDR"); }
if (scanline == NULL) scanline = (stbi_uc *) malloc(width * 4);
-
+
for (k = 0; k < 4; ++k) {
i = 0;
while (i < width) {
diff --git a/src/helper/SOIL/stb_image.h b/src/helper/SOIL/stb_image.h
index 44215ef61..2d635178f 100644
--- a/src/helper/SOIL/stb_image.h
+++ b/src/helper/SOIL/stb_image.h
@@ -17,7 +17,7 @@
// Basic usage (see HDR discussion below):
// int x,y,n;
// unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
-// // ... process data if not NULL ...
+// // ... process data if not NULL ...
// // ... x = width, y = height, n = # 8-bit components per pixel ...
// // ... replace '0' with '1'..'4' to force that many components per pixel
// stbi_image_free(data)
@@ -92,7 +92,7 @@
// (linear) floats to preserve the full dynamic range:
//
// float *data = stbi_loadf(filename, &x, &y, &n, 0);
-//
+//
// If you load LDR images through this interface, those images will
// be promoted to floating point values, run through the inverse of
// constants corresponding to the above:
@@ -120,7 +120,7 @@ enum
STBI_grey = 1,
STBI_grey_alpha = 2,
STBI_rgb = 3,
- STBI_rgb_alpha = 4,
+ STBI_rgb_alpha = 4
};
typedef unsigned char stbi_uc;
@@ -157,7 +157,7 @@ extern stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y,
// get a VERY brief reason for failure
// NOT THREADSAFE
-extern const char *stbi_failure_reason (void);
+extern const char *stbi_failure_reason (void);
// free the loaded image -- this is just free()
extern void stbi_image_free (void *retval_from_stbi_load);
diff --git a/src/helper/SOIL/stb_image_write.c b/src/helper/SOIL/stb_image_write.c
index 14973a448..f8b198195 100644
--- a/src/helper/SOIL/stb_image_write.c
+++ b/src/helper/SOIL/stb_image_write.c
@@ -248,7 +248,7 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l
}
if (bestloc) {
- int d = data+i - bestloc; // distance back
+ int d = (int)( data+i - bestloc ); // distance back
assert(d <= 32767 && best <= 258);
for (j=0; best > lengthc[j+1]-1; ++j);
stbi__zlib_huff(j+257);
diff --git a/src/helper/haikuttf/hkfontmanager.hpp b/src/helper/haikuttf/hkfontmanager.hpp
index 51f89b6f6..efb6142e3 100644
--- a/src/helper/haikuttf/hkfontmanager.hpp
+++ b/src/helper/haikuttf/hkfontmanager.hpp
@@ -28,19 +28,19 @@ class hkFontManager {
~hkFontManager();
- int Init();
+ int Init();
- void Destroy();
+ void Destroy();
- int WasInit();
+ int WasInit();
- void CloseFont( hkFont * Font );
+ void CloseFont( hkFont * Font );
- hkFont * OpenFromMemory( const uint8_t* data, unsigned long size, int ptsize, long index = 0, unsigned int glyphCacheSize = 256 );
+ hkFont * OpenFromMemory( const uint8_t* data, unsigned long size, int ptsize, long index = 0, unsigned int glyphCacheSize = 256 );
- hkFont * OpenFromFile( const char* filename, int ptsize, long index = 0, unsigned int glyphCacheSize = 256 );
+ hkFont * OpenFromFile( const char* filename, int ptsize, long index = 0, unsigned int glyphCacheSize = 256 );
- const FT_Library Library() const { return mLibrary; }
+ FT_Library Library() const { return mLibrary; }
protected:
FT_Library mLibrary;
int mInitialized;
diff --git a/src/helper/stb_vorbis/stb_vorbis.c b/src/helper/stb_vorbis/stb_vorbis.c
index 1579cde52..80e05c07b 100755
--- a/src/helper/stb_vorbis/stb_vorbis.c
+++ b/src/helper/stb_vorbis/stb_vorbis.c
@@ -4022,7 +4022,7 @@ int stb_vorbis_decode_frame_pushdata(
while (get8_packet(f) != EOP)
if (f->eof) break;
*samples = 0;
- return f->stream - data;
+ return (int)( f->stream - data );
}
if (error == VORBIS_continued_packet_flag_invalid) {
if (f->previous_length == 0) {
@@ -4032,7 +4032,7 @@ int stb_vorbis_decode_frame_pushdata(
while (get8_packet(f) != EOP)
if (f->eof) break;
*samples = 0;
- return f->stream - data;
+ return (int)( f->stream - data );
}
}
// if we get an error while parsing, what to do?
@@ -4052,7 +4052,7 @@ int stb_vorbis_decode_frame_pushdata(
if (channels) *channels = f->channels;
*samples = len;
*output = f->outputs;
- return f->stream - data;
+ return (int)( f->stream - data );
}
stb_vorbis *stb_vorbis_open_pushdata(
@@ -4075,7 +4075,7 @@ stb_vorbis *stb_vorbis_open_pushdata(
f = vorbis_alloc(&p);
if (f) {
*f = p;
- *data_used = f->stream - data;
+ *data_used = (int)( f->stream - data );
*error = 0;
return f;
} else {
@@ -4090,7 +4090,7 @@ unsigned int stb_vorbis_get_file_offset(stb_vorbis *f)
#ifndef STB_VORBIS_NO_PUSHDATA_API
if (f->push_mode) return 0;
#endif
- if (USE_MEMORY(f)) return f->stream - f->stream_start;
+ if (USE_MEMORY(f)) return (unsigned int)( f->stream - f->stream_start );
#ifndef STB_VORBIS_NO_STDIO
return ftell(f->f) - f->f_start;
#endif
diff --git a/src/helper/zip_utils/unzip.cpp b/src/helper/zip_utils/unzip.cpp
index 5cca23a46..dd70591f2 100644
--- a/src/helper/zip_utils/unzip.cpp
+++ b/src/helper/zip_utils/unzip.cpp
@@ -11,7 +11,11 @@
#endif
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__)
#include
+#if (defined (_MSCVER) || defined (_MSC_VER))
+#define lumkdir(t) (_mkdir(t))
+#else
#define lumkdir(t) (mkdir(t))
+#endif
#else
#include
#define lumkdir(t) (mkdir(t,0755))
@@ -171,7 +175,13 @@ typedef struct tm_unz_s
// some windows<->linux portability things
#ifdef ZIP_STD
DWORD GetFilePosU(ZIPHANDLE hfout)
-{ struct stat st; fstat(fileno(hfout),&st);
+{
+ struct stat st;
+ #if (defined (_MSCVER) || defined (_MSC_VER))
+ fstat(_fileno(hfout),&st);
+ #else
+ fstat(fileno(hfout),&st);
+ #endif
if ((st.st_mode&S_IFREG)==0) return 0xFFFFFFFF;
return ftell(hfout);
}
@@ -3895,7 +3905,11 @@ ZRESULT TUnzip::Open(void *z,unsigned int len,DWORD flags)
{ if (uf!=0 || currentfile!=-1) return ZR_NOTINITED;
//
#ifdef ZIP_STD
+ #if (defined (_MSCVER) || defined (_MSC_VER))
+ _getcwd(rootdir,MAX_PATH-1);
+ #else
getcwd(rootdir,MAX_PATH-1);
+ #endif
#else
#ifdef GetCurrentDirectory
GetCurrentDirectory(MAX_PATH-1,rootdir);
@@ -4109,7 +4123,7 @@ void EnsureDirectory(const TCHAR *rootdir, const TCHAR *dir)
TCHAR cd[MAX_PATH]; *cd=0; if (rootdir!=0) _tcsncpy(cd,rootdir,MAX_PATH); cd[MAX_PATH-1]=0;
size_t len=_tcslen(cd); _tcsncpy(cd+len,dir,MAX_PATH-len); cd[MAX_PATH-1]=0;
#ifdef ZIP_STD
- if (!FileExists(cd)) lumkdir(cd);
+ if (!FileExists(cd))lumkdir(cd);
#else
if (!FileExists(cd))
{ CreateDirectory(cd,0);
diff --git a/src/helper/zip_utils/zip.cpp b/src/helper/zip_utils/zip.cpp
index 809a12ddd..ab9bec8e6 100644
--- a/src/helper/zip_utils/zip.cpp
+++ b/src/helper/zip_utils/zip.cpp
@@ -650,7 +650,13 @@ void GetNow(lutime_t *ft, WORD *dosdate, WORD *dostime)
}
DWORD GetFilePosZ(ZIPHANDLE hfout)
-{ struct stat st; fstat(fileno(hfout),&st);
+{
+ struct stat st;
+ #if (defined (_MSCVER) || defined (_MSC_VER))
+ fstat(_fileno(hfout),&st);
+ #else
+ fstat(fileno(hfout),&st);
+ #endif
if ((st.st_mode&S_IFREG)==0) return 0xFFFFFFFF;
return ftell(hfout);
}
@@ -660,7 +666,14 @@ ZRESULT GetFileInfo(FILE *hf, ulg *attr, long *size, iztimes *times, ulg *timest
// The date and time is returned in a long with the date most significant to allow
// unsigned integer comparison of absolute times. The attributes have two
// high bytes unix attr, and two low bytes a mapping of that to DOS attr.
- struct stat bhi; int res=fstat(fileno(hf),&bhi); if (res==-1) return ZR_NOFILE;
+ struct stat bhi;
+ #if (defined (_MSCVER) || defined (_MSC_VER))
+ int res=fstat(_fileno(hf),&bhi);
+ #else
+ int res=fstat(fileno(hf),&bhi);
+ #endif
+ if (res==-1) return ZR_NOFILE;
+
ulg fa=bhi.st_mode; ulg a=0;
// Zip uses the lower word for its interpretation of windows stuff
if ((fa&S_IWUSR)==0) a|=0x01;
@@ -2567,7 +2580,14 @@ ZRESULT TZip::open_handle(ZIPHANDLE hf,unsigned int len)
if (hf==0 || hf==INVALID_HANDLE_VALUE) return ZR_ARGS;
bool canseek;
#ifdef ZIP_STD
- struct stat st; fstat(fileno(hf),&st); canseek = S_ISREG(st.st_mode);
+ struct stat st;
+ #if (defined (_MSCVER) || defined (_MSC_VER))
+ fstat(_fileno(hf),&st);
+ #else
+ fstat(fileno(hf),&st);
+ #endif
+
+ canseek = S_ISREG(st.st_mode);
#else
DWORD res = SetFilePointer(hfout,0,0,FILE_CURRENT);
canseek = (res!=0xFFFFFFFF);
diff --git a/src/system/cinifile.cpp b/src/system/cinifile.cpp
index 4f2b09d8e..bb3cab3e7 100755
--- a/src/system/cinifile.cpp
+++ b/src/system/cinifile.cpp
@@ -160,7 +160,7 @@ long cIniFile::FindValue ( unsigned const keyID, std::string const valuename ) c
unsigned cIniFile::AddKeyName ( std::string const keyname ) {
mNames.resize ( mNames.size() + 1, keyname );
mKeys.resize ( mKeys.size() + 1 );
- return mNames.size() - 1;
+ return (unsigned int)(mNames.size() - 1);
}
std::string cIniFile::KeyName ( unsigned const keyID ) const {
@@ -172,7 +172,7 @@ std::string cIniFile::KeyName ( unsigned const keyID ) const {
unsigned cIniFile::NumValues ( unsigned const keyID ) {
if ( keyID < mKeys.size() )
- return mKeys[keyID].names.size();
+ return (unsigned int)mKeys[keyID].names.size();
return 0;
}
@@ -180,7 +180,7 @@ unsigned cIniFile::NumValues ( std::string const keyname ) {
long keyID = FindKey ( keyname );
if ( keyID == noID )
return 0;
- return mKeys[keyID].names.size();
+ return (unsigned int)mKeys[keyID].names.size();
}
std::string cIniFile::ValueName ( unsigned const keyID, unsigned const valueID ) const {
@@ -203,7 +203,7 @@ bool cIniFile::SetValue ( unsigned const keyID, unsigned const valueID, std::str
return false;
}
-bool cIniFile::SetValue ( std::string const keyname, std::string const valuename, std::string const value, bool const create ) {
+bool cIniFile::SetValue ( std::string const keyname, std::string const valuename, std::string const value, bool create ) {
long keyID = FindKey ( keyname );
if ( keyID == noID ) {
if ( create )
@@ -224,18 +224,18 @@ bool cIniFile::SetValue ( std::string const keyname, std::string const valuename
return true;
}
-bool cIniFile::SetValueI ( std::string const keyname, std::string const valuename, int const value, bool const create ) {
+bool cIniFile::SetValueI ( std::string const keyname, std::string const valuename, int const value, bool create ) {
char svalue[MAX_VALUEDATA];
StrFormat( svalue, MAX_VALUEDATA, "%d", value );
- return SetValue ( keyname, valuename, svalue );
+ return SetValue ( keyname, valuename, svalue, create );
}
-bool cIniFile::SetValueF ( std::string const keyname, std::string const valuename, double const value, bool const create ) {
+bool cIniFile::SetValueF ( std::string const keyname, std::string const valuename, double const value, bool create ) {
char svalue[MAX_VALUEDATA];
StrFormat ( svalue, MAX_VALUEDATA, "%f", value );
- return SetValue ( keyname, valuename, svalue );
+ return SetValue ( keyname, valuename, svalue, create );
}
bool cIniFile::SetValueV ( std::string const keyname, std::string const valuename, char *format, ... ) {
@@ -387,7 +387,7 @@ bool cIniFile::DeleteHeaderComment ( unsigned commentID ) {
unsigned cIniFile::NumKeyComments ( unsigned const keyID ) const {
if ( keyID < mKeys.size() )
- return mKeys[keyID].comments.size();
+ return (unsigned int)mKeys[keyID].comments.size();
return 0;
}
@@ -395,7 +395,7 @@ unsigned cIniFile::NumKeyComments ( std::string const keyname ) const {
long keyID = FindKey ( keyname );
if ( keyID == noID )
return 0;
- return mKeys[keyID].comments.size();
+ return (unsigned int)mKeys[keyID].comments.size();
}
bool cIniFile::KeyComment ( unsigned const keyID, std::string const comment ) {
diff --git a/src/system/cinifile.hpp b/src/system/cinifile.hpp
index 3f0f6ad16..ebe4a15a1 100755
--- a/src/system/cinifile.hpp
+++ b/src/system/cinifile.hpp
@@ -37,16 +37,16 @@ class EE_API cIniFile {
vector mNames;
vector mComments;
std::string CheckCase ( std::string s ) const;
-
+
std::vector mLines;
public:
enum errors { noID = -1};
cIniFile ( std::string const iniPath = "" );
cIniFile ( const Uint8* RAWData, const Uint32& size );
-
+
bool LoadFromFile( const std::string& iniPath );
bool LoadFromMemory( const Uint8* RAWData, const Uint32& size );
-
+
virtual ~cIniFile() {}
// Sets whether or not keynames and valuenames should be case sensitive.
@@ -78,7 +78,7 @@ class EE_API cIniFile {
long FindValue ( unsigned const keyID, std::string const valuename ) const;
// Returns number of mKeys currently in the ini.
- unsigned NumKeys() const {return mNames.size();}
+ unsigned NumKeys() const {return (unsigned int)mNames.size();}
unsigned GetNumKeys() const {return NumKeys();}
// Add a key name.
@@ -128,12 +128,12 @@ class EE_API cIniFile {
// the key if it doesn't exist. Returns true if data entered, false otherwise.
// Overloaded to accept std::string, int, and double.
bool SetValue ( unsigned const keyID, unsigned const valueID, std::string const value );
- bool SetValue ( std::string const keyname, std::string const valuename, std::string const value, bool const create = true );
- bool SetValueI ( std::string const keyname, std::string const valuename, int const value, bool const create = true );
- bool SetValueB ( std::string const keyname, std::string const valuename, bool const value, bool const create = true ) {
+ bool SetValue ( std::string const keyname, std::string const valuename, std::string const value, bool create = true );
+ bool SetValueI ( std::string const keyname, std::string const valuename, int const value, bool create = true );
+ bool SetValueB ( std::string const keyname, std::string const valuename, bool const value, bool create = true ) {
return SetValueI ( keyname, valuename, int ( value ), create );
}
- bool SetValueF ( std::string const keyname, std::string const valuename, double const value, bool const create = true );
+ bool SetValueF ( std::string const keyname, std::string const valuename, double const value, bool create = true );
bool SetValueV ( std::string const keyname, std::string const valuename, char *format, ... );
// Deletes specified value.
@@ -148,7 +148,7 @@ class EE_API cIniFile {
// Header comments are those comments before the first key.
//
// Number of header comments.
- unsigned NumHeaderComments() {return mComments.size();}
+ unsigned NumHeaderComments() {return (unsigned int)mComments.size();}
// Add a header comment.
void HeaderComment ( std::string const comment );
// Return a header comment.
diff --git a/src/system/cpak.cpp b/src/system/cpak.cpp
index 8c2fa0092..2e8f2aeb8 100755
--- a/src/system/cpak.cpp
+++ b/src/system/cpak.cpp
@@ -221,7 +221,7 @@ bool cPak::AddFile( const Uint8 * data, const Uint32& dataSize, const std::strin
pakE[ myPak.pakFilesNum ].file_length = fsize;
// Update the new pakEntrys on pakFile
- myPak.fs.write( reinterpret_cast(&pakE[0]), ( sizeof(pakEntry) * pakE.size() ) );
+ myPak.fs.write( reinterpret_cast(&pakE[0]), (std::streamsize)( sizeof(pakEntry) * pakE.size() ) );
pakFiles.push_back( pakE[ myPak.pakFilesNum ] );
myPak.pakFilesNum += 1;
@@ -298,10 +298,10 @@ bool cPak::EraseFiles( const std::vector& paths ) {
}
}
- nPf.pakFilesNum = uEntry.size();
+ nPf.pakFilesNum = (Uint32)uEntry.size();
nPf.header.head[0] = 'P'; nPf.header.head[1] = 'A'; nPf.header.head[2] = 'C'; nPf.header.head[3] = 'K';
nPf.header.dir_offset = total_offset + sizeof(pakHeader);
- nPf.header.dir_length = uEntry.size() * sizeof( pakEntry );
+ nPf.header.dir_length = (Uint32)uEntry.size() * sizeof( pakEntry );
nPf.fs.write( reinterpret_cast(&nPf.header), sizeof(pakHeader) );
@@ -309,11 +309,11 @@ bool cPak::EraseFiles( const std::vector& paths ) {
for ( i = 0; i < uEntry.size(); i++ )
if ( ExtractFileToMemory( std::string( uEntry[i].filename ), data ) ) {
uEntry[i].file_position = nPf.fs.tellg();
- uEntry[i].file_length = data.size();
- nPf.fs.write( reinterpret_cast(&data[0]), data.size() );
+ uEntry[i].file_length = (Uint32)data.size();
+ nPf.fs.write( reinterpret_cast(&data[0]), (std::streamsize)data.size() );
}
- nPf.fs.write( reinterpret_cast(&uEntry[0]), sizeof(pakEntry) * uEntry.size() );
+ nPf.fs.write( reinterpret_cast(&uEntry[0]), (std::streamsize)( sizeof(pakEntry) * uEntry.size() ) );
nPf.fs.close();
diff --git a/src/system/crc4.cpp b/src/system/crc4.cpp
index 32b00e971..72a7b90b5 100644
--- a/src/system/crc4.cpp
+++ b/src/system/crc4.cpp
@@ -69,18 +69,18 @@ bool cRC4::EncryptFile( const std::string& SourceFile, const std::string& DestFi
tmpv.resize( FileSize( SourceFile ) );
fs.open( SourceFile.c_str() , std::ios::in | std::ios::out | std::ios::binary );
- fs.read( reinterpret_cast(&tmpv[0]), tmpv.size() );
+ fs.read( reinterpret_cast(&tmpv[0]), (std::streamsize)tmpv.size() );
EncryptByte( tmpv );
if ( SourceFile != DestFile ) {
std::fstream fs2;
fs2.open( DestFile.c_str() , std::ios::out | std::ios::binary );
- fs2.write( reinterpret_cast( &tmpv[0] ), tmpv.size() );
+ fs2.write( reinterpret_cast( &tmpv[0] ), (std::streamsize)tmpv.size() );
fs2.close();
} else {
fs.seekg( 0, ios::beg );
- fs.write( reinterpret_cast( &tmpv[0] ), tmpv.size() );
+ fs.write( reinterpret_cast( &tmpv[0] ), (std::streamsize)tmpv.size() );
}
fs.close();
diff --git a/src/system/ctimer.cpp b/src/system/ctimer.cpp
index 602f56f56..e02330542 100755
--- a/src/system/ctimer.cpp
+++ b/src/system/ctimer.cpp
@@ -65,7 +65,7 @@ void cTimer::reset() {
HANDLE thread = GetCurrentThread();
// Set affinity to the first core
- DWORD oldMask = SetThreadAffinityMask(thread, mTimerMask);
+ DWORD_PTR oldMask = SetThreadAffinityMask(thread, mTimerMask);
// Get the constant frequency
QueryPerformanceFrequency(&mFrequency);
@@ -92,7 +92,7 @@ unsigned long cTimer::getMilliseconds() {
HANDLE thread = GetCurrentThread();
// Set affinity to the first core
- DWORD oldMask = SetThreadAffinityMask(thread, mTimerMask);
+ DWORD_PTR oldMask = SetThreadAffinityMask(thread, mTimerMask);
// Query the cTimer
QueryPerformanceCounter(&curTime);
@@ -137,7 +137,7 @@ unsigned long cTimer::getMicroseconds() {
HANDLE thread = GetCurrentThread();
// Set affinity to the first core
- DWORD oldMask = SetThreadAffinityMask(thread, mTimerMask);
+ DWORD_PTR oldMask = SetThreadAffinityMask(thread, mTimerMask);
// Query the timer
QueryPerformanceCounter(&curTime);
diff --git a/src/test/ee.cpp b/src/test/ee.cpp
index de0782815..6d3cbc6e6 100644
--- a/src/test/ee.cpp
+++ b/src/test/ee.cpp
@@ -537,7 +537,7 @@ void cEETest::RandomizeHeights() {
}
void cEETest::CreateTiling( const bool& Wire ) {
- for ( x = 0; x < static_cast( Map.Width() ); x++ )
+ for ( x = 0; x < static_cast( Map.Width() ); x++ ) {
for ( y = 0; y < static_cast( Map.Height() ); y++ ) {
if (Wire)
Map.Layer(x, y, 0, Tiles[6] );
@@ -547,6 +547,7 @@ void cEETest::CreateTiling( const bool& Wire ) {
if ( !TreeTilingCreated )
Map.Layer(x, y, 1, 0);
}
+ }
if ( !TreeTilingCreated ) {
for ( x = 0; x < 100; x++ )
@@ -572,6 +573,10 @@ void cEETest::ParticlesThread() {
}
}
+void cEETest::Screen1() {
+ Map.Draw();
+}
+
void cEETest::Screen2() {
eeFloat PlanetX = HWidth - TNP[6]->Width() * 0.5f;
eeFloat PlanetY = HHeight - TNP[6]->Height() * 0.5f;
@@ -714,10 +719,6 @@ void cEETest::Screen2() {
PR.DrawPoint( WP.GetPos(), 10.f );
}
-void cEETest::Screen1() {
- Map.Draw();
-}
-
void cEETest::Screen3() {
if (AnimVal>=300.0f) {
AnimVal = 300.0f;
@@ -748,7 +749,7 @@ void cEETest::Render() {
HWidth = EE->GetWidth() * 0.5f;
HHeight = EE->GetHeight() * 0.5f;
- if ( eeGetTicks() - lasttick >= 100 ) {
+ if ( eeGetTicks() - lasttick >= 50 ) {
lasttick = eeGetTicks();
mInfo = StrFormated( "EE - FPS: %d Elapsed Time: %4.8f\nMouse X: %d Mouse Y: %d\nTexture Memory Size: %d",
EE->FPS(),
@@ -857,18 +858,18 @@ void cEETest::Input() {
Mus.Play();
}
+ if ( KM->IsKeyDown(KEY_ESCAPE) )
+ EE->Running(false);
+
if ( KM->IsKeyUp(KEY_F1) )
MultiViewportMode = !MultiViewportMode;
if ( KM->AltPressed() && KM->IsKeyUp(KEY_M) && !Con.Active() )
EE->MaximizeWindow();
-
- if ( KM->IsKeyDown(KEY_ESCAPE) )
- EE->Running(false);
-
+/*
if ( KM->IsKeyUp(KEY_F4) )
TF->ReloadAllTextures();
-
+*/
if ( KM->AltPressed() && KM->IsKeyUp(KEY_RETURN) ) {
if ( EE->Windowed() ) {
EE->ChangeRes( EE->GetDeskWidth(), EE->GetDeskHeight(), false );
diff --git a/src/ui/cuicontrol.cpp b/src/ui/cuicontrol.cpp
index 90433fec0..7ab336c9c 100644
--- a/src/ui/cuicontrol.cpp
+++ b/src/ui/cuicontrol.cpp
@@ -622,7 +622,7 @@ cUIControl * cUIControl::ChildPrev( cUIControl * Ctrl, bool Loop ) const {
ChildLoop = ChildLoop->NextGet();
}
- } else {
+ } else if ( Loop ) {
ChildLoop = mChild;
while ( NULL != ChildLoop->NextGet() )
diff --git a/src/ui/cuimessage.hpp b/src/ui/cuimessage.hpp
index e5af4e559..b61b3a31e 100644
--- a/src/ui/cuimessage.hpp
+++ b/src/ui/cuimessage.hpp
@@ -17,7 +17,7 @@ class EE_API cUIMessage {
MsgMouseExit,
MsgWindowResize,
MsgUser,
- MsgForceDWord = 0xFFFFFFFF,
+ MsgForceDWord = 0xFFFFFFFF
};
cUIMessage( cUIControl * Ctrl, const Uint32& Msg );
diff --git a/src/utils/cinterpolation.cpp b/src/utils/cinterpolation.cpp
index 958df21e2..c4af9ccd5 100644
--- a/src/utils/cinterpolation.cpp
+++ b/src/utils/cinterpolation.cpp
@@ -4,18 +4,18 @@ using namespace EE::Utils::easing;
namespace EE { namespace Utils {
-cInterpolation::cInterpolation() :
+cInterpolation::cInterpolation() :
mType(LINEAR),
- mEnable(false),
- mUpdate(true),
- mLoop(false),
- mEnded(false),
+ mEnable(false),
+ mUpdate(true),
+ mLoop(false),
+ mEnded(false),
mTotDist(0.f),
- mCurPoint(0),
- mCurTime(0),
- mSpeed(1.3f),
- mActP(NULL),
- mNexP(NULL),
+ mCurPoint(0),
+ mCurTime(0),
+ mSpeed(1.3f),
+ mActP(NULL),
+ mNexP(NULL),
mOnPathEndCallback(NULL)
{
}
@@ -97,7 +97,7 @@ bool cInterpolation::EraseWaypoint( const eeUint PointNum ) {
mTotDist -= fabs( mPoints[ PointNum ].p - mPoints[ PointNum - 1 ].p );
mPoints.erase( mPoints.begin() + PointNum );
-
+
return true;
}
return false;
@@ -126,7 +126,7 @@ void cInterpolation::Update( const eeFloat& Elapsed ) {
else {
if ( mLoop ) {
mNexP = &mPoints[ 0 ];
-
+
if ( NULL != mOnPathEndCallback )
mOnPathEndCallback();
} else {
@@ -144,9 +144,9 @@ void cInterpolation::Update( const eeFloat& Elapsed ) {
}
mCurTime += Elapsed;
-
+
mCurPos = easingCb[ mType ]( mCurTime, mActP->p, ( mNexP->p - mActP->p ), mActP->t );
-
+
if ( mCurTime >= mActP->t ) {
mCurPos = mNexP->p;
@@ -167,12 +167,12 @@ void cInterpolation::SetTotalTime( const eeFloat TotTime ) {
mPoints.clear();
return;
}
-
+
if ( mLoop ) {
tdist += fabs( mPoints[ mPoints.size() - 1 ].p - mPoints[0].p );
mPoints[ mPoints.size() - 1 ].t = abs( mPoints[ mPoints.size() - 1 ].p - mPoints[0].p ) * TotTime / tdist;
}
-
+
for ( eeUint i = 0; i < mPoints.size() - 1; i++) {
eeFloat CurDist = fabs( mPoints[i].p - mPoints[i + 1].p );
mPoints[i].t = CurDist * TotTime / tdist;
@@ -195,7 +195,7 @@ void cInterpolation::Speed( const eeFloat speed ) {
mPoints[ mPoints.size() - 1 ].t = fabs( mPoints[ mPoints.size() - 1 ].p - mPoints[0].p ) * TotTime / tdist;
TotTime = tdist * mSpeed;
}
-
+
for ( eeUint i = 0; i < mPoints.size() - 1; i++) {
eeFloat CurDist = fabs( mPoints[i].p - mPoints[i + 1].p );
mPoints[i].t = CurDist * TotTime / tdist;
@@ -207,7 +207,7 @@ void cInterpolation::Type( EE_INTERPOLATION InterpolationType ) {
mType = InterpolationType;
}
-const eeInt cInterpolation::Type() const {
+const eeInt& cInterpolation::Type() const {
return mType;
}
diff --git a/src/utils/cinterpolation.hpp b/src/utils/cinterpolation.hpp
index 9d02481fa..d0cb11265 100644
--- a/src/utils/cinterpolation.hpp
+++ b/src/utils/cinterpolation.hpp
@@ -20,9 +20,9 @@ typedef Point1d cPoint1df;
class cInterpolation {
public:
cInterpolation();
-
+
~cInterpolation();
-
+
typedef boost::function0 OnPathEndCallback;
/** Add a new point */
@@ -66,7 +66,7 @@ class cInterpolation {
/** Set the current interpolation speed */
void Speed( const eeFloat speed );
-
+
/** Get the current interpolation speed */
const eeFloat& Speed() const { return mSpeed; }
@@ -80,10 +80,10 @@ class cInterpolation {
/** @return the vector of points */
const std::vector& GetPoints() const { return mPoints; }
-
+
/** @return The Current Node */
cPoint1df* GetCurrentActual() const { return mActP; }
-
+
/** @return The Next Node */
cPoint1df* GetCurrentNext() const { return mNexP; }
@@ -97,14 +97,14 @@ class cInterpolation {
void Type( EE_INTERPOLATION InterpolationType );
/** @return The type of the interpolation */
- const eeInt Type() const;
+ const eeInt& Type() const;
protected:
eeInt mType;
bool mEnable;
bool mUpdate;
bool mLoop;
bool mEnded;
-
+
eeFloat mTotDist;
eeFloat mCurPos;
eeUint mCurPoint;
diff --git a/src/utils/cwaypoints.cpp b/src/utils/cwaypoints.cpp
index 60318c3a0..d49af0aa2 100755
--- a/src/utils/cwaypoints.cpp
+++ b/src/utils/cwaypoints.cpp
@@ -200,7 +200,7 @@ void cWaypoints::Type( EE_INTERPOLATION InterpolationType ) {
mType = InterpolationType;
}
-const eeInt cWaypoints::Type() const {
+const eeInt& cWaypoints::Type() const {
return mType;
}
diff --git a/src/utils/cwaypoints.hpp b/src/utils/cwaypoints.hpp
index 82ee2e348..94764cc7e 100755
--- a/src/utils/cwaypoints.hpp
+++ b/src/utils/cwaypoints.hpp
@@ -72,16 +72,16 @@ class EE_API cWaypoints {
cWaypoint* GetCurrentNext() const { return mNexP; }
/** @return The Current Position in the vector */
- const Uint32 GetCurrentPos() const { return mCurPoint; }
+ const Uint32& GetCurrentPos() const { return mCurPoint; }
/** @return the vector of waypoints */
- const std::vector* const GetWaypoints() { return &mPoints; }
+ const std::vector* GetWaypoints() { return &mPoints; }
/** Set the current interpolation speed ( This will destroy the time of the interpolation and create one depending on the speed ) */
void Speed( const eeFloat& Speed );
/** Get the current interpolation speed */
- const eeFloat Speed() const { return mSpeed; }
+ const eeFloat& Speed() const { return mSpeed; }
/** @return If enabled */
bool& Enabled() { return mEnable; }
@@ -93,7 +93,7 @@ class EE_API cWaypoints {
void Type( EE_INTERPOLATION InterpolationType );
/** @return The type of the interpolation */
- const eeInt Type() const;
+ const eeInt& Type() const;
protected:
eeInt mType;
bool mEnable;
diff --git a/src/utils/polygon2.hpp b/src/utils/polygon2.hpp
index 132b20a3c..402ec859b 100755
--- a/src/utils/polygon2.hpp
+++ b/src/utils/polygon2.hpp
@@ -74,7 +74,7 @@ void Polygon2::Reset() {
template
Uint32 Polygon2::PushBack( const Vector2& V ) {
Vector.push_back( V );
- return Vector.size() - 1;
+ return (Uint32)Vector.size() - 1;
}
template
diff --git a/src/utils/string.cpp b/src/utils/string.cpp
index ca2db7eac..54bacdc40 100644
--- a/src/utils/string.cpp
+++ b/src/utils/string.cpp
@@ -70,7 +70,7 @@ std::vector < std::wstring > SplitString ( const std::wstring& str, const Uint32
std::wstring tmpstr;
for ( eeUint i = 0; i < str.size(); i++ ) {
- #ifdef EE_COMPILER_MSVC
+ #if EE_PLATFORM == EE_PLATFORM_WIN32
if ( str[i] == splitchar ) {
#else
if ( str[i] == (Int32)splitchar ) {
diff --git a/src/utils/utils.cpp b/src/utils/utils.cpp
index 6260bb765..f0fb26300 100755
--- a/src/utils/utils.cpp
+++ b/src/utils/utils.cpp
@@ -386,7 +386,7 @@ bool FileWrite( const std::string& filepath, const Uint8* data, const Uint32& da
}
bool FileWrite( const std::string& filepath, const std::vector& data ) {
- return FileWrite( filepath, reinterpret_cast ( &data[0] ), data.size() );
+ return FileWrite( filepath, reinterpret_cast ( &data[0] ), (Uint32)data.size() );
}
}}
diff --git a/src/window/cengine.cpp b/src/window/cengine.cpp
index 6840972a7..404c6842b 100755
--- a/src/window/cengine.cpp
+++ b/src/window/cengine.cpp
@@ -554,7 +554,7 @@ std::string cEngine::GetVersion() {
}
bool cEngine::GetExtension( const std::string& Ext ) {
- return (bool)glewIsSupported( Ext.c_str() );
+ return 0 != glewIsSupported( Ext.c_str() );
}
SDL_Cursor* cEngine::CreateCursor( const Uint32& TexId, const eeVector2i& HotSpot ) {
@@ -601,7 +601,7 @@ SDL_Cursor* cEngine::CreateCursor( const Uint32& TexId, const eeVector2i& HotSpo
}
Tex->Unlock( false, false );
- return SDL_CreateCursor( &data[0], &mask[0], cursor_width, static_cast( Tex->Height() ), HotSpot.x, HotSpot.y );
+ return SDL_CreateCursor( &data[0], &mask[0], (int)cursor_width, static_cast( Tex->Height() ), HotSpot.x, HotSpot.y );
}
void cEngine::SetCursor( const Uint32& TexId, const eeVector2i& HotSpot ) {
@@ -778,7 +778,7 @@ int cEngine::clipboard_convert_scrap(int type, char *dst, char *src, int srclen)
switch (type) {
case T('T', 'E', 'X', 'T'):
if ( srclen == 0 )
- srclen = strlen(src);
+ srclen = (int)strlen(src);
if ( dst ) {
while ( --srclen >= 0 ) {
diff --git a/src/window/cinputtextbuffer.cpp b/src/window/cinputtextbuffer.cpp
index ad1b58f2d..c1b89656e 100755
--- a/src/window/cinputtextbuffer.cpp
+++ b/src/window/cinputtextbuffer.cpp
@@ -100,7 +100,7 @@ void cInputTextBuffer::Update( EE_Event* Event ) {
if ( mPromptAutoPos ) {
mText += c;
- mPromptPos = mText.size();
+ mPromptPos = (eeInt)mText.size();
} else {
InsertChar( mText, mPromptPos, c );
mPromptPos++;
@@ -157,7 +157,7 @@ bool cInputTextBuffer::ChangedSinceLastUpdate() {
void cInputTextBuffer::SetAutoPromp( const bool& set ) {
if ( set ) {
mPromptAutoPos = true;
- mPromptPos = mText.size();
+ mPromptPos = (eeInt)mText.size();
} else {
mPromptAutoPos = false;
}
diff --git a/src/window/cjoystick.hpp b/src/window/cjoystick.hpp
index 5ff3297fe..64ee65a16 100644
--- a/src/window/cjoystick.hpp
+++ b/src/window/cjoystick.hpp
@@ -23,7 +23,7 @@ namespace EE { namespace Window {
#define AXIS_MAX (32768)
#define AXIS_MIN (-32768)
-class cJoystick {
+class EE_API cJoystick {
public:
cJoystick( const Uint32& index );
diff --git a/src/window/cjoystickmanager.hpp b/src/window/cjoystickmanager.hpp
index 1c17dff7f..79e2e18bc 100644
--- a/src/window/cjoystickmanager.hpp
+++ b/src/window/cjoystickmanager.hpp
@@ -8,7 +8,7 @@ namespace EE { namespace Window {
#define MAX_JOYSTICKS (16)
-class cJoystickManager : public cSingleton {
+class EE_API cJoystickManager : public cSingleton {
friend class cSingleton;
friend class cJoystick;
public:
diff --git a/src/window/cview.cpp b/src/window/cview.cpp
index 9a9b1c58c..1fb9d138e 100755
--- a/src/window/cview.cpp
+++ b/src/window/cview.cpp
@@ -7,7 +7,7 @@ cView::cView() : mNeedUpdate(true) {
mView.Right = 0;
mView.Top = 0;
mView.Bottom = 0;
-
+
CalcCenter();
}
@@ -17,7 +17,7 @@ cView::cView( const eeInt& X, const eeInt& Y, const eeInt& Width, const eeInt& H
cView::cView( const eeRecti& View ) : mNeedUpdate(true) {
mView = View;
-
+
CalcCenter();
}
@@ -44,19 +44,19 @@ eeVector2i cView::Center() const {
void cView::Center( const eeVector2i& Center ) {
eeVector2f LastCenter = mCenter;
-
+
mCenter.x = (eeFloat)Center.x;
mCenter.y = (eeFloat)Center.y;
mView.Left = static_cast ( mCenter.x - (eeFloat)mView.Right * 0.5f );
mView.Top = static_cast ( mCenter.y - (eeFloat)mView.Bottom * 0.5f );
-
+
mNeedUpdate = true;
}
void cView::Move( const eeInt& OffsetX, const eeInt& OffsetY ) {
mView.Left += OffsetX;
mView.Top += OffsetY;
-
+
CalcCenter();
mNeedUpdate = true;
}
@@ -68,12 +68,12 @@ void cView::Move( const eeVector2i& Offset ) {
void cView::Scale( const eeFloat& Factor ) {
eeRecti LastView = mView;
eeVector2f v( mView.Right * 0.5f, mView.Bottom * 0.5f );
-
+
mView.Left = mView.Left + static_cast ( v.x - v.x * Factor );
mView.Top = mView.Top + static_cast ( v.y - v.y * Factor );
mView.Right = static_cast( (eeFloat)mView.Right * Factor );
mView.Bottom = static_cast( (eeFloat)mView.Bottom * Factor );
-
+
CalcCenter();
mNeedUpdate = true;
}
@@ -81,7 +81,7 @@ void cView::Scale( const eeFloat& Factor ) {
void cView::SetPosition( const eeInt& X, const eeInt& Y ) {
mView.Left = X;
mView.Top = Y;
-
+
CalcCenter();
mNeedUpdate = true;
}
@@ -89,17 +89,17 @@ void cView::SetPosition( const eeInt& X, const eeInt& Y ) {
void cView::SetSize( const eeInt& Width, const eeInt& Height ) {
mView.Right = Width;
mView.Bottom = Height;
-
+
CalcCenter();
mNeedUpdate = true;
}
-const bool cView::NeedUpdate() const {
+bool cView::NeedUpdate() const {
bool Need = mNeedUpdate;
-
+
if ( Need )
const_cast(this)->mNeedUpdate = false;
-
+
return Need;
}
diff --git a/src/window/cview.hpp b/src/window/cview.hpp
index 6a33eae17..7436b89e6 100755
--- a/src/window/cview.hpp
+++ b/src/window/cview.hpp
@@ -12,41 +12,41 @@ class cView {
cView( const eeInt& X, const eeInt& Y, const eeInt& Width, const eeInt& Height );
cView( const eeRecti& View );
~cView();
-
+
/** Offset the position */
void Move( const eeInt& OffsetX, const eeInt& OffsetY );
-
+
/** Offset the position */
void Move( const eeVector2i& Offset );
-
+
/** Scale the current view (from center) */
void Scale( const eeFloat& Factor );
-
+
/** @return The center position of the view */
eeVector2i Center() const;
-
+
/** Set the center position of the view ( will move it if is needed ) */
void Center( const eeVector2i& Center );
-
+
/** @return The current view ( Left = X, Right = Width, Top = Y, Bottom = Height ) */
eeRecti GetView() const { return mView; }
-
+
/** Set a new position to the view */
void SetPosition( const eeInt& X, const eeInt& Y );
-
+
/** Set a new size to the view */
void SetSize( const eeInt& Width, const eeInt& Height );
-
+
/** Creates a new view */
void SetView( const eeInt& X, const eeInt& Y, const eeInt& Width, const eeInt& Height );
-
+
/** This is only used by cEngine. DON'T CALL IT. */
- const bool NeedUpdate() const;
+ bool NeedUpdate() const;
private:
bool mNeedUpdate;
eeRecti mView;
eeVector2f mCenter;
-
+
void CalcCenter();
};