Commit 2f2f23c2 authored by hybrid's avatar hybrid

Fix some warnings under Linux.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2149 dfc29bdd-3216-0410-991c-e03cc46cb475
parent dfa2d627
# Makefile for Irrlicht Examples
# It's usually sufficient to change just the target name and source file list
# and be sure that CXX is set to a valid compiler
Target = 16.Quake3MapShader
Sources = main.cpp
Target = 21.Quake3Explorer
Sources = main.cpp sound.cpp q3factory.cpp
# general compiler settings
CPPFLAGS = -I../../include -I/usr/X11R6/include
CXXFLAGS = -O3 -ffast-math
#CXXFLAGS = -g -Wall
#CXXFLAGS = -O3 -ffast-math
CXXFLAGS = -g -Wall
#default target is Linux
all: all_linux
......
......@@ -48,12 +48,12 @@ struct GameData
GammaValue = 1.f;
// default deviceParam;
deviceParam.DriverType = EDT_DIRECT3D9;
deviceParam.DriverType = EDT_OPENGL;
deviceParam.WindowSize.Width = 800;
deviceParam.WindowSize.Height = 600;
deviceParam.Fullscreen = false;
deviceParam.Bits = 32;
deviceParam.ZBufferBits = 32;
deviceParam.ZBufferBits = 24;
deviceParam.Vsync = false;
deviceParam.AntiAlias = false;
......@@ -544,8 +544,8 @@ void CQuake3EventHandler::CreateGUI()
env->getSkin()->setColor ( EGDC_WINDOW, video::SColor(240,0x66,0x66,0x66) );
// minimal gui size 800x600
dimension2d<s32> dim ( 800, 600 );
dimension2d<s32> vdim ( Game->Device->getVideoDriver()->getScreenSize() );
dimension2d<u32> dim ( 800, 600 );
dimension2d<u32> vdim ( Game->Device->getVideoDriver()->getScreenSize() );
if ( vdim.Height >= dim.Height && vdim.Width >= dim.Width )
{
......@@ -692,7 +692,7 @@ void CQuake3EventHandler::CreateGUI()
IGUIImageList* imageList = env->createImageList( driver->getTexture ( "iconlist.png" ),
dimension2d<irr::s32>( 32, 32 ), true );
dimension2di( 32, 32 ), true );
if ( imageList )
{
......@@ -1880,9 +1880,10 @@ void runGame ( GameData *game )
/*!
*/
s32 IRRCALLCONV main(int argc, char* argv[])
int IRRCALLCONV main(int argc, char* argv[])
{
GameData game ( deletePathFromPath ( core::string<c16> (argv[0]), 1 ) );
core::string<c16> prgname(argv[0]);
GameData game ( deletePathFromPath ( prgname, 1 ) );
// dynamically load irrlicht
const c8 * dllName = argc > 1 ? argv[1] : "irrlicht.dll";
......
......@@ -682,7 +682,9 @@ funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename)
#else
// TODO: Dynamic Loading for other os
#ifdef _MSC_VER
#pragma comment(lib, "Irrlicht.lib")
#endif
funcptr_createDevice load_createDevice ( const c8 * filename)
{
......
DIRS = $(wildcard [01]* Demo)
DIRS = $(wildcard [012]* Demo)
all: $(DIRS)
......
......@@ -46,8 +46,8 @@ namespace quake3
cleanUnResolvedMeshes ( 1 ),
loadAllShaders ( 0 ),
loadSkyShader ( 0 ),
swapLump ( 0 ),
alpharef ( 1 ),
swapLump ( 0 ),
#ifdef __BIG_ENDIAN__
swapHeader ( 1 )
#else
......@@ -65,11 +65,11 @@ namespace quake3
u32 endTime;
s32 mergeShaderBuffer;
s32 cleanUnResolvedMeshes;
s32 loadAllShaders;
s32 loadSkyShader;
s32 alpharef;
s32 swapLump;
s32 swapHeader;
s32 loadAllShaders;
s32 loadSkyShader;
c8 scriptDir [ 64 ];
};
......@@ -493,6 +493,8 @@ namespace quake3
case NOISE:
y = Noiser::get();
break;
default:
break;
}
return base + ( y * amp );
......
......@@ -47,6 +47,7 @@ static inline u32 locale_lower ( u32 x )
switch ( locale_current )
{
case IRR_LOCALE_GERMAN:
case IRR_LOCALE_ANSI:
break;
}
// ansi
......
......@@ -329,7 +329,7 @@ namespace irr
//! typedef for Function Pointer
typedef IrrlichtDevice* (IRRCALLCONV *funcptr_createDevice )(
video::E_DRIVER_TYPE deviceType,
const core::dimension2d<s32>& windowSize,
const core::dimension2d<u32>& windowSize,
u32 bits,
bool fullscreen,
bool stencilbuffer,
......
......@@ -36,8 +36,8 @@ CAnimatedMeshSceneNode::CAnimatedMeshSceneNode(IAnimatedMesh* mesh,
CurrentFrameNr(0.f),
JointMode(EJUOR_NONE), JointsUsed(false),
TransitionTime(0), Transiting(0.f), TransitingBlend(0.f),
Looping(true), ReadOnlyMaterials(false),
LoopCallBack(0), PassCount(0), Shadow(0), RenderFromIdentity(0),
Looping(true), ReadOnlyMaterials(false), RenderFromIdentity(0),
LoopCallBack(0), PassCount(0), Shadow(0),
MD3Special ( 0 )
{
#ifdef _DEBUG
......
......@@ -580,7 +580,7 @@ void CGUIFont::draw(const wchar_t* text, const core::rect<s32>& position,
}
wchar_t c;
while( c = *text++)
while (( c = *text++))
{
bool lineBreak=false;
if ( c == L'\r') // Mac or Windows breaks
......
......@@ -176,6 +176,8 @@ bool CGUISpinBox::OnEvent(const SEvent& event)
changeEvent = true;
}
break;
default:
break;
}
break;
......
......@@ -16,13 +16,8 @@ namespace gui
{
CGUITreeViewNode::CGUITreeViewNode( CGUITreeView* owner, CGUITreeViewNode* parent )
: Owner( owner ),
Parent( parent ),
ImageIndex( -1 ),
SelectedImageIndex( -1 ),
Data( 0 ),
Data2( 0 ),
Expanded( false )
: Owner(owner), Parent(parent), ImageIndex(-1), SelectedImageIndex(-1),
Data(0), Data2(0), Expanded(false)
{
#ifdef _DEBUG
setDebugName( "CGUITreeView" );
......@@ -427,22 +422,22 @@ CGUITreeView::CGUITreeView(IGUIEnvironment* environment, IGUIElement* parent,
s32 id, core::rect<s32> rectangle, bool clip,
bool drawBack,bool scrollBarVertical, bool scrollBarHorizontal)
: IGUITreeView( environment, parent, id, rectangle ),
Selected( 0 ),
ScrollBarH( 0 ),
ScrollBarV( 0 ),
LinesVisible( true ),
Root(0), Selected(0),
ItemHeight( 0 ),
IndentWidth( 0 ),
TotalItemHeight( 0 ),
TotalItemWidth ( 0 ),
Selecting( false ),
Font( 0 ),
IconFont( 0 ),
ScrollBarH( 0 ),
ScrollBarV( 0 ),
ImageList( 0 ),
ImageLeftOfIcon( true ),
LastEventNode( 0 ),
LinesVisible( true ),
Selecting( false ),
Clip( clip ),
DrawBack( drawBack )
DrawBack( drawBack ),
ImageLeftOfIcon( true )
{
#ifdef _DEBUG
setDebugName( "CGUITreeView" );
......@@ -611,6 +606,8 @@ bool CGUITreeView::OnEvent( const SEvent &event )
return false;
}
break;
default:
break;
}
break;
case EET_MOUSE_INPUT_EVENT:
......@@ -672,9 +669,14 @@ bool CGUITreeView::OnEvent( const SEvent &event )
return true;
}
}
break;
default:
break;
}
}
break;
default:
break;
}
......
......@@ -117,7 +117,7 @@ namespace gui
s32 imageIndex = -1,
s32 selectedImageIndex = -1,
void* data = 0,
IReferenceCounted* data2 = 0 );
IReferenceCounted* data2 = 0);
//! Adds a new node before the first child node.
//! \param text text of the new node
......@@ -306,21 +306,21 @@ namespace gui
CGUITreeViewNode* Root;
IGUITreeViewNode* Selected;
bool LinesVisible;
s32 ItemHeight;
s32 IndentWidth;
s32 TotalItemHeight;
s32 TotalItemWidth;
IGUIFont* Font;
IGUIFont* IconFont;
bool Selecting;
IGUIScrollBar* ScrollBarH;
IGUIScrollBar* ScrollBarV;
IGUIImageList* ImageList;
IGUITreeViewNode* LastEventNode;
bool LinesVisible;
bool Selecting;
bool Clip;
bool DrawBack;
IGUIImageList* ImageList;
bool ImageLeftOfIcon;
IGUITreeViewNode* LastEventNode;
};
......
......@@ -1452,10 +1452,10 @@ void CImage::copyToScalingBoxFilter(IImage* target, s32 bias)
f32 sy;
sy = 0.f;
for ( s32 y = 0; y != destSize.Height; ++y )
for ( u32 y = 0; y != destSize.Height; ++y )
{
sx = 0.f;
for ( s32 x = 0; x != destSize.Width; ++x )
for ( u32 x = 0; x != destSize.Width; ++x )
{
target->setPixel( x, y, getPixelBox( core::floor32(sx), core::floor32(sy), fx, fy, bias ) );
sx += sourceXStep;
......
......@@ -722,7 +722,7 @@ bool CIrrDeviceLinux::run()
if ((CreationParams.DriverType != video::EDT_NULL) && display)
{
SEvent irrevent;
irrevent.MouseInput.ButtonStates = -1;
irrevent.MouseInput.ButtonStates = 0xffffffff;
while (XPending(display) > 0 && !Close)
{
......@@ -1461,7 +1461,7 @@ void CIrrDeviceLinux::pollJoysticks()
}
IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx(const SIrrlichtCreationParameters& param)
extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx(const SIrrlichtCreationParameters& param)
{
CIrrDeviceLinux* dev = new CIrrDeviceLinux(param);
......
......@@ -13,7 +13,7 @@ namespace io
CLimitReadFile::CLimitReadFile(IReadFile* alreadyOpenedFile, long pos, long areaSize,
const core::string<c16>& name)
: Filename(name), AreaStart(0), AreaEnd(0), File(alreadyOpenedFile), Pos ( 0 )
: Filename(name), AreaStart(0), AreaEnd(0), Pos(0), File(alreadyOpenedFile)
{
#ifdef _DEBUG
setDebugName("CLimitReadFile");
......
......@@ -80,7 +80,7 @@ bool CArchiveLoaderPAK::isALoadableFileFormat(io::IReadFile* file) const
PAK Reader
*/
CPakReader::CPakReader(IReadFile* file, bool ignoreCase, bool ignorePaths)
: File(file), IgnoreCase(ignoreCase), IgnorePaths(ignorePaths), Type ( "pak" )
: Type("pak"), File(file), IgnoreCase(ignoreCase), IgnorePaths(ignorePaths)
{
#ifdef _DEBUG
setDebugName("CPakReader");
......
......@@ -25,12 +25,11 @@ namespace scene
using namespace quake3;
//! constructor
CQ3LevelMesh::CQ3LevelMesh( io::IFileSystem* fs,
scene::ISceneManager* smgr,
CQ3LevelMesh::CQ3LevelMesh(io::IFileSystem* fs, scene::ISceneManager* smgr,
const Q3LevelLoadParameter &loadParam)
: Textures(0), LightMaps(0),
: LoadParam(loadParam), Textures(0), LightMaps(0),
Vertices(0), Faces(0), Planes(0), Nodes(0), Leafs(0), LeafFaces(0),
MeshVerts(0), Brushes(0), FileSystem(fs), SceneManager(smgr),LoadParam (loadParam)
MeshVerts(0), Brushes(0), FileSystem(fs), SceneManager(smgr)
{
#ifdef _DEBUG
IReferenceCounted::setDebugName("CQ3LevelMesh");
......
......@@ -28,11 +28,10 @@ CQuake3ShaderSceneNode::CQuake3ShaderSceneNode(
io::IFileSystem *fileSystem, scene::IMeshBuffer *original,
const IShader * shader)
: scene::IMeshSceneNode(parent, mgr, id,
core::vector3df ( 0.f, 0.f, 0.f ),
core::vector3df ( 0.f, 0.f, 0.f ),
core::vector3df ( 1.f, 1.f, 1.f )),
Mesh ( 0 ), MeshBuffer(0), Original(0),
Shader(shader), TimeAbs(0.f)
core::vector3df(0.f, 0.f, 0.f),
core::vector3df(0.f, 0.f, 0.f),
core::vector3df(1.f, 1.f, 1.f)),
Shader(shader), Mesh(0), Original(0), MeshBuffer(0), TimeAbs(0.f)
{
#ifdef _DEBUG
core::stringc dName = "CQuake3ShaderSceneNode ";
......@@ -904,13 +903,15 @@ void CQuake3ShaderSceneNode::vertextransform_rgbgen( f32 dt, SModifierFunction &
MeshBuffer->Vertices[i].Color.color = value;
} break;
case CONSTANT:
{
//rgbgen const ( x y z )
video::SColorf cf( function.x, function.y, function.z );
u32 col = cf.toSColor ().color;
for ( i = 0; i != vsize; ++i )
MeshBuffer->Vertices[i].Color.color = col;
} break;
default:
break;
}
}
......@@ -971,6 +972,8 @@ void CQuake3ShaderSceneNode::vertextransform_alphagen( f32 dt, SModifierFunction
for ( i = 0; i != vsize; ++i )
MeshBuffer->Vertices[i].Color.setAlpha ( value );
} break;
default:
break;
}
}
......@@ -1071,7 +1074,8 @@ void CQuake3ShaderSceneNode::vertextransform_tcgen( f32 dt, SModifierFunction &f
}
#endif
} break;
default:
break;
}
}
......@@ -1170,6 +1174,8 @@ void CQuake3ShaderSceneNode::animate( u32 stage,core::matrix4 &texture )
case TCMOD:
m2.makeIdentity();
break;
default:
break;
}
// get the modifier function
......@@ -1250,6 +1256,8 @@ void CQuake3ShaderSceneNode::animate( u32 stage,core::matrix4 &texture )
function.z = getAsFloat( v.content, pos );
function.y = getAsFloat( v.content, pos );
break;
default:
break;
}
}
......@@ -1261,6 +1269,8 @@ void CQuake3ShaderSceneNode::animate( u32 stage,core::matrix4 &texture )
case MOVE:
getModifierFunc( function, v.content, pos );
break;
default:
break;
}
switch ( function.masterfunc1 )
......@@ -1297,6 +1307,8 @@ void CQuake3ShaderSceneNode::animate( u32 stage,core::matrix4 &texture )
case MOVE:
deformvertexes_move( TimeAbs, function );
break;
default:
break;
}
break;
case RGBGEN:
......@@ -1319,8 +1331,12 @@ void CQuake3ShaderSceneNode::animate( u32 stage,core::matrix4 &texture )
//vertextransform_alphagen( TimeAbs, function );
break;
default:
break;
}
break;
default:
break;
}
} break;
......@@ -1360,8 +1376,8 @@ void CQuake3ShaderSceneNode::animate( u32 stage,core::matrix4 &texture )
// deformvertexes autosprite2
deformvertexes_autosprite2(TimeAbs, function);
break;
default:
break;
} // func
switch ( function.masterfunc0 )
......@@ -1369,6 +1385,8 @@ void CQuake3ShaderSceneNode::animate( u32 stage,core::matrix4 &texture )
case TCMOD:
texture *= m2;
break;
default:
break;
}
} // group
......
......@@ -23,10 +23,9 @@ CSceneNodeAnimatorCollisionResponse::CSceneNodeAnimatorCollisionResponse(
f32 slidingSpeed)
: Radius(ellipsoidRadius), Gravity(gravityPerSecond), Translation(ellipsoidTranslation),
World(world), Object(object), SceneManager(scenemanager), LastTime(0),
SlidingSpeed(slidingSpeed), Falling(false), IsCamera(false),
AnimateCameraTarget(true), CollisionOccurred(false),
CollisionCallback(0),
FirstUpdate ( true )
SlidingSpeed(slidingSpeed), CollisionCallback(0),
Falling(false), IsCamera(false), AnimateCameraTarget(true), CollisionOccurred(false),
FirstUpdate(true)
{
#ifdef _DEBUG
setDebugName("CSceneNodeAnimatorCollisionResponse");
......
......@@ -136,18 +136,18 @@ namespace scene
ISceneManager* SceneManager;
u32 LastTime;
f32 SlidingSpeed;
bool Falling;
bool IsCamera;
bool AnimateCameraTarget;
bool FirstUpdate;
bool CollisionOccurred;
core::vector3df CollisionPoint;
core::triangle3df CollisionTriangle;
core::vector3df CollisionResultPosition;
const ISceneNode * CollisionNode;
ICollisionCallback* CollisionCallback;
bool Falling;
bool IsCamera;
bool AnimateCameraTarget;
bool CollisionOccurred;
bool FirstUpdate;
};
} // end namespace scene
......
......@@ -1660,8 +1660,8 @@ void CBurningVideoDriver::OnResize(const core::dimension2d<u32>& size)
if (ScreenSize != realSize)
{
if (ViewPort.getWidth() == ScreenSize.Width &&
ViewPort.getHeight() == ScreenSize.Height)
if (ViewPort.getWidth() == (s32)ScreenSize.Width &&
ViewPort.getHeight() == (s32)ScreenSize.Height)
{
ViewPort.UpperLeftCorner.X = 0;
ViewPort.UpperLeftCorner.Y = 0;
......
......@@ -35,7 +35,7 @@ IRRVIDEOOBJ = CVideoModeList.o CFPSCounter.o $(IRRDRVROBJ) $(IRRIMAGEOBJ)
IRRSWRENDEROBJ = CSoftwareDriver.o CSoftwareTexture.o CTRFlat.o CTRFlatWire.o CTRGouraud.o CTRGouraudWire.o CTRTextureFlat.o CTRTextureFlatWire.o CTRTextureGouraud.o CTRTextureGouraudAdd.o CTRTextureGouraudNoZ.o CTRTextureGouraudWire.o CZBuffer.o CTRTextureGouraudVertexAlpha2.o CTRTextureGouraudNoZ2.o CTRTextureLightMap2_M2.o CTRTextureLightMap2_M4.o CTRTextureLightMap2_M1.o CSoftwareDriver2.o CSoftwareTexture2.o CTRTextureGouraud2.o CTRGouraud2.o CTRGouraudAlpha2.o CTRGouraudAlphaNoZ2.o CTRTextureDetailMap2.o CTRTextureGouraudAdd2.o CTRTextureGouraudAddNoZ2.o CTRTextureWire2.o CTRTextureLightMap2_Add.o CTRTextureLightMapGouraud2_M4.o IBurningShader.o CTRTextureBlend.o CTRTextureGouraudAlpha.o CTRTextureGouraudAlphaNoZ.o CDepthBuffer.o CBurningShader_Raster_Reference.o
IRRIOOBJ = CFileList.o CFileSystem.o CLimitReadFile.o CMemoryFile.o CReadFile.o CWriteFile.o CXMLReader.o CXMLWriter.o CZipReader.o CPakReader.o irrXML.o CAttributes.o
IRROTHEROBJ = CIrrDeviceSDL.o CIrrDeviceLinux.o CIrrDeviceStub.o CIrrDeviceWin32.o CLogger.o COSOperator.o Irrlicht.o os.o
IRRGUIOBJ = CGUIButton.o CGUICheckBox.o CGUIComboBox.o CGUIContextMenu.o CGUIEditBox.o CGUIEnvironment.o CGUIFileOpenDialog.o CGUIFont.o CGUIImage.o CGUIInOutFader.o CGUIListBox.o CGUIMenu.o CGUIMeshViewer.o CGUIMessageBox.o CGUIModalScreen.o CGUIScrollBar.o CGUISpinBox.o CGUISkin.o CGUIStaticText.o CGUITabControl.o CGUITable.o CGUIToolBar.o CGUIWindow.o CGUIColorSelectDialog.o CDefaultGUIElementFactory.o CGUISpriteBank.o
IRRGUIOBJ = CGUIButton.o CGUICheckBox.o CGUIComboBox.o CGUIContextMenu.o CGUIEditBox.o CGUIEnvironment.o CGUIFileOpenDialog.o CGUIFont.o CGUIImage.o CGUIInOutFader.o CGUIListBox.o CGUIMenu.o CGUIMeshViewer.o CGUIMessageBox.o CGUIModalScreen.o CGUIScrollBar.o CGUISpinBox.o CGUISkin.o CGUIStaticText.o CGUITabControl.o CGUITable.o CGUIToolBar.o CGUIWindow.o CGUIColorSelectDialog.o CDefaultGUIElementFactory.o CGUISpriteBank.o CGUIImageList.o CGUITreeView.o
ZLIBOBJ = zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o zlib/uncompr.o zlib/zutil.o
JPEGLIBOBJ = jpeglib/jcapimin.o jpeglib/jcapistd.o jpeglib/jccoefct.o jpeglib/jccolor.o jpeglib/jcdctmgr.o jpeglib/jchuff.o jpeglib/jcinit.o jpeglib/jcmainct.o jpeglib/jcmarker.o jpeglib/jcmaster.o jpeglib/jcomapi.o jpeglib/jcparam.o jpeglib/jcphuff.o jpeglib/jcprepct.o jpeglib/jcsample.o jpeglib/jctrans.o jpeglib/jdapimin.o jpeglib/jdapistd.o jpeglib/jdatadst.o jpeglib/jdatasrc.o jpeglib/jdcoefct.o jpeglib/jdcolor.o jpeglib/jddctmgr.o jpeglib/jdhuff.o jpeglib/jdinput.o jpeglib/jdmainct.o jpeglib/jdmarker.o jpeglib/jdmaster.o jpeglib/jdmerge.o jpeglib/jdphuff.o jpeglib/jdpostct.o jpeglib/jdsample.o jpeglib/jdtrans.o jpeglib/jerror.o jpeglib/jfdctflt.o jpeglib/jfdctfst.o jpeglib/jfdctint.o jpeglib/jidctflt.o jpeglib/jidctfst.o jpeglib/jidctint.o jpeglib/jidctred.o jpeglib/jmemmgr.o jpeglib/jmemnobs.o jpeglib/jquant1.o jpeglib/jquant2.o jpeglib/jutils.o
LIBPNGOBJ = libpng/png.o libpng/pngerror.o libpng/pngget.o libpng/pngmem.o libpng/pngpread.o libpng/pngread.o libpng/pngrio.o libpng/pngrtran.o libpng/pngrutil.o libpng/pngset.o libpng/pngtrans.o libpng/pngwio.o libpng/pngwrite.o libpng/pngwtran.o libpng/pngwutil.o
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment