* No more warnings in fixed areas, widgets still have warnings

Thu, 21 Apr 2011 13:25:39 +0000

author
cemkalyoncu
date
Thu, 21 Apr 2011 13:25:39 +0000
changeset 21
016809939f8a
parent 20
cc549c0f8ebd
child 22
d6be62134f28

* No more warnings in fixed areas, widgets still have warnings

Effects/Flip.cpp file | annotate | diff | comparison | revisions
Effects/Flip.h file | annotate | diff | comparison | revisions
Effects/LayerMover.cpp file | annotate | diff | comparison | revisions
Effects/LayerResizer.cpp file | annotate | diff | comparison | revisions
Effects/Tinting.cpp file | annotate | diff | comparison | revisions
Engine/GGEMain.cpp file | annotate | diff | comparison | revisions
Engine/Graphics.cpp file | annotate | diff | comparison | revisions
Engine/Graphics.h file | annotate | diff | comparison | revisions
Engine/OS.Win32.cpp file | annotate | diff | comparison | revisions
Engine/Sound.cpp file | annotate | diff | comparison | revisions
Engine/Sound.h file | annotate | diff | comparison | revisions
Engine/Wave.cpp file | annotate | diff | comparison | revisions
Engine/Wave.h file | annotate | diff | comparison | revisions
External/JPEG/src/jmorecfg.h file | annotate | diff | comparison | revisions
Resource/BitmapFontResource.cpp file | annotate | diff | comparison | revisions
Resource/ImageResource.cpp file | annotate | diff | comparison | revisions
Utils/Point2D.h file | annotate | diff | comparison | revisions
Utils/Rectangle2D.h file | annotate | diff | comparison | revisions
Widgets/Line.cpp file | annotate | diff | comparison | revisions
--- a/Effects/Flip.cpp	Thu Apr 21 01:53:15 2011 +0000
+++ b/Effects/Flip.cpp	Thu Apr 21 13:25:39 2011 +0000
@@ -37,17 +37,17 @@
 			FlipSide cside=Side;
 			if(Backside ^ rev) {
 				switch(Side) {
-					case EAFS_Top:
-						cside=EAFS_Bottom;
+					case Top:
+						cside=Bottom;
 						break;
-					case EAFS_Left:
-						cside=EAFS_Right;
+					case Left:
+						cside=Right;
 						break;
-					case EAFS_Bottom:
-						cside=EAFS_Top;
+					case Bottom:
+						cside=Top;
 						break;
-					case EAFS_Right:
-						cside=EAFS_Left;
+					case Right:
+						cside=Left;
 						break;
 				}
 			}
@@ -62,7 +62,7 @@
 			float tmp;
 
 			switch(cside) {
-				case EAFS_Top:
+				case Top:
 					tmp=(sin(ang)*cx)*Perspective;
 
 					y1-=pivot.y;
@@ -79,7 +79,7 @@
 					x3+=tmp;
 					x4-=tmp;
 					break;
-				case EAFS_Left:
+				case Left:
 					tmp=(sin(ang)*cy)*Perspective;
 
 					x1-=pivot.x;
@@ -96,7 +96,7 @@
 					y2-=tmp;
 					y3+=tmp;
 					break;
-				case EAFS_Bottom:
+				case Bottom:
 					tmp=(sin(ang)*cx)*Perspective;
 
 					y1-=pivot.y;
@@ -113,7 +113,7 @@
 					x1-=tmp;
 					x2+=tmp;
 					break;
-				case EAFS_Right:
+				case Right:
 					tmp=(sin(ang)*cy)*Perspective;
 
 					x1-=pivot.x;
@@ -153,7 +153,7 @@
 		Flipping=false;
 		Backside=false;
 		ETA=0;
-		Side=EAFS_Top;
+		Side=Top;
 
 		PivotFront.x=0;
 		PivotFront.y=0;
--- a/Effects/Flip.h	Thu Apr 21 01:53:15 2011 +0000
+++ b/Effects/Flip.h	Thu Apr 21 13:25:39 2011 +0000
@@ -7,15 +7,15 @@
 #include "../Engine/GraphicLayers.h"
 
 namespace gge { namespace effects {
-	enum FlipSide {
-		EAFS_Top=1,
-		EAFS_Left,
-		EAFS_Bottom,
-		EAFS_Right,
-	};
 
 	class FlipEffect : public AnimatorBase, public graphics::Buffered2DGraphic {
 	public:
+		enum FlipSide {
+			Top=1,
+			Left,
+			Bottom,
+			Right,
+		};
 		////This event is fired when the animation
 		/// completes
 		utils::EventChain<FlipEffect> FinishedEvent;
--- a/Effects/LayerMover.cpp	Thu Apr 21 01:53:15 2011 +0000
+++ b/Effects/LayerMover.cpp	Thu Apr 21 13:25:39 2011 +0000
@@ -7,8 +7,8 @@
 		current=from;
 		to=To;
 
-		Target->X=from.x;
-		Target->Y=from.y;
+		Target->X=(int)from.x;
+		Target->Y=(int)from.y;
 		this->progressed=0;
 
 		if(Time) {
@@ -19,8 +19,8 @@
 			speed.x=0;
 			speed.y=0;
 			current=from=to;
-			Target->X=to.x;
-			Target->Y=to.y;
+			Target->X=(int)to.x;
+			Target->Y=(int)to.y;
 		}
 	}
 
@@ -39,7 +39,7 @@
 			if(current.x>to.x)
 				current.x=to.x;
 		}
-		Target->X=current.x;
+		Target->X=(int)current.x;
 
 
 		if(from.y>to.y) {
@@ -52,7 +52,7 @@
 			if(current.y>to.y)
 				current.y=to.y;
 		}
-		Target->Y=current.y;
+		Target->Y=(int)current.y;
 
 	}
 } }
--- a/Effects/LayerResizer.cpp	Thu Apr 21 01:53:15 2011 +0000
+++ b/Effects/LayerResizer.cpp	Thu Apr 21 13:25:39 2011 +0000
@@ -2,14 +2,14 @@
 namespace gge { namespace effects {
 	void LayerResizer::Setup(gge::Rectangle From, gge::Rectangle To, int Time) {
 
-		from=From;
+		from=Rectangle2D(From);
 		current=from;
 		to=To;
 
-		Target->X=from.Left;
-		Target->Y=from.Top;
-		Target->W=from.Width;
-		Target->H=from.Height;
+		Target->X=(int)from.Left;
+		Target->Y=(int)from.Top;
+		Target->W=(int)from.Width;
+		Target->H=(int)from.Height;
 		this->progressed=0;
 
 		if(Time) {
@@ -25,10 +25,10 @@
 			speed.Width=0;
 			speed.Height=0;
 			current=from=to;
-			Target->X=to.Left;
-			Target->Y=to.Top;
-			Target->W=to.Width;
-			Target->H=to.Height;
+			Target->X=(int)to.Left;
+			Target->Y=(int)to.Top;
+			Target->W=(int)to.Width;
+			Target->H=(int)to.Height;
 		}
 	}
 
--- a/Effects/Tinting.cpp	Thu Apr 21 01:53:15 2011 +0000
+++ b/Effects/Tinting.cpp	Thu Apr 21 13:25:39 2011 +0000
@@ -44,7 +44,7 @@
 			if(current.a>to.a)
 				current.a=to.a;
 		}
-		Target->Ambient.a=current.a*255;
+		Target->Ambient.a=(Byte)current.a*255;
 
 		if(from.r>to.r) {
 			current.r=from.r+Time*speed.r;
@@ -56,7 +56,7 @@
 			if(current.r>to.r)
 				current.r=to.r;
 		}
-		Target->Ambient.r=current.r*255;
+		Target->Ambient.r=(Byte)current.r*255;
 
 		if(from.g>to.g) {
 			current.g=from.g+Time*speed.g;
@@ -68,7 +68,7 @@
 			if(current.g>to.g)
 				current.g=to.g;
 		}
-		Target->Ambient.g=current.g*255;
+		Target->Ambient.g=(Byte)current.g*255;
 
 		if(from.b>to.b) {
 			current.b=from.b+Time*speed.b;
@@ -80,6 +80,6 @@
 			if(current.b>to.b)
 				current.b=to.b;
 		}
-		Target->Ambient.b=current.b*255;
+		Target->Ambient.b=(Byte)current.b*255;
 	}
 } }
--- a/Engine/GGEMain.cpp	Thu Apr 21 01:53:15 2011 +0000
+++ b/Engine/GGEMain.cpp	Thu Apr 21 13:25:39 2011 +0000
@@ -14,7 +14,6 @@
 		AfterRenderEvent("AfterRender", this),
 		Window(NULL)
 	{
-
 		X=0;
 		Y=0;
 		isVisible=true;
@@ -24,7 +23,7 @@
 		FPS=50;
 	}
 
-		void GGEMain::Setup(string SystemName, os::InstanceHandle Instance,int Width, int Height, int BitDepth, bool FullScreen) {
+	void GGEMain::Setup(string SystemName, os::InstanceHandle Instance,int Width, int Height, int BitDepth, bool FullScreen) {
 #ifdef _DEBUG
 		if(Window!=NULL)
 			throw std::runtime_error("System already initialized.");
--- a/Engine/Graphics.cpp	Thu Apr 21 01:53:15 2011 +0000
+++ b/Engine/Graphics.cpp	Thu Apr 21 13:25:39 2011 +0000
@@ -43,7 +43,7 @@
 
 		HGLRC hRC;
 		hRC = wglCreateContext( hDC );
-		bool r=wglMakeCurrent(hDC,hRC);
+		wglMakeCurrent(hDC,hRC);
 #endif
 
 		ScreenSize.x=Width;
--- a/Engine/Graphics.h	Thu Apr 21 01:53:15 2011 +0000
+++ b/Engine/Graphics.h	Thu Apr 21 13:25:39 2011 +0000
@@ -13,6 +13,10 @@
 #include <stdexcept>
 #include "../Utils/ManagedBuffer.h"
 
+#undef WINGDIAPI
+#undef APIENTRY
+#undef CALLBACK
+
 #ifndef GL_BGR
 #	define GL_BGR	0x80E0
 #	define GL_BGRA	0x80E1
--- a/Engine/OS.Win32.cpp	Thu Apr 21 01:53:15 2011 +0000
+++ b/Engine/OS.Win32.cpp	Thu Apr 21 13:25:39 2011 +0000
@@ -7,8 +7,8 @@
 
 #ifdef WIN32
 
-#	define WINVER 0x0500
-#	define _WIN32_WINNT 0x0500
+//#	define WINVER 0x0500
+//#	define _WIN32_WINNT 0x0500
 #	include <windows.h>
 #	undef CreateWindow
 #	undef Rectangle
--- a/Engine/Sound.cpp	Thu Apr 21 01:53:15 2011 +0000
+++ b/Engine/Sound.cpp	Thu Apr 21 13:25:39 2011 +0000
@@ -70,7 +70,8 @@
 			return source;
 		}
 
-		SoundControlHandle Create3DSoundController(SoundBufferHandle Buffer, int maxWaveDistance) {
+		gge::sound::system::SoundControlHandle Create3DSoundController( SoundBufferHandle Buffer, float maxWaveDistance )
+		{
 			SoundControlHandle source;
 
 			alGetError();
--- a/Engine/Sound.h	Thu Apr 21 01:53:15 2011 +0000
+++ b/Engine/Sound.h	Thu Apr 21 13:25:39 2011 +0000
@@ -63,7 +63,7 @@
 
 		////Creates a new sound controller with 3D positional properties. maxWaveDistance
 		/// allows the control of attenuation
-		SoundControlHandle Create3DSoundController(SoundBufferHandle Buffer, int maxWaveDistance);
+		SoundControlHandle Create3DSoundController(SoundBufferHandle Buffer, float maxWaveDistance);
 
 		////Used to identify if sound is available
 		extern bool	isAvailable;
--- a/Engine/Wave.cpp	Thu Apr 21 01:53:15 2011 +0000
+++ b/Engine/Wave.cpp	Thu Apr 21 13:25:39 2011 +0000
@@ -26,7 +26,7 @@
 		}
 	}
 
-	Wave::Wave(system::SoundBufferHandle buffer, int maxWaveDistance) {
+	Wave::Wave(system::SoundBufferHandle buffer, float maxWaveDistance) {
 		buffer=buffer;
 		isavailable=false;
 		AutoDestruct=true;
--- a/Engine/Wave.h	Thu Apr 21 01:53:15 2011 +0000
+++ b/Engine/Wave.h	Thu Apr 21 13:25:39 2011 +0000
@@ -32,7 +32,7 @@
 		////default constructor requires buffer handle.
 		///@maxWaveDistance	: if specified the generated sound controller
 		/// will have 3D properties
-		Wave(system::SoundBufferHandle Buffer, int maxWaveDistance=0);
+		Wave(system::SoundBufferHandle Buffer, float maxWaveDistance=0.0f);
 		////Plays this sound once
 		Wave& Play();
 		////Plays this sound continously until stopped
--- a/External/JPEG/src/jmorecfg.h	Thu Apr 21 01:53:15 2011 +0000
+++ b/External/JPEG/src/jmorecfg.h	Thu Apr 21 13:25:39 2011 +0000
@@ -1,3 +1,4 @@
+#pragma once
 /*
  * jmorecfg.h
  *
@@ -212,8 +213,10 @@
 #ifdef NEED_FAR_POINTERS
 #define FAR  far
 #else
+#ifndef FAR
 #define FAR
 #endif
+#endif
 
 
 /*
--- a/Resource/BitmapFontResource.cpp	Thu Apr 21 01:53:15 2011 +0000
+++ b/Resource/BitmapFontResource.cpp	Thu Apr 21 13:25:39 2011 +0000
@@ -64,7 +64,7 @@
 	}
 
 	void BitmapFontResource::Print(graphics::I2DColorizableGraphicsTarget *target, int x, int y, int w, string text, graphics::RGBint color, TextAlignment align, ShadowParams Shadow) {
-		int i;
+		unsigned i;
 		int l=x;
 		int lstart=0,lword=0;
 		int llen=0;
@@ -151,7 +151,7 @@
 				lstart=lword+1;
 				i=lword;
 				llen=0;
-				y+=fh*VerticalSpacing;
+				y+=int(fh*VerticalSpacing);
 				nextline=false;
 			}
 		}
@@ -343,7 +343,7 @@
 				i=lword;
 				llen=0;
 				if(!nowrap)
-					y+=fh*VerticalSpacing;
+					y+=int(fh*VerticalSpacing);
 				nextline=false;
 			}
 		}
@@ -543,7 +543,7 @@
 				i=lword;
 				llen=0;
 				if(!nowrap)
-					y+=fh*VerticalSpacing;
+					y+=int(fh*VerticalSpacing);
 				nextline=false;
 			}
 		}
--- a/Resource/ImageResource.cpp	Thu Apr 21 01:53:15 2011 +0000
+++ b/Resource/ImageResource.cpp	Thu Apr 21 13:25:39 2011 +0000
@@ -385,14 +385,14 @@
 		png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
 
 
-		Resize(width,height,graphics::ColorMode::ARGB_32BPP);
+		Resize(width,height,graphics::ARGB_32BPP);
 
 		//currently only RGB is supported
 		if(pChannels!=3)
 			return UnimplementedType;
 
-		for(int y=0;y<height;y++) {
-			for(int x=0;x<width;x++) {
+		for(unsigned y=0;y<height;y++) {
+			for(unsigned x=0;x<width;x++) {
 				Raw2DGraphic::Data[(x+y*width)*4+2]=row_pointers[y][x*3];
 				Raw2DGraphic::Data[(x+y*width)*4+1]=row_pointers[y][x*3+1];
 				Raw2DGraphic::Data[(x+y*width)*4+0]=row_pointers[y][x*3+2];
--- a/Utils/Point2D.h	Thu Apr 21 01:53:15 2011 +0000
+++ b/Utils/Point2D.h	Thu Apr 21 13:25:39 2011 +0000
@@ -66,7 +66,7 @@
 		basic_Point2D(const basic_Point2D<U_> &point) : x(point.x), y(point.y) { }
 
 		template <class U_>
-		basic_Point2D& operator =(const basic_Point2D<U_> &point) { x=point.x; y=point.y; return *this; }
+		basic_Point2D& operator =(const basic_Point2D<U_> &point) { x=T_(point.x); y=T_(point.y); return *this; }
 
 		graphtype Distance(const basic_Point2D &point) {
 			return std::sqrt( (graphtype)(x-point.x)*(x-point.x) + (y-point.y)*(y-point.y) );
--- a/Utils/Rectangle2D.h	Thu Apr 21 01:53:15 2011 +0000
+++ b/Utils/Rectangle2D.h	Thu Apr 21 13:25:39 2011 +0000
@@ -54,7 +54,7 @@
 
 		template <class U>
 		basic_Rectangle2D(const basic_Rectangle2D<U> &rect) : 
-			Left(rect.Left), Top(rect.Top), Width(rect.Width), Height(rect.Height)
+			Left(T_(rect.Left)), Top(T_(rect.Top)), Width(T_(rect.Width)), Height(T_(rect.Height))
 		{ }
 
 		basic_Rectangle2D(const basic_Bounds2D<T_> &bounds);
--- a/Widgets/Line.cpp	Thu Apr 21 01:53:15 2011 +0000
+++ b/Widgets/Line.cpp	Thu Apr 21 13:25:39 2011 +0000
@@ -220,7 +220,7 @@
 				line->isTiled=t!=0;
 				if(size>4) {
 					fread(&t,4,1,gfile);
-					line->isVertical=t;
+					line->isVertical=t!=0;
 					if(size>8)
 						EatChunk(gfile,size-8);
 				}

mercurial