Merged revisions 2748:2778 from branch 1.6. A few bug fixes (wrong drop/grab, normals handling, rotation animator) and many doc fixes.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2780 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2009-11-02 10:27:15 +00:00
parent 24265b1527
commit 7713cddaf8
20 changed files with 111 additions and 101 deletions

View File

@ -1,3 +1,11 @@
Changes in 1.6.1
- Fix another (OldValue == NewValue) before drop()/grap(), this time in CTextureAttribute::setTexture.
- Bugfix: CGUIToolBar::addButton does no longer mess up when no image is set and does now actually work with the text.
- Fix ninja animation range which got messed up a little when b3d animations got fixed (thx gbox for finding)
Changes in 1.6 (23.09.2009)
- Added IFileSystem::createEmptyFileList, exposed IFileList::sort, addItem and added getID

View File

@ -556,11 +556,9 @@ public:
Most of the hard work is done. We only need to create the Irrlicht Engine
device and all the buttons, menus and toolbars. We start up the engine as
usual, using createDevice(). To make our application catch events, we set our
eventreceiver as parameter. The #ifdef WIN32 preprocessor commands are not
necessary, but I included them to make the tutorial use DirectX on Windows and
OpenGL on all other platforms like Linux. As you can see, there is also a
unusual call to IrrlichtDevice::setResizeAble(). This makes the render window
resizeable, which is quite useful for a mesh viewer.
eventreceiver as parameter. As you can see, there is also a call to
IrrlichtDevice::setResizeable(). This makes the render window resizeable, which
is quite useful for a mesh viewer.
*/
int main(int argc, char* argv[])
{

View File

@ -1,8 +1,10 @@
/** Example 020 Managed Lights
// Written by Colin MacDonald
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
Written by Colin MacDonald. This tutorial explains the use of the Light Manager
of Irrlicht. It enables the use of more dynamic light sources than the actual
hardware supports. Further applications of the Light Manager, such as per scene
node callbacks, are left out for simplicity of the example.
*/
#include <irrlicht.h>
#include <iostream>
@ -273,7 +275,7 @@ private:
};
/*!
/*
*/
int main(int argumentCount, char * argumentValues[])
{
@ -328,7 +330,9 @@ int main(int argumentCount, char * argumentValues[])
guienv->addStaticText(L"2 - Closest 3 lights", core::rect<s32>(10,30,200,50));
guienv->addStaticText(L"3 - Lights in zone", core::rect<s32>(10,50,200,70));
// Add several "zones". You could use this technique to light individual rooms, for example.
/*
Add several "zones". You could use this technique to light individual rooms, for example.
*/
for(f32 zoneX = -100.f; zoneX <= 100.f; zoneX += 50.f)
for(f32 zoneY = -60.f; zoneY <= 60.f; zoneY += 60.f)
{
@ -403,3 +407,7 @@ int main(int argumentCount, char * argumentValues[])
device->drop();
return 0;
}
/*
**/

View File

@ -23,12 +23,17 @@ Copyright 2006-2009 Burningwater, Thomas Alten
#include "sound.h"
#include <iostream>
/*!
/*
Game Data is used to hold Data which is needed to drive the game
*/
struct GameData
{
GameData ( const path &startupDir);
GameData ( const path &startupDir) :
retVal(0), createExDevice(0), Device(0), StartupDir(startupDir)
{
setDefault ();
}
void setDefault ();
s32 save ( const path &filename );
s32 load ( const path &filename );
@ -58,18 +63,7 @@ struct GameData
IrrlichtDevice *Device;
};
/*!
*/
GameData::GameData ( const path &startupDir)
{
retVal = 0;
createExDevice = 0;
Device = 0;
StartupDir = startupDir;
setDefault ();
}
/*!
/*
set default settings
*/
void GameData::setDefault ()
@ -112,19 +106,17 @@ void GameData::setDefault ()
CurrentMapName = "";
CurrentArchiveList.clear ();
//! Explorer Media directory
// Explorer Media directory
CurrentArchiveList.push_back ( StartupDir + "../../media/" );
//! Add the original quake3 files before you load your custom map
//! Most mods are using the original shaders, models&items&weapons
CurrentArchiveList.push_back ( "/q/baseq3/" );
CurrentArchiveList.push_back ( StartupDir + "../../media/map-20kdm2.pk3" );
// Add the original quake3 files before you load your custom map
// Most mods are using the original shaders, models&items&weapons
CurrentArchiveList.push_back("/q/baseq3/");
CurrentArchiveList.push_back(StartupDir + "../../media/map-20kdm2.pk3");
}
/*!
/*
Load the current game State from a typical quake3 cfg file
*/
s32 GameData::load ( const path &filename )
@ -132,7 +124,7 @@ s32 GameData::load ( const path &filename )
if (!Device)
return 0;
//! the quake3 mesh loader can also handle *.shader and *.cfg file
// the quake3 mesh loader can also handle *.shader and *.cfg file
IQ3LevelMesh* mesh = (IQ3LevelMesh*) Device->getSceneManager()->getMesh ( filename );
if (!mesh)
return 0;
@ -171,7 +163,7 @@ s32 GameData::load ( const path &filename )
return 1;
}
/*!
/*
Store the current game State in a quake3 configuration file
*/
s32 GameData::save ( const path &filename )
@ -217,7 +209,7 @@ s32 GameData::save ( const path &filename )
return 1;
}
/*!
/*
Representing a player
*/
struct Q3Player : public IAnimationEndCallBack
@ -254,7 +246,7 @@ struct Q3Player : public IAnimationEndCallBack
};
/*!
/* End player
*/
void Q3Player::shutdown ()
{
@ -274,7 +266,7 @@ void Q3Player::shutdown ()
}
/*!
/* create a new player
*/
void Q3Player::create ( IrrlichtDevice *device, IQ3LevelMesh* mesh, ISceneNode *mapNode, IMetaTriangleSelector *meta )
{
@ -373,7 +365,7 @@ void Q3Player::create ( IrrlichtDevice *device, IQ3LevelMesh* mesh, ISceneNode *
}
/*!
/*
so we need a good starting Position in the level.
we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch"
*/
@ -413,7 +405,7 @@ void Q3Player::setpos ( const vector3df &pos, const vector3df &rotation )
}
}
/*!
/* set the Animation of the player and weapon
*/
void Q3Player::setAnim ( const c8 *name )
{
@ -437,8 +429,7 @@ void Q3Player::setAnim ( const c8 *name )
}
/*!
*/
// Callback
void Q3Player::OnAnimationEnd(IAnimatedMeshSceneNode* node)
{
setAnim ( 0 );
@ -446,7 +437,8 @@ void Q3Player::OnAnimationEnd(IAnimatedMeshSceneNode* node)
//! GUIElements
/* GUI Elements
*/
struct GUI
{
GUI ()
@ -489,11 +481,10 @@ struct GUI
IGUIStaticText* StatusLine;
IGUIImage* Logo;
IGUIWindow* Window;
};
/*!
/*
CQuake3EventHandler controls the game
*/
class CQuake3EventHandler : public IEventReceiver
@ -553,14 +544,14 @@ private:
void dropMap ();
};
/*!
/* Constructor
*/
CQuake3EventHandler::CQuake3EventHandler( GameData *game )
: Game(game), Mesh(0), MapParent(0), ShaderParent(0), ItemParent(0), UnresolvedParent(0),
BulletParent(0), FogParent(0), SkyNode(0), Meta(0)
{
buf[0]=0;
//! Also use 16 Bit Textures for 16 Bit RenderDevice
// Also use 16 Bit Textures for 16 Bit RenderDevice
if ( Game->deviceParam.Bits == 16 )
{
game->Device->getVideoDriver()->setTextureCreationFlag(ETCF_ALWAYS_16_BIT, true);
@ -578,6 +569,7 @@ CQuake3EventHandler::CQuake3EventHandler( GameData *game )
}
// destructor
CQuake3EventHandler::~CQuake3EventHandler ()
{
Player[0].shutdown ();
@ -589,7 +581,7 @@ CQuake3EventHandler::~CQuake3EventHandler ()
}
//! create runtime textures smog, fog
// create runtime textures smog, fog
void CQuake3EventHandler::createTextures ()
{
IVideoDriver * driver = Game->Device->getVideoDriver();
@ -642,7 +634,7 @@ void CQuake3EventHandler::createTextures ()
}
/*!
/*
create the GUI
*/
void CQuake3EventHandler::CreateGUI()
@ -835,8 +827,7 @@ void CQuake3EventHandler::CreateGUI()
}
/*!
/*
Add an Archive to the FileSystems und updates the GUI
*/
void CQuake3EventHandler::AddArchive ( const path& archiveName )
@ -922,7 +913,7 @@ void CQuake3EventHandler::AddArchive ( const path& archiveName )
u32 g = 0;
core::stringw s;
//! browse the attached file system
// browse the attached file system
fs->setFileListSystem ( FILESYSTEM_VIRTUAL );
fs->changeWorkingDirectoryTo ( "/maps/" );
IFileList *fileList = fs->createFileList ();
@ -1000,7 +991,7 @@ void CQuake3EventHandler::AddArchive ( const path& archiveName )
}
/*!
/*
clears the Map in Memory
*/
void CQuake3EventHandler::dropMap ()
@ -1037,7 +1028,7 @@ void CQuake3EventHandler::dropMap ()
Mesh = 0;
}
/*!
/* Load new map
*/
void CQuake3EventHandler::LoadMap ( const stringw &mapName, s32 collision )
{
@ -1134,9 +1125,6 @@ void CQuake3EventHandler::LoadMap ( const stringw &mapName, s32 collision )
}
/*
**/
/*!
Adds a SceneNode with an icon to the Scene Tree
*/
void CQuake3EventHandler::addSceneTreeItem( ISceneNode * parent, IGUITreeViewNode* nodeParent)
@ -1209,13 +1197,13 @@ void CQuake3EventHandler::addSceneTreeItem( ISceneNode * parent, IGUITreeViewNod
}
//! Adds life!
// Adds life!
void CQuake3EventHandler::CreatePlayers()
{
Player[0].create ( Game->Device, Mesh, MapParent, Meta );
}
//! Adds a skydome to the scene
// Adds a skydome to the scene
void CQuake3EventHandler::AddSky( u32 dome, const c8 *texture)
{
ISceneManager *smgr = Game->Device->getSceneManager ();
@ -1282,8 +1270,7 @@ void CQuake3EventHandler::AddSky( u32 dome, const c8 *texture)
}
/*!
*/
// enable GUI elements
void CQuake3EventHandler::SetGUIActive( s32 command)
{
bool inputState = false;
@ -1325,7 +1312,7 @@ void CQuake3EventHandler::SetGUIActive( s32 command)
/*!
/*
Handle game input
*/
bool CQuake3EventHandler::OnEvent(const SEvent& eve)
@ -1535,7 +1522,7 @@ bool CQuake3EventHandler::OnEvent(const SEvent& eve)
else
if (eve.KeyInput.Key == KEY_F11)
{
//! screenshot are taken without gamma!
// screenshot are taken without gamma!
IImage* image = Game->Device->getVideoDriver()->createScreenShot();
if (image)
{
@ -1834,8 +1821,7 @@ void CQuake3EventHandler::useItem( Q3Player * player)
// play sound
}
/*!
*/
// rendered when bullets hit something
void CQuake3EventHandler::createParticleImpacts( u32 now )
{
ISceneManager* sm = Game->Device->getSceneManager();
@ -2016,7 +2002,7 @@ void CQuake3EventHandler::Animate()
}
/*!
/* The main game states
*/
void runGame ( GameData *game )
{
@ -2034,10 +2020,10 @@ void runGame ( GameData *game )
// create an event receiver based on current game data
CQuake3EventHandler *eventHandler = new CQuake3EventHandler( game );
//! load stored config
// load stored config
game->load ( "explorer.cfg" );
//! add our media directory and archive to the file system
// add our media directory and archive to the file system
for ( u32 i = 0; i < game->CurrentArchiveList.size(); ++i )
{
eventHandler->AddArchive ( game->CurrentArchiveList[i] );
@ -2088,7 +2074,7 @@ void runGame ( GameData *game )
#endif
/*!
/* The main routine, doing all setup
*/
int IRRCALLCONV main(int argc, char* argv[])
{
@ -2140,4 +2126,3 @@ int IRRCALLCONV main(int argc, char* argv[])
/*
**/

View File

@ -181,8 +181,11 @@ Global
{FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.ActiveCfg = Debug|Win32
{FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.Build.0 = Debug|Win32
{FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.ActiveCfg = Release|Win32
{FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.Build.0 = Release|Win32
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.Build.0 = Debug|Win32
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.Build.0 = Release|Win32
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.ActiveCfg = Debug|Win32
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.Build.0 = Debug|Win32
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.ActiveCfg = Release|Win32

View File

@ -313,7 +313,7 @@ struct SEvent
* each connected joystick once per run() of the device. Joystick events will
* not be generated by default. If joystick support is available for the
* active device, _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ is defined, and
* @ref IrrlichtDevice::activateJoysticks() has been called, an event of
* @ref irr::IrrlichtDevice::activateJoysticks() has been called, an event of
* this type will be generated once per joystick per @ref IrrlichtDevice::run()
* regardless of whether the state of the joystick has actually changed. */
struct SJoystickEvent
@ -420,7 +420,7 @@ public:
};
//! Information on a joystick, returned from @ref IrrlichtDevice::activateJoysticks()
//! Information on a joystick, returned from @ref irr::IrrlichtDevice::activateJoysticks()
struct SJoystickInfo
{
//! The ID of the joystick

View File

@ -70,7 +70,7 @@ namespace scene
virtual void scale(IMeshBuffer* buffer, const core::vector3df& factor) const = 0;
//! Scales the actual mesh, not a scene node.
/** \deprecated
/** \deprecated Use scale() instead
\param mesh Mesh on which the operation is performed.
\param factor Scale factor for each axis. */
virtual void scaleMesh(IMesh* mesh, const core::vector3df& factor) const {return scale(mesh,factor);}
@ -98,7 +98,7 @@ namespace scene
virtual void transform(IMeshBuffer* buffer, const core::matrix4& m) const = 0;
//! Applies a transformation to a mesh
/** \deprecated
/** \deprecated Use transform() instead
\param mesh Mesh on which the operation is performed.
\param m transformation matrix. */
virtual void transformMesh(IMesh* mesh, const core::matrix4& m) const {return transform(mesh,m);}

View File

@ -209,7 +209,7 @@ namespace scene
* a dummy object in this mode. Meshes included in the
* scene will be added into the scene manager with the
* following naming scheme:
* path/to/file/file.dea#meshname. The loading of such
* "path/to/file/file.dea#meshname". The loading of such
* meshes is logged. Currently, this loader is able to
* create meshes (made of only polygons), lights, and
* cameras. Materials and animations are currently not

View File

@ -404,7 +404,7 @@ namespace video
example in picture edit programs. To avoid this problem, you
could use the makeColorKeyTexture method, which takes the
position of a pixel instead a color value.
\param \deprecated zeroTexels If set to true, then any texels that match
\param zeroTexels \deprecated If set to true, then any texels that match
the color key will have their color, as well as their alpha, set to zero
(i.e. black). This behaviour matches the legacy (buggy) behaviour prior
to release 1.5 and is provided for backwards compatibility only.*/
@ -420,7 +420,7 @@ namespace video
\param colorKeyPixelPos Position of a pixel with the color key
color. Every texel with this color will become fully transparent as
described above.
\deprecated \param zeroTexels If set to true, then any texels that match
\param zeroTexels \deprecated If set to true, then any texels that match
the color key will have their color, as well as their alpha, set to zero
(i.e. black). This behaviour matches the legacy (buggy) behaviour prior
to release 1.5 and is provided for backwards compatibility only.*/

View File

@ -122,12 +122,15 @@ typedef unsigned short wchar_t;
namespace irr
{
//! Should the wide character version of the FileSystem be used
//! Type name for character type used by the file system.
/** Should the wide character version of the FileSystem be used it is a
16 bit character variable. Used for unicode Filesystem and unicode strings.
Else it is a 8 bit character variable. Used for ansi Filesystem and non-unicode
strings
*/
#if defined(_IRR_WCHAR_FILESYSTEM)
//! 16 bit character variable. Used for unicode Filesystem and unicode strings
typedef wchar_t fschar_t;
#else
//! 8 bit character variable. Used for ansi Filesystem and non-unicode strings
typedef char fschar_t;
#endif

View File

@ -17,7 +17,7 @@
Here you'll find any information you'll need to develop applications with
irrXML. If you look for a tutorial on how to start, take a look at the \ref irrxmlexample,
at the homepage of irrXML at <A HREF="http://www.ambiera.com/irrxml/">www.ambiera.com/irrxml/</A>
or into the SDK in the directory \example.
or into the SDK in the directory example.
irrXML is intended to be a high speed and easy-to-use XML Parser for C++, and
this documentation is an important part of it. If you have any questions or
@ -522,7 +522,7 @@ namespace io
bool deleteCallback = false);
/*! \file irrxml.h
/*! \file irrXML.h
\brief Header file of the irrXML, the Irrlicht XML parser.
This file includes everything needed for using irrXML,
@ -534,7 +534,7 @@ namespace io
\endcode
It is also common to use the two namespaces in which irrXML is included,
directly after #including irrXML.h:
directly after including irrXML.h:
\code
#include <irrXML.h>

View File

@ -357,7 +357,7 @@ namespace irr
// THE FOLLOWING IS AN EMPTY LIST OF ALL SUB NAMESPACES
// EXISTING ONLY FOR THE DOCUMENTATION SOFTWARE DOXYGEN.
//! In this namespace can be found basic classes like vectors, planes, arrays, lists and so on.
//! Basic classes such as vectors, planes, arrays, lists, and so on can be found in this namespace.
namespace core
{
}
@ -367,14 +367,12 @@ namespace irr
{
}
//! This namespace provides interfaces for input/output: Reading and
//! writing files, accessing zip archives, xml files, ...
//! This namespace provides interfaces for input/output: Reading and writing files, accessing zip archives, xml files, ...
namespace io
{
}
//! All scene management can be found in this namespace: Mesh loading,
//! special scene nodes like octrees and billboards, ...
//! All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees and billboards, ...
namespace scene
{
}
@ -391,4 +389,3 @@ namespace irr
#endif

View File

@ -12,6 +12,8 @@ namespace irr
namespace io
{
//! Type used for all file system related strings.
/** This type will transparently handle different file system encodings. */
typedef core::string<fschar_t> path;
} // io

BIN
media/020shot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -21,7 +21,11 @@ rem for /F %%i in ('dir ..\..\..\examples\[01]*\main.cpp') DO ..\sed.exe -f tuto
..\sed.exe -f tutorials.sed ..\..\..\examples\14.Win32Window\main.cpp >>tut.txt
..\sed.exe -f tutorials.sed ..\..\..\examples\15.LoadIrrFile\main.cpp >>tut.txt
..\sed.exe -f tutorials.sed ..\..\..\examples\16.Quake3MapShader\main.cpp >>tut.txt
..\sed.exe -f tutorials.sed ..\..\..\examples\17.SplitScreen\main.cpp >>tut.txt
..\sed.exe -f tutorials.sed ..\..\..\examples\17.HelloWorld_Mobile\main.cpp >>tut.txt
..\sed.exe -f tutorials.sed ..\..\..\examples\18.SplitScreen\main.cpp >>tut.txt
..\sed.exe -f tutorials.sed ..\..\..\examples\19.MouseAndJoystick\main.cpp >>tut.txt
..\sed.exe -f tutorials.sed ..\..\..\examples\20.ManagedLights\main.cpp >>tut.txt
..\sed.exe -f tutorials.sed ..\..\..\examples\21.Quake3Explorer\main.cpp >>tut.txt
..\doxygen.exe doxygen.cfg

View File

@ -1,5 +1,5 @@
rm tut.txt || true;
for i in ../../../examples/[01]*/main.cpp; do
for i in ../../../examples/[012]*/main.cpp; do
sed -f tutorials.sed $i >>tut.txt;
done

View File

@ -1850,6 +1850,9 @@ public:
virtual void setTexture(video::ITexture* value)
{
if ( value == Value )
return;
if (Value)
Value->drop();

View File

@ -909,9 +909,9 @@ IMesh* CMeshManipulator::createMeshWithTangents(IMesh* mesh, bool recalculateNor
v[idx[i+2]].TCoords);
if (recalculateNormals)
v[idx[i+0]].Tangent += localTangent * weight.X;
v[idx[i+0]].Normal += localNormal * weight.X;
v[idx[i+0]].Tangent += localTangent * weight.X;
v[idx[i+0]].Binormal += localBinormal * weight.X;
v[idx[i+0]].Normal += localNormal * weight.X;
calculateTangents(
localNormal,
@ -925,9 +925,9 @@ IMesh* CMeshManipulator::createMeshWithTangents(IMesh* mesh, bool recalculateNor
v[idx[i+0]].TCoords);
if (recalculateNormals)
v[idx[i+1]].Tangent += localTangent * weight.Y;
v[idx[i+1]].Normal += localNormal * weight.Y;
v[idx[i+1]].Tangent += localTangent * weight.Y;
v[idx[i+1]].Binormal += localBinormal * weight.Y;
v[idx[i+1]].Normal += localNormal * weight.Y;
calculateTangents(
localNormal,
@ -941,9 +941,9 @@ IMesh* CMeshManipulator::createMeshWithTangents(IMesh* mesh, bool recalculateNor
v[idx[i+1]].TCoords);
if (recalculateNormals)
v[idx[i+2]].Tangent += localTangent * weight.Z;
v[idx[i+2]].Normal += localNormal * weight.Z;
v[idx[i+2]].Tangent += localTangent * weight.Z;
v[idx[i+2]].Binormal += localBinormal * weight.Z;
v[idx[i+2]].Normal += localNormal * weight.Z;
}
// Normalize the tangents and binormals
@ -1104,7 +1104,6 @@ IMesh* CMeshManipulator::createMeshWith1TCoords(IMesh* mesh) const
SMeshBuffer* buffer = new SMeshBuffer();
buffer->Material = mesh->getMeshBuffer(b)->getMaterial();
buffer->Material.MaterialType = video::EMT_SOLID;
// copy vertices

View File

@ -33,11 +33,11 @@ void CSceneNodeAnimatorRotation::animateNode(ISceneNode* node, u32 timeMs)
// precision problems with huge floats.
core::vector3df rot = node->getRotation() + Rotation*(diffTime*0.1f);
if (rot.X>360.f)
fmodf(rot.X, 360.f);
rot.X=fmodf(rot.X, 360.f);
if (rot.Y>360.f)
fmodf(rot.Y, 360.f);
rot.Y=fmodf(rot.Y, 360.f);
if (rot.Z>360.f)
fmodf(rot.Z, 360.f);
rot.Z=fmodf(rot.Z, 360.f);
node->setRotation(rot);
StartTime=timeMs;
}