Commit ee5942f4 authored by Rogerborg's avatar Rogerborg

Add example 20 to C::B and VC7/VC9 projects. Fix some build issues with the...

Add example 20 to C::B and VC7/VC9 projects.  Fix some build issues with the light manager and example.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2065 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 94a1346a
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<CodeBlocks_project_file> <CodeBlocks_project_file>
<FileVersion major="1" minor="6" /> <FileVersion major="1" minor="6" />
<Project> <Project>
<Option title="Irrlicht Example 19 ManagedLights" /> <Option title="Irrlicht Example 20 ManagedLights" />
<Option pch_mode="0" /> <Option pch_mode="0" />
<Option compiler="gcc" /> <Option compiler="gcc" />
<Build> <Build>
......
...@@ -14,7 +14,9 @@ using namespace video; ...@@ -14,7 +14,9 @@ using namespace video;
using namespace io; using namespace io;
using namespace gui; using namespace gui;
#if defined(MSC_VER)
#pragma comment(lib, "Irrlicht.lib") #pragma comment(lib, "Irrlicht.lib")
#endif // MSC_VER
/* /*
Normally, you are limited to 8 dynamic lights per scene: this is a hardware limit. If you Normally, you are limited to 8 dynamic lights per scene: this is a hardware limit. If you
...@@ -69,9 +71,9 @@ class CMyLightManager : public ILightManager, public IEventReceiver ...@@ -69,9 +71,9 @@ class CMyLightManager : public ILightManager, public IEventReceiver
public: public:
CMyLightManager(ISceneManager* sceneManager) CMyLightManager(ISceneManager* sceneManager)
: SceneManager(sceneManager), SceneLightList(0), : Mode(NO_MANAGEMENT), RequestedMode(NO_MANAGEMENT),
CurrentRenderPass(ESNRP_COUNT), CurrentSceneNode(0), SceneManager(sceneManager), SceneLightList(0),
Mode(NO_MANAGEMENT), RequestedMode(NO_MANAGEMENT) CurrentRenderPass(ESNRP_COUNT), CurrentSceneNode(0)
{ } { }
virtual ~CMyLightManager(void) { } virtual ~CMyLightManager(void) { }
...@@ -179,8 +181,6 @@ public: ...@@ -179,8 +181,6 @@ public:
for(i = 0; i < SceneLightList->size(); ++i) for(i = 0; i < SceneLightList->size(); ++i)
{ {
ILightSceneNode* lightNode = (*SceneLightList)[i]; ILightSceneNode* lightNode = (*SceneLightList)[i];
SLight & lightData = lightNode->getLightData();
f64 distance = lightNode->getAbsolutePosition().getDistanceFromSQ(nodePosition); f64 distance = lightNode->getAbsolutePosition().getDistanceFromSQ(nodePosition);
sortingArray.push_back(LightDistanceElement(lightNode, distance)); sortingArray.push_back(LightDistanceElement(lightNode, distance));
} }
......
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file> <CodeBlocks_workspace_file>
<Workspace title="Build all examples"> <Workspace title="Build all examples">
<Project filename="01.HelloWorld\HelloWorld.cbp" active="1" /> <Project filename="01.HelloWorld\HelloWorld.cbp" />
<Project filename="02.Quake3Map\Quake3Map.cbp" /> <Project filename="02.Quake3Map\Quake3Map.cbp" />
<Project filename="03.CustomSceneNode\CustomSceneNode.cbp" /> <Project filename="03.CustomSceneNode\CustomSceneNode.cbp" />
<Project filename="04.Movement\Movement.cbp" /> <Project filename="04.Movement\Movement.cbp" />
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<Project filename="16.Quake3MapShader\Quake3MapShader.cbp" /> <Project filename="16.Quake3MapShader\Quake3MapShader.cbp" />
<Project filename="18.SplitScreen\SplitScreen.cbp" /> <Project filename="18.SplitScreen\SplitScreen.cbp" />
<Project filename="19.MouseAndJoystick\MouseAndJoystick.cbp" /> <Project filename="19.MouseAndJoystick\MouseAndJoystick.cbp" />
<Project filename="20.ManagedLights\ManagedLights.cbp" active="1" />
<Project filename="Demo\demo.cbp" /> <Project filename="Demo\demo.cbp" />
<Project filename="..\source\Irrlicht\Irrlicht-gcc.cbp" /> <Project filename="..\source\Irrlicht\Irrlicht-gcc.cbp" />
</Workspace> </Workspace>
......
...@@ -76,6 +76,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader", "16.Qu ...@@ -76,6 +76,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader", "16.Qu
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.MouseAndJoystick\MouseAndJoystick.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.MouseAndJoystick\MouseAndJoystick.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights_vc8", "20.ManagedLights\ManagedLights_vc8.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
EndProject
Global Global
GlobalSection(SolutionConfiguration) = preSolution GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug Debug = Debug
......
...@@ -92,6 +92,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18.SplitScreen_vc9", "18.Sp ...@@ -92,6 +92,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18.SplitScreen_vc9", "18.Sp
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick_vc9", "19.MouseAndJoystick\MouseAndJoystick_vc9.vcproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick_vc9", "19.MouseAndJoystick\MouseAndJoystick_vc9.vcproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights_vc8", "20.ManagedLights\ManagedLights_vc8.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32 Debug|Win32 = Debug|Win32
......
// Written by Colin MacDonald - all rights assigned to Nikolaus Gebhardt // Written by Colin MacDonald - all rights assigned to Nikolaus Gebhardt
// Copyright (C) 2008-2009 Nikolaus Gebhardt // Copyright (C) 2008 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine". // This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
...@@ -15,17 +15,13 @@ namespace scene ...@@ -15,17 +15,13 @@ namespace scene
{ {
class ILightSceneNode; class ILightSceneNode;
//! Provides callbacks to when the the scene graph is rendered. //! ILightManager provides an interface for user applications to manipulate the list
/** ILightManager is an optional manager that the user application can //! of lights in the scene. The light list can be trimmed or re-ordered before device/
register in order to receive callbacks as the scene is rendered. //! hardware lights are created, and/or individual lights can be switched on and off
The OnPreRender() callback provides the user application with a list of the //! before or after each scene node is rendered.
lights in the scene. This list can be stored and used to turn lights //! It is assumed that the ILightManager implementation will store any data that it wishes
on and off as each scene node is rendered in order to provide per-node //! to retain, i.e. the ISceneManager to which it is assigned, the lightList, the current
or 'local' lights. //! render pass, and the current scene node.
It is assumed that the ILightManager implementation will store any
data that it wishes to retain, i.e. the ISceneManager to which it is assigned,
the lightList, the current render pass, and the current scene node.
*/
class ILightManager : public IReferenceCounted class ILightManager : public IReferenceCounted
{ {
public: public:
......
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