From e7add518808baa6a72b81d3b247e9d9aac71b592 Mon Sep 17 00:00:00 2001 From: hybrid Date: Wed, 5 Mar 2008 00:02:00 +0000 Subject: [PATCH] Merged from 1.4 branch revisions 1272:1279 git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1280 dfc29bdd-3216-0410-991c-e03cc46cb475 --- changes.txt | 5 + examples/05.UserInterface/main.cpp | 279 +++++--------------- include/IGUIElement.h | 11 +- include/ISkinnedMesh.h | 2 +- include/SSkinMeshBuffer.h | 2 +- source/Irrlicht/CBoneSceneNode.cpp | 21 +- source/Irrlicht/CBoneSceneNode.h | 11 +- source/Irrlicht/CColladaMeshWriter.cpp | 6 + source/Irrlicht/CEmptySceneNode.cpp | 1 - source/Irrlicht/CGUIMenu.cpp | 2 + source/Irrlicht/CGUIToolBar.cpp | 2 +- source/Irrlicht/CIrrDeviceLinux.cpp | 3 +- source/Irrlicht/CLightSceneNode.cpp | 6 +- source/Irrlicht/CMeshManipulator.cpp | 6 +- source/Irrlicht/COpenGLDriver.cpp | 8 +- source/Irrlicht/COpenGLDriver.h | 5 +- source/Irrlicht/COpenGLExtensionHandler.cpp | 8 +- source/Irrlicht/COpenGLExtensionHandler.h | 1 + source/Irrlicht/CQuake3ShaderSceneNode.cpp | 12 +- source/Irrlicht/CQuake3ShaderSceneNode.h | 2 - source/Irrlicht/CSceneManager.cpp | 9 +- source/Irrlicht/CSkinnedMesh.cpp | 2 +- source/Irrlicht/CSkinnedMesh.h | 10 +- source/Irrlicht/CTRTextureGouraud.cpp | 2 - source/Irrlicht/CTRTextureGouraud.h | 20 +- source/Irrlicht/CTRTextureGouraudWire.cpp | 4 +- source/Irrlicht/CTerrainSceneNode.cpp | 1 + source/Irrlicht/CTerrainSceneNode.h | 5 +- source/Irrlicht/ITriangleRenderer.h | 5 +- 29 files changed, 178 insertions(+), 273 deletions(-) diff --git a/changes.txt b/changes.txt index 3ef9a767..734943d1 100644 --- a/changes.txt +++ b/changes.txt @@ -49,6 +49,11 @@ Changes in version 1.5 (... 2008) ------------------------------------------- Changes in version 1.4.1 (??? 2008) + - Fixed clipping of menu, toolbar and combo box GUI elements, reported by greenya + - setNotClipped now applies all the way up to the root of the GUI environment, rather than just to the next parent + + - Made new scene managers use the original manager's GUIEnvironment, reported by MasterGod + - Fixed IGUICheckBox::setEnabled, reported by Dorth - Fixed the FollowSpline animator to avoid crashes when only one waypoint is given. diff --git a/examples/05.UserInterface/main.cpp b/examples/05.UserInterface/main.cpp index 09c6f400..9b3fb277 100644 --- a/examples/05.UserInterface/main.cpp +++ b/examples/05.UserInterface/main.cpp @@ -24,226 +24,91 @@ using namespace gui; #pragma comment(lib, "Irrlicht.lib") #endif +gui::IGUIButton *buttonMain; +gui::IGUIWindow *windowMain; +bool isWindowMinimized = false; -IrrlichtDevice *device = 0; -s32 cnt = 0; -IGUIListBox* listbox = 0; - - -/* -The Event Receiver is not only capable of getting keyboard and -mouse input events, but also events of the graphical user interface -(gui). There are events for almost everything: Button click, -Listbox selection change, events that say that a element was hovered -and so on. To be able to react to some of these events, we create -an event receiver. -We only react to gui events, and if it's such an event, we get the -id of the caller (the gui element which caused the event) and get -the pointer to the gui environment. -*/ -class MyEventReceiver : public IEventReceiver +class : public IEventReceiver { -public: - virtual bool OnEvent(const SEvent& event) - { - if (event.EventType == EET_GUI_EVENT) - { - s32 id = event.GUIEvent.Caller->getID(); - IGUIEnvironment* env = device->getGUIEnvironment(); + virtual bool OnEvent(const SEvent& event) + { + static s32 windowHeight; - switch(event.GUIEvent.EventType) - { + if (event.EventType==EET_GUI_EVENT) + { + if (event.GUIEvent.EventType==gui::EGET_BUTTON_CLICKED) + { + if (event.GUIEvent.Caller==buttonMain) + { + isWindowMinimized = !isWindowMinimized; - /* - If a scrollbar changed its scroll position, and it is 'our' - scrollbar (the one with id 104), then we change the - transparency of all gui elements. This is a very easy task: - There is a skin object, in which all color settings are stored. - We simply go through all colors stored in the skin and change - their alpha value. - */ - case EGET_SCROLL_BAR_CHANGED: - if (id == 104) - { - s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos(); - - for (u32 i=0; igetSkin()->getColor((EGUI_DEFAULT_COLOR)i); - col.setAlpha(pos); - env->getSkin()->setColor((EGUI_DEFAULT_COLOR)i, col); - } - - } - break; + rect pos = windowMain->getRelativePosition(); + if (isWindowMinimized) + { + windowHeight = pos.LowerRightCorner.Y - pos.UpperLeftCorner.Y; + pos.LowerRightCorner.Y = pos.UpperLeftCorner.Y + 22; + } else { + pos.LowerRightCorner.Y = pos.UpperLeftCorner.Y + windowHeight; + } - /* - If a button was clicked, it could be one of 'our' - three buttons. If it is the first, we shut down the engine. - If it is the second, we create a little window with some - text on it. We also add a string to the list box to log - what happened. And if it is the third button, we create - a file open dialog, and add also this as string to the list box. - That's all for the event receiver. - */ - case EGET_BUTTON_CLICKED: + windowMain->setRelativePosition(pos); - if (id == 101) - { - device->closeDevice(); - return true; - } + return true; + } + } + } - if (id == 102) - { - listbox->addItem(L"Window created"); - cnt += 30; - if (cnt > 200) - cnt = 0; + return false; + } +} eventReceiver; - IGUIWindow* window = env->addWindow( - rect(100 + cnt, 100 + cnt, 300 + cnt, 200 + cnt), - false, // modal? - L"Test window"); - - env->addStaticText(L"Please close me", - rect(35,35,140,50), - true, // border? - false, // wordwrap? - window); - - return true; - } - - if (id == 103) - { - listbox->addItem(L"File open"); - env->addFileOpenDialog(L"Please choose a file."); - return true; - } - - break; - default: - break; - } - } - - return false; - } -}; - - -/* -Ok, now for the more interesting part. First, create the -Irrlicht device. As in some examples before, we ask the user which -driver he wants to use for this example: -*/ int main() { - // ask user for driver - - video::E_DRIVER_TYPE driverType; + // irr device and pointers + IrrlichtDevice *irrDevice = createDevice(video::EDT_DIRECT3D9); + video::IVideoDriver *irrVideo = irrDevice->getVideoDriver(); + gui::IGUIEnvironment *irrGUI = irrDevice->getGUIEnvironment(); - printf("Please select the driver you want for this example:\n"\ - " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\ - " (d) Software Renderer\n (e) Burning's Software Renderer\n"\ - " (f) NullDevice\n (otherKey) exit\n\n"); + irrDevice->setEventReceiver(&eventReceiver); - char i; - std::cin >> i; + // gui mass + + buttonMain = irrGUI->addButton(rect(4,4,100,40), 0, -1, L"CLICK ME"); + windowMain = irrGUI->addWindow(rect(40,40,400,400), false, L"Main Window"); - switch(i) - { - case 'a': driverType = video::EDT_DIRECT3D9;break; - case 'b': driverType = video::EDT_DIRECT3D8;break; - case 'c': driverType = video::EDT_OPENGL; break; - case 'd': driverType = video::EDT_SOFTWARE; break; - case 'e': driverType = video::EDT_BURNINGSVIDEO;break; - case 'f': driverType = video::EDT_NULL; break; - default: return 1; - } + irrGUI->addButton(rect(4,24,100,40), windowMain, -1, L"button"); + irrGUI->addCheckBox(true, rect(4,40,100,60), windowMain); + irrGUI->addComboBox(rect(4,60,100,80), windowMain)->addItem(L"item"); + irrGUI->addEditBox(L"test", rect(4,80,100,100), true, windowMain); + irrGUI->addImage(rect(4,100,100,120), windowMain); + irrGUI->addListBox(rect(4,120,100,160), windowMain)->addItem(L"item"); + gui::IGUIContextMenu *m = irrGUI->addMenu(windowMain); + m->setMinSize(dimension2di(100,40)); + m->addItem(L"menuitem1"); + m->addItem(L"menuitem2"); + irrGUI->addMeshViewer(rect(4,160,100,180), windowMain); + irrGUI->addScrollBar(true, rect(4,180,100,200), windowMain); + irrGUI->addSpinBox(L"spinbox", rect(4,200,100,220), windowMain); + irrGUI->addStaticText(L"statictext", rect(4,220,100,240), false, true, windowMain); + irrGUI->addTabControl(rect(120,24,220,64), windowMain); +// irrGUI->addTable(rect(120,80,220,120), windowMain)->addColumn(L"column1"); + gui::IGUIToolBar *t = irrGUI->addToolBar(windowMain); + t->setMinSize(dimension2di(100,80)); + t->addButton(-1, L"toolbarButton1"); + t->addButton(-1, L"toolbarButton2"); + irrGUI->addWindow(rect(120,150,250,300), false, L"testWindow", windowMain); - // create device and exit if creation failed + // show time! + while(irrDevice->run()) + if (irrDevice->isWindowActive()) + { + irrVideo->beginScene(true, true, video::SColor(0x204060)); + irrGUI->drawAll(); + irrVideo->endScene(); + } - device = createDevice(driverType, core::dimension2d(640, 480)); + // drop time + irrDevice->drop(); - if (device == 0) - return 1; // could not create selected driver. - - /* The creation was successful, now we set the event receiver and - store pointers to the driver and to the gui environment. */ - - MyEventReceiver receiver; - device->setEventReceiver(&receiver); - device->setWindowCaption(L"Irrlicht Engine - User Interface Demo"); - - video::IVideoDriver* driver = device->getVideoDriver(); - IGUIEnvironment* env = device->getGUIEnvironment(); - - /* - To make the font a little bit nicer, we load an external font - and set it as the new default font in the skin. - To keep the standard font for tool tip text, we set it to - the built-in font. - */ - - IGUISkin* skin = env->getSkin(); - IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp"); - if (font) - skin->setFont(font); - - skin->setFont(env->getBuiltInFont(), EGDF_TOOLTIP); - - /* - We add three buttons. The first one closes the engine. The second - creates a window and the third opens a file open dialog. The third - parameter is the id of the button, with which we can easily identify - the button in the event receiver. - */ - - env->addButton(rect(10,240,110,240 + 32), 0, 101, L"Quit", L"Exits Program"); - env->addButton(rect(10,280,110,280 + 32), 0, 102, L"New Window", L"Launches a new Window"); - env->addButton(rect(10,320,110,320 + 32), 0, 103, L"File Open", L"Opens a file"); - - /* - Now, we add a static text and a scrollbar, which modifies the - transparency of all gui elements. We set the maximum value of - the scrollbar to 255, because that's the maximal value for - a color value. - Then we create an other static text and a list box. - */ - - env->addStaticText(L"Transparent Control:", rect(150,20,350,40), true); - IGUIScrollBar* scrollbar = env->addScrollBar(true, rect(150, 45, 350, 60), 0, 104); - scrollbar->setMax(255); - - // set scrollbar position to alpha value of an arbitrary element - scrollbar->setPos(env->getSkin()->getColor(EGDC_WINDOW).getAlpha()); - - env->addStaticText(L"Logging ListBox:", rect(50,110,250,130), true); - listbox = env->addListBox(rect(50, 140, 250, 210)); - env->addEditBox(L"Editable Text", rect(350, 80, 550, 100)); - - // add the engine logo - env->addImage(driver->getTexture("../../media/irrlichtlogo2.png"), - position2d(10,10)); - - - /* - That's all, we only have to draw everything. - */ - - while(device->run() && driver) - if (device->isWindowActive()) - { - driver->beginScene(true, true, SColor(0,200,200,200)); - - env->drawAll(); - - driver->endScene(); - } - - device->drop(); - - return 0; -} + return 0; +} \ No newline at end of file diff --git a/include/IGUIElement.h b/include/IGUIElement.h index 96689fab..18621781 100644 --- a/include/IGUIElement.h +++ b/include/IGUIElement.h @@ -1,4 +1,4 @@ - // Copyright (C) 2002-2007 Nikolaus Gebhardt +// Copyright (C) 2002-2007 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h @@ -215,12 +215,9 @@ public: if (NoClip) { IGUIElement* p=this; - while (p && p->NoClip && p->Parent) - p = p->Parent; - if (p->Parent) - parentAbsoluteClip = p->Parent->AbsoluteClippingRect; - else - parentAbsoluteClip = p->AbsoluteClippingRect; + while (p && p->Parent) + p = p->Parent; + parentAbsoluteClip = p->AbsoluteClippingRect; } else parentAbsoluteClip = Parent->AbsoluteClippingRect; diff --git a/include/ISkinnedMesh.h b/include/ISkinnedMesh.h index 34f35efb..b9ef140f 100644 --- a/include/ISkinnedMesh.h +++ b/include/ISkinnedMesh.h @@ -1,4 +1,4 @@ -// Copyright (C) 2002-2006 Nikolaus Gebhardt +// Copyright (C) 2002-2007 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h diff --git a/include/SSkinMeshBuffer.h b/include/SSkinMeshBuffer.h index 2dc8fb99..68688c7f 100644 --- a/include/SSkinMeshBuffer.h +++ b/include/SSkinMeshBuffer.h @@ -1,4 +1,4 @@ -// Copyright (C) 2002-2006 Nikolaus Gebhardt +// Copyright (C) 2002-2007 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h diff --git a/source/Irrlicht/CBoneSceneNode.cpp b/source/Irrlicht/CBoneSceneNode.cpp index 37391271..5ad59347 100644 --- a/source/Irrlicht/CBoneSceneNode.cpp +++ b/source/Irrlicht/CBoneSceneNode.cpp @@ -1,3 +1,10 @@ +// Copyright (C) 2002-2007 Nikolaus Gebhardt +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#include "IrrCompileConfig.h" +#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ + #include "CBoneSceneNode.h" namespace irr @@ -8,10 +15,9 @@ namespace scene //! constructor CBoneSceneNode::CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, u32 boneIndex, const c8* boneName) -: IBoneSceneNode(parent, mgr, id), AnimationMode(EBAM_AUTOMATIC), SkinningSpace(EBSS_LOCAL), - BoneIndex(boneIndex), BoneName(boneName) +: IBoneSceneNode(parent, mgr, id), BoneIndex(boneIndex), BoneName(boneName), + AnimationMode(EBAM_AUTOMATIC), SkinningSpace(EBSS_LOCAL) { - } @@ -21,12 +27,14 @@ const c8* CBoneSceneNode::getBoneName() const return BoneName.c_str(); } + //! Returns the index of the bone u32 CBoneSceneNode::getBoneIndex() const { return BoneIndex; } + //! Sets the animation mode of the bone. Returns true if successful. bool CBoneSceneNode::setAnimationMode(E_BONE_ANIMATION_MODE mode) { @@ -34,17 +42,21 @@ bool CBoneSceneNode::setAnimationMode(E_BONE_ANIMATION_MODE mode) return true; } + //! Gets the current animation mode of the bone E_BONE_ANIMATION_MODE CBoneSceneNode::getAnimationMode() const { return AnimationMode; } + //! returns the axis aligned bounding box of this node const core::aabbox3d& CBoneSceneNode::getBoundingBox() const { return Box; } + + /* //! Returns the relative transformation of the scene node. core::matrix4 CBoneSceneNode::getRelativeTransformation() const @@ -53,6 +65,7 @@ core::matrix4 CBoneSceneNode::getRelativeTransformation() const } */ + void CBoneSceneNode::OnAnimate(u32 timeMs) { if (IsVisible) @@ -112,3 +125,5 @@ void CBoneSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeRe } // namespace scene } // namespace irr +#endif + diff --git a/source/Irrlicht/CBoneSceneNode.h b/source/Irrlicht/CBoneSceneNode.h index 5a6ed18a..3a0bb02b 100644 --- a/source/Irrlicht/CBoneSceneNode.h +++ b/source/Irrlicht/CBoneSceneNode.h @@ -1,3 +1,7 @@ +// Copyright (C) 2002-2007 Nikolaus Gebhardt +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + #ifndef __C_BONE_SCENE_NODE_H_INCLUDED__ #define __C_BONE_SCENE_NODE_H_INCLUDED__ @@ -6,7 +10,6 @@ #include "IBoneSceneNode.h" #include "irrString.h" - namespace irr { namespace scene @@ -64,13 +67,13 @@ namespace scene private: void helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node); - E_BONE_ANIMATION_MODE AnimationMode; - E_BONE_SKINNING_SPACE SkinningSpace; - u32 BoneIndex; core::stringc BoneName; core::aabbox3d Box; + + E_BONE_ANIMATION_MODE AnimationMode; + E_BONE_SKINNING_SPACE SkinningSpace; }; } // end namespace scene diff --git a/source/Irrlicht/CColladaMeshWriter.cpp b/source/Irrlicht/CColladaMeshWriter.cpp index 2ee36e89..54057eff 100644 --- a/source/Irrlicht/CColladaMeshWriter.cpp +++ b/source/Irrlicht/CColladaMeshWriter.cpp @@ -1,3 +1,7 @@ +#include "IrrCompileConfig.h" + +#ifdef _IRR_COMPILE_WITH_COLLADA_WRITER_ + #include "CColladaMeshWriter.h" #include "os.h" #include "IFileSystem.h" @@ -814,3 +818,5 @@ bool CColladaMeshWriter::hasSecondTextureCoordinates(video::E_VERTEX_TYPE type) } // end namespace } // end namespace +#endif + diff --git a/source/Irrlicht/CEmptySceneNode.cpp b/source/Irrlicht/CEmptySceneNode.cpp index a65a28ee..f4f53421 100644 --- a/source/Irrlicht/CEmptySceneNode.cpp +++ b/source/Irrlicht/CEmptySceneNode.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CEmptySceneNode.h" -#include "IVideoDriver.h" #include "ISceneManager.h" namespace irr diff --git a/source/Irrlicht/CGUIMenu.cpp b/source/Irrlicht/CGUIMenu.cpp index c42a4e56..ef9508fe 100644 --- a/source/Irrlicht/CGUIMenu.cpp +++ b/source/Irrlicht/CGUIMenu.cpp @@ -28,6 +28,8 @@ CGUIMenu::CGUIMenu(IGUIEnvironment* environment, IGUIElement* parent, Type = EGUIET_MENU; + setNotClipped(false); + recalculateSize(); } diff --git a/source/Irrlicht/CGUIToolBar.cpp b/source/Irrlicht/CGUIToolBar.cpp index 2430172f..3ade427d 100644 --- a/source/Irrlicht/CGUIToolBar.cpp +++ b/source/Irrlicht/CGUIToolBar.cpp @@ -89,7 +89,7 @@ void CGUIToolBar::draw() return; core::rect rect = AbsoluteRect; - core::rect* clip = 0; + core::rect* clip = &AbsoluteClippingRect; // draw frame skin->draw3DToolBar(this, rect, clip); diff --git a/source/Irrlicht/CIrrDeviceLinux.cpp b/source/Irrlicht/CIrrDeviceLinux.cpp index 627a7ead..d76cfc35 100644 --- a/source/Irrlicht/CIrrDeviceLinux.cpp +++ b/source/Irrlicht/CIrrDeviceLinux.cpp @@ -1052,7 +1052,7 @@ void CIrrDeviceLinux::setResizeAble(bool resize) //! by the gfx adapter. video::IVideoModeList* CIrrDeviceLinux::getVideoModeList() { - +#ifdef _IRR_COMPILE_WITH_X11_ if (!VideoModeList.getVideoModeCount()) { bool temporaryDisplay = false; @@ -1119,6 +1119,7 @@ video::IVideoModeList* CIrrDeviceLinux::getVideoModeList() XCloseDisplay(display); } } +#endif return &VideoModeList; } diff --git a/source/Irrlicht/CLightSceneNode.cpp b/source/Irrlicht/CLightSceneNode.cpp index 0d7fa63a..027cedad 100644 --- a/source/Irrlicht/CLightSceneNode.cpp +++ b/source/Irrlicht/CLightSceneNode.cpp @@ -15,8 +15,8 @@ namespace scene { //! constructor -CLightSceneNode::CLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position, video::SColorf color,f32 radius) +CLightSceneNode::CLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, + const core::vector3df& position, video::SColorf color, f32 radius) : ILightSceneNode(parent, mgr, id, position) { #ifdef _DEBUG @@ -175,7 +175,7 @@ ISceneNode* CLightSceneNode::clone(ISceneNode* newParent, ISceneManager* newMana if (!newManager) newManager = SceneManager; - CLightSceneNode* nb = new CLightSceneNode(newParent, + CLightSceneNode* nb = new CLightSceneNode(newParent, newManager, ID, RelativeTranslation, LightData.DiffuseColor, LightData.Radius); nb->cloneMembers(this, newManager); diff --git a/source/Irrlicht/CMeshManipulator.cpp b/source/Irrlicht/CMeshManipulator.cpp index aff48264..481d2ca4 100644 --- a/source/Irrlicht/CMeshManipulator.cpp +++ b/source/Irrlicht/CMeshManipulator.cpp @@ -3,12 +3,8 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CMeshManipulator.h" -#include "IMesh.h" #include "SMesh.h" -#include "SMeshBuffer.h" -#include "SMeshBufferLightMap.h" -#include "SMeshBufferTangents.h" -#include "IAnimatedMesh.h" +#include "CMeshBuffer.h" #include "SAnimatedMesh.h" #include "os.h" diff --git a/source/Irrlicht/COpenGLDriver.cpp b/source/Irrlicht/COpenGLDriver.cpp index 62052aed..151b8045 100644 --- a/source/Irrlicht/COpenGLDriver.cpp +++ b/source/Irrlicht/COpenGLDriver.cpp @@ -2,8 +2,9 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" #include "COpenGLDriver.h" +// needed here also because of the create methods' parameters +#include "CNullDriver.h" #ifdef _IRR_COMPILE_WITH_OPENGL_ @@ -2631,6 +2632,7 @@ void COpenGLDriver::enableClipPlane(u32 index, bool enable) } // end namespace } // end namespace +#endif // _IRR_COMPILE_WITH_OPENGL_ namespace irr { @@ -2712,7 +2714,3 @@ IVideoDriver* createOpenGLDriver(const core::dimension2d& screenSize, } // end namespace } // end namespace -#endif // _IRR_COMPILE_WITH_OPENGL_ - - - diff --git a/source/Irrlicht/COpenGLDriver.h b/source/Irrlicht/COpenGLDriver.h index e3117a03..6266c756 100644 --- a/source/Irrlicht/COpenGLDriver.h +++ b/source/Irrlicht/COpenGLDriver.h @@ -6,12 +6,13 @@ #define __C_VIDEO_OPEN_GL_H_INCLUDED__ #include "IrrCompileConfig.h" + +#ifdef _IRR_COMPILE_WITH_OPENGL_ + #include "CNullDriver.h" #include "IMaterialRendererServices.h" #include "COpenGLExtensionHandler.h" -#ifdef _IRR_COMPILE_WITH_OPENGL_ - #if defined(_IRR_WINDOWS_API_) // include windows headers for HWND #define WIN32_LEAN_AND_MEAN diff --git a/source/Irrlicht/COpenGLExtensionHandler.cpp b/source/Irrlicht/COpenGLExtensionHandler.cpp index fa7be499..d0625a97 100644 --- a/source/Irrlicht/COpenGLExtensionHandler.cpp +++ b/source/Irrlicht/COpenGLExtensionHandler.cpp @@ -1,12 +1,12 @@ +#include "IrrCompileConfig.h" + +#ifdef _IRR_COMPILE_WITH_OPENGL_ + #include "COpenGLExtensionHandler.h" #include "irrString.h" #include "SMaterial.h" // for MATERIAL_MAX_TEXTURES #include "fast_atof.h" -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_OPENGL_ - namespace irr { namespace video diff --git a/source/Irrlicht/COpenGLExtensionHandler.h b/source/Irrlicht/COpenGLExtensionHandler.h index ec95790a..07db9708 100644 --- a/source/Irrlicht/COpenGLExtensionHandler.h +++ b/source/Irrlicht/COpenGLExtensionHandler.h @@ -1497,3 +1497,4 @@ inline void COpenGLExtensionHandler::extGlGetBufferPointerv (GLenum target, GLen #endif #endif + diff --git a/source/Irrlicht/CQuake3ShaderSceneNode.cpp b/source/Irrlicht/CQuake3ShaderSceneNode.cpp index 4531d62d..b152ed40 100644 --- a/source/Irrlicht/CQuake3ShaderSceneNode.cpp +++ b/source/Irrlicht/CQuake3ShaderSceneNode.cpp @@ -2,6 +2,10 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h +#include "IrrCompileConfig.h" + +#ifdef _IRR_COMPILE_WITH_BSP_LOADER_ + #include "CQuake3ShaderSceneNode.h" #include "IVideoDriver.h" #include "ICameraSceneNode.h" @@ -42,12 +46,6 @@ CQuake3ShaderSceneNode::CQuake3ShaderSceneNode( } -/* -*/ -CQuake3ShaderSceneNode::~CQuake3ShaderSceneNode () -{ -} - /* create single copies */ @@ -791,3 +789,5 @@ video::SMaterial& CQuake3ShaderSceneNode::getMaterial(u32 i) } // end namespace scene } // end namespace irr +#endif + diff --git a/source/Irrlicht/CQuake3ShaderSceneNode.h b/source/Irrlicht/CQuake3ShaderSceneNode.h index 23477afe..3b14c600 100644 --- a/source/Irrlicht/CQuake3ShaderSceneNode.h +++ b/source/Irrlicht/CQuake3ShaderSceneNode.h @@ -26,8 +26,6 @@ public: const quake3::SShader * shader ); - virtual ~CQuake3ShaderSceneNode (); - virtual void OnRegisterSceneNode(); virtual void render(); virtual void OnAnimate(u32 timeMs); diff --git a/source/Irrlicht/CSceneManager.cpp b/source/Irrlicht/CSceneManager.cpp index 054b81fe..9ab90e1e 100644 --- a/source/Irrlicht/CSceneManager.cpp +++ b/source/Irrlicht/CSceneManager.cpp @@ -13,6 +13,7 @@ #include "ISceneUserDataSerializer.h" #include "IGUIEnvironment.h" #include "IMaterialRenderer.h" +#include "IReadFile.h" #include "os.h" @@ -174,7 +175,7 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, if (CursorControl) CursorControl->grab(); - if ( GUIEnvironment ) + if (GUIEnvironment) GUIEnvironment->grab(); // create mesh cache if not there already @@ -405,6 +406,7 @@ ISceneNode* CSceneManager::addQuake3SceneNode(IMeshBuffer* meshBuffer, const quake3::SShader * shader, ISceneNode* parent, s32 id) { +#ifdef _IRR_COMPILE_WITH_BSP_LOADER_ if ( 0 == shader ) return 0; @@ -415,6 +417,9 @@ ISceneNode* CSceneManager::addQuake3SceneNode(IMeshBuffer* meshBuffer, node->drop(); return node; +#else + return 0; +#endif } //! adds Volume Lighting Scene Node. @@ -1642,7 +1647,7 @@ IMeshCache* CSceneManager::getMeshCache() //! Creates a new scene manager. ISceneManager* CSceneManager::createNewSceneManager(bool cloneContent) { - CSceneManager* manager = new CSceneManager(Driver, FileSystem, CursorControl, MeshCache); + CSceneManager* manager = new CSceneManager(Driver, FileSystem, CursorControl, MeshCache, GUIEnvironment); if (cloneContent) manager->cloneMembers(this, manager); diff --git a/source/Irrlicht/CSkinnedMesh.cpp b/source/Irrlicht/CSkinnedMesh.cpp index 5b668321..3932c15b 100644 --- a/source/Irrlicht/CSkinnedMesh.cpp +++ b/source/Irrlicht/CSkinnedMesh.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2002-2006 Nikolaus Gebhardt +// Copyright (C) 2002-2007 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h diff --git a/source/Irrlicht/CSkinnedMesh.h b/source/Irrlicht/CSkinnedMesh.h index 68119110..6503304c 100644 --- a/source/Irrlicht/CSkinnedMesh.h +++ b/source/Irrlicht/CSkinnedMesh.h @@ -1,20 +1,18 @@ -// Copyright (C) 2002-2006 Nikolaus Gebhardt +// Copyright (C) 2002-2007 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h - //New skinned mesh #ifndef __C_SKINNED_MESH_H_INCLUDED__ #define __C_SKINNED_MESH_H_INCLUDED__ +#include "ISkinnedMesh.h" +#include "SMeshBuffer.h" #include "S3DVertex.h" #include "irrString.h" #include "matrix4.h" -#include "SMeshBuffer.h" -#include - -#include "ISkinnedMesh.h" +#include "quaternion.h" namespace irr { diff --git a/source/Irrlicht/CTRTextureGouraud.cpp b/source/Irrlicht/CTRTextureGouraud.cpp index 8dbbe82b..a9fdf7e9 100644 --- a/source/Irrlicht/CTRTextureGouraud.cpp +++ b/source/Irrlicht/CTRTextureGouraud.cpp @@ -2,9 +2,7 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" #include "CTRTextureGouraud.h" -#include "os.h" #ifdef _IRR_COMPILE_WITH_SOFTWARE_ diff --git a/source/Irrlicht/CTRTextureGouraud.h b/source/Irrlicht/CTRTextureGouraud.h index c05b9171..2ba1b67d 100644 --- a/source/Irrlicht/CTRTextureGouraud.h +++ b/source/Irrlicht/CTRTextureGouraud.h @@ -5,7 +5,23 @@ #ifndef __C_TRIANGLE_RENDERER_TEXTURE_GOURAUD_H_INCLUDED__ #define __C_TRIANGLE_RENDERER_TEXTURE_GOURAUD_H_INCLUDED__ +#include "IrrCompileConfig.h" + +#ifndef _IRR_COMPILE_WITH_SOFTWARE_ +// forward declarations for create methods +namespace irr +{ +namespace video +{ + class ITriangleRenderer; + class IZBuffer; +} // end namespace video +} // end namespace irr + +#else + #include "ITriangleRenderer.h" +#include "IImage.h" namespace irr { @@ -21,7 +37,7 @@ namespace video //! destructor virtual ~CTRTextureGouraud(); - + //! sets a render target virtual void setRenderTarget(video::IImage* surface, const core::rect& viewPort); @@ -65,3 +81,5 @@ namespace video #endif +#endif + diff --git a/source/Irrlicht/CTRTextureGouraudWire.cpp b/source/Irrlicht/CTRTextureGouraudWire.cpp index f57210be..7714efd5 100644 --- a/source/Irrlicht/CTRTextureGouraudWire.cpp +++ b/source/Irrlicht/CTRTextureGouraudWire.cpp @@ -332,11 +332,10 @@ public: RenderTarget->unlock(); ZBuffer->unlock(); Texture->unlock(); - } - }; + } // end namespace video } // end namespace irr @@ -359,3 +358,4 @@ ITriangleRenderer* createTriangleRendererTextureGouraudWire(IZBuffer* zbuffer) } // end namespace video } // end namespace irr + diff --git a/source/Irrlicht/CTerrainSceneNode.cpp b/source/Irrlicht/CTerrainSceneNode.cpp index 6c136d7c..c4277cfd 100644 --- a/source/Irrlicht/CTerrainSceneNode.cpp +++ b/source/Irrlicht/CTerrainSceneNode.cpp @@ -19,6 +19,7 @@ #include "IGUIFont.h" #include "IFileSystem.h" #include "IReadFile.h" +#include "ITextSceneNode.h" namespace irr { diff --git a/source/Irrlicht/CTerrainSceneNode.h b/source/Irrlicht/CTerrainSceneNode.h index 3f872184..6cc4ba5c 100644 --- a/source/Irrlicht/CTerrainSceneNode.h +++ b/source/Irrlicht/CTerrainSceneNode.h @@ -11,17 +11,18 @@ #include "ITerrainSceneNode.h" #include "SMesh.h" -#include "IReadFile.h" -#include "ITextSceneNode.h" namespace irr { namespace io { class IFileSystem; + class IReadFile; } namespace scene { + class ITextSceneNode; + //! A scene node for displaying terrain using the geo mip map algorithm. class CTerrainSceneNode : public ITerrainSceneNode { diff --git a/source/Irrlicht/ITriangleRenderer.h b/source/Irrlicht/ITriangleRenderer.h index 731ced51..69d4a185 100644 --- a/source/Irrlicht/ITriangleRenderer.h +++ b/source/Irrlicht/ITriangleRenderer.h @@ -6,7 +6,6 @@ #define __I_TRIANGLE_RENDERER_H_INCLUDED__ #include "IReferenceCounted.h" -#include "IImage.h" #include "S2DVertex.h" #include "rect.h" #include "IZBuffer.h" @@ -15,6 +14,7 @@ namespace irr { namespace video { + class IImage; enum ETriangleRenderer { @@ -35,9 +35,6 @@ namespace video { public: - //! destructor - virtual ~ITriangleRenderer() {}; - //! sets a render target virtual void setRenderTarget(video::IImage* surface, const core::rect& viewPort) = 0;