Merged from trunk revisions 2144:2363
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@2364 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
fa91c5ab41
commit
75b5403b5b
637
changes.txt
637
changes.txt
|
@ -1,4 +1,613 @@
|
|||
Changes in version 1.6
|
||||
Changes in 1.6
|
||||
|
||||
- Direct3D now also uses screen coordinates in 2d mode, just like OpenGL. This means that screen coords are going from 0..ScreenWidth and 0..ScreenHeight instead of -1..1.
|
||||
|
||||
- ALT+F4 keypress now closes Windows SDL device
|
||||
|
||||
- Allow Direct3D drivers in SDL, patch by Halifax
|
||||
|
||||
- Added compiler error when attempting to compile with VC6.
|
||||
|
||||
- Use setWindowTextA in Windows device for WIN64 platform, posted by veegun
|
||||
|
||||
- ELL_ERROR log events are now created when shaders fail to compile or link, reported by Halan
|
||||
|
||||
- irrList now uses irrAllocator, fixed by Nox
|
||||
|
||||
- Added IGUIWindow::setDraggable and IGUIWindow::isDraggable, by Nox
|
||||
|
||||
- Added SGI RGB file reader by Gary Conway, for loading Silicon Graphics .rgb, .rgba, .sgi, .int and .inta textures
|
||||
|
||||
- Renamed setResizeAble to setResizable
|
||||
|
||||
- Added new device method minimizeWindow which minimizes the window (just as if the minimize button has been clicked).
|
||||
|
||||
- SkyDome is now serialized correctly
|
||||
|
||||
- Added PLY mesh reader and writer
|
||||
|
||||
- Ensure ListBox on combo box doesn't hang off the bottom of the GUI root, by Matthias Specht
|
||||
|
||||
- Made IGUIElements recalculate clipping rectangle after setNotClipped, reported by Aelis440
|
||||
|
||||
- Bug fix for the combo box where it showed white text instead of skin colour before being focused, fix posted by drewbacca
|
||||
|
||||
- EGDS_MESSAGE_BOX_HEIGHT is now honoured, bug reported by Spkka
|
||||
|
||||
- Fixed a bug in the edit box where events are sometimes sent to a null parent, reported by Sudi.
|
||||
|
||||
- Coordinate system fix for OpenGL in SDL device
|
||||
|
||||
- Added generic console device. You can now use Irrlicht to create and manipuate graphics on a shell where no graphics hardware
|
||||
or windowing system is available. To enable it uncomment #define _IRR_USE_CONSOLE_DEVICE_ in IrrCompileConfig.h
|
||||
- The console device can now present images from the software drivers and display them as ASCII art in the console
|
||||
- By default it replaces the default font in the skin, to prevent fonts from being huge.
|
||||
|
||||
|
||||
Changes in 1.6 TA
|
||||
- implemented isALoadableFileFormat ( File *file ) for the Archive Loader
|
||||
Changes in 1.6 TA
|
||||
- PixelBlend16 and PixelBlend16_simd are working for the new rules.
|
||||
- bugfix. CLightSceneNode didn't correctly update it's attributes
|
||||
|
||||
Lighting Linear Attenuation. = 1.f / radius
|
||||
|
||||
The Example loadirr files set the lightscene radius to 1000.f but
|
||||
stays on the previous default attentuation with the older radius 100 -> 1.f / 100
|
||||
so the examples looks golden-brown.
|
||||
|
||||
Now the radius is correctly!! set to the attenuation of 1.f/1000.f because the
|
||||
file doesn't have special attenuation. and now it looks more yellow.
|
||||
can anybody show me a correct screenshot for this file;-)? Niko?
|
||||
|
||||
Or is this behavior the default lighting?. then it would be
|
||||
a fixed constant linear attenuation of 0.01f;-). Please clearify
|
||||
For now i didn't fixed it
|
||||
|
||||
|
||||
I encountered this behavior because i ( burning video ) used the original radius
|
||||
for calculations and so i've found that radius != 1.f / linearAttenuation but
|
||||
in the LightSceneNode this formula was used.. confused;-)
|
||||
|
||||
|
||||
- vector template and equals tests
|
||||
as working with the test suits i cleaned the template behavior (mixed types are
|
||||
used in the templates) and added all missing special math function with their coressponding type
|
||||
I also set the equal test for s32 to behave like the f32 routine.
|
||||
|
||||
The function equals always implements a weak test.
|
||||
that means a tolerance MUST always be used if you use the equal function. default is 1.
|
||||
you can set it to zero a==b-> equals ( a, b, 0 ) but do it explicit like you have to
|
||||
for floating compare. This is important when irrlicht is going to use special hardware
|
||||
math acceleration on a per function base, like sse2, or the other way round fixpoint.
|
||||
|
||||
- VideoDriver drawPixel
|
||||
The HW renderes are using the alpha components for blending.
|
||||
The Software Renderes and image loaders are using CImage::setPixel copy.
|
||||
so setPixel is engaged to either blends or copy the pixel
|
||||
default: false
|
||||
- Burningvideo
|
||||
added RenderMaterial EMT_SPHERE_MAP
|
||||
pushed burningsvideo to 0.43
|
||||
added RenderMaterial EMT_REFLECTION_2_LAYER
|
||||
pushed burningsvideo to 0.44
|
||||
set EMT_TRANSPARENT_ALPHA_CHANNEL_REF
|
||||
to use AlphaRef 0.5 like Direct3D
|
||||
|
||||
One Note: in OpenGL there is know difference between sphere_map and reflection layer
|
||||
both using GL_TEXTURE_GEN_MODE GL_SPHERE_MAP, whereas in d3d one time using camera_normal
|
||||
on sphere and reflection on refletcion_layer.
|
||||
|
||||
The visual difference is that on sphere map the "image is not moving" when you rotate the
|
||||
viewer. For Buring i took the opengl visual. always moving
|
||||
|
||||
|
||||
- rename quake3 SEntity to IEntity to be confom with IShader
|
||||
even IShader and IEntity are none pure virtual interfaces
|
||||
like most irrlicht objects
|
||||
--------------------------------------------------------------
|
||||
|
||||
Changes in 1.6 TA
|
||||
- fixed createMeshWith2TCoords
|
||||
normals were missing during copy.
|
||||
- addded
|
||||
//! Creates a copy of the mesh, which will only consist of S3DVertex vertices.
|
||||
IMesh* CMeshManipulator::createMeshWith1TCoords(IMesh* mesh) const
|
||||
|
||||
- added io::IFileSystem* CSceneManager::getFileSystem()
|
||||
for preparing to remove the (mostly) unnecessary double member variables
|
||||
in many loaders
|
||||
|
||||
- added virtual const c8* ISceneManager::getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type);
|
||||
to the SceneManger Interface. just like getTypeName is public
|
||||
|
||||
- added CSceneNodeAnimatorFlyCircle::radiusEllipsoid.
|
||||
if radiusEllipsoid == 0 the default circle animation is done
|
||||
else radiusEllipsoid forms the b-axe of the ellipsoid.
|
||||
|
||||
-> gummiball bouncing
|
||||
|
||||
- added ISceneManager::createFlyStraightAnimator variable bool ping-pong
|
||||
used in loop mode to device if start from beginning ( default ) or make ping-pong
|
||||
|
||||
-> straight bouncing
|
||||
|
||||
- changed IFileSystem::registerFileArchive
|
||||
remove the index of the hiarchy and added a new interface method
|
||||
|
||||
//! move the hirarchy of the filesystem. moves sourceIndex relative up or down
|
||||
virtual bool moveFileArchive( u32 sourceIndex, s32 relative ) = 0;
|
||||
|
||||
|
||||
- bugfix and changes in
|
||||
SViewFrustum::SViewFrustum
|
||||
wrong size of Matrices copy. This bug must be ages old... (typo)
|
||||
detected during resizing the Matrices. removed obsolute Matrices
|
||||
renamed E_TRANSFORMATION_STATE_2 to E_TRANSFORMATION_STATE_FRUSTUM
|
||||
|
||||
therefore also changed SViewFrustum::setTransformState to not tap
|
||||
in the pitfall again of wrong memory...
|
||||
and renamed it to getTransform, like in the driver
|
||||
and Matrices private
|
||||
|
||||
- OpenGL:
|
||||
Specular
|
||||
- moved
|
||||
//! EMT_ONETEXTURE_BLEND: has BlendFactor Alphablending
|
||||
inline bool textureBlendFunc_hasAlpha ( E_BLEND_FACTOR factor ) const
|
||||
from the material renderes ( 3x declared ) to SMaterial.h
|
||||
|
||||
- updated managed light example to use standard driver selection
|
||||
- BurningsVideo
|
||||
- LightModel reworked.
|
||||
Point Light & Direction Light works for Diffuse Color as aspected
|
||||
Specular and Fog still have problems ( needs new pixel shader )
|
||||
pushed burningsvideo to 0.42 for this major step
|
||||
|
||||
- removed obsolete matrix transformations
|
||||
renamed E_TRANSFORMATION_STATE_2 to E_TRANSFORMATION_STATE_BURNING
|
||||
|
||||
|
||||
- cleaned line3d.h vector3d.h template behavior.
|
||||
many mixed f32/f64 implementations are here. i'm not sure if this should be
|
||||
the default behavior to use f64 for example for 1.0/x value, because they
|
||||
benefit from more precisions, but in my point of view the user is responsible
|
||||
of choosing a vector3d<f32> or vector3d<f64>.
|
||||
- added core::squareroot to irrmath.h
|
||||
-> for having candidates for faster math in the same file
|
||||
- added AllowZWriteOnTransparent from SceneManager to burningsvideo
|
||||
Following SceneManger guideline
|
||||
-added hasAlpha() to ITexture
|
||||
This info can be used for e.q to downgrade a transparent alpha channel blit
|
||||
to add if the texture has no alpha channel.
|
||||
|
||||
--------------------------------------------------------------
|
||||
Changes in version 1.6, TA
|
||||
|
||||
- FileSystem 2.0 SUPER MASTER MAJOR API CHANGE !!!
|
||||
|
||||
The FileSystem is now build internally like for e.g. the image- and meshloaders.
|
||||
There exists a known list of ArchiveLoaders, which know how to produce a Archive.
|
||||
The Loaders and the Archives can be attached/detached on runtime.
|
||||
|
||||
The FileNames are now stored as core::string<c16>. where c16 is toggled between char/wchar
|
||||
with the #define flag _IRR_WCHAR_FILESYSTEM, to supported unicode backends (default:off)
|
||||
Replaced most (const c8* filename) to string references.
|
||||
|
||||
Basically the FileSystem is divided into two regions. Native and Virtual.
|
||||
Native means using the backend OS.
|
||||
Virtual means only use currently attached IArchives.
|
||||
|
||||
Browsing
|
||||
each FileSystem has it's own workdirectory and it's own methods to
|
||||
- create a FileTree
|
||||
- add/remove files & directory ( to be done )
|
||||
Hint: store a savegame in a zip archive...
|
||||
|
||||
basic browsing for all archives is implemented.
|
||||
Example 21. Quake3Explorer shows this
|
||||
|
||||
TODO:
|
||||
- a file filter should be implemented.
|
||||
- The IArchive should have a function to create a filetree
|
||||
for now CFileList is used.
|
||||
|
||||
Class Hierarchy:
|
||||
|
||||
IArchiveLoader: is able to produce a IFileArchive
|
||||
- ZipLoader
|
||||
- PakLoader
|
||||
- MountPointReader ( formaly known as CUnzipReader )
|
||||
|
||||
IFileArchive:
|
||||
-ZipArchive
|
||||
-PakArchive
|
||||
-MountPoint (known as FolderFile)
|
||||
|
||||
IFileSystem
|
||||
- addArchiveLoader
|
||||
|
||||
- changed implementation of isALoadableFileExtension in all loaders
|
||||
to have consistent behavior
|
||||
- added a parameter to IFileList * createFileList
|
||||
setFileListSystem
|
||||
allows to query files in any of the game archives
|
||||
standard behavior listtype = SYSTEM ( default)
|
||||
|
||||
- CLimitReadFile
|
||||
added multiple file random-access support.
|
||||
solved problems with mixed compressed & uncompressed files in a zip
|
||||
|
||||
TODO:
|
||||
- Big Big Testing!!
|
||||
- many loaders use their own private filesearching
|
||||
- there are a lot of helper function ( getAbsolutePath, getFileDir )
|
||||
which should be adapted to the virtual filesystem
|
||||
|
||||
- IrrlichtDevice
|
||||
added:
|
||||
virtual bool setGammaRamp( f32 red, f32 green, f32 blue, f32 brightness, f32 contrast ) = 0;
|
||||
virtual bool getGammaRamp( f32 &red, f32 &green, f32 &blue ) = 0;
|
||||
|
||||
and calculating methods to DeviceStub.
|
||||
implemented in Win32, TODO: other Devices
|
||||
|
||||
- irrlicht.h
|
||||
changed exported irrlicht.dll routines createDevice, createDeviceEx, IdentityMatrix
|
||||
to extern "C" name mangling.
|
||||
|
||||
for easier dynamically loading the irrlicht library and different versions
|
||||
|
||||
- ParticleSystem
|
||||
removed the private (old?,wrong?) interface from the ParticleEffectors
|
||||
to match the parent class irr::io::IAttributeExchangingObject::deserializeAttributes
|
||||
TODO:
|
||||
please test if the serialization works!
|
||||
|
||||
- Generic
|
||||
- vector3d<T>& normalize() optimized
|
||||
added reciprocal_squareroot for f64
|
||||
|
||||
- dimension2d
|
||||
added operator dimension2d<T>& operator=(const dimension2d<U>& other)
|
||||
to cast between different types
|
||||
- vector2d bugfix operator+=
|
||||
|
||||
- C3DMeshLoader renamed chunks const u16 to a enum
|
||||
removing "variable declared but never used warning"
|
||||
- added a global const identity Material
|
||||
changed all references *((video::SMaterial*)0) to point to IdentityMaterial
|
||||
removed warning: "a NULL reference is not allowed"
|
||||
|
||||
- modified IRRLICHT_MATH to not support reciprocal stuff
|
||||
but to use faster float-to-int conversion.
|
||||
gcc troubles may they are. i'm using intel-compiler..;-)
|
||||
- core::matrix4
|
||||
USE_MATRIX_TEST
|
||||
|
||||
i tried to optimize the identity-check ( in means of performance)
|
||||
i didn't succeed so well, so i made a define for the matrix isIdentity -check
|
||||
for now it's sometimes faster to always calculate versus identity-check
|
||||
but if there are a lot of scenenodes/ particles one can profit from the
|
||||
fast_inverse matrix, when no scaling is used. further approvement could
|
||||
be done on inverse for just tranlastion! ( many static scenenodes are not rotated,
|
||||
they are just placed somewhere in the world)
|
||||
one thing to take in account is that sizeof(matrix) is 64 byte and
|
||||
with the additional bool/u32 makes it 66 byte which is not really cache-friendly..
|
||||
|
||||
- added buildRotateFromTo
|
||||
Builds a matrix that rotates from one vector to another
|
||||
|
||||
- irr::array. changed allocating routine in push_back
|
||||
|
||||
okt, 2008. it's only allowed to alloc one element, if
|
||||
default constructor has to be called.
|
||||
|
||||
removes existing crashes. ( MD3 Mesh ) and possible others ones.
|
||||
|
||||
A new list template should be made.
|
||||
one with constructor/destructor calls ( safe_array ) and
|
||||
one without. like the array since the beginning of irrlicht.
|
||||
currently the array/string is extremly slow..
|
||||
|
||||
also a hint for the user has to be done, so that a struct T of
|
||||
array<T> must have a copy constructor of type T ( const T&other ).
|
||||
|
||||
i needed hours to track that down...
|
||||
|
||||
added a new method setAllocStrategy,
|
||||
safe ( used + 1 ), double ( used * 2 + 1)
|
||||
|
||||
better default strategies will be implemented
|
||||
|
||||
- removed binary_search_const
|
||||
i added it quite a long time ago, but it doesnt make real sense
|
||||
a call to a sort method should happen always. i just wanted to safe
|
||||
a few cycles..
|
||||
- added binary_search_multi
|
||||
searches for a multi-set ( more than 1 entry in the sorted array)
|
||||
returns start and end-index
|
||||
|
||||
- changed some identity matrix settings to use core::IdentityMatrix
|
||||
- added deletePathFromFilename to generic string functions in coreutil.h and
|
||||
removed from CZipReader and CPakReader
|
||||
|
||||
- s32 deserializeAttributes used instead of virtual void deserializeAttributes in
|
||||
ParticleSystem ( wrong virtual was used)
|
||||
|
||||
- strings & Locale
|
||||
- started to add locale support
|
||||
- added verify to string
|
||||
- added some helper functions
|
||||
|
||||
|
||||
- XBOX
|
||||
i have access to a XBOX development machine now. I started to compile
|
||||
for the XBOX. Question: Who did the previous implementation?. There
|
||||
is no XBOX-Device inhere. maybe it's forbidden because of using the offical
|
||||
Microsoft XDK. I will implement a native or sdl device based on opendk.
|
||||
irrlicht compiles without errors on the xbox but can't be used.
|
||||
|
||||
TODO:
|
||||
- native XBOX Device
|
||||
- Windows Mobile
|
||||
reworked a little. added the mobile example to the windows solution for
|
||||
cross development.
|
||||
added maximal 128x128 texture size for windows mobile ( memory issues )
|
||||
- Collision Speed Up
|
||||
|
||||
The Collision Speed Up greatly improves with many small static child-nodes
|
||||
|
||||
- added COctTreeTriangleSelector::getTriangles for 3dline from user Piraaate
|
||||
- modified createOctTreeTriangleSelector and createTriangleSelector
|
||||
to allow node == 0, to be added to a meta selector
|
||||
- CSceneNodeAnimatorCollisionResponse has the same problem as CSceneNodeAnimatorFPS
|
||||
on first update:
|
||||
Problem. you start setting the map. (setWorld). First update cames 4000 ms later.
|
||||
The Animator applies the missing force... big problem...
|
||||
changed to react on first update like camera.
|
||||
|
||||
- add Variable FirstUpdate. if set to true ( on all changes )
|
||||
then position, lasttime, and falling are initialized
|
||||
|
||||
-added #define OCTTREE_USE_HARDWARE in Octree.h
|
||||
|
||||
if defined octtree uses internally a derived scene::MeshBuffer which has
|
||||
the possibility to use the Hardware Vertex Buffer for static vertices and
|
||||
dirty indices;-)
|
||||
|
||||
if defined OCTTREE_USE_HARDWARE octree uses internally a derived scene::CMeshBuffer
|
||||
so it's not just a replacement inside the octree. It also in the OctTreeSceneNode.
|
||||
#define OCTTREE_PARENTTEST is also used. It's skip testing on fully outside and takes everything on fully inside
|
||||
|
||||
|
||||
- virtual void ISceneNode::updateAbsolutePosition()
|
||||
- changed
|
||||
inline CMatrix4<T> CMatrix4<T>::operator*(const CMatrix4<T>& m2) const
|
||||
|
||||
all two matrices have to be checked by isIdentity()
|
||||
to let the isIdentity work always
|
||||
|
||||
- changed inline bool CMatrix4<T>::isIdentity() const
|
||||
|
||||
on full identityCheck->
|
||||
to look first on Translation, because this is the most challenging element
|
||||
which will likely not to be identity..
|
||||
|
||||
- virtual core::matrix4 getRelativeTransformation() const
|
||||
|
||||
Hierarchy on Identity-Check
|
||||
1) ->getRelativeTransform -> 9 floating point checks to be passed as Identity
|
||||
2) ->isIdentity () -> 16 floating point checks to be passed as Identity
|
||||
|
||||
- inline void CMatrix4<T>::transformBoxEx(core::aabbox3d<f32>& box) const
|
||||
added isIdentity() check
|
||||
|
||||
|
||||
- changed CSceneNodeAnimatorCollisionResponse
|
||||
- added CSceneNodeAnimatorCollisionResponse::setGravity
|
||||
needed to set the differents Forces for the Animator. for eq. water..
|
||||
- added CSceneNodeAnimatorCollisionResponse::setAnimateTarget
|
||||
- added CSceneNodeAnimatorCollisionResponse::getAnimateTarget
|
||||
- changed CSceneNodeAnimatorCollisionResponse::animateNode to react on FirstUpdate
|
||||
- TODO: set Gravity to Physically frame independent values..
|
||||
current response uses an frame depdended acceleration vector.
|
||||
~9.81 m/s^2 was achieved at around 50 fps with a setting of -0.03
|
||||
may effect existing application..
|
||||
|
||||
- SceneNodes
|
||||
- CSkyDomeSceneNode
|
||||
moved radius ( default 1000 ) to constructor
|
||||
added Normals
|
||||
added DebugInfo
|
||||
added Material.ZBuffer, added SceneMaanager
|
||||
|
||||
- CVolumeLightSceneNode:
|
||||
changed default blending OneTextureBlendgl_src_color gl_src_alpha to
|
||||
EMT_TRANSPARENT_ADD_COLOR ( gl_src_color gl_one )
|
||||
which gives the same effect on non-transparent-materials.
|
||||
Following the unspoken guide-line, lowest effect as default
|
||||
- changed SceneNode Skydome f64 to f32,
|
||||
- AnimatedMesh
|
||||
-Debug Data:
|
||||
mesh normals didn't rotate with the scenenode fixed ( matrix-multiplication order)
|
||||
- Camera SceneNode setPosition
|
||||
Camera now finally allow to change position and target and updates all
|
||||
effected animators..
|
||||
|
||||
a call to OnAnimate ( ) lastime < time or OnAnimate ( 0 ) will reset the
|
||||
camera and fr. the collision animator to a new position
|
||||
|
||||
- Device:
|
||||
added the current mousebutton state to the Mouse Event
|
||||
so i need to get the current mouse state from the OS
|
||||
|
||||
-added to CIrrDeviceWin32
|
||||
TODO:
|
||||
- Linux and SDL Device
|
||||
- GUI
|
||||
|
||||
- CGUIFont:
|
||||
- added virtual void setInvisibleCharacters( const wchar_t *s ) = 0;
|
||||
|
||||
define which characters should not be drawn ( send to driver) by the font.
|
||||
for example " " would not draw any space which is usually blank in most fonts
|
||||
and saves rendering of ususally full blank alpha-sprites.
|
||||
This saves a lot of rendering...
|
||||
|
||||
default:
|
||||
setInvisibleCharacters ( L" " );
|
||||
|
||||
- added MultiLine rendering
|
||||
should avoid to us CStaticText breaking text in future
|
||||
- CGUIListBox
|
||||
- changed Scrollbar LargeStepSize to ItemHeight
|
||||
which easy enables to scroll line by line
|
||||
|
||||
- CGUIScrollBar
|
||||
bug:
|
||||
Create a Window and inside a listbox with a scrollbar or
|
||||
a windowed irrlicht application
|
||||
|
||||
Click & hold Scrollbar Slider. move outside it's region.
|
||||
Release Mouse. Go Back to Scrollbar.. it's moving always...
|
||||
|
||||
it's generally missing the event PRESSED_MOVED, which
|
||||
leads to problem when an element is dragging, has a focus, or position loose
|
||||
and gets focus back again. ( think of a drunken mouse sliding left&right during tracking )
|
||||
|
||||
so added the mouse Input Buttonstates on every mouse event
|
||||
IrrDeviceWin32:
|
||||
added event.MouseInput.ButtonStates = wParam & ( MK_LBUTTON | MK_RBUTTON | MK_MBUTTON );
|
||||
TODO:
|
||||
Linux & SDL
|
||||
|
||||
so now i can do this
|
||||
case irr::EMIE_MOUSE_MOVED:
|
||||
if ( !event.MouseInput.isLeftPressed () )
|
||||
{
|
||||
Dragging = false;
|
||||
}
|
||||
|
||||
- bug:
|
||||
Scrollbar notifyListBox notify when the scrollbar is clicked.
|
||||
|
||||
- changed timed event in draw to OnPostRender
|
||||
|
||||
- added GUI Image List from Reinhard Ostermeier, modified to work
|
||||
added GUI Tree View from Reinhard Ostermeier, modified to work
|
||||
shown in the Quake3MapShader Example
|
||||
TODO: Spritebanks
|
||||
|
||||
- FileOpenDialog
|
||||
changed the static text for the filename to an edit box.
|
||||
- changed the interface for addEditBox to match with addStaticText
|
||||
- changed the interface for addSpinBox to match with addEditBox
|
||||
- added MouseWheel to Spinbox
|
||||
- changed CGUITable CLICK_AREA from 3 to 12 to enable clicking on the visible marker
|
||||
- CGUISpritebank
|
||||
removed some crashes with empty Sprite banks
|
||||
- IGUIScrollBar
|
||||
added SetMin before min was always 0
|
||||
changed ScrollWheel Direction on horizontal to move right on wheel up, left on wheel down
|
||||
|
||||
- IComboBox
|
||||
-added ItemData
|
||||
- optimized IsVisible check in IGUIElement::draw
|
||||
|
||||
|
||||
- Image Loaders
|
||||
- added TGA file type 2 ( grayscale uncompressed )
|
||||
- added TGA file type (1) 8 Bit indexed color uncompressed
|
||||
|
||||
ColorConverter:
|
||||
- added convert_B8G8R8toA8R8G8B8
|
||||
- added convert_B8G8R8A8toA8R8G8B8
|
||||
|
||||
- Media Files
|
||||
- added missing shaders and textures to map-20kdm2.
|
||||
Taken from free implementation
|
||||
- ball.wav. adjusted DC-Offset, amplified to -4dB, trim cross-zero
|
||||
- impact.wav clip-restoration, trim cross-zero
|
||||
- added gun.md2, gun.pcx to media-files
|
||||
- added new irrlicht logo irrlicht3.png
|
||||
|
||||
- OctTree
|
||||
-added
|
||||
#define OCTTREE_PARENTTEST ( default: disabled )
|
||||
used to leave-out children test if the parent passed a complete frustum.
|
||||
plus: leaves out children test
|
||||
minus: all edges have to be checked
|
||||
- added MeshBuffer Hardware Hint Vertex to octtree
|
||||
|
||||
- CQuake3ShaderSceneNode:
|
||||
- removed function releaseMesh
|
||||
Shader doesn't copy the original mesh anymore ( saving memory )
|
||||
so therefore this (for others often misleading ) function was removed
|
||||
- changed constructor to take a (shared) destination meshbuffer for rendering
|
||||
reducing vertex-memory to a half
|
||||
- don't copy the original vertices anymore
|
||||
- added deformvertexes autosprite
|
||||
- added deformvertexes move
|
||||
- added support for RTCW and Raven BSPs ( qmap2 )
|
||||
- added polygonoffset (TODO: not perfect)
|
||||
- added added nomipmaps
|
||||
- added rgbgen const
|
||||
- added alphagen
|
||||
- added MesBuffer Hardware Hint Vertex/Index to Quake3: static geometry, dynamic indices
|
||||
- added Quake3Explorer examples
|
||||
- added wave noise
|
||||
- added tcmod transform
|
||||
- added whiteimage
|
||||
- added collision to Quake3Explorer
|
||||
- renamed SMD3QuaterionTag* to SMD3QuaternionTag* ( typo )
|
||||
- updated quake3:blendfunc
|
||||
- added crouch to Quake3Explorer
|
||||
(modifying the ellipsiodRadius of the camera animator )
|
||||
added crouch to CSceneNodeAnimatorCameraFPS
|
||||
still problems with stand up and collision
|
||||
- Quake3MapLoader
|
||||
modified memory allocation for faster loading
|
||||
- Quake3LoadParam
|
||||
added Parameter to the Mesh-Loader
|
||||
- added
|
||||
The still existing missing caulking of curved surfaces.
|
||||
using round in the coordinates doesn't solve the problem.
|
||||
but for the demo bsp mesh it solves the problem... (luck)
|
||||
so for now it's switchable.
|
||||
TJUNCTION_SOLVER_ROUND
|
||||
default:off
|
||||
|
||||
- BurningVideo
|
||||
- pushed BurningsVideo to 0.40
|
||||
- added blendfunc gl_one_minus_dst_alpha gl_one
|
||||
- added blendfunc gl_dst_color gl_zero
|
||||
- added blendfunc gl_dst_color src_alpha
|
||||
- modified AlphaChannel_Ref renderer to support alpha test lessequal
|
||||
- addded 32 Bit Index Buffer
|
||||
- added sourceRect/destRect check to 2D-Blitter ( slower, but resolves crash )
|
||||
- added setTextureCreationFlag video::ETCF_ALLOW_NON_POWER_2
|
||||
Burning checks this flag and when set, it bypasses the power2 size check,
|
||||
which is necessary on 3D but can be avoided on 2D.
|
||||
used on fonts automatically.
|
||||
- added Support for Destination Alpha
|
||||
|
||||
- Direct3D8
|
||||
- added 32 Bit Index Buffer
|
||||
- compile for XBOX
|
||||
- Direc3D9
|
||||
- fixed crash on RTT Textures DepthBuffer freed twice.
|
||||
added deleteAllTextures to destuctor
|
||||
- NullDriver
|
||||
- removeallTextures. added setMaterial ( SMaterial() ) to clean pointers for freed textures
|
||||
|
||||
- ISceneCollisionManager::getSceneNodeAndCollisionPointFromRay() allows selection by BB and triangle on a heirarchy of scene nodes.
|
||||
|
||||
- Triangle selectors created from animated mesh scene nodes will update themselves as required to stay in sync with the node.
|
||||
|
||||
- IVideoDriver has methods to enumerate the available image loaders and writers.
|
||||
|
||||
- Octtree scene nodes are now IMeshSceneNodes rather than ISceneNodes, and so you can call getMesh() on them.
|
||||
|
||||
- New scene parameter B3D_LOADER_IGNORE_MIPMAP_FLAG to ignore the often missing mipmap flag in b3d files. If this parameter is true, the old pre Irrlicht-1.5 behavior is restored.
|
||||
|
||||
|
@ -55,12 +664,36 @@ Changes in version 1.6
|
|||
-------------------------------------
|
||||
Changes in version 1.5.1 (??.?? 2009)
|
||||
|
||||
- Fix loading of Collada files from irrEdit 1.2
|
||||
|
||||
- Update to libpng 1.2.35, fixed issues on 64bit machines with system's libpng.
|
||||
|
||||
- Remove texture pointers after texture clear.
|
||||
|
||||
- Fix ALPHA_CHANNEL_REF to a fixed check for alpha==127 as expected.
|
||||
|
||||
- Fixed OSX device bug where screen size was not set in fullscreen mode.
|
||||
|
||||
- OpenGL version calculation fixed.
|
||||
|
||||
- OSX device now supports shift and ctrl keys.
|
||||
|
||||
- Fixed ambient light issues in bruningsvideo.
|
||||
|
||||
- device reset for d3d fixed when using VBOs.
|
||||
|
||||
- MD2 mesh loader: Now uses much less memory, reduced number of allocations when loading meshes.
|
||||
|
||||
- OpenGL render state (texture wrongly cached) fixed.
|
||||
|
||||
- Fixed animator removal.
|
||||
|
||||
- Fix terrain to use 32bit only when necessary, make terrain use hw buffers. Heightmap loading and height calculation fixed.
|
||||
|
||||
- Some mem leaks fixed
|
||||
|
||||
- FPS camera resets the cursor better
|
||||
|
||||
-----------------------------------
|
||||
Changes in version 1.5 (15.12.2008)
|
||||
|
||||
|
@ -1031,7 +1664,7 @@ Font improvements:
|
|||
Texture scaling bugfix, support for alpha blending, new option to normalise weights,
|
||||
animation code optimization, fixed memory leak
|
||||
|
||||
- ROUNDING_ERROR is now ROUNDING_ERROR_32 or ROUNDING_ERROR_64
|
||||
- ROUNDING_ERROR is now ROUNDING_ERROR_f32 or ROUNDING_ERROR_f64
|
||||
|
||||
- Material ZBuffer flag changed to a u32 value
|
||||
Reason: change ( off or on ) to , off, lequal, equal
|
||||
|
|
|
@ -6,6 +6,17 @@
|
|||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Linux">
|
||||
<Option output="HelloWorld" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/Linux" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\HelloWorld" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
|
@ -23,11 +34,11 @@
|
|||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
<Add directory="../../include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
|
|
|
@ -122,13 +122,9 @@ int main()
|
|||
dimensions, etc.
|
||||
*/
|
||||
IrrlichtDevice *device =
|
||||
#ifdef _IRR_OSX_PLATFORM_
|
||||
createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 16,
|
||||
false, false, false, 0);
|
||||
#else
|
||||
createDevice( video::EDT_SOFTWARE, dimension2d<u32>(640, 480), 16,
|
||||
false, false, false, 0);
|
||||
#endif
|
||||
|
||||
if (!device)
|
||||
return 1;
|
||||
|
||||
|
@ -171,7 +167,10 @@ int main()
|
|||
*/
|
||||
IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
|
||||
if (!mesh)
|
||||
{
|
||||
device->drop();
|
||||
return 1;
|
||||
}
|
||||
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
|
||||
|
||||
/*
|
||||
|
|
|
@ -6,6 +6,17 @@
|
|||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Linux">
|
||||
<Option output="Quake3Map" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\Quake3Map" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="CustomSceneNode" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="Movement" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -191,7 +191,7 @@ int main()
|
|||
To be able to look at and move around in this scene, we create a first
|
||||
person shooter style camera and make the mouse cursor invisible.
|
||||
*/
|
||||
smgr->addCameraSceneNodeFPS(0, 100.0f, .1f);
|
||||
smgr->addCameraSceneNodeFPS();
|
||||
device->getCursorControl()->setVisible(false);
|
||||
|
||||
/*
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="UserInterface" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -192,6 +192,7 @@ int main()
|
|||
store pointers to the driver and to the gui environment. */
|
||||
|
||||
device->setWindowCaption(L"Irrlicht Engine - User Interface Demo");
|
||||
device->setResizable(true);
|
||||
|
||||
video::IVideoDriver* driver = device->getVideoDriver();
|
||||
IGUIEnvironment* env = device->getGUIEnvironment();
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="2DGraphics" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -61,7 +61,7 @@ int main()
|
|||
|
||||
/*
|
||||
All 2d graphics in this example are put together into one texture,
|
||||
2ddemo.bmp. Because we want to draw colorkey based sprites, we need to
|
||||
2ddemo.png. Because we want to draw colorkey based sprites, we need to
|
||||
load this texture and tell the engine, which part of it should be
|
||||
transparent based on a colorkey.
|
||||
|
||||
|
@ -72,7 +72,7 @@ int main()
|
|||
e.g. all black pixels transparent. Please note that
|
||||
makeColorKeyTexture just creates an alpha channel based on the color.
|
||||
*/
|
||||
video::ITexture* images = driver->getTexture("../../media/2ddemo.bmp");
|
||||
video::ITexture* images = driver->getTexture("../../media/2ddemo.png");
|
||||
driver->makeColorKeyTexture(images, core::position2d<s32>(0,0));
|
||||
|
||||
/*
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="Collision" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
/** Example 007 Collision
|
||||
|
||||
In this tutorial, I will show how to detect collisions with the Irrlicht Engine.
|
||||
I will describe 3 methods: Automatic collision detection for moving through 3d
|
||||
worlds with stair climbing and sliding, manual triangle picking, and manual
|
||||
scene node picking.
|
||||
We will describe 2 methods: Automatic collision detection for moving through 3d worlds
|
||||
with stair climbing and sliding, and manual scene node and triangle picking using a
|
||||
ray. In this case, we will use a ray coming out from the camera, but you can use
|
||||
any ray.
|
||||
|
||||
To start, we take the program from tutorial 2, which loads and displays a quake
|
||||
3 level. We will use the level to walk in it and to pick triangles from it. In
|
||||
addition we'll place 3 animated models into it for scene node picking. The
|
||||
following code starts up the engine and loads a quake 3 level. I will not
|
||||
explain it, because it should already be known from tutorial 2.
|
||||
3 level. We will use the level to walk in it and to pick triangles from. In
|
||||
addition we'll place 3 animated models into it for triangle picking. The
|
||||
following code starts up the engine and loads a quake 3 level, as per tutorial 2.
|
||||
*/
|
||||
#include <irrlicht.h>
|
||||
#include <iostream>
|
||||
|
@ -20,6 +19,22 @@ using namespace irr;
|
|||
#pragma comment(lib, "Irrlicht.lib")
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
// I use this ISceneNode ID to indicate a scene node that is
|
||||
// not pickable by getSceneNodeAndCollisionPointFromRay()
|
||||
ID_IsNotPickable = 0,
|
||||
|
||||
// I use this flag in ISceneNode IDs to indicate that the
|
||||
// scene node can be picked by ray selection.
|
||||
IDFlag_IsPickable = 1 << 0,
|
||||
|
||||
// I use this flag in ISceneNode IDs to indicate that the
|
||||
// scene node can be highlighted. In this example, the
|
||||
// homonids can be highlighted, but the level mesh can't.
|
||||
IDFlag_IsHighlightable = 1 << 1
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
// let user select driver type
|
||||
|
@ -59,12 +74,11 @@ int main()
|
|||
device->getFileSystem()->addZipFileArchive("../../media/map-20kdm2.pk3");
|
||||
|
||||
scene::IAnimatedMesh* q3levelmesh = smgr->getMesh("20kdm2.bsp");
|
||||
scene::ISceneNode* q3node = 0;
|
||||
scene::IMeshSceneNode* q3node = 0;
|
||||
|
||||
// The Quake mesh is pickable, but doesn't get highlighted.
|
||||
if (q3levelmesh)
|
||||
q3node = smgr->addOctTreeSceneNode(q3levelmesh->getMesh(0));
|
||||
|
||||
q3node->setID(0); // Make it an invalid target for bounding box collision
|
||||
q3node = smgr->addOctTreeSceneNode(q3levelmesh->getMesh(0), 0, IDFlag_IsPickable);
|
||||
|
||||
/*
|
||||
So far so good, we've loaded the quake 3 level like in tutorial 2. Now,
|
||||
|
@ -88,26 +102,27 @@ int main()
|
|||
q3node->setPosition(core::vector3df(-1350,-130,-1400));
|
||||
|
||||
selector = smgr->createOctTreeTriangleSelector(
|
||||
q3levelmesh->getMesh(0), q3node, 128);
|
||||
q3node->getMesh(), q3node, 128);
|
||||
q3node->setTriangleSelector(selector);
|
||||
// We're not done with this selector yet, so don't drop it.
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
We add a first person shooter camera to the scene for being able to
|
||||
We add a first person shooter camera to the scene so that we can see and
|
||||
move in the quake 3 level like in tutorial 2. But this, time, we add a
|
||||
special animator to the camera: A Collision Response animator. This
|
||||
animator modifies the scene node to which it is attached to in order to
|
||||
prevent it moving through walls, and to add gravity to it. The
|
||||
only thing we have to tell the animator is how the world looks like,
|
||||
how big the scene node is, how much gravity to apply and so on. After the
|
||||
how big the scene node is, how much gravity to apply and so on. After the
|
||||
collision response animator is attached to the camera, we do not have to do
|
||||
anything more for collision detection, anything is done automatically,
|
||||
all other collision detection code below is for picking. And please
|
||||
anything more for collision detection, anything is done automatically.
|
||||
The rest of the collision detection code below is for picking. And please
|
||||
note another cool feature: The collision response animator can be
|
||||
attached also to all other scene nodes, not only to cameras. And it can
|
||||
be mixed with other scene node animators. In this way, collision
|
||||
detection and response in the Irrlicht engine is really, really easy.
|
||||
detection and response in the Irrlicht engine is really easy.
|
||||
|
||||
Now we'll take a closer look on the parameters of
|
||||
createCollisionResponseAnimator(). The first parameter is the
|
||||
|
@ -117,11 +132,11 @@ int main()
|
|||
case it is the camera. The third defines how big the object is, it is
|
||||
the radius of an ellipsoid. Try it out and change the radius to smaller
|
||||
values, the camera will be able to move closer to walls after this. The
|
||||
next parameter is the direction and speed of gravity. We'll set it to
|
||||
next parameter is the direction and speed of gravity. We'll set it to
|
||||
(0, -10, 0), which approximates to realistic gravity, assuming that our
|
||||
units are metres. You could set it to (0,0,0) to disable gravity. And the
|
||||
last value is just a translation: Without this, the ellipsoid with which
|
||||
collision detection is done would be around the camera, and the camera would
|
||||
units are metres. You could set it to (0,0,0) to disable gravity. And the
|
||||
last value is just a translation: Without this, the ellipsoid with which
|
||||
collision detection is done would be around the camera, and the camera would
|
||||
be in the middle of the ellipsoid. But as human beings, we are used to have our
|
||||
eyes on top of the body, with which we collide with our world, not in
|
||||
the middle of it. So we place the scene node 50 units over the center
|
||||
|
@ -132,175 +147,161 @@ int main()
|
|||
// Set a jump speed of 3 units per second, which gives a fairly realistic jump
|
||||
// when used with the gravity of (0, -10, 0) in the collision response animator.
|
||||
scene::ICameraSceneNode* camera =
|
||||
smgr->addCameraSceneNodeFPS(0, 100.0f, .3f, -1, 0, 0, true, 3.f);
|
||||
camera->setPosition(core::vector3df(-100,50,-150));
|
||||
camera->setID(0); // Make it an invalid target for bounding box collision
|
||||
smgr->addCameraSceneNodeFPS(0, 100.0f, .3f, ID_IsNotPickable, 0, 0, true, 3.f);
|
||||
camera->setPosition(core::vector3df(50,50,-60));
|
||||
camera->setTarget(core::vector3df(-70,30,-60));
|
||||
|
||||
if (selector)
|
||||
{
|
||||
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
|
||||
selector, camera, core::vector3df(30,50,30),
|
||||
core::vector3df(0,-10,0),
|
||||
core::vector3df(0,50,0));
|
||||
core::vector3df(0,-10,0), core::vector3df(0,30,0));
|
||||
selector->drop(); // As soon as we're done with the selector, drop it.
|
||||
camera->addAnimator(anim);
|
||||
anim->drop();
|
||||
anim->drop(); // And likewise, drop the animator when we're done referring to it.
|
||||
}
|
||||
|
||||
/*
|
||||
Because collision detection is no big deal in irrlicht, I'll describe how to
|
||||
do two different types of picking in the next section. But before this,
|
||||
I'll prepare the scene a little. I need three animated characters which we
|
||||
could pick later, a dynamic light for lighting them,
|
||||
a billboard for drawing where we found an intersection, and, yes, I need to
|
||||
get rid of this mouse cursor. :)
|
||||
*/
|
||||
|
||||
// disable mouse cursor
|
||||
// Now I create three animated characters which we can pick, a dynamic light for
|
||||
// lighting them, and a billboard for drawing where we found an intersection.
|
||||
|
||||
// First, let's get rid of the mouse cursor. We'll use a billboard to show
|
||||
// what we're looking at.
|
||||
device->getCursorControl()->setVisible(false);
|
||||
|
||||
// add billboard
|
||||
|
||||
// Add the billboard.
|
||||
scene::IBillboardSceneNode * bill = smgr->addBillboardSceneNode();
|
||||
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR );
|
||||
bill->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp"));
|
||||
bill->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
bill->setMaterialFlag(video::EMF_ZBUFFER, false);
|
||||
bill->setSize(core::dimension2d<f32>(20.0f, 20.0f));
|
||||
bill->setID(0); // Make it an invalid target for bounding box collision
|
||||
bill->setID(ID_IsNotPickable); // This ensures that we don't accidentally ray-pick it
|
||||
|
||||
// add 3 animated faeries. We'll make their bounding boxes visible so
|
||||
// that we can see the same boxes that the scene collision manager is
|
||||
// using to perform the getSceneNodeFromCameraBB() check below.
|
||||
/* Add 3 animated hominids, which we can pick using a ray-triangle intersection.
|
||||
They all animate quite slowly, to make it easier to see that accurate triangle
|
||||
selection is being performed. */
|
||||
scene::IAnimatedMeshSceneNode* node = 0;
|
||||
|
||||
// Add an MD2 node, which uses vertex-based animation.
|
||||
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/faerie.md2"),
|
||||
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
|
||||
node->setPosition(core::vector3df(-70,-15,-120)); // Put its feet on the floor.
|
||||
node->setScale(core::vector3df(2, 2, 2)); // Make it appear realistically scaled
|
||||
node->setMD2Animation(scene::EMAT_POINT);
|
||||
node->setAnimationSpeed(20.f);
|
||||
video::SMaterial material;
|
||||
material.setTexture(0, driver->getTexture("../../media/faerie2.bmp"));
|
||||
material.Lighting = true;
|
||||
material.NormalizeNormals = true;
|
||||
node->getMaterial(0) = material;
|
||||
|
||||
scene::IAnimatedMeshSceneNode* node = 0;
|
||||
scene::IAnimatedMesh* faerie = smgr->getMesh("../../media/faerie.md2");
|
||||
// Now create a triangle selector for it. The selector will know that it
|
||||
// is associated with an animated node, and will update itself as necessary.
|
||||
selector = smgr->createTriangleSelector(node);
|
||||
node->setTriangleSelector(selector);
|
||||
selector->drop(); // We're done with this selector, so drop it now.
|
||||
|
||||
if (faerie)
|
||||
{
|
||||
node = smgr->addAnimatedMeshSceneNode(faerie);
|
||||
node->setPosition(core::vector3df(-70,0,-90));
|
||||
node->setMD2Animation(scene::EMAT_RUN);
|
||||
node->getMaterial(0) = material;
|
||||
node->setDebugDataVisible(scene::EDS_BBOX_ALL);
|
||||
|
||||
node = smgr->addAnimatedMeshSceneNode(faerie);
|
||||
node->setPosition(core::vector3df(-70,0,-30));
|
||||
node->setMD2Animation(scene::EMAT_SALUTE);
|
||||
node->getMaterial(0) = material;
|
||||
node->setDebugDataVisible(scene::EDS_BBOX_ALL);
|
||||
// This X files uses skeletal animation, but without skinning.
|
||||
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/dwarf.x"),
|
||||
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
|
||||
node->setPosition(core::vector3df(-70,-66,0)); // Put its feet on the floor.
|
||||
node->setRotation(core::vector3df(0,-90,0)); // And turn it towards the camera.
|
||||
node->setAnimationSpeed(20.f);
|
||||
selector = smgr->createTriangleSelector(node);
|
||||
node->setTriangleSelector(selector);
|
||||
selector->drop();
|
||||
|
||||
node = smgr->addAnimatedMeshSceneNode(faerie);
|
||||
node->setPosition(core::vector3df(-70,0,-60));
|
||||
node->setMD2Animation(scene::EMAT_JUMP);
|
||||
node->getMaterial(0) = material;
|
||||
node->setDebugDataVisible(scene::EDS_BBOX_ALL);
|
||||
}
|
||||
// And this B3D file uses skinned skeletal animation.
|
||||
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/ninja.b3d"),
|
||||
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
|
||||
node->setScale(core::vector3df(10, 10, 10));
|
||||
node->setPosition(core::vector3df(-70,-66,-60));
|
||||
node->setRotation(core::vector3df(0,90,0));
|
||||
node->setAnimationSpeed(10.f);
|
||||
node->getMaterial(0).NormalizeNormals = true;
|
||||
// Just do the same as we did above.
|
||||
selector = smgr->createTriangleSelector(node);
|
||||
node->setTriangleSelector(selector);
|
||||
selector->drop();
|
||||
|
||||
material.setTexture(0, 0);
|
||||
material.Lighting = false;
|
||||
|
||||
// Add a light
|
||||
|
||||
// Add a light, so that the unselected nodes aren't completely dark.
|
||||
scene::ILightSceneNode * light = smgr->addLightSceneNode(0, core::vector3df(-60,100,400),
|
||||
video::SColorf(1.0f,1.0f,1.0f,1.0f),
|
||||
600.0f);
|
||||
light->setID(0); // Make it an invalid target for bounding box collision
|
||||
|
||||
|
||||
/*
|
||||
For not making it to complicated, I'm doing picking inside the drawing
|
||||
loop. We take two pointers for storing the current and the last
|
||||
selected scene node and start the loop.
|
||||
*/
|
||||
|
||||
|
||||
scene::ISceneNode* selectedSceneNode = 0;
|
||||
scene::ISceneNode* lastSelectedSceneNode = 0;
|
||||
|
||||
video::SColorf(1.0f,1.0f,1.0f,1.0f), 600.0f);
|
||||
light->setID(ID_IsNotPickable); // Make it an invalid target for selection.
|
||||
|
||||
// Remember which scene node is highlighted
|
||||
scene::ISceneNode* highlightedSceneNode = 0;
|
||||
scene::ISceneCollisionManager* collMan = smgr->getSceneCollisionManager();
|
||||
int lastFPS = -1;
|
||||
|
||||
while(device->run())
|
||||
if (device->isWindowActive())
|
||||
{
|
||||
driver->beginScene(true, true, 0);
|
||||
|
||||
smgr->drawAll();
|
||||
|
||||
/*
|
||||
After we've drawn the whole scene with smgr->drawAll(), we'll
|
||||
do the first picking: We want to know which triangle of the
|
||||
world we are looking at. In addition, we want the exact point
|
||||
of the quake 3 level we are looking at. For this, we create a
|
||||
3d line starting at the position of the camera and going
|
||||
through the lookAt-target of it. Then we ask the collision
|
||||
manager if this line collides with a triangle of the world
|
||||
stored in the triangle selector. If yes, we draw the 3d
|
||||
triangle and set the position of the billboard to the
|
||||
intersection point.
|
||||
*/
|
||||
// Unlight any currently highlighted scene node
|
||||
if (highlightedSceneNode)
|
||||
{
|
||||
highlightedSceneNode->setMaterialFlag(video::EMF_LIGHTING, true);
|
||||
highlightedSceneNode = 0;
|
||||
}
|
||||
|
||||
core::line3d<f32> line;
|
||||
line.start = camera->getPosition();
|
||||
line.end = line.start + (camera->getTarget() - line.start).normalize() * 1000.0f;
|
||||
// All intersections in this example are done with a ray cast out from the camera to
|
||||
// a distance of 1000. You can easily modify this to check (e.g.) a bullet
|
||||
// trajectory or a sword's position, or create a ray from a mouse click position using
|
||||
// ISceneCollisionManager::getRayFromScreenCoordinates()
|
||||
core::line3d<f32> ray;
|
||||
ray.start = camera->getPosition();
|
||||
ray.end = ray.start + (camera->getTarget() - ray.start).normalize() * 1000.0f;
|
||||
|
||||
// Tracks the current intersection point with the level or a mesh
|
||||
core::vector3df intersection;
|
||||
core::triangle3df tri;
|
||||
const scene::ISceneNode* hitNode;
|
||||
// Used to show with triangle has been hit
|
||||
core::triangle3df hitTriangle;
|
||||
|
||||
if (smgr->getSceneCollisionManager()->getCollisionPoint(
|
||||
line, selector, intersection, tri, hitNode))
|
||||
// This call is all you need to perform ray/triangle collision on every scene node
|
||||
// that has a triangle selector, including the Quake level mesh. It finds the nearest
|
||||
// collision point/triangle, and returns the scene node containing that point.
|
||||
// Irrlicht provides other types of selection, including ray/triangle selector,
|
||||
// ray/box and ellipse/triangle selector, plus associated helpers.
|
||||
// See the methods of ISceneCollisionManager
|
||||
scene::ISceneNode * selectedSceneNode =
|
||||
collMan->getSceneNodeAndCollisionPointFromRay(
|
||||
ray,
|
||||
intersection, // This will be the position of the collision
|
||||
hitTriangle, // This will be the triangle hit in the collision
|
||||
IDFlag_IsPickable, // This ensures that only nodes that we have
|
||||
// set up to be pickable are considered
|
||||
0); // Check the entire scene (this is actually the implicit default)
|
||||
|
||||
// If the ray hit anything, move the billboard to the collision position
|
||||
// and draw the triangle that was hit.
|
||||
if(selectedSceneNode)
|
||||
{
|
||||
bill->setPosition(intersection);
|
||||
|
||||
// We need to reset the transform before doing our own rendering.
|
||||
driver->setTransform(video::ETS_WORLD, core::matrix4());
|
||||
driver->setMaterial(material);
|
||||
driver->draw3DTriangle(tri, video::SColor(0,255,0,0));
|
||||
driver->draw3DTriangle(hitTriangle, video::SColor(0,255,0,0));
|
||||
|
||||
// We can check the flags for the scene node that was hit to see if it should be
|
||||
// highlighted. The animated nodes can be highlighted, but not the Quake level mesh
|
||||
if((selectedSceneNode->getID() & IDFlag_IsHighlightable) == IDFlag_IsHighlightable)
|
||||
{
|
||||
highlightedSceneNode = selectedSceneNode;
|
||||
|
||||
// Highlighting in this case means turning lighting OFF for this node,
|
||||
// which means that it will be drawn with full brightness.
|
||||
highlightedSceneNode->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Another type of picking supported by the Irrlicht Engine is
|
||||
scene node picking based on bounding boxes. Every scene node has
|
||||
got a bounding box, and because of that, it's very fast for
|
||||
example to get the scene node which the camera looks at. Again,
|
||||
we ask the collision manager for this, and if we've got a scene
|
||||
node, we highlight it by disabling Lighting in its material, if
|
||||
it is not the billboard or the quake 3 level.
|
||||
We use a collision bitmask of 1, i.e. any scene node with a scene ID
|
||||
with bit 1 set is valid for collision. Scene nodes ID defaults to 0xFFFFFFFF
|
||||
so all nodes will have this bit by default. We have called setID(0) on
|
||||
the nodes that we don't care about in order to clear this bit and make
|
||||
them invalid targets for collision. This makes the test a bit more
|
||||
efficient, and also stops us from accidentally picking unexpected nodes,
|
||||
e.g. the quake3 level, camera, light and billboard nodes. By default,
|
||||
these *are* valid targets for bounding box selection.
|
||||
*/
|
||||
|
||||
selectedSceneNode =
|
||||
smgr->getSceneCollisionManager()->getSceneNodeFromCameraBB(camera, 1);
|
||||
|
||||
if (lastSelectedSceneNode)
|
||||
lastSelectedSceneNode->setMaterialFlag(video::EMF_LIGHTING, true);
|
||||
|
||||
if (selectedSceneNode == q3node || selectedSceneNode == bill)
|
||||
selectedSceneNode = 0;
|
||||
|
||||
if (selectedSceneNode)
|
||||
selectedSceneNode->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
|
||||
lastSelectedSceneNode = selectedSceneNode;
|
||||
|
||||
|
||||
/*
|
||||
That's it, we just have to finish drawing.
|
||||
*/
|
||||
|
||||
// We're all done drawing, so end the scene.
|
||||
driver->endScene();
|
||||
|
||||
int fps = driver->getFPS();
|
||||
|
@ -317,7 +318,6 @@ int main()
|
|||
}
|
||||
}
|
||||
|
||||
selector->drop();
|
||||
device->drop();
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="SpecialFX" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -104,7 +104,7 @@ int main()
|
|||
want to.
|
||||
*/
|
||||
|
||||
mesh = smgr->addHillPlaneMesh("myHill",
|
||||
mesh = smgr->addHillPlaneMesh( "myHill",
|
||||
core::dimension2d<f32>(20,20),
|
||||
core::dimension2d<u32>(40,40), 0, 0,
|
||||
core::dimension2d<f32>(0,0),
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="MeshViewer" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -133,18 +133,18 @@ void loadModel(const c8* fn)
|
|||
extension == ".bmp" || extension == ".wal")
|
||||
{
|
||||
video::ITexture * texture =
|
||||
Device->getVideoDriver()->getTexture( filename.c_str() );
|
||||
Device->getVideoDriver()->getTexture( filename );
|
||||
if ( texture && Model )
|
||||
{
|
||||
// always reload texture
|
||||
Device->getVideoDriver()->removeTexture(texture);
|
||||
texture = Device->getVideoDriver()->getTexture( filename.c_str() );
|
||||
texture = Device->getVideoDriver()->getTexture( filename );
|
||||
|
||||
Model->setMaterialTexture(0, texture);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// if a archive is loaded add it to the FileSystems..
|
||||
// if a archive is loaded add it to the FileArchive..
|
||||
else if (extension == ".pk3" || extension == ".zip")
|
||||
{
|
||||
Device->getFileSystem()->addZipFileArchive(filename.c_str());
|
||||
|
@ -297,6 +297,11 @@ public:
|
|||
elem->setVisible(!elem->isVisible());
|
||||
}
|
||||
}
|
||||
else if (event.KeyInput.Key == irr::KEY_KEY_M)
|
||||
{
|
||||
if (Device)
|
||||
Device->minimizeWindow();
|
||||
}
|
||||
}
|
||||
|
||||
if (event.EventType == EET_GUI_EVENT)
|
||||
|
@ -576,7 +581,7 @@ int main(int argc, char* argv[])
|
|||
if (Device == 0)
|
||||
return 1; // could not create selected driver.
|
||||
|
||||
Device->setResizeAble(true);
|
||||
Device->setResizable(true);
|
||||
|
||||
Device->setWindowCaption(L"Irrlicht Engine - Loading...");
|
||||
|
||||
|
@ -589,7 +594,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
smgr->addLightSceneNode();
|
||||
smgr->addLightSceneNode(0, core::vector3df(50,-50,GUI_ID_OPEN_MODEL),
|
||||
video::SColorf(1.0f,1.0f,1.0f),20000);
|
||||
video::SColorf(1.0f,1.0f,1.0f),2000)->setPosition(core::vector3df(200,200,200));
|
||||
// add our media directory as "search path"
|
||||
Device->getFileSystem()->addFolderFileArchive("../../media/");
|
||||
|
||||
|
@ -614,7 +619,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
// read configuration from xml file
|
||||
|
||||
io::IXMLReader* xml = Device->getFileSystem()->createXMLReader("config.xml");
|
||||
io::IXMLReader* xml = Device->getFileSystem()->createXMLReader( L"config.xml");
|
||||
|
||||
while(xml && xml->read())
|
||||
{
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
<br> printf("Please select the driver you want for this example:\n"\<br> " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\<br> " (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\<br> " (f) NullDevice\n (otherKey) exit\n\n");<br><br> char key;<br> std::cin >> key;<br><br> switch(key)<br> {<br> case 'a': driverType = video::EDT_DIRECT3D9;break;<br> case 'b': driverType = video::EDT_DIRECT3D8;break;<br> case 'c': driverType = video::EDT_OPENGL; break;<br> case 'd': driverType = video::EDT_SOFTWARE; break;<br> case 'e': driverType = video::EDT_BURNINGSVIDEO;break;<br> case 'f': driverType = video::EDT_NULL; break;<br> default: return 1;<br> }
|
||||
<br> // create device and exit if creation failed
|
||||
<br> MyEventReceiver receiver;<br> Device = createDevice(driverType, core::dimension2d<s32>(640, 480),<br> 16, false, false, false, &receiver);
|
||||
<br> if (Device == 0)<br> return 1; // could not create selected driver.<br><br> Device->setResizeAble(true);<br> Device->setWindowCaption(L"Irrlicht Engine - Loading...");<br><br> video::IVideoDriver* driver = Device->getVideoDriver();<br> IGUIEnvironment* env = Device->getGUIEnvironment();<br> scene::ISceneManager* smgr = Device->getSceneManager();<br></pre></td>
|
||||
<br> if (Device == 0)<br> return 1; // could not create selected driver.<br><br> Device->setResizable(true);<br> Device->setWindowCaption(L"Irrlicht Engine - Loading...");<br><br> video::IVideoDriver* driver = Device->getVideoDriver();<br> IGUIEnvironment* env = Device->getGUIEnvironment();<br> scene::ISceneManager* smgr = Device->getSceneManager();<br></pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> The next step is to read the configuration file. It is stored in the
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="Shaders" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -171,8 +171,8 @@ int main()
|
|||
addShaderMaterial() instead of addShaderMaterialFromFiles().
|
||||
*/
|
||||
|
||||
const c8* vsFileName = 0; // filename for the vertex shader
|
||||
const c8* psFileName = 0; // filename for the pixel shader
|
||||
core::string<c16> vsFileName; // filename for the vertex shader
|
||||
core::string<c16> psFileName; // filename for the pixel shader
|
||||
|
||||
switch(driverType)
|
||||
{
|
||||
|
@ -225,7 +225,7 @@ int main()
|
|||
{
|
||||
device->getLogger()->log("WARNING: Pixel shaders disabled "\
|
||||
"because of missing driver/hardware support.");
|
||||
psFileName = 0;
|
||||
psFileName = "";
|
||||
}
|
||||
|
||||
if (!driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1) &&
|
||||
|
@ -233,7 +233,7 @@ int main()
|
|||
{
|
||||
device->getLogger()->log("WARNING: Vertex shaders disabled "\
|
||||
"because of missing driver/hardware support.");
|
||||
vsFileName = 0;
|
||||
vsFileName = "";
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -380,7 +380,7 @@ int main()
|
|||
|
||||
// add a camera and disable the mouse cursor
|
||||
|
||||
scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS(0, 100.0f, .1f);
|
||||
scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS();
|
||||
cam->setPosition(core::vector3df(-100,50,100));
|
||||
cam->setTarget(core::vector3df(0,0,0));
|
||||
device->getCursorControl()->setVisible(false);
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="PerPixelLighting" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -207,8 +207,7 @@ int main()
|
|||
core::position2d<s32>(10,10));
|
||||
|
||||
// add camera
|
||||
scene::ICameraSceneNode* camera =
|
||||
smgr->addCameraSceneNodeFPS(0, 100.0f, .3f);
|
||||
scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
|
||||
camera->setPosition(core::vector3df(-200,200,-200));
|
||||
|
||||
// disable mouse cursor
|
||||
|
@ -259,12 +258,11 @@ int main()
|
|||
to a bigger value, the map will look more rocky.
|
||||
*/
|
||||
|
||||
video::ITexture* colorMap =
|
||||
driver->getTexture("../../media/rockwall.bmp");
|
||||
video::ITexture* normalMap =
|
||||
driver->getTexture("../../media/rockwall_height.bmp");
|
||||
|
||||
driver->makeNormalMapTexture(normalMap, 9.0f);
|
||||
if (normalMap)
|
||||
driver->makeNormalMapTexture(normalMap, 9.0f);
|
||||
|
||||
/*
|
||||
But just setting color and normal map is not everything. The
|
||||
|
@ -283,7 +281,8 @@ int main()
|
|||
roomMesh->getMesh(0));
|
||||
|
||||
room = smgr->addMeshSceneNode(tangentMesh);
|
||||
room->setMaterialTexture(0, colorMap);
|
||||
room->setMaterialTexture(0,
|
||||
driver->getTexture("../../media/rockwall.jpg"));
|
||||
room->setMaterialTexture(1, normalMap);
|
||||
|
||||
room->getMaterial(0).SpecularColor.set(0,0,0,0);
|
||||
|
@ -332,13 +331,16 @@ int main()
|
|||
sphere->setPosition(core::vector3df(-70,130,45));
|
||||
|
||||
// load heightmap, create normal map from it and set it
|
||||
video::ITexture* earthNormalMap = driver->getTexture("../../media/earthbump.bmp");
|
||||
driver->makeNormalMapTexture(earthNormalMap, 20.0f);
|
||||
sphere->setMaterialTexture(1, earthNormalMap);
|
||||
video::ITexture* earthNormalMap = driver->getTexture("../../media/earthbump.jpg");
|
||||
if (earthNormalMap)
|
||||
{
|
||||
driver->makeNormalMapTexture(earthNormalMap, 20.0f);
|
||||
sphere->setMaterialTexture(1, earthNormalMap);
|
||||
sphere->setMaterialType(video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA);
|
||||
}
|
||||
|
||||
// adjust material settings
|
||||
sphere->setMaterialFlag(video::EMF_FOG_ENABLE, true);
|
||||
sphere->setMaterialType(video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA);
|
||||
|
||||
// add rotation animator
|
||||
scene::ISceneNodeAnimator* anim =
|
||||
|
@ -363,6 +365,8 @@ int main()
|
|||
smgr->addLightSceneNode(0, core::vector3df(0,0,0),
|
||||
video::SColorf(0.5f, 1.0f, 0.5f, 0.0f), 800.0f);
|
||||
|
||||
light1->setDebugDataVisible ( scene::EDS_BBOX );
|
||||
|
||||
|
||||
// add fly circle animator to light 1
|
||||
scene::ISceneNodeAnimator* anim =
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="TerrainRendering" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="RenderToTexture" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\LoadIrrFile" prefix_auto="0" extension_auto="1" />
|
||||
<Option output="../../bin/gcc/LoadIrrFile" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
|
@ -16,6 +16,18 @@
|
|||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="LoadIrrFile" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option use_console_runner="0" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
@ -23,11 +35,11 @@
|
|||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add directory="..\..\include" />
|
||||
<Add directory="../../include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
<Add directory="..\..\lib\gcc" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
|
|
|
@ -18,7 +18,7 @@ using namespace irr;
|
|||
#pragma comment(lib, "Irrlicht.lib")
|
||||
#endif
|
||||
|
||||
int main()
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
// ask user for driver
|
||||
|
||||
|
@ -68,7 +68,10 @@ int main()
|
|||
*/
|
||||
|
||||
// load the scene
|
||||
smgr->loadScene("../../media/example.irr");
|
||||
if (argc>1)
|
||||
smgr->loadScene(argv[1]);
|
||||
else
|
||||
smgr->loadScene("../../media/example.irr");
|
||||
|
||||
/*
|
||||
Now we'll create a camera, and give it a collision response animator
|
||||
|
|
|
@ -7,11 +7,22 @@
|
|||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\LoadIrrFile" prefix_auto="0" extension_auto="1" />
|
||||
<Option output="..\..\bin\gcc\Q3MapShader" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="Q3MapShader" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -191,6 +191,9 @@ int IRRCALLCONV main(int argc, char* argv[])
|
|||
|
||||
|
||||
|
||||
// Quake3 Shader controls Z-Writing
|
||||
smgr->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true);
|
||||
|
||||
/*
|
||||
Now we can load the mesh by calling getMesh(). We get a pointer returned
|
||||
to a IAnimatedMesh. As you know, Quake 3 maps are not really animated,
|
||||
|
@ -251,7 +254,7 @@ int IRRCALLCONV main(int argc, char* argv[])
|
|||
s32 shaderIndex = (s32) material.MaterialTypeParam2;
|
||||
|
||||
// the meshbuffer can be rendered without additional support, or it has no shader
|
||||
const quake3::SShader *shader = mesh->getShader ( shaderIndex );
|
||||
const quake3::IShader *shader = mesh->getShader ( shaderIndex );
|
||||
if ( 0 == shader )
|
||||
{
|
||||
continue;
|
||||
|
@ -266,18 +269,6 @@ int IRRCALLCONV main(int argc, char* argv[])
|
|||
#ifndef SHOW_SHADER_NAME
|
||||
smgr->addQuake3SceneNode ( meshBuffer, shader );
|
||||
#else
|
||||
// Now add the MeshBuffer(s) with the current Shader to the Manager
|
||||
#if 0
|
||||
if ( shader->name != "textures/cf/window-decal"
|
||||
)
|
||||
continue;
|
||||
#endif
|
||||
if ( 0 == count )
|
||||
{
|
||||
core::stringc s;
|
||||
//quake3::dumpShader ( s, shader );
|
||||
printf ( s.c_str () );
|
||||
}
|
||||
count += 1;
|
||||
|
||||
node = smgr->addQuake3SceneNode ( meshBuffer, shader );
|
||||
|
@ -294,8 +285,6 @@ int IRRCALLCONV main(int argc, char* argv[])
|
|||
}
|
||||
|
||||
|
||||
// original mesh is not needed anymore
|
||||
mesh->releaseMesh ( quake3::E_Q3_MESH_ITEMS );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -320,12 +309,12 @@ int IRRCALLCONV main(int argc, char* argv[])
|
|||
*/
|
||||
if ( mesh )
|
||||
{
|
||||
const quake3::tQ3EntityList &entityList = mesh->getEntityList ();
|
||||
quake3::tQ3EntityList &entityList = mesh->getEntityList ();
|
||||
|
||||
quake3::SEntity search;
|
||||
quake3::IEntity search;
|
||||
search.name = "info_player_deathmatch";
|
||||
|
||||
s32 index = entityList.binary_search_const ( search );
|
||||
s32 index = entityList.binary_search ( search );
|
||||
if ( index >= 0 )
|
||||
{
|
||||
const quake3::SVarGroup *group;
|
||||
|
@ -422,6 +411,12 @@ int IRRCALLCONV main(int argc, char* argv[])
|
|||
str += calls;
|
||||
str += "/";
|
||||
str += culled;
|
||||
str += " Draw: ";
|
||||
str += attr->getAttributeAsInt ( "drawn_solid" );
|
||||
str += "/";
|
||||
str += attr->getAttributeAsInt ( "drawn_transparent" );
|
||||
str += "/";
|
||||
str += attr->getAttributeAsInt ( "drawn_transparent_effect" );
|
||||
|
||||
device->setWindowCaption(str.c_str());
|
||||
lastFPS = fps;
|
||||
|
|
|
@ -0,0 +1,185 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="17.HelloWorld for Windows Mobile on PC"
|
||||
ProjectGUID="{2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}"
|
||||
RootNamespace="My17HelloWorldforWindowsMobileonPC"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\17.HelloWorld_Mobile on PC.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\17.HelloWorld_Mobile on PC.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath=".\main.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -2,6 +2,9 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "17.HelloWorld_mobile", "HelloWorld_mobile.vcproj", "{AD95D5D7-91D2-4030-B28D-23A6FE5C0359}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\..\source\Irrlicht\Irrlicht_mobile6.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}"
|
||||
EndProject
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
ForceDirty="-1"
|
||||
RemoteDirectory="%CSIDL_PROGRAM_FILES%\irrlicht\bin\wince-visualstudio"
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles="sydney.md2|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;sydney.bmp|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht.dll|$(InputDir)$(OutDir)|%CSIDL_PROGRAM_FILES%\irrlicht\bin\wince-visualstudio|0"
|
||||
AdditionalFiles="sydney.md2|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;sydney.bmp|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;ninja.b3d|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;nskinbl.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlichtlogo3.png|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;terrain-heightmap.bmp|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;terrain-texture.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;detailmap3.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht2_up.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht2_dn.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht2_lf.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht2_rt.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht2_ft.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht2_bk.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;skydome.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht.dll|$(InputDir)$(OutDir)|%CSIDL_PROGRAM_FILES%\irrlicht\bin\wince-visualstudio|0"
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
|
@ -130,7 +130,7 @@
|
|||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
DebugInformationFormat="0"
|
||||
EnableFloatingPointEmulation="true"
|
||||
/>
|
||||
<Tool
|
||||
|
@ -179,7 +179,7 @@
|
|||
ForceDirty="-1"
|
||||
RemoteDirectory="%CSIDL_PROGRAM_FILES%\irrlicht\bin\wince-visualstudio"
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles="sydney.md2|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;sydney.bmp|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht.dll|$(InputDir)$(OutDir)|%CSIDL_PROGRAM_FILES%\irrlicht\bin\wince-visualstudio|0"
|
||||
AdditionalFiles="sydney.md2|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;sydney.bmp|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;ninja.b3d|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;nskinbl.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlichtlogo3.png|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;terrain-heightmap.bmp|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;terrain-texture.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;detailmap3.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht2_up.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht2_dn.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht2_lf.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht2_rt.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht2_ft.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht2_bk.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;skydome.jpg|$(InputDir)..\..\media|%CSIDL_PROGRAM_FILES%\irrlicht\media|0;irrlicht.dll|$(InputDir)$(OutDir)|%CSIDL_PROGRAM_FILES%\irrlicht\bin\wince-visualstudio|0"
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
/** Example 017 Helloworld mobile
|
||||
|
||||
This example show Hello World for Windows mobile
|
||||
This example show Hello World for Windows mobile.
|
||||
It compiles on other platform too. The only differences between the original
|
||||
examples are. You need a GUI, because otherwise you can't quit the application.
|
||||
You need a Filesystem, which is relative based to your executable.
|
||||
*/
|
||||
|
||||
#include <irrlicht.h>
|
||||
|
||||
#ifdef _IRR_USE_WINDOWS_CE_DEVICE_
|
||||
#include <windows.h>
|
||||
#if defined ( _IRR_WINDOWS_ )
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
using namespace irr;
|
||||
|
@ -18,12 +20,12 @@ using namespace gui;
|
|||
|
||||
#pragma comment(lib, "Irrlicht.lib")
|
||||
|
||||
class MyEventReceiver : public IEventReceiver
|
||||
class EventReceiver_basic : public IEventReceiver
|
||||
{
|
||||
private:
|
||||
IrrlichtDevice *Device;
|
||||
public:
|
||||
MyEventReceiver ( IrrlichtDevice *device ): Device ( device ) {}
|
||||
EventReceiver_basic ( IrrlichtDevice *device ): Device ( device ) {}
|
||||
|
||||
virtual bool OnEvent(const SEvent& event)
|
||||
{
|
||||
|
@ -101,50 +103,98 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
#if defined(_WIN32_WCE)
|
||||
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine,
|
||||
int nCmdShow )
|
||||
#else
|
||||
int main()
|
||||
#endif
|
||||
/*!
|
||||
Startup a Windows Mobile Device
|
||||
*/
|
||||
IrrlichtDevice *startup()
|
||||
{
|
||||
//E_DRIVER_TYPE driverType = EDT_BURNINGSVIDEO;
|
||||
E_DRIVER_TYPE driverType = EDT_OPENGL;
|
||||
|
||||
// create device
|
||||
IrrlichtDevice *device = 0;
|
||||
|
||||
IrrlichtDevice *device =
|
||||
createDevice(driverType, dimension2d<s32>(240, 320), 16, true );
|
||||
|
||||
if (device == 0)
|
||||
return 1; // could not create selected driver.
|
||||
|
||||
// create engine and camera
|
||||
MyEventReceiver receiver(device);
|
||||
device->setEventReceiver(&receiver);
|
||||
device->setWindowCaption(L"Irrlicht CE Demo");
|
||||
#if defined (_IRR_USE_WINDOWS_CE_DEVICE_)
|
||||
// set to standard mobile fullscreen 240x320
|
||||
device = createDevice(driverType, dimension2d<u32>(240, 320), 16, true );
|
||||
#else
|
||||
// on PC. use window mode
|
||||
device = createDevice(driverType, dimension2d<u32>(240, 320), 16, false );
|
||||
#endif
|
||||
if ( 0 == device )
|
||||
return 0;
|
||||
|
||||
IVideoDriver* driver = device->getVideoDriver();
|
||||
ISceneManager* smgr = device->getSceneManager();
|
||||
IGUIEnvironment* guienv = device->getGUIEnvironment();
|
||||
|
||||
// set the filesystem relative to the executable
|
||||
#if defined (_IRR_WINDOWS_)
|
||||
{
|
||||
wchar_t buf[255];
|
||||
GetModuleFileNameW ( 0, buf, 255 );
|
||||
|
||||
stringc base = buf;
|
||||
base = base.subString ( 0, base.findLast ( '\\' ) );
|
||||
device->getFileSystem()->addFolderFileArchive ( base.c_str() );
|
||||
string<c16> base = buf;
|
||||
base = base.subString ( 0, base.findLast ( '\\' ) + 1 );
|
||||
device->getFileSystem()->registerFileArchive ( base );
|
||||
}
|
||||
#endif
|
||||
|
||||
IGUIStaticText *text = guienv->addStaticText(L"FPS: 25",
|
||||
rect<s32>(140,15,200,30), false, false, 0, 100 );
|
||||
|
||||
guienv->addButton(core::rect<int>(200,10,238,30), 0, 2, L"Quit");
|
||||
|
||||
// add irrlicht logo
|
||||
guienv->addImage(driver->getTexture("../../media/irrlichtlogo3.png"),
|
||||
core::position2d<s32>(0,-2));
|
||||
return device;
|
||||
}
|
||||
|
||||
/*!
|
||||
*/
|
||||
int run ( IrrlichtDevice *device )
|
||||
{
|
||||
while(device->run())
|
||||
if (device->isWindowActive())
|
||||
{
|
||||
device->getVideoDriver()->beginScene(true, true, SColor(0,100,100,100));
|
||||
device->getSceneManager()->drawAll();
|
||||
device->getGUIEnvironment()->drawAll();
|
||||
device->getVideoDriver()->endScene ();
|
||||
|
||||
IGUIElement *stat = device->getGUIEnvironment()->
|
||||
getRootGUIElement()->getElementFromId ( 100 );
|
||||
if ( stat )
|
||||
{
|
||||
stringw str = L"FPS: ";
|
||||
str += (s32)device->getVideoDriver()->getFPS();
|
||||
|
||||
stat->setText ( str.c_str() );
|
||||
}
|
||||
}
|
||||
|
||||
device->drop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
IGUIStaticText *text =
|
||||
guienv->addStaticText(L"FPS: 25",
|
||||
rect<s32>(60,5,200,20), false );
|
||||
/*!
|
||||
*/
|
||||
int example_customscenenode()
|
||||
{
|
||||
// create device
|
||||
IrrlichtDevice *device = startup();
|
||||
if (device == 0)
|
||||
return 1; // could not create selected driver.
|
||||
|
||||
// create engine and camera
|
||||
EventReceiver_basic receiver(device);
|
||||
device->setEventReceiver(&receiver);
|
||||
|
||||
IVideoDriver* driver = device->getVideoDriver();
|
||||
ISceneManager* smgr = device->getSceneManager();
|
||||
IGUIEnvironment* guienv = device->getGUIEnvironment();
|
||||
|
||||
guienv->addButton(core::rect<int>(10,5,50,20), 0, 2, L"Quit");
|
||||
|
||||
smgr->addCameraSceneNode(0, vector3df(0,-40,0), vector3df(0,0,0));
|
||||
|
||||
|
@ -164,27 +214,289 @@ int main()
|
|||
myNode->drop();
|
||||
myNode = 0; // As I shouldn't refer to it again, ensure that I can't
|
||||
|
||||
u32 frames=0;
|
||||
while(device->run())
|
||||
return run ( device );
|
||||
}
|
||||
|
||||
class EventReceiver_terrain : public IEventReceiver
|
||||
{
|
||||
public:
|
||||
|
||||
EventReceiver_terrain(IrrlichtDevice *device, scene::ISceneNode* terrain, scene::ISceneNode* skybox, scene::ISceneNode* skydome) :
|
||||
Device ( device ), Terrain(terrain), Skybox(skybox), Skydome(skydome), showBox(true)
|
||||
{
|
||||
driver->beginScene(true, true, SColor(0,100,100,100));
|
||||
smgr->drawAll();
|
||||
guienv->drawAll();
|
||||
driver->endScene();
|
||||
|
||||
if (++frames==10)
|
||||
{
|
||||
stringw str = L"FPS: ";
|
||||
str += (s32)driver->getFPS();
|
||||
|
||||
text->setText ( str.c_str() );
|
||||
frames=0;
|
||||
}
|
||||
Skybox->setVisible(true);
|
||||
Skydome->setVisible(false);
|
||||
}
|
||||
|
||||
device->drop();
|
||||
bool OnEvent(const SEvent& event)
|
||||
{
|
||||
if (event.EventType == EET_GUI_EVENT)
|
||||
{
|
||||
s32 id = event.GUIEvent.Caller->getID();
|
||||
|
||||
switch(event.GUIEvent.EventType)
|
||||
{
|
||||
case EGET_BUTTON_CLICKED:
|
||||
if (id == 2)
|
||||
{
|
||||
Device->closeDevice();
|
||||
return true;
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
// check if user presses the key 'W' or 'D'
|
||||
if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)
|
||||
{
|
||||
switch (event.KeyInput.Key)
|
||||
{
|
||||
case irr::KEY_KEY_W: // switch wire frame mode
|
||||
Terrain->setMaterialFlag(video::EMF_WIREFRAME,
|
||||
!Terrain->getMaterial(0).Wireframe);
|
||||
Terrain->setMaterialFlag(video::EMF_POINTCLOUD, false);
|
||||
return true;
|
||||
case irr::KEY_KEY_P: // switch wire frame mode
|
||||
Terrain->setMaterialFlag(video::EMF_POINTCLOUD,
|
||||
!Terrain->getMaterial(0).PointCloud);
|
||||
Terrain->setMaterialFlag(video::EMF_WIREFRAME, false);
|
||||
return true;
|
||||
case irr::KEY_KEY_D: // toggle detail map
|
||||
Terrain->setMaterialType(
|
||||
Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ?
|
||||
video::EMT_DETAIL_MAP : video::EMT_SOLID);
|
||||
return true;
|
||||
case irr::KEY_KEY_S: // toggle skies
|
||||
showBox=!showBox;
|
||||
Skybox->setVisible(showBox);
|
||||
Skydome->setVisible(!showBox);
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
IrrlichtDevice *Device;
|
||||
scene::ISceneNode* Terrain;
|
||||
scene::ISceneNode* Skybox;
|
||||
scene::ISceneNode* Skydome;
|
||||
bool showBox;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
The start of the main function starts like in most other example. We ask the user
|
||||
for the desired renderer and start it up. This time with the advanced parameter handling.
|
||||
*/
|
||||
int example_terrain()
|
||||
{
|
||||
// create device
|
||||
IrrlichtDevice *device = startup();
|
||||
if (device == 0)
|
||||
return 1; // could not create selected driver.
|
||||
|
||||
return 0;
|
||||
/*
|
||||
First, we add standard stuff to the scene: A nice irrlicht engine
|
||||
logo, a small help text, a user controlled camera, and we disable
|
||||
the mouse cursor.
|
||||
*/
|
||||
|
||||
video::IVideoDriver* driver = device->getVideoDriver();
|
||||
scene::ISceneManager* smgr = device->getSceneManager();
|
||||
gui::IGUIEnvironment* env = device->getGUIEnvironment();
|
||||
|
||||
|
||||
//set other font
|
||||
//env->getSkin()->setFont(env->getFont("../../media/fontlucida.png"));
|
||||
|
||||
// add some help text
|
||||
env->addStaticText(
|
||||
L"Press 'W' to change wireframe mode\nPress 'D' to toggle detail map\nPress 'S' to toggle skybox/skydome",
|
||||
core::rect<s32>(5,250,235,320), true, true, 0, -1, true);
|
||||
|
||||
// add camera
|
||||
scene::ICameraSceneNode* camera =
|
||||
smgr->addCameraSceneNodeFPS(0,100.0f,1.2f);
|
||||
|
||||
camera->setPosition(core::vector3df(2700*2,255*2,2600*2));
|
||||
camera->setTarget(core::vector3df(2397*2,343*2,2700*2));
|
||||
camera->setFarValue(42000.0f);
|
||||
|
||||
// disable mouse cursor
|
||||
device->getCursorControl()->setVisible(false);
|
||||
|
||||
/*
|
||||
Here comes the terrain renderer scene node: We add it just like any
|
||||
other scene node to the scene using
|
||||
ISceneManager::addTerrainSceneNode(). The only parameter we use is a
|
||||
file name to the heightmap we use. A heightmap is simply a gray scale
|
||||
texture. The terrain renderer loads it and creates the 3D terrain from
|
||||
it.
|
||||
|
||||
To make the terrain look more big, we change the scale factor of
|
||||
it to (40, 4.4, 40). Because we don't have any dynamic lights in the
|
||||
scene, we switch off the lighting, and we set the file
|
||||
terrain-texture.jpg as texture for the terrain and detailmap3.jpg as
|
||||
second texture, called detail map. At last, we set the scale values for
|
||||
the texture: The first texture will be repeated only one time over the
|
||||
whole terrain, and the second one (detail map) 20 times.
|
||||
*/
|
||||
|
||||
// add terrain scene node
|
||||
scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode(
|
||||
"../../media/terrain-heightmap.bmp",
|
||||
0, // parent node
|
||||
-1, // node id
|
||||
core::vector3df(0.f, 0.f, 0.f), // position
|
||||
core::vector3df(0.f, 0.f, 0.f), // rotation
|
||||
core::vector3df(40.f, 4.4f, 40.f), // scale
|
||||
video::SColor ( 255, 255, 255, 255 ), // vertexColor
|
||||
5, // maxLOD
|
||||
scene::ETPS_17, // patchSize
|
||||
4 // smoothFactor
|
||||
);
|
||||
|
||||
if ( terrain )
|
||||
{
|
||||
terrain->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
|
||||
terrain->setMaterialTexture(0,
|
||||
driver->getTexture("../../media/terrain-texture.jpg"));
|
||||
terrain->setMaterialTexture(1,
|
||||
driver->getTexture("../../media/detailmap3.jpg"));
|
||||
|
||||
terrain->setMaterialType(video::EMT_DETAIL_MAP);
|
||||
|
||||
terrain->scaleTexture(1.0f, 20.0f);
|
||||
//terrain->setDebugDataVisible ( true );
|
||||
|
||||
/*
|
||||
To be able to do collision with the terrain, we create a triangle selector.
|
||||
If you want to know what triangle selectors do, just take a look into the
|
||||
collision tutorial. The terrain triangle selector works together with the
|
||||
terrain. To demonstrate this, we create a collision response animator
|
||||
and attach it to the camera, so that the camera will not be able to fly
|
||||
through the terrain.
|
||||
*/
|
||||
|
||||
// create triangle selector for the terrain
|
||||
scene::ITriangleSelector* selector
|
||||
= smgr->createTerrainTriangleSelector(terrain, 0);
|
||||
terrain->setTriangleSelector(selector);
|
||||
|
||||
// create collision response animator and attach it to the camera
|
||||
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
|
||||
selector, camera, core::vector3df(60,100,60),
|
||||
core::vector3df(0,0,0),
|
||||
core::vector3df(0,50,0));
|
||||
selector->drop();
|
||||
camera->addAnimator(anim);
|
||||
anim->drop();
|
||||
|
||||
/* If you need access to the terrain data you can also do this directly via the following code fragment.
|
||||
*/
|
||||
scene::CDynamicMeshBuffer* buffer = new scene::CDynamicMeshBuffer(video::EVT_2TCOORDS, video::EIT_16BIT);
|
||||
terrain->getMeshBufferForLOD(*buffer, 0);
|
||||
video::S3DVertex2TCoords* data = (video::S3DVertex2TCoords*)buffer->getVertexBuffer().getData();
|
||||
// Work on data or get the IndexBuffer with a similar call.
|
||||
buffer->drop(); // When done drop the buffer again.
|
||||
}
|
||||
|
||||
/*
|
||||
To make the user be able to switch between normal and wireframe mode,
|
||||
we create an instance of the event reciever from above and let Irrlicht
|
||||
know about it. In addition, we add the skybox which we already used in
|
||||
lots of Irrlicht examples and a skydome, which is shown mutually
|
||||
exclusive with the skybox by pressing 'S'.
|
||||
*/
|
||||
|
||||
// create skybox and skydome
|
||||
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
|
||||
|
||||
scene::ISceneNode* skybox=smgr->addSkyBoxSceneNode(
|
||||
driver->getTexture("../../media/irrlicht2_up.jpg"),
|
||||
driver->getTexture("../../media/irrlicht2_dn.jpg"),
|
||||
driver->getTexture("../../media/irrlicht2_lf.jpg"),
|
||||
driver->getTexture("../../media/irrlicht2_rt.jpg"),
|
||||
driver->getTexture("../../media/irrlicht2_ft.jpg"),
|
||||
driver->getTexture("../../media/irrlicht2_bk.jpg"));
|
||||
scene::ISceneNode* skydome=smgr->addSkyDomeSceneNode(driver->getTexture("../../media/skydome.jpg"),16,8,0.95f,2.0f);
|
||||
|
||||
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);
|
||||
|
||||
// create event receiver
|
||||
EventReceiver_terrain receiver( device, terrain, skybox, skydome);
|
||||
device->setEventReceiver(&receiver);
|
||||
|
||||
return run ( device );
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
int example_helloworld()
|
||||
{
|
||||
// create device
|
||||
IrrlichtDevice *device = startup();
|
||||
if (device == 0)
|
||||
return 1; // could not create selected driver.
|
||||
|
||||
IVideoDriver* driver = device->getVideoDriver();
|
||||
ISceneManager* smgr = device->getSceneManager();
|
||||
IGUIEnvironment* guienv = device->getGUIEnvironment();
|
||||
|
||||
IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
|
||||
if (!mesh)
|
||||
{
|
||||
device->drop();
|
||||
return 1;
|
||||
}
|
||||
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
|
||||
|
||||
/*
|
||||
To let the mesh look a little bit nicer, we change its material. We
|
||||
disable lighting because we do not have a dynamic light in here, and
|
||||
the mesh would be totally black otherwise. Then we set the frame loop,
|
||||
such that the predefined STAND animation is used. And last, we apply a
|
||||
texture to the mesh. Without it the mesh would be drawn using only a
|
||||
color.
|
||||
*/
|
||||
if (node)
|
||||
{
|
||||
node->setMaterialFlag(EMF_LIGHTING, false);
|
||||
node->setMD2Animation(scene::EMAT_STAND);
|
||||
node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
|
||||
}
|
||||
|
||||
/*
|
||||
To look at the mesh, we place a camera into 3d space at the position
|
||||
(0, 30, -40). The camera looks from there to (0,5,0), which is
|
||||
approximately the place where our md2 model is.
|
||||
*/
|
||||
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
|
||||
|
||||
EventReceiver_basic receiver(device);
|
||||
device->setEventReceiver(&receiver);
|
||||
|
||||
return run ( device );
|
||||
|
||||
}
|
||||
|
||||
#if defined (_IRR_USE_WINDOWS_CE_DEVICE_)
|
||||
#pragma comment(linker, "/subsystem:WINDOWSCE /ENTRY:main")
|
||||
#elif defined (_IRR_WINDOWS_)
|
||||
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
|
||||
#endif
|
||||
|
||||
/*
|
||||
*/
|
||||
int main()
|
||||
{
|
||||
example_helloworld ();
|
||||
example_customscenenode();
|
||||
//example_terrain();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -7,11 +7,22 @@
|
|||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="default">
|
||||
<Option output="..\..\bin\gcc\LoadIrrFile" prefix_auto="0" extension_auto="1" />
|
||||
<Option output="..\..\bin\gcc\SplitScreen" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="SplitScreen" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -16,6 +16,17 @@
|
|||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option output="default" prefix_auto="1" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="Irrlicht" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="default;" />
|
||||
|
|
|
@ -182,7 +182,15 @@ int main()
|
|||
/*
|
||||
We'll create an arrow mesh and move it around either with the joystick axis/hat,
|
||||
or make it follow the mouse pointer. */
|
||||
scene::ISceneNode * node = smgr->addMeshSceneNode(smgr->addArrowMesh("Arrow", video::SColor(255, 255, 0, 0), video::SColor(255, 0, 255, 0)));
|
||||
scene::ISceneNode * node = smgr->addMeshSceneNode(
|
||||
smgr->addArrowMesh( "Arrow",
|
||||
video::SColor(255, 255, 0, 0),
|
||||
video::SColor(255, 0, 255, 0),
|
||||
16,16,
|
||||
2.f, 1.3f,
|
||||
0.1f, 0.6f
|
||||
)
|
||||
);
|
||||
node->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
|
||||
scene::ICameraSceneNode * camera = smgr->addCameraSceneNode();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Version="8,00"
|
||||
Name="20.ManagedLights_vc8"
|
||||
ProjectGUID="{16007FE2-142B-47F8-93E1-519BA3F39E71}"
|
||||
RootNamespace="ManagedLights_vc8"
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
CMyLightManager(ISceneManager* sceneManager)
|
||||
: Mode(NO_MANAGEMENT), RequestedMode(NO_MANAGEMENT),
|
||||
SceneManager(sceneManager), SceneLightList(0),
|
||||
CurrentRenderPass(ESNRP_COUNT), CurrentSceneNode(0)
|
||||
CurrentRenderPass(ESNRP_NONE), CurrentSceneNode(0)
|
||||
{ }
|
||||
|
||||
virtual ~CMyLightManager(void) { }
|
||||
|
@ -273,7 +273,8 @@ private:
|
|||
};
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
*/
|
||||
int main(int argumentCount, char * argumentValues[])
|
||||
{
|
||||
char driverChoice;
|
||||
|
@ -284,7 +285,8 @@ int main(int argumentCount, char * argumentValues[])
|
|||
{
|
||||
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) Burning's Software Renderer\n(otherKey) exit\n\n");
|
||||
" (d) Software Renderer\n (e) Burning's Software Renderer\n"\
|
||||
" (f) NullDevice\n (otherKey) exit\n\n");
|
||||
|
||||
std::cin >> driverChoice;
|
||||
}
|
||||
|
@ -295,10 +297,13 @@ int main(int argumentCount, char * argumentValues[])
|
|||
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_BURNINGSVIDEO; break;
|
||||
case 'd': driverType = video::EDT_SOFTWARE; break;
|
||||
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
|
||||
case 'f': driverType = video::EDT_NULL; break;
|
||||
default: return 0;
|
||||
}
|
||||
|
||||
|
||||
IrrlichtDevice *device = createDevice(driverType, dimension2d<u32>(640, 480), 32,
|
||||
false, false, false, 0);
|
||||
if(!device)
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
# 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 = 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
|
||||
|
||||
#default target is Linux
|
||||
all: all_linux
|
||||
|
||||
ifeq ($(HOSTTYPE), x86_64)
|
||||
LIBSELECT=64
|
||||
endif
|
||||
|
||||
# target specific settings
|
||||
all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
|
||||
all_linux clean_linux: SYSTEM=Linux
|
||||
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
|
||||
all_win32 clean_win32: SYSTEM=Win32-gcc
|
||||
all_win32 clean_win32: SUF=.exe
|
||||
# name of the binary - only valid for targets which set SYSTEM
|
||||
DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
|
||||
|
||||
all_linux all_win32:
|
||||
$(warning Building...)
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
|
||||
|
||||
clean: clean_linux clean_win32
|
||||
$(warning Cleaning...)
|
||||
|
||||
clean_linux clean_win32:
|
||||
@$(RM) $(DESTPATH)
|
||||
|
||||
.PHONY: all all_win32 clean clean_linux clean_win32
|
|
@ -0,0 +1,99 @@
|
|||
[Project]
|
||||
FileName=Quake3Explorer.dev
|
||||
Name=Irrlicht Example 21 Quake3 Explorer
|
||||
UnitCount=5
|
||||
Type=1
|
||||
Ver=1
|
||||
ObjFiles=
|
||||
Includes=..\..\include
|
||||
Libs=
|
||||
PrivateResource=
|
||||
ResourceIncludes=
|
||||
MakeIncludes=
|
||||
Compiler=
|
||||
CppCompiler=
|
||||
Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_
|
||||
IsCpp=1
|
||||
Icon=
|
||||
ExeOutput=../../bin/Win32-gcc
|
||||
ObjectOutput=obj
|
||||
OverrideOutput=1
|
||||
OverrideOutputName=21.Quake3Explorer.exe
|
||||
HostApplication=
|
||||
Folders=
|
||||
CommandLine=
|
||||
IncludeVersionInfo=0
|
||||
SupportXPThemes=0
|
||||
CompilerSet=0
|
||||
CompilerSettings=0000000000000000000000
|
||||
UseCustomMakefile=0
|
||||
CustomMakefile=
|
||||
|
||||
[Unit1]
|
||||
FileName=main.cpp
|
||||
CompileCpp=1
|
||||
Folder=Projekt1
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[VersionInfo]
|
||||
Major=0
|
||||
Minor=1
|
||||
Release=1
|
||||
Build=1
|
||||
LanguageID=1033
|
||||
CharsetID=1252
|
||||
CompanyName=
|
||||
FileVersion=
|
||||
FileDescription=Irrlicht Engine example compiled using DevCpp and gcc
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=
|
||||
AutoIncBuildNr=0
|
||||
|
||||
[Unit2]
|
||||
FileName=q3factory.cpp
|
||||
CompileCpp=1
|
||||
Folder=Irrlicht Example 21 Quake3 Explorer
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit3]
|
||||
FileName=q3factory.h
|
||||
CompileCpp=1
|
||||
Folder=Irrlicht Example 21 Quake3 Explorer
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit4]
|
||||
FileName=sound.cpp
|
||||
CompileCpp=1
|
||||
Folder=Irrlicht Example 21 Quake3 Explorer
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit5]
|
||||
FileName=sound.h
|
||||
CompileCpp=1
|
||||
Folder=Irrlicht Example 21 Quake3 Explorer
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{830FD174-FABE-4667-B9FC-F7F8B8378EE7}") = "19.Quake3MapExplorer", "Quake3MapShader.vcproj", "{CDC4AAA9-72E1-4ffa-A04D-7EF59D8B97CD}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{CDC4AAA9-72E1-4ffa-A04D-7EF59D8B97CD}.Debug.ActiveCfg = Debug|Win32
|
||||
{CDC4AAA9-72E1-4ffa-A04D-7EF59D8B97CD}.Debug.Build.0 = Debug|Win32
|
||||
{CDC4AAA9-72E1-4ffa-A04D-7EF59D8B97CD}.Release.ActiveCfg = Release|Win32
|
||||
{CDC4AAA9-72E1-4ffa-A04D-7EF59D8B97CD}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,132 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="21.Quake3Explorer"
|
||||
ProjectGUID="{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\19.Quake3MapExplorer.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/Quake3MapShader.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/QIfist /Oa"
|
||||
Optimization="3"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="TRUE"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="TRUE"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="4"
|
||||
BufferSecurityCheck="FALSE"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="0"
|
||||
CallingConvention="1"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\19.Quake3MapExplorer.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
GenerateDebugInformation="FALSE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath=".\main.cpp">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -0,0 +1,132 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="21.Quake3Explorer"
|
||||
ProjectGUID="{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/Quake3MapShader.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/QIfist /Oa"
|
||||
Optimization="3"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="TRUE"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="TRUE"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="4"
|
||||
BufferSecurityCheck="FALSE"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="0"
|
||||
CallingConvention="1"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\19.Quake3MapExplorer.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
GenerateDebugInformation="FALSE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath=".\main.cpp">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -0,0 +1,210 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="21.Quake3Explorer_vc8"
|
||||
ProjectGUID="{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}"
|
||||
RootNamespace="21.Quake3Explorer_vc8"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
DisableSpecificWarnings="4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/Quake3MapShader.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
CallingConvention="1"
|
||||
DisableSpecificWarnings="4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath=".\main.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\q3factory.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\q3factory.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\sound.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\sound.h"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -0,0 +1,204 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="21.Quake3Explorer_vc9"
|
||||
ProjectGUID="{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}"
|
||||
RootNamespace="19.Quake3Explorer_vc9"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/Quake3MapShader.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
CallingConvention="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath=".\main.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\q3factory.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\q3factory.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\sound.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\sound.h"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,830 @@
|
|||
/*!
|
||||
Model Factory.
|
||||
create the additional scenenodes for ( bullets, health... )
|
||||
|
||||
Defines the Entities for Quake3
|
||||
*/
|
||||
|
||||
#include "q3factory.h"
|
||||
#include "sound.h"
|
||||
|
||||
using namespace irr;
|
||||
using namespace scene;
|
||||
using namespace gui;
|
||||
using namespace video;
|
||||
using namespace core;
|
||||
using namespace quake3;
|
||||
|
||||
//! This list is based on the original quake3.
|
||||
static const SItemElement Quake3ItemElement [] = {
|
||||
{ "item_health",
|
||||
"models/powerups/health/medium_cross.md3",
|
||||
"models/powerups/health/medium_sphere.md3",
|
||||
"sound/items/n_health.wav",
|
||||
"icons/iconh_yellow",
|
||||
"25 Health",
|
||||
25,
|
||||
HEALTH,
|
||||
SUB_NONE,
|
||||
SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1
|
||||
},
|
||||
{ "item_health_large",
|
||||
"models/powerups/health/large_cross.md3",
|
||||
"models/powerups/health/large_sphere.md3",
|
||||
"sound/items/l_health.wav",
|
||||
"icons/iconh_red",
|
||||
"50 Health",
|
||||
50,
|
||||
HEALTH,
|
||||
SUB_NONE,
|
||||
SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1
|
||||
},
|
||||
{
|
||||
"item_health_mega",
|
||||
"models/powerups/health/mega_cross.md3",
|
||||
"models/powerups/health/mega_sphere.md3",
|
||||
"sound/items/m_health.wav",
|
||||
"icons/iconh_mega",
|
||||
"Mega Health",
|
||||
100,
|
||||
HEALTH,
|
||||
SUB_NONE,
|
||||
SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1
|
||||
},
|
||||
{
|
||||
"item_health_small",
|
||||
"models/powerups/health/small_cross.md3",
|
||||
"models/powerups/health/small_sphere.md3",
|
||||
"sound/items/s_health.wav",
|
||||
"icons/iconh_green",
|
||||
"5 Health",
|
||||
5,
|
||||
HEALTH,
|
||||
SUB_NONE,
|
||||
SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1
|
||||
},
|
||||
{ "ammo_bullets",
|
||||
"models/powerups/ammo/machinegunam.md3",
|
||||
"",
|
||||
"sound/misc/am_pkup.wav",
|
||||
"icons/icona_machinegun",
|
||||
"Bullets",
|
||||
50,
|
||||
AMMO,
|
||||
MACHINEGUN,
|
||||
SPECIAL_SFX_BOUNCE,
|
||||
},
|
||||
{
|
||||
"ammo_cells",
|
||||
"models/powerups/ammo/plasmaam.md3",
|
||||
"",
|
||||
"sound/misc/am_pkup.wav",
|
||||
"icons/icona_plasma",
|
||||
"Cells",
|
||||
30,
|
||||
AMMO,
|
||||
PLASMAGUN,
|
||||
SPECIAL_SFX_BOUNCE
|
||||
},
|
||||
{ "ammo_rockets",
|
||||
"models/powerups/ammo/rocketam.md3",
|
||||
"",
|
||||
"",
|
||||
"icons/icona_rocket",
|
||||
"Rockets",
|
||||
5,
|
||||
AMMO,
|
||||
ROCKET_LAUNCHER,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"ammo_shells",
|
||||
"models/powerups/ammo/shotgunam.md3",
|
||||
"",
|
||||
"sound/misc/am_pkup.wav",
|
||||
"icons/icona_shotgun",
|
||||
"Shells",
|
||||
10,
|
||||
AMMO,
|
||||
SHOTGUN,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"ammo_slugs",
|
||||
"models/powerups/ammo/railgunam.md3",
|
||||
"",
|
||||
"sound/misc/am_pkup.wav",
|
||||
"icons/icona_railgun",
|
||||
"Slugs",
|
||||
10,
|
||||
AMMO,
|
||||
RAILGUN,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"item_armor_body",
|
||||
"models/powerups/armor/armor_red.md3",
|
||||
"",
|
||||
"sound/misc/ar2_pkup.wav",
|
||||
"icons/iconr_red",
|
||||
"Heavy Armor",
|
||||
100,
|
||||
ARMOR,
|
||||
SUB_NONE,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"item_armor_combat",
|
||||
"models/powerups/armor/armor_yel.md3",
|
||||
"",
|
||||
"sound/misc/ar2_pkup.wav",
|
||||
"icons/iconr_yellow",
|
||||
"Armor",
|
||||
50,
|
||||
ARMOR,
|
||||
SUB_NONE,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"item_armor_shard",
|
||||
"models/powerups/armor/shard.md3",
|
||||
"",
|
||||
"sound/misc/ar1_pkup.wav",
|
||||
"icons/iconr_shard",
|
||||
"Armor Shared",
|
||||
5,
|
||||
ARMOR,
|
||||
SUB_NONE,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"weapon_gauntlet",
|
||||
"models/weapons2/gauntlet/gauntlet.md3",
|
||||
"",
|
||||
"sound/misc/w_pkup.wav",
|
||||
"icons/iconw_gauntlet",
|
||||
"Gauntlet",
|
||||
0,
|
||||
WEAPON,
|
||||
GAUNTLET,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"weapon_shotgun",
|
||||
"models/weapons2/shotgun/shotgun.md3",
|
||||
"",
|
||||
"sound/misc/w_pkup.wav",
|
||||
"icons/iconw_shotgun",
|
||||
"Shotgun",
|
||||
10,
|
||||
WEAPON,
|
||||
SHOTGUN,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"weapon_machinegun",
|
||||
"models/weapons2/machinegun/machinegun.md3",
|
||||
"",
|
||||
"sound/misc/w_pkup.wav",
|
||||
"icons/iconw_machinegun",
|
||||
"Machinegun",
|
||||
40,
|
||||
WEAPON,
|
||||
MACHINEGUN,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"weapon_grenadelauncher",
|
||||
"models/weapons2/grenadel/grenadel.md3",
|
||||
"",
|
||||
"sound/misc/w_pkup.wav",
|
||||
"icons/iconw_grenade",
|
||||
"Grenade Launcher",
|
||||
10,
|
||||
WEAPON,
|
||||
GRENADE_LAUNCHER,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"weapon_rocketlauncher",
|
||||
"models/weapons2/rocketl/rocketl.md3",
|
||||
"",
|
||||
"sound/misc/w_pkup.wav",
|
||||
"icons/iconw_rocket",
|
||||
"Rocket Launcher",
|
||||
10,
|
||||
WEAPON,
|
||||
ROCKET_LAUNCHER,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"weapon_lightning",
|
||||
"models/weapons2/lightning/lightning.md3",
|
||||
"",
|
||||
"sound/misc/w_pkup.wav",
|
||||
"icons/iconw_lightning",
|
||||
"Lightning Gun",
|
||||
100,
|
||||
WEAPON,
|
||||
LIGHTNING,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"weapon_railgun",
|
||||
"models/weapons2/railgun/railgun.md3",
|
||||
"",
|
||||
"sound/misc/w_pkup.wav",
|
||||
"icons/iconw_railgun",
|
||||
"Railgun",
|
||||
10,
|
||||
WEAPON,
|
||||
RAILGUN,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"weapon_plasmagun",
|
||||
"models/weapons2/plasma/plasma.md3",
|
||||
"",
|
||||
"sound/misc/w_pkup.wav",
|
||||
"icons/iconw_plasma",
|
||||
"Plasma Gun",
|
||||
50,
|
||||
WEAPON,
|
||||
PLASMAGUN,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"weapon_bfg",
|
||||
"models/weapons2/bfg/bfg.md3",
|
||||
"",
|
||||
"sound/misc/w_pkup.wav",
|
||||
"icons/iconw_bfg",
|
||||
"BFG10K",
|
||||
20,
|
||||
WEAPON,
|
||||
BFG,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
"weapon_grapplinghook",
|
||||
"models/weapons2/grapple/grapple.md3",
|
||||
"",
|
||||
"sound/misc/w_pkup.wav",
|
||||
"icons/iconw_grapple",
|
||||
"Grappling Hook",
|
||||
0,
|
||||
WEAPON,
|
||||
GRAPPLING_HOOK,
|
||||
SPECIAL_SFX_ROTATE
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
*/
|
||||
const SItemElement * getItemElement ( const stringc& key )
|
||||
{
|
||||
const SItemElement *item = Quake3ItemElement;
|
||||
|
||||
while ( item->key[0] )
|
||||
{
|
||||
if ( 0 == strcmp ( key.c_str(), item->key ) )
|
||||
return item;
|
||||
item += 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
Quake3 Model Factory.
|
||||
Takes the mesh buffers and creates scenenodes for their associated shaders
|
||||
*/
|
||||
void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam,
|
||||
IrrlichtDevice *device,
|
||||
IQ3LevelMesh* mesh,
|
||||
eQ3MeshIndex meshIndex,
|
||||
ISceneNode *parent,
|
||||
IMetaTriangleSelector *meta,
|
||||
bool showShaderName )
|
||||
{
|
||||
if ( 0 == mesh || 0 == device )
|
||||
return;
|
||||
|
||||
IMeshSceneNode* node = 0;
|
||||
ISceneManager* smgr = device->getSceneManager();
|
||||
ITriangleSelector * selector = 0;
|
||||
|
||||
// the additional mesh can be quite huge and is unoptimized
|
||||
// Save to cast to SMesh
|
||||
SMesh * additional_mesh = (SMesh*) mesh->getMesh ( meshIndex );
|
||||
if ( 0 == additional_mesh || additional_mesh->getMeshBufferCount() == 0)
|
||||
return;
|
||||
|
||||
char buf[128];
|
||||
if ( loadParam.verbose > 0 )
|
||||
{
|
||||
loadParam.startTime = device->getTimer()->getRealTime();
|
||||
if ( loadParam.verbose > 1 )
|
||||
{
|
||||
snprintf(buf, 128, "q3shaderfactory start" );
|
||||
device->getLogger()->log( buf, ELL_INFORMATION);
|
||||
}
|
||||
}
|
||||
|
||||
IGUIFont *font = 0;
|
||||
if ( showShaderName )
|
||||
font = device->getGUIEnvironment()->getFont("fontlucida.png");
|
||||
|
||||
IVideoDriver *driver = device->getVideoDriver();
|
||||
|
||||
// create helper textures
|
||||
if ( 1 )
|
||||
{
|
||||
tTexArray tex;
|
||||
u32 pos = 0;
|
||||
getTextures ( tex, "$redimage $blueimage $whiteimage $checkerimage", pos,
|
||||
device->getFileSystem(), driver );
|
||||
}
|
||||
|
||||
s32 sceneNodeID = 0;
|
||||
for ( u32 i = 0; i!= additional_mesh->getMeshBufferCount (); ++i )
|
||||
{
|
||||
IMeshBuffer *meshBuffer = additional_mesh->getMeshBuffer ( i );
|
||||
const SMaterial &material = meshBuffer->getMaterial();
|
||||
|
||||
//! The ShaderIndex is stored in the second material parameter
|
||||
s32 shaderIndex = (s32) material.MaterialTypeParam2;
|
||||
|
||||
// the meshbuffer can be rendered without additional support, or it has no shader
|
||||
IShader *shader = (IShader *) mesh->getShader ( shaderIndex );
|
||||
|
||||
// no shader, or mapped to existing material
|
||||
if ( 0 == shader )
|
||||
{
|
||||
|
||||
#if 1
|
||||
// clone mesh
|
||||
SMesh * m = new SMesh ();
|
||||
m->addMeshBuffer ( meshBuffer );
|
||||
SMaterial &mat = m->getMeshBuffer( 0 )->getMaterial();
|
||||
if ( mat.getTexture( 0 ) == 0 )
|
||||
mat.setTexture ( 0, driver->getTexture ( "$blueimage" ) );
|
||||
if ( mat.getTexture( 1 ) == 0 )
|
||||
mat.setTexture ( 1, driver->getTexture ( "$redimage" ) );
|
||||
|
||||
IMesh * store = smgr->getMeshManipulator ()->createMeshWith2TCoords ( m );
|
||||
m->drop();
|
||||
|
||||
node = smgr->addMeshSceneNode ( store, parent, sceneNodeID );
|
||||
node->setAutomaticCulling ( scene::EAC_OFF );
|
||||
store->drop ();
|
||||
sceneNodeID += 1;
|
||||
#endif
|
||||
}
|
||||
else if ( 1 )
|
||||
{
|
||||
/*
|
||||
stringc s;
|
||||
dumpShader ( s, shader );
|
||||
printf ( s.c_str () );
|
||||
*/
|
||||
// create sceneNode
|
||||
node = smgr->addQuake3SceneNode ( meshBuffer, shader, parent, sceneNodeID );
|
||||
node->setAutomaticCulling ( scene::EAC_FRUSTUM_BOX );
|
||||
sceneNodeID += 1;
|
||||
}
|
||||
|
||||
// show Debug Shader Name
|
||||
if ( showShaderName && node )
|
||||
{
|
||||
IBillboardTextSceneNode* node2 = 0;
|
||||
swprintf ( (wchar_t*) buf, 64, L"%hs:%d", node->getName(),node->getID() );
|
||||
node2 = smgr->addBillboardTextSceneNode(
|
||||
font,
|
||||
(wchar_t*) buf,
|
||||
node,
|
||||
dimension2d<f32>(80.0f, 8.0f),
|
||||
vector3df(0, 10, 0),
|
||||
sceneNodeID
|
||||
);
|
||||
snprintf ( buf, 64, "%s:%d", node->getName(),node->getID() );
|
||||
//node2->setName ( buf );
|
||||
sceneNodeID += 1;
|
||||
}
|
||||
|
||||
// create Portal Rendertargets
|
||||
if ( shader )
|
||||
{
|
||||
const SVarGroup *group = shader->getGroup(1);
|
||||
if ( group->isDefined( "surfaceparm", "portal" ) )
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// add collision
|
||||
// find out if shader is marked als nonsolid
|
||||
u8 doCreate = meta !=0 ;
|
||||
|
||||
if ( shader )
|
||||
{
|
||||
const SVarGroup *group = shader->getGroup(1);
|
||||
if ( group->isDefined( "surfaceparm", "trans" )
|
||||
// || group->isDefined( "surfaceparm", "sky" )
|
||||
// || group->isDefined( "surfaceparm", "nonsolid" )
|
||||
)
|
||||
{
|
||||
if ( !group->isDefined( "surfaceparm", "metalsteps" ) )
|
||||
{
|
||||
doCreate = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( doCreate )
|
||||
{
|
||||
IMesh *m = 0;
|
||||
|
||||
//! controls if triangles are modified by the scenenode during runtime
|
||||
bool takeOriginal = true;
|
||||
|
||||
if ( takeOriginal )
|
||||
{
|
||||
m = new SMesh ();
|
||||
((SMesh*) m )->addMeshBuffer (meshBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
m = node->getMesh();
|
||||
}
|
||||
|
||||
//selector = smgr->createOctTreeTriangleSelector ( m, 0, 128 );
|
||||
selector = smgr->createTriangleSelector ( m, 0 );
|
||||
meta->addTriangleSelector ( selector );
|
||||
selector->drop ();
|
||||
|
||||
if ( takeOriginal )
|
||||
{
|
||||
delete m;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if 0
|
||||
if ( meta )
|
||||
{
|
||||
selector = smgr->createOctTreeTriangleSelector ( additional_mesh, 0 );
|
||||
meta->addTriangleSelector ( selector );
|
||||
selector->drop ();
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( loadParam.verbose > 0 )
|
||||
{
|
||||
loadParam.endTime = device->getTimer()->getRealTime ();
|
||||
snprintf(buf, 128, "q3shaderfactory needed %04d ms to create %d shader nodes",
|
||||
loadParam.endTime - loadParam.startTime,
|
||||
sceneNodeID
|
||||
);
|
||||
device->getLogger()->log(buf, ELL_INFORMATION);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
create Items from Entity
|
||||
*/
|
||||
void Q3ModelFactory ( Q3LevelLoadParameter &loadParam,
|
||||
IrrlichtDevice *device,
|
||||
IQ3LevelMesh* masterMesh,
|
||||
ISceneNode *parent,
|
||||
bool showShaderName
|
||||
)
|
||||
{
|
||||
if ( 0 == masterMesh )
|
||||
return;
|
||||
|
||||
tQ3EntityList &entity = masterMesh->getEntityList ();
|
||||
ISceneManager* smgr = device->getSceneManager();
|
||||
|
||||
|
||||
char buf[128];
|
||||
const SVarGroup *group;
|
||||
IEntity search;
|
||||
s32 index;
|
||||
s32 lastIndex;
|
||||
|
||||
/*
|
||||
stringc s;
|
||||
FILE *f = 0;
|
||||
f = fopen ( "entity.txt", "wb" );
|
||||
for ( index = 0; (u32) index < entityList.size (); ++index )
|
||||
{
|
||||
const IEntity *entity = &entityList[ index ];
|
||||
s = entity->name;
|
||||
dumpShader ( s, entity );
|
||||
fwrite ( s.c_str(), 1, s.size(), f );
|
||||
}
|
||||
fclose ( f );
|
||||
*/
|
||||
IAnimatedMeshMD3* model;
|
||||
SMD3Mesh * mesh;
|
||||
const SMD3MeshBuffer *meshBuffer;
|
||||
IMeshSceneNode* node;
|
||||
ISceneNodeAnimator* anim;
|
||||
const IShader *shader;
|
||||
u32 pos;
|
||||
vector3df p;
|
||||
u32 nodeCount = 0;
|
||||
tTexArray textureArray;
|
||||
|
||||
IGUIFont *font = 0;
|
||||
if ( showShaderName )
|
||||
font = device->getGUIEnvironment()->getFont("fontlucida.png");
|
||||
|
||||
const SItemElement *itemElement;
|
||||
|
||||
// walk list
|
||||
for ( index = 0; (u32) index < entity.size(); ++index )
|
||||
{
|
||||
itemElement = getItemElement ( entity[index].name );
|
||||
if ( 0 == itemElement )
|
||||
continue;
|
||||
|
||||
pos = 0;
|
||||
p = getAsVector3df ( entity[index].getGroup(1)->get ( "origin" ), pos );
|
||||
|
||||
nodeCount += 1;
|
||||
for ( u32 g = 0; g < 2; ++g )
|
||||
{
|
||||
if ( 0 == itemElement->model[g] || itemElement->model[g][0] == 0 )
|
||||
continue;
|
||||
model = (IAnimatedMeshMD3*) smgr->getMesh( itemElement->model[g] );
|
||||
if ( 0 == model )
|
||||
continue;
|
||||
|
||||
mesh = model->getOriginalMesh();
|
||||
for ( u32 j = 0; j != mesh->Buffer.size (); ++j )
|
||||
{
|
||||
meshBuffer = mesh->Buffer[j];
|
||||
if ( 0 == meshBuffer )
|
||||
continue;
|
||||
|
||||
shader = masterMesh->getShader ( meshBuffer->Shader.c_str(), false );
|
||||
IMeshBuffer *final = model->getMesh(0)->getMeshBuffer(j);
|
||||
if ( shader )
|
||||
{
|
||||
//!TODO: Hack don't modify the vertexbuffer. make it better;-)
|
||||
final->getMaterial().ColorMask = 0;
|
||||
node = smgr->addQuake3SceneNode ( final, shader, parent );
|
||||
final->getMaterial().ColorMask = 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
// clone mesh
|
||||
SMesh * m = new SMesh ();
|
||||
m->addMeshBuffer ( final );
|
||||
node = smgr->addMeshSceneNode ( m, parent );
|
||||
m->drop();
|
||||
}
|
||||
|
||||
if ( 0 == node )
|
||||
{
|
||||
snprintf ( buf, 128, "q3ModelFactory shader %s failed", meshBuffer->Shader.c_str() );
|
||||
device->getLogger()->log ( buf );
|
||||
continue;
|
||||
}
|
||||
|
||||
// node was maybe centered by shaderscenenode
|
||||
node->setPosition ( p );
|
||||
node->setName ( meshBuffer->Shader );
|
||||
node->setAutomaticCulling ( scene::EAC_BOX );
|
||||
|
||||
// add special effects to node
|
||||
if ( itemElement->special & SPECIAL_SFX_ROTATE ||
|
||||
(g == 0 && itemElement->special & SPECIAL_SFX_ROTATE_1)
|
||||
)
|
||||
{
|
||||
anim = smgr->createRotationAnimator ( vector3df ( 0.f,
|
||||
2.f, 0.f ) );
|
||||
node->addAnimator ( anim );
|
||||
anim->drop ();
|
||||
}
|
||||
|
||||
if ( itemElement->special & SPECIAL_SFX_BOUNCE )
|
||||
{
|
||||
//anim = smgr->createFlyStraightAnimator (
|
||||
// p, p + vector3df ( 0.f, 60.f, 0.f ), 1000, true, true );
|
||||
anim = smgr->createFlyCircleAnimator (
|
||||
p + vector3df( 0.f, 20.f, 0.f ),
|
||||
20.f,
|
||||
0.005f,
|
||||
vector3df ( 1.f, 0.f, 0.f ),
|
||||
core::fract ( nodeCount * 0.05f ),
|
||||
1.f
|
||||
);
|
||||
node->addAnimator ( anim );
|
||||
anim->drop ();
|
||||
}
|
||||
}
|
||||
}
|
||||
// show name
|
||||
if ( showShaderName )
|
||||
{
|
||||
IBillboardTextSceneNode* node2 = 0;
|
||||
swprintf ( (wchar_t*) buf, sizeof(buf) / 2, L"%hs", itemElement->key );
|
||||
node2 = smgr->addBillboardTextSceneNode(
|
||||
font,
|
||||
(wchar_t*) buf,
|
||||
parent,
|
||||
dimension2d<f32>(80.0f, 8.0f),
|
||||
p + vector3df(0, 30, 0),
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// music
|
||||
search.name = "worldspawn";
|
||||
index = entity.binary_search_multi ( search, lastIndex );
|
||||
|
||||
if ( index >= 0 )
|
||||
{
|
||||
group = entity[ index ].getGroup(1);
|
||||
background_music ( group->get ( "music" ).c_str () );
|
||||
}
|
||||
|
||||
// music
|
||||
search.name = "worldspawn";
|
||||
index = entity.binary_search_multi ( search, lastIndex );
|
||||
|
||||
if ( index >= 0 )
|
||||
{
|
||||
group = entity[ index ].getGroup(1);
|
||||
background_music ( group->get ( "music" ).c_str () );
|
||||
}
|
||||
|
||||
//IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
|
||||
//IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
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"
|
||||
*/
|
||||
s32 Q3StartPosition ( IQ3LevelMesh* mesh,
|
||||
ICameraSceneNode* camera,
|
||||
s32 startposIndex,
|
||||
const vector3df &translation
|
||||
)
|
||||
{
|
||||
if ( 0 == mesh )
|
||||
return 0;
|
||||
|
||||
tQ3EntityList &entityList = mesh->getEntityList ();
|
||||
|
||||
IEntity search;
|
||||
search.name = "info_player_start"; // "info_player_deathmatch";
|
||||
|
||||
// find all entities in the multi-list
|
||||
s32 lastIndex;
|
||||
s32 index = entityList.binary_search_multi ( search, lastIndex );
|
||||
|
||||
if ( index < 0 )
|
||||
{
|
||||
search.name = "info_player_deathmatch";
|
||||
index = entityList.binary_search_multi ( search, lastIndex );
|
||||
}
|
||||
|
||||
if ( index < 0 )
|
||||
return 0;
|
||||
|
||||
index += core::clamp ( startposIndex, 0, lastIndex - index );
|
||||
|
||||
u32 parsepos;
|
||||
|
||||
const SVarGroup *group;
|
||||
group = entityList[ index ].getGroup(1);
|
||||
|
||||
parsepos = 0;
|
||||
vector3df pos = getAsVector3df ( group->get ( "origin" ), parsepos );
|
||||
pos += translation;
|
||||
|
||||
parsepos = 0;
|
||||
f32 angle = getAsFloat ( group->get ( "angle"), parsepos );
|
||||
|
||||
vector3df target ( 0.f, 0.f, 1.f );
|
||||
target.rotateXZBy ( angle - 90.f, vector3df () );
|
||||
|
||||
if ( camera )
|
||||
{
|
||||
camera->setPosition ( pos );
|
||||
camera->setTarget ( pos + target );
|
||||
//! New. FPSCamera and animators catches reset on animate 0
|
||||
camera->OnAnimate ( 0 );
|
||||
}
|
||||
return lastIndex - index + 1;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
gets a accumulated force on a given surface
|
||||
*/
|
||||
vector3df getGravity ( const c8 * surface )
|
||||
{
|
||||
if ( 0 == strcmp ( surface, "earth" ) ) return vector3df ( 0.f, -90.f, 0.f );
|
||||
if ( 0 == strcmp ( surface, "moon" ) ) return vector3df ( 0.f, -6.f / 100.f, 0.f );
|
||||
if ( 0 == strcmp ( surface, "water" ) ) return vector3df ( 0.1f / 100.f, -2.f / 100.f, 0.f );
|
||||
if ( 0 == strcmp ( surface, "ice" ) ) return vector3df ( 0.2f / 100.f, -9.f / 100.f, 0.3f / 100.f );
|
||||
|
||||
return vector3df ( 0.f, 0.f, 0.f );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Dynamically load the Irrlicht Library
|
||||
*/
|
||||
|
||||
#if defined(_IRR_WINDOWS_API_) && 1
|
||||
#include <windows.h>
|
||||
|
||||
funcptr_createDevice load_createDevice ( const c8 * filename)
|
||||
{
|
||||
return (funcptr_createDevice) GetProcAddress ( LoadLibrary ( filename ), "createDevice" );
|
||||
}
|
||||
|
||||
funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename)
|
||||
{
|
||||
return (funcptr_createDeviceEx) GetProcAddress ( LoadLibrary ( filename ), "createDeviceEx" );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// TODO: Dynamic Loading for other os
|
||||
#ifdef _MSC_VER
|
||||
#pragma comment(lib, "Irrlicht.lib")
|
||||
#endif
|
||||
|
||||
funcptr_createDevice load_createDevice ( const c8 * filename)
|
||||
{
|
||||
return createDevice;
|
||||
}
|
||||
|
||||
funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename)
|
||||
{
|
||||
return createDeviceEx;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
get the current collision respone camera animator
|
||||
*/
|
||||
ISceneNodeAnimatorCollisionResponse* camCollisionResponse( IrrlichtDevice * device )
|
||||
{
|
||||
ICameraSceneNode *camera = device->getSceneManager()->getActiveCamera();
|
||||
ISceneNodeAnimatorCollisionResponse *a = 0;
|
||||
|
||||
list<ISceneNodeAnimator*>::ConstIterator it = camera->getAnimators().begin();
|
||||
for (; it != camera->getAnimators().end(); ++it)
|
||||
{
|
||||
a = (ISceneNodeAnimatorCollisionResponse*) (*it);
|
||||
if ( a->getType() == ESNAT_COLLISION_RESPONSE )
|
||||
return a;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//! internal Animation
|
||||
void setTimeFire ( TimeFire *t, u32 delta, u32 flags )
|
||||
{
|
||||
t->flags = flags;
|
||||
t->next = 0;
|
||||
t->delta = delta;
|
||||
}
|
||||
|
||||
|
||||
void checkTimeFire ( TimeFire *t, u32 listSize, u32 now )
|
||||
{
|
||||
u32 i;
|
||||
for ( i = 0; i < listSize; ++i )
|
||||
{
|
||||
if ( now < t[i].next )
|
||||
continue;
|
||||
|
||||
t[i].next = core::max_ ( now + t[i].delta, t[i].next + t[i].delta );
|
||||
t[i].flags |= FIRED;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,152 @@
|
|||
/*!
|
||||
Model Factory.
|
||||
create the additional scenenodes for ( bullets, health... )
|
||||
|
||||
Defines the Entities for Quake3
|
||||
*/
|
||||
#ifndef __QUAKE3_FACTORY__H_INCLUDED__
|
||||
#define __QUAKE3_FACTORY__H_INCLUDED__
|
||||
|
||||
#include <irrlicht.h>
|
||||
|
||||
|
||||
using namespace irr;
|
||||
using namespace scene;
|
||||
using namespace gui;
|
||||
using namespace video;
|
||||
using namespace core;
|
||||
using namespace quake3;
|
||||
using namespace io;
|
||||
|
||||
|
||||
|
||||
//! Defines to which group the entities belong
|
||||
enum eItemGroup
|
||||
{
|
||||
WEAPON,
|
||||
AMMO,
|
||||
ARMOR,
|
||||
HEALTH,
|
||||
POWERUP
|
||||
};
|
||||
|
||||
//! define a supgroup for the item. for e.q the Weapons
|
||||
enum eItemSubGroup
|
||||
{
|
||||
SUB_NONE = 0,
|
||||
GAUNTLET,
|
||||
MACHINEGUN,
|
||||
SHOTGUN,
|
||||
GRENADE_LAUNCHER,
|
||||
ROCKET_LAUNCHER,
|
||||
LIGHTNING,
|
||||
RAILGUN,
|
||||
PLASMAGUN,
|
||||
BFG,
|
||||
GRAPPLING_HOOK,
|
||||
NAILGUN,
|
||||
PROX_LAUNCHER,
|
||||
CHAINGUN,
|
||||
};
|
||||
|
||||
//! aplly a special effect to the shader
|
||||
enum eItemSpecialEffect
|
||||
{
|
||||
SPECIAL_SFX_NONE = 0,
|
||||
SPECIAL_SFX_ROTATE = 1,
|
||||
SPECIAL_SFX_BOUNCE = 2,
|
||||
SPECIAL_SFX_ROTATE_1 = 4,
|
||||
};
|
||||
|
||||
// a List for defining a model
|
||||
struct SItemElement
|
||||
{
|
||||
const c8 *key;
|
||||
const c8 *model[2];
|
||||
const c8 *sound;
|
||||
const c8 *icon;
|
||||
const c8 *pickup;
|
||||
s32 value;
|
||||
eItemGroup group;
|
||||
eItemSubGroup sub;
|
||||
u32 special;
|
||||
};
|
||||
|
||||
|
||||
//! Get's an entity based on it's key
|
||||
const SItemElement * getItemElement ( const stringc& key );
|
||||
|
||||
/*!
|
||||
Quake3 Model Factory.
|
||||
Takes the mesh buffers and creates scenenodes for their associated shaders
|
||||
*/
|
||||
void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam,
|
||||
IrrlichtDevice *device,
|
||||
IQ3LevelMesh* mesh,
|
||||
eQ3MeshIndex meshIndex,
|
||||
ISceneNode *parent,
|
||||
IMetaTriangleSelector *meta,
|
||||
bool showShaderName
|
||||
);
|
||||
|
||||
|
||||
/*!
|
||||
Creates Model based on the entity list
|
||||
*/
|
||||
void Q3ModelFactory ( Q3LevelLoadParameter &loadParam,
|
||||
IrrlichtDevice *device,
|
||||
IQ3LevelMesh* masterMesh,
|
||||
ISceneNode *parent,
|
||||
bool showShaderName
|
||||
);
|
||||
|
||||
/*!
|
||||
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"
|
||||
*/
|
||||
s32 Q3StartPosition ( IQ3LevelMesh* mesh,
|
||||
ICameraSceneNode* camera,
|
||||
s32 startposIndex,
|
||||
const vector3df &translation
|
||||
);
|
||||
/*!
|
||||
gets a accumulated force on a given surface
|
||||
*/
|
||||
vector3df getGravity ( const c8 * surface );
|
||||
|
||||
|
||||
/*
|
||||
Dynamically load the Irrlicht Library
|
||||
*/
|
||||
funcptr_createDevice load_createDevice ( const c8 * filename);
|
||||
funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename);
|
||||
|
||||
|
||||
//! Macro for save Dropping an Element
|
||||
#define dropElement(x) if (x) { x->remove(); x = 0; }
|
||||
|
||||
|
||||
/*
|
||||
get the current collision respone camera animator
|
||||
*/
|
||||
ISceneNodeAnimatorCollisionResponse* camCollisionResponse( IrrlichtDevice * device );
|
||||
|
||||
//! internal Animation
|
||||
enum eTimeFireFlag
|
||||
{
|
||||
FIRED = 1,
|
||||
};
|
||||
|
||||
struct TimeFire
|
||||
{
|
||||
u32 flags;
|
||||
u32 next;
|
||||
u32 delta;
|
||||
};
|
||||
|
||||
void setTimeFire ( TimeFire *t, u32 delta, u32 flags = 0 );
|
||||
void checkTimeFire ( TimeFire *t, u32 listSize, u32 now );
|
||||
|
||||
#endif // __QUAKE3_FACTORY__H_INCLUDED__
|
||||
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
/*!
|
||||
Sound Factory.
|
||||
provides a sound interface
|
||||
|
||||
*/
|
||||
|
||||
#include "sound.h"
|
||||
|
||||
|
||||
//#define USE_IRRKLANG
|
||||
|
||||
#ifdef USE_IRRKLANG
|
||||
|
||||
#include <irrKlang.h>
|
||||
#ifdef _IRR_WINDOWS_
|
||||
#pragma comment (lib, "irrKlang.lib")
|
||||
#endif
|
||||
|
||||
using namespace irrklang;
|
||||
|
||||
struct soundfile: public IFileReader
|
||||
{
|
||||
soundfile ( io::IReadFile* f ): file (f ) {}
|
||||
virtual ~soundfile () { file->drop (); }
|
||||
|
||||
virtual ik_s32 read(void* buffer, ik_u32 sizeToRead) { return file->read ( buffer, sizeToRead ); }
|
||||
virtual bool seek(ik_s32 finalPos, bool relativeMovement = false) { return file->seek ( finalPos, relativeMovement ); }
|
||||
virtual ik_s32 getSize(){ return file->getSize (); }
|
||||
virtual ik_s32 getPos() {return file->getPos (); }
|
||||
virtual const ik_c8* getFileName() { return file->getFileName (); }
|
||||
io::IReadFile* file;
|
||||
};
|
||||
|
||||
struct klangFactory : public irrklang::IFileFactory
|
||||
{
|
||||
klangFactory ( IrrlichtDevice *device ) { Device = device; }
|
||||
|
||||
virtual irrklang::IFileReader* createFileReader(const ik_c8* filename)
|
||||
{
|
||||
io::IReadFile* file = Device->getFileSystem()->createAndOpenFile(filename);
|
||||
if ( 0 == file )
|
||||
return 0;
|
||||
|
||||
return new soundfile ( file );
|
||||
}
|
||||
|
||||
IrrlichtDevice *Device;
|
||||
};
|
||||
|
||||
ISoundEngine *engine = 0;
|
||||
ISound *backMusic = 0;
|
||||
|
||||
void sound_init ( IrrlichtDevice *device )
|
||||
{
|
||||
engine = createIrrKlangDevice ();
|
||||
if ( 0 == engine )
|
||||
return;
|
||||
|
||||
klangFactory *f = new klangFactory ( device );
|
||||
engine->addFileFactory ( f );
|
||||
}
|
||||
|
||||
void sound_shutdown ()
|
||||
{
|
||||
if ( backMusic )
|
||||
backMusic->drop ();
|
||||
|
||||
if ( engine )
|
||||
engine->drop ();
|
||||
}
|
||||
|
||||
void background_music ( const c8 * file )
|
||||
{
|
||||
if ( 0 == engine )
|
||||
return;
|
||||
|
||||
if ( backMusic )
|
||||
{
|
||||
backMusic->stop ();
|
||||
backMusic->drop ();
|
||||
}
|
||||
|
||||
backMusic = engine->play2D ( file, true, false, true );
|
||||
|
||||
if ( backMusic )
|
||||
{
|
||||
backMusic->setVolume ( 0.5f );
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void sound_init ( IrrlichtDevice *device ) {}
|
||||
void sound_shutdown () {}
|
||||
void background_music ( const c8 * file ) {}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
/*!
|
||||
Sound Factory.
|
||||
provides a sound interface
|
||||
|
||||
*/
|
||||
#ifndef __QUAKE3_SOUND__H_INCLUDED__
|
||||
#define __QUAKE3_SOUND__H_INCLUDED__
|
||||
|
||||
#include <irrlicht.h>
|
||||
|
||||
using namespace irr;
|
||||
|
||||
void sound_init ( IrrlichtDevice *device );
|
||||
void sound_shutdown ();
|
||||
void background_music ( const c8 * file );
|
||||
|
||||
|
||||
#endif // __QUAKE3_SOUND__H_INCLUDED__
|
|
@ -75,8 +75,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader", "16.Qu
|
|||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.MouseAndJoystick\MouseAndJoystick.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights_vc8", "20.ManagedLights\ManagedLights_vc8.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "20.ManagedLights\ManagedLights_vc7.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer", "21.Quake3Explorer\Quake3Explorer_vc7.vcproj", "{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
|
@ -156,6 +165,16 @@ Global
|
|||
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug.Build.0 = Debug|Win32
|
||||
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.ActiveCfg = Release|Win32
|
||||
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.Build.0 = Release|Win32
|
||||
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug.ActiveCfg = Debug|Win32
|
||||
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release.ActiveCfg = Release|Win32
|
||||
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug.ActiveCfg = Debug|Win32
|
||||
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug.Build.0 = Debug|Win32
|
||||
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Release.ActiveCfg = Release|Win32
|
||||
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Release.Build.0 = Release|Win32
|
||||
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug.ActiveCfg = Debug|Win32
|
||||
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug.Build.0 = Debug|Win32
|
||||
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release.ActiveCfg = Release|Win32
|
||||
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
|
|
|
@ -6,6 +6,9 @@ EndProject
|
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02.Quake3Map_vc8", "02.Quake3Map\Quake3Map_vc8.vcproj", "{D1A464A2-D479-458C-98A2-60965D823CD1}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03.CustomSceneNode_vc8", "03.CustomSceneNode\CustomSceneNode_vc8.vcproj", "{171CCDFA-C140-4956-8EB7-F0168F4521D3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04.Movement_vc8", "04.Movement\Movement_vc8.vcproj", "{7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}"
|
||||
EndProject
|
||||
|
@ -16,6 +19,9 @@ EndProject
|
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07.Collision_vc8", "07.Collision\Collision_vc8.vcproj", "{3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08.SpecialFX_vc8", "08.SpecialFX\SpecialFX_vc8.vcproj", "{C869BF55-B9D6-4980-BC92-60FA0CF8411A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "09.Meshviewer_vc8", "09.Meshviewer\Meshviewer_vc8.vcproj", "{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}"
|
||||
EndProject
|
||||
|
@ -26,10 +32,16 @@ EndProject
|
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12.TerrainRendering_vc8", "12.TerrainRendering\TerrainRendering_vc8.vcproj", "{3A5B74E5-6390-43B0-A459-2793B81FFD31}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "13.RenderToTexture_vc8", "13.RenderToTexture\RenderToTexture_vc8.vcproj", "{0914E5C8-5352-467B-8421-C9EB35BD5596}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14.Win32Window_vc8", "14.Win32Window\Win32Window_vc8.vcproj", "{772FBE05-D05A-467B-9842-BEC409EEA8D0}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15.LoadIrrFile_vc8", "15.LoadIrrFile\LoadIrrFile_vc8.vcproj", "{78C9F424-523C-49AC-94B7-823AA4A26BF9}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht8.0.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}"
|
||||
EndProject
|
||||
|
@ -43,6 +55,16 @@ EndProject
|
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick_vc8", "19.MouseAndJoystick\MouseAndJoystick_vc8.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights_vc8", "20.ManagedLights\ManagedLights_vc8.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer_vc8", "21.Quake3Explorer\Quake3Explorer_vc8.vcproj", "{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "17.HelloWorld for Windows Mobile on PC", "17.HelloWorld_Mobile\17. HelloWorld for Windows Mobile on PC_v8.vcproj", "{2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -112,8 +134,8 @@ Global
|
|||
{78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.Build.0 = Release|Win32
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release - Fast FPU|Win32
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release - Fast FPU|Win32
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32
|
||||
{6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.ActiveCfg = Release|Win32
|
||||
|
@ -130,6 +152,14 @@ Global
|
|||
{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
|
||||
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.Build.0 = Release|Win32
|
||||
{2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -21,7 +21,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04.Movement_vc9", "04.Movem
|
|||
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05.UserInterface_vc9", "05.UserInterface\UserInterface_vc9.vcproj", "{622C9DD7-0391-49FF-AF53-24F9D5A8EC53}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05.UserInterface_vc8", "05.UserInterface\UserInterface_vc9.vcproj", "{622C9DD7-0391-49FF-AF53-24F9D5A8EC53}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
|
||||
EndProjectSection
|
||||
|
@ -94,6 +94,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick_vc9", "
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights_vc9", "20.ManagedLights\ManagedLights_vc9.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer_vc9", "21.Quake3Explorer\Quake3Explorer_vc9.vcproj", "{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
|
@ -179,6 +181,12 @@ 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
|
||||
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = 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
|
||||
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -351,6 +351,9 @@ void CDemo::loadSceneData()
|
|||
video::IVideoDriver* driver = device->getVideoDriver();
|
||||
scene::ISceneManager* sm = device->getSceneManager();
|
||||
|
||||
// Quake3 Shader controls Z-Writing
|
||||
sm->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true);
|
||||
|
||||
quakeLevelMesh = (scene::IQ3LevelMesh*) sm->getMesh("maps/20kdm2.bsp");
|
||||
|
||||
if (quakeLevelMesh)
|
||||
|
@ -399,7 +402,7 @@ void CDemo::loadSceneData()
|
|||
s32 shaderIndex = (s32) material.MaterialTypeParam2;
|
||||
|
||||
// the meshbuffer can be rendered without additional support, or it has no shader
|
||||
const scene::quake3::SShader *shader = quakeLevelMesh->getShader ( shaderIndex );
|
||||
const scene::quake3::IShader *shader = quakeLevelMesh->getShader ( shaderIndex );
|
||||
if ( 0 == shader )
|
||||
{
|
||||
continue;
|
||||
|
@ -408,9 +411,6 @@ void CDemo::loadSceneData()
|
|||
sm->addQuake3SceneNode ( meshBuffer, shader );
|
||||
}
|
||||
|
||||
// original mesh is not needed anymore
|
||||
quakeLevelMesh->releaseMesh ( scene::quake3::E_Q3_MESH_ITEMS );
|
||||
|
||||
}
|
||||
|
||||
// load sydney model and create 2 instances
|
||||
|
@ -482,7 +482,7 @@ void CDemo::loadSceneData()
|
|||
core::stringc tmp("../../media/portal");
|
||||
tmp += g;
|
||||
tmp += ".bmp";
|
||||
video::ITexture* t = driver->getTexture( tmp.c_str () );
|
||||
video::ITexture* t = driver->getTexture( tmp );
|
||||
textures.push_back(t);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,64 +4,6 @@
|
|||
#include "CMainMenu.h"
|
||||
|
||||
|
||||
//! we want the lights follow the model when it's moving
|
||||
class CSceneNodeAnimatorFollowBoundingBox : public irr::scene::ISceneNodeAnimator
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
CSceneNodeAnimatorFollowBoundingBox(irr::scene::ISceneNode* tofollow,
|
||||
const core::vector3df &offset, u32 frequency, s32 phase)
|
||||
: Offset(offset), ToFollow(tofollow), Frequency(frequency), Phase(phase)
|
||||
{
|
||||
if (ToFollow)
|
||||
ToFollow->grab();
|
||||
}
|
||||
|
||||
//! destructor
|
||||
virtual ~CSceneNodeAnimatorFollowBoundingBox()
|
||||
{
|
||||
if (ToFollow)
|
||||
ToFollow->drop();
|
||||
}
|
||||
|
||||
//! animates a scene node
|
||||
virtual void animateNode(irr::scene::ISceneNode* node, u32 timeMs)
|
||||
{
|
||||
if (0 == node || node->getType() != irr::scene::ESNT_LIGHT)
|
||||
return;
|
||||
|
||||
irr::scene::ILightSceneNode* l = (irr::scene::ILightSceneNode*) node;
|
||||
|
||||
if (ToFollow)
|
||||
{
|
||||
core::vector3df now = l->getPosition();
|
||||
now += ToFollow->getBoundingBox().getCenter();
|
||||
now += Offset;
|
||||
l->setPosition(now);
|
||||
}
|
||||
|
||||
irr::video::SColorHSL color;
|
||||
irr::video::SColor rgb(0);
|
||||
color.Hue = ( (timeMs + Phase) % Frequency ) * ( 2.f * irr::core::PI / Frequency );
|
||||
color.Saturation = 1.f;
|
||||
color.Luminance = 0.5f;
|
||||
color.toRGB(rgb);
|
||||
|
||||
video::SLight light = l->getLightData();
|
||||
light.DiffuseColor = rgb;
|
||||
l->setLightData(light);
|
||||
}
|
||||
|
||||
virtual scene::ISceneNodeAnimator* createClone(scene::ISceneNode* node, scene::ISceneManager* newManager=0) {return 0;}
|
||||
private:
|
||||
|
||||
core::vector3df Offset;
|
||||
irr::scene::ISceneNode* ToFollow;
|
||||
s32 Frequency;
|
||||
s32 Phase;
|
||||
};
|
||||
|
||||
|
||||
CMainMenu::CMainMenu()
|
||||
: startButton(0), MenuDevice(0), selected(2), start(false), fullscreen(true),
|
||||
|
@ -74,7 +16,12 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows,
|
|||
bool& outAdditive, bool& outVSync, bool& outAA,
|
||||
video::E_DRIVER_TYPE& outDriver)
|
||||
{
|
||||
MenuDevice = createDevice(video::EDT_BURNINGSVIDEO,
|
||||
//video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
|
||||
//video::E_DRIVER_TYPE driverType = video::EDT_OPENGL;
|
||||
video::E_DRIVER_TYPE driverType = video::EDT_BURNINGSVIDEO;
|
||||
//video::E_DRIVER_TYPE driverType = video::EDT_SOFTWARE;
|
||||
|
||||
MenuDevice = createDevice(driverType,
|
||||
core::dimension2d<u32>(512, 384), 16, false, false, false, this);
|
||||
|
||||
if (MenuDevice->getFileSystem()->existFile("irrlicht.dat"))
|
||||
|
@ -116,7 +63,7 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows,
|
|||
box->addItem(L"OpenGL 1.5");
|
||||
box->addItem(L"Direct3D 8.1");
|
||||
box->addItem(L"Direct3D 9.0c");
|
||||
box->addItem(L"Burning's Video 0.39");
|
||||
box->addItem(L"Burning's Video 0.44");
|
||||
box->addItem(L"Irrlicht Software Renderer 1.0");
|
||||
box->setSelected(selected);
|
||||
|
||||
|
@ -163,95 +110,107 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows,
|
|||
modelNode->setPosition( core::vector3df(0.f, 0.f, -5.f) );
|
||||
modelNode->setMaterialTexture(0, driver->getTexture("../../media/faerie2.bmp"));
|
||||
modelNode->setMaterialFlag(video::EMF_LIGHTING, true);
|
||||
modelNode->getMaterial(0).Shininess = 28.f;
|
||||
modelNode->getMaterial(0).Shininess = 50.f;
|
||||
modelNode->getMaterial(0).NormalizeNormals = true;
|
||||
modelNode->setMD2Animation(scene::EMAT_STAND);
|
||||
}
|
||||
|
||||
// set ambient light (no sun light in the catacombs)
|
||||
smgr->setAmbientLight( video::SColorf(0.f, 0.f, 0.f) );
|
||||
smgr->setAmbientLight( video::SColorf(0.2f, 0.2f, 0.2f) );
|
||||
|
||||
scene::ILightSceneNode *light;
|
||||
scene::ISceneNodeAnimator* anim;
|
||||
scene::ISceneNode* bill;
|
||||
|
||||
// add light 1 (sunset orange)
|
||||
scene::ILightSceneNode* light1 =
|
||||
smgr->addLightSceneNode(0, core::vector3df(10.f,10.f,0),
|
||||
video::SColorf(0.86f, 0.38f, 0.05f), 200.0f);
|
||||
|
||||
// add fly circle animator to light 1
|
||||
anim = smgr->createFlyCircleAnimator(core::vector3df(0,0,0),30.0f, -0.004f, core::vector3df(0.41f, 0.4f, 0.0f));
|
||||
light1->addAnimator(anim);
|
||||
anim->drop();
|
||||
|
||||
// let the lights follow the model...
|
||||
anim = new CSceneNodeAnimatorFollowBoundingBox(modelNode, core::vector3df(0,16,0), 4000, 0);
|
||||
//light1->addAnimator(anim);
|
||||
anim->drop();
|
||||
|
||||
// attach billboard to the light
|
||||
bill = smgr->addBillboardSceneNode(light1, core::dimension2d<f32>(10, 10));
|
||||
bill->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
|
||||
bill->setMaterialTexture(0, driver->getTexture("../../media/particlered.bmp"));
|
||||
|
||||
#if 1
|
||||
// add light 2 (nearly red)
|
||||
scene::ILightSceneNode* light2 =
|
||||
smgr->addLightSceneNode(0, core::vector3df(0,1,0),
|
||||
video::SColorf(0.9f, 1.0f, 0.f, 0.0f), 200.0f);
|
||||
|
||||
// add fly circle animator to light 1
|
||||
anim = smgr->createFlyCircleAnimator(core::vector3df(0,0,0),30.0f, 0.004f, core::vector3df(0.41f, 0.4f, 0.0f));
|
||||
light2->addAnimator(anim);
|
||||
anim->drop();
|
||||
|
||||
// let the lights follow the model...
|
||||
anim = new CSceneNodeAnimatorFollowBoundingBox( modelNode, core::vector3df(0,-8,0), 2000, 0 );
|
||||
//light2->addAnimator(anim);
|
||||
anim->drop();
|
||||
|
||||
|
||||
// attach billboard to the light
|
||||
bill = smgr->addBillboardSceneNode(light2, core::dimension2d<f32>(10, 10));
|
||||
bill->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
|
||||
bill->setMaterialTexture(0, driver->getTexture("../../media/particlered.bmp"));
|
||||
|
||||
// add light 3 (nearly blue)
|
||||
scene::ILightSceneNode* light3 =
|
||||
smgr->addLightSceneNode(0, core::vector3df(0,-1,0),
|
||||
video::SColorf(0.f, 0.0f, 0.9f, 0.0f), 40.0f);
|
||||
|
||||
// add fly circle animator to light 2
|
||||
anim = smgr->createFlyCircleAnimator(core::vector3df(0,0,0),40.0f, 0.004f, core::vector3df(-0.41f, -0.4f, 0.0f));
|
||||
light3->addAnimator(anim);
|
||||
anim->drop();
|
||||
|
||||
// let the lights follow the model...
|
||||
anim = new CSceneNodeAnimatorFollowBoundingBox(modelNode, core::vector3df(0,8,0), 8000, 0);
|
||||
//light3->addAnimator(anim);
|
||||
anim->drop();
|
||||
|
||||
// attach billboard to the light
|
||||
bill = smgr->addBillboardSceneNode(light3, core::dimension2d<f32>(10, 10));
|
||||
if (bill)
|
||||
enum eLightParticle
|
||||
{
|
||||
bill->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
|
||||
bill->setMaterialTexture(0, driver->getTexture("../../media/portal1.bmp"));
|
||||
LIGHT_NONE,
|
||||
LIGHT_GLOBAL,
|
||||
LIGHT_RED,
|
||||
LIGHT_BLUE
|
||||
};
|
||||
core::vector3df lightDir[2] = {
|
||||
core::vector3df(0.f, 0.1f, 0.4f),
|
||||
core::vector3df(0.f, 0.1f, -0.4f),
|
||||
};
|
||||
|
||||
struct SLightParticle
|
||||
{
|
||||
eLightParticle type;
|
||||
u32 dir;
|
||||
};
|
||||
const SLightParticle lightParticle[] =
|
||||
{
|
||||
//LIGHT_GLOBAL,0,
|
||||
LIGHT_RED,0,
|
||||
LIGHT_BLUE,0,
|
||||
LIGHT_RED,1,
|
||||
LIGHT_BLUE,1,
|
||||
LIGHT_NONE,0
|
||||
};
|
||||
|
||||
const SLightParticle *l = lightParticle;
|
||||
while ( l->type != LIGHT_NONE )
|
||||
{
|
||||
switch ( l->type )
|
||||
{
|
||||
case LIGHT_GLOBAL:
|
||||
// add illumination from the background
|
||||
light = smgr->addLightSceneNode(0, core::vector3df(10.f,40.f,-5.f),
|
||||
video::SColorf(0.2f, 0.2f, 0.2f), 90.f);
|
||||
break;
|
||||
case LIGHT_RED:
|
||||
// add light nearly red
|
||||
light = smgr->addLightSceneNode(0, core::vector3df(0,1,0),
|
||||
video::SColorf(0.8f, 0.f, 0.f, 0.0f), 30.0f);
|
||||
// attach red billboard to the light
|
||||
bill = smgr->addBillboardSceneNode(light, core::dimension2d<f32>(10, 10));
|
||||
if ( bill )
|
||||
{
|
||||
bill->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
|
||||
bill->setMaterialTexture(0, driver->getTexture("../../media/particlered.bmp"));
|
||||
}
|
||||
// add fly circle animator to the light
|
||||
anim = smgr->createFlyCircleAnimator(core::vector3df(0.f,0.f,-5.f),20.f,
|
||||
0.002f, lightDir [l->dir] );
|
||||
light->addAnimator(anim);
|
||||
anim->drop();
|
||||
break;
|
||||
case LIGHT_BLUE:
|
||||
// add light nearly blue
|
||||
light = smgr->addLightSceneNode(0, core::vector3df(0,1,0),
|
||||
video::SColorf(0.f, 0.0f, 0.8f, 0.0f), 30.0f);
|
||||
// attach blue billboard to the light
|
||||
bill = smgr->addBillboardSceneNode(light, core::dimension2d<f32>(10, 10));
|
||||
if (bill)
|
||||
{
|
||||
bill->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
|
||||
bill->setMaterialTexture(0, driver->getTexture("../../media/portal1.bmp"));
|
||||
}
|
||||
// add fly circle animator to the light
|
||||
anim = smgr->createFlyCircleAnimator(core::vector3df(0.f,0.f,-5.f),20.f,
|
||||
-0.002f, lightDir [l->dir], 0.5f);
|
||||
light->addAnimator(anim);
|
||||
anim->drop();
|
||||
break;
|
||||
case LIGHT_NONE:
|
||||
break;
|
||||
}
|
||||
l += 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
// create a fixed camera
|
||||
smgr->addCameraSceneNode(0, core::vector3df(45,0,0), core::vector3df(0,0,10));
|
||||
|
||||
|
||||
// irrlicht logo and background
|
||||
// add irrlicht logo
|
||||
bool oldMipMapState = driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS);
|
||||
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
|
||||
|
||||
guienv->addImage(driver->getTexture("../../media/irrlichtlogo2.png"),
|
||||
guienv->addImage(driver->getTexture("../../media/irrlichtlogo3.png"),
|
||||
core::position2d<s32>(5,5));
|
||||
|
||||
video::ITexture* irrlichtBack = driver->getTexture("../../media/demoback.jpg");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
DIRS = $(wildcard [01]* Demo)
|
||||
DIRS = $(wildcard [012]* Demo)
|
||||
|
||||
all: $(DIRS)
|
||||
|
||||
|
|
|
@ -1,103 +1,103 @@
|
|||
// 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
|
||||
|
||||
#ifndef __E_DRIVER_FEATURES_H_INCLUDED__
|
||||
#define __E_DRIVER_FEATURES_H_INCLUDED__
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
//! enumeration for querying features of the video driver.
|
||||
enum E_VIDEO_DRIVER_FEATURE
|
||||
{
|
||||
//! Is driver able to render to a surface?
|
||||
EVDF_RENDER_TO_TARGET = 0,
|
||||
|
||||
//! Is hardeware transform and lighting supported?
|
||||
EVDF_HARDWARE_TL,
|
||||
|
||||
//! Are multiple textures per material possible?
|
||||
EVDF_MULTITEXTURE,
|
||||
|
||||
//! Is driver able to render with a bilinear filter applied?
|
||||
EVDF_BILINEAR_FILTER,
|
||||
|
||||
//! Can the driver handle mip maps?
|
||||
EVDF_MIP_MAP,
|
||||
|
||||
//! Can the driver update mip maps automatically?
|
||||
EVDF_MIP_MAP_AUTO_UPDATE,
|
||||
|
||||
//! Are stencilbuffers switched on and does the device support stencil buffers?
|
||||
EVDF_STENCIL_BUFFER,
|
||||
|
||||
//! Is Vertex Shader 1.1 supported?
|
||||
EVDF_VERTEX_SHADER_1_1,
|
||||
|
||||
//! Is Vertex Shader 2.0 supported?
|
||||
EVDF_VERTEX_SHADER_2_0,
|
||||
|
||||
//! Is Vertex Shader 3.0 supported?
|
||||
EVDF_VERTEX_SHADER_3_0,
|
||||
|
||||
//! Is Pixel Shader 1.1 supported?
|
||||
EVDF_PIXEL_SHADER_1_1,
|
||||
|
||||
//! Is Pixel Shader 1.2 supported?
|
||||
EVDF_PIXEL_SHADER_1_2,
|
||||
|
||||
//! Is Pixel Shader 1.3 supported?
|
||||
EVDF_PIXEL_SHADER_1_3,
|
||||
|
||||
//! Is Pixel Shader 1.4 supported?
|
||||
EVDF_PIXEL_SHADER_1_4,
|
||||
|
||||
//! Is Pixel Shader 2.0 supported?
|
||||
EVDF_PIXEL_SHADER_2_0,
|
||||
|
||||
//! Is Pixel Shader 3.0 supported?
|
||||
EVDF_PIXEL_SHADER_3_0,
|
||||
|
||||
//! Are ARB vertex programs v1.0 supported?
|
||||
EVDF_ARB_VERTEX_PROGRAM_1,
|
||||
|
||||
//! Are ARB fragment programs v1.0 supported?
|
||||
EVDF_ARB_FRAGMENT_PROGRAM_1,
|
||||
|
||||
//! Is GLSL supported?
|
||||
EVDF_ARB_GLSL,
|
||||
|
||||
//! Is HLSL supported?
|
||||
EVDF_HLSL,
|
||||
|
||||
//! Are non-square textures supported?
|
||||
EVDF_TEXTURE_NSQUARE,
|
||||
|
||||
//! Are non-power-of-two textures supported?
|
||||
EVDF_TEXTURE_NPOT,
|
||||
|
||||
//! Are framebuffer objects supported?
|
||||
EVDF_FRAMEBUFFER_OBJECT,
|
||||
|
||||
//! Are vertex buffer objects supported?
|
||||
EVDF_VERTEX_BUFFER_OBJECT,
|
||||
|
||||
//! Supports Alpha To Coverage
|
||||
EVDF_ALPHA_TO_COVERAGE,
|
||||
|
||||
//! Supports Color masks (disabling color planes in output)
|
||||
EVDF_COLOR_MASK,
|
||||
|
||||
//! Only used for counting the elements of this enum
|
||||
EVDF_COUNT
|
||||
};
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// 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
|
||||
|
||||
#ifndef __E_DRIVER_FEATURES_H_INCLUDED__
|
||||
#define __E_DRIVER_FEATURES_H_INCLUDED__
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
//! enumeration for querying features of the video driver.
|
||||
enum E_VIDEO_DRIVER_FEATURE
|
||||
{
|
||||
//! Is driver able to render to a surface?
|
||||
EVDF_RENDER_TO_TARGET = 0,
|
||||
|
||||
//! Is hardeware transform and lighting supported?
|
||||
EVDF_HARDWARE_TL,
|
||||
|
||||
//! Are multiple textures per material possible?
|
||||
EVDF_MULTITEXTURE,
|
||||
|
||||
//! Is driver able to render with a bilinear filter applied?
|
||||
EVDF_BILINEAR_FILTER,
|
||||
|
||||
//! Can the driver handle mip maps?
|
||||
EVDF_MIP_MAP,
|
||||
|
||||
//! Can the driver update mip maps automatically?
|
||||
EVDF_MIP_MAP_AUTO_UPDATE,
|
||||
|
||||
//! Are stencilbuffers switched on and does the device support stencil buffers?
|
||||
EVDF_STENCIL_BUFFER,
|
||||
|
||||
//! Is Vertex Shader 1.1 supported?
|
||||
EVDF_VERTEX_SHADER_1_1,
|
||||
|
||||
//! Is Vertex Shader 2.0 supported?
|
||||
EVDF_VERTEX_SHADER_2_0,
|
||||
|
||||
//! Is Vertex Shader 3.0 supported?
|
||||
EVDF_VERTEX_SHADER_3_0,
|
||||
|
||||
//! Is Pixel Shader 1.1 supported?
|
||||
EVDF_PIXEL_SHADER_1_1,
|
||||
|
||||
//! Is Pixel Shader 1.2 supported?
|
||||
EVDF_PIXEL_SHADER_1_2,
|
||||
|
||||
//! Is Pixel Shader 1.3 supported?
|
||||
EVDF_PIXEL_SHADER_1_3,
|
||||
|
||||
//! Is Pixel Shader 1.4 supported?
|
||||
EVDF_PIXEL_SHADER_1_4,
|
||||
|
||||
//! Is Pixel Shader 2.0 supported?
|
||||
EVDF_PIXEL_SHADER_2_0,
|
||||
|
||||
//! Is Pixel Shader 3.0 supported?
|
||||
EVDF_PIXEL_SHADER_3_0,
|
||||
|
||||
//! Are ARB vertex programs v1.0 supported?
|
||||
EVDF_ARB_VERTEX_PROGRAM_1,
|
||||
|
||||
//! Are ARB fragment programs v1.0 supported?
|
||||
EVDF_ARB_FRAGMENT_PROGRAM_1,
|
||||
|
||||
//! Is GLSL supported?
|
||||
EVDF_ARB_GLSL,
|
||||
|
||||
//! Is HLSL supported?
|
||||
EVDF_HLSL,
|
||||
|
||||
//! Are non-square textures supported?
|
||||
EVDF_TEXTURE_NSQUARE,
|
||||
|
||||
//! Are non-power-of-two textures supported?
|
||||
EVDF_TEXTURE_NPOT,
|
||||
|
||||
//! Are framebuffer objects supported?
|
||||
EVDF_FRAMEBUFFER_OBJECT,
|
||||
|
||||
//! Are vertex buffer objects supported?
|
||||
EVDF_VERTEX_BUFFER_OBJECT,
|
||||
|
||||
//! Supports Alpha To Coverage
|
||||
EVDF_ALPHA_TO_COVERAGE,
|
||||
|
||||
//! Supports Color masks (disabling color planes in output)
|
||||
EVDF_COLOR_MASK,
|
||||
|
||||
//! Only used for counting the elements of this enum
|
||||
EVDF_COUNT
|
||||
};
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -82,6 +82,9 @@ enum EGUI_ELEMENT_TYPE
|
|||
//! A window
|
||||
EGUIET_WINDOW,
|
||||
|
||||
//! A Tree View
|
||||
EGUIET_TREE_VIEW,
|
||||
|
||||
//! Not an element, amount of elements in there
|
||||
EGUIET_COUNT,
|
||||
|
||||
|
|
|
@ -1,40 +1,44 @@
|
|||
// 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
|
||||
|
||||
#ifndef __E_HARDWARE_BUFFER_FLAGS_INCLUDED__
|
||||
#define __E_HARDWARE_BUFFER_FLAGS_INCLUDED__
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
enum E_HARDWARE_MAPPING
|
||||
{
|
||||
//! Don't load in hardware
|
||||
EHM_NEVER=0,
|
||||
|
||||
//! Rarely changed
|
||||
EHM_STATIC,
|
||||
|
||||
//! Sometimes changed
|
||||
EHM_DYNAMIC,
|
||||
|
||||
//! Always changed
|
||||
EHM_STREAM
|
||||
};
|
||||
|
||||
enum E_BUFFER_TYPE
|
||||
{
|
||||
EBT_NONE=0,
|
||||
EBT_VERTEX,
|
||||
EBT_INDEX,
|
||||
EBT_VERTEX_AND_INDEX
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
||||
// 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
|
||||
|
||||
#ifndef __E_HARDWARE_BUFFER_FLAGS_INCLUDED__
|
||||
#define __E_HARDWARE_BUFFER_FLAGS_INCLUDED__
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
enum E_HARDWARE_MAPPING
|
||||
{
|
||||
//! Don't store on the hardware
|
||||
EHM_NEVER=0,
|
||||
|
||||
//! Rarely changed, usually stored completely on the hardware
|
||||
EHM_STATIC,
|
||||
|
||||
//! Sometimes changed, driver optimized placement
|
||||
EHM_DYNAMIC,
|
||||
|
||||
//! Always changed, cache optimizing on the GPU
|
||||
EHM_STREAM
|
||||
};
|
||||
|
||||
enum E_BUFFER_TYPE
|
||||
{
|
||||
//! Does not change anything
|
||||
EBT_NONE=0,
|
||||
//! Change the vertex mapping
|
||||
EBT_VERTEX,
|
||||
//! Change the index mapping
|
||||
EBT_INDEX,
|
||||
//! Change both vertex and index mapping to the same value
|
||||
EBT_VERTEX_AND_INDEX
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -14,48 +14,48 @@ namespace video
|
|||
enum E_MATERIAL_FLAG
|
||||
{
|
||||
//! Draw as wireframe or filled triangles? Default: false
|
||||
EMF_WIREFRAME = 0,
|
||||
EMF_WIREFRAME = 0x1,
|
||||
|
||||
//! Draw as point cloud or filled triangles? Default: false
|
||||
EMF_POINTCLOUD,
|
||||
EMF_POINTCLOUD = 0x2,
|
||||
|
||||
//! Flat or Gouraud shading? Default: true
|
||||
EMF_GOURAUD_SHADING,
|
||||
EMF_GOURAUD_SHADING = 0x4,
|
||||
|
||||
//! Will this material be lighted? Default: true
|
||||
EMF_LIGHTING,
|
||||
EMF_LIGHTING = 0x8,
|
||||
|
||||
//! Is the ZBuffer enabled? Default: true
|
||||
EMF_ZBUFFER,
|
||||
EMF_ZBUFFER = 0x10,
|
||||
|
||||
//! May be written to the zbuffer or is it readonly. Default: true
|
||||
/** This flag is ignored, if the material type is a transparent type. */
|
||||
EMF_ZWRITE_ENABLE,
|
||||
EMF_ZWRITE_ENABLE = 0x20,
|
||||
|
||||
//! Is backface culling enabled? Default: true
|
||||
EMF_BACK_FACE_CULLING,
|
||||
EMF_BACK_FACE_CULLING = 0x40,
|
||||
|
||||
//! Is frontface culling enabled? Default: false
|
||||
/** Overrides EMF_BACK_FACE_CULLING if both are enabled. */
|
||||
EMF_FRONT_FACE_CULLING,
|
||||
EMF_FRONT_FACE_CULLING = 0x80,
|
||||
|
||||
//! Is bilinear filtering enabled? Default: true
|
||||
EMF_BILINEAR_FILTER,
|
||||
EMF_BILINEAR_FILTER = 0x100,
|
||||
|
||||
//! Is trilinear filtering enabled? Default: false
|
||||
/** If the trilinear filter flag is enabled,
|
||||
the bilinear filtering flag is ignored. */
|
||||
EMF_TRILINEAR_FILTER,
|
||||
EMF_TRILINEAR_FILTER = 0x200,
|
||||
|
||||
//! Is anisotropic filtering? Default: false
|
||||
/** In Irrlicht you can use anisotropic texture filtering in
|
||||
conjunction with bilinear or trilinear texture filtering
|
||||
to improve rendering results. Primitives will look less
|
||||
blurry with this flag switched on. */
|
||||
EMF_ANISOTROPIC_FILTER,
|
||||
EMF_ANISOTROPIC_FILTER = 0x400,
|
||||
|
||||
//! Is fog enabled? Default: false
|
||||
EMF_FOG_ENABLE,
|
||||
EMF_FOG_ENABLE = 0x800,
|
||||
|
||||
//! Normalizes normals. Default: false
|
||||
/** You can enable this if you need to scale a dynamic lighted
|
||||
|
@ -63,19 +63,19 @@ namespace video
|
|||
will get darker. If you enable the EMF_NORMALIZE_NORMALS flag,
|
||||
the normals will be normalized again, and the model will look
|
||||
as bright as it should. */
|
||||
EMF_NORMALIZE_NORMALS,
|
||||
EMF_NORMALIZE_NORMALS = 0x1000,
|
||||
|
||||
//! Access to all layers texture wrap settings. Overwrites separate layer settings.
|
||||
EMF_TEXTURE_WRAP,
|
||||
EMF_TEXTURE_WRAP = 0x2000,
|
||||
|
||||
//! AntiAliasing mode
|
||||
EMF_ANTI_ALIASING,
|
||||
EMF_ANTI_ALIASING = 0x4000,
|
||||
|
||||
//! ColorMask bits, for enabling the color planes
|
||||
EMF_COLOR_MASK,
|
||||
EMF_COLOR_MASK = 0x8000,
|
||||
|
||||
//! This is not a flag, but a value indicating how much flags there are.
|
||||
EMF_MATERIAL_FLAG_COUNT
|
||||
//! ColorMaterial enum for vertex color interpretation
|
||||
EMF_COLOR_MATERIAL = 0x10000
|
||||
};
|
||||
|
||||
} // end namespace video
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace scene
|
|||
name clashes with external mesh writers.*/
|
||||
enum EMESH_WRITER_TYPE
|
||||
{
|
||||
//! Irrlicht Native mesh writer, for static .irrmesh files.
|
||||
//! Irrlicht native mesh writer, for static .irrmesh files.
|
||||
EMWT_IRR_MESH = MAKE_IRR_ID('i','r','r','m'),
|
||||
|
||||
//! COLLADA mesh writer for .dae and .xml files
|
||||
|
@ -28,7 +28,10 @@ namespace scene
|
|||
EMWT_STL = MAKE_IRR_ID('s','t','l',0),
|
||||
|
||||
//! OBJ mesh writer for .obj files
|
||||
EMWT_OBJ = MAKE_IRR_ID('o','b','j',0)
|
||||
EMWT_OBJ = MAKE_IRR_ID('o','b','j',0),
|
||||
|
||||
//! PLY mesh writer for .ply files
|
||||
EMWT_PLY = MAKE_IRR_ID('p','l','y',0)
|
||||
};
|
||||
|
||||
|
||||
|
@ -41,8 +44,11 @@ namespace scene
|
|||
//! write lightmap textures out if possible
|
||||
EMWF_WRITE_LIGHTMAPS = 0x1,
|
||||
|
||||
//! write in a way that does consume less disk space
|
||||
EMWF_WRITE_COMPRESSED = 0x2
|
||||
//! write in a way that consumes less disk space
|
||||
EMWF_WRITE_COMPRESSED = 0x2,
|
||||
|
||||
//! write in binary format rather than text
|
||||
EMWF_WRITE_BINARY = 0x4
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
|
|
|
@ -36,6 +36,9 @@ namespace scene
|
|||
//! Sky Box Scene Node
|
||||
ESNT_SKY_BOX = MAKE_IRR_ID('s','k','y','_'),
|
||||
|
||||
//! Sky Dome Scene Node
|
||||
ESNT_SKY_DOME = MAKE_IRR_ID('s','k','y','d'),
|
||||
|
||||
//! Shadow Volume Scene Node
|
||||
ESNT_SHADOW_VOLUME = MAKE_IRR_ID('s','h','d','w'),
|
||||
|
||||
|
@ -66,9 +69,15 @@ namespace scene
|
|||
//! Particle System Scene Node
|
||||
ESNT_PARTICLE_SYSTEM = MAKE_IRR_ID('p','t','c','l'),
|
||||
|
||||
//! Quake3 Shader Scene Node
|
||||
ESNT_Q3SHADER_SCENE_NODE = MAKE_IRR_ID('q','3','s','h'),
|
||||
|
||||
//! Quake3 Model Scene Node ( has tag to link to )
|
||||
ESNT_MD3_SCENE_NODE = MAKE_IRR_ID('m','d','3','_'),
|
||||
|
||||
//! Volume Light Scene Node
|
||||
ESNT_VOLUME_LIGHT = MAKE_IRR_ID('v','o','l','l'),
|
||||
|
||||
//! Maya Camera Scene Node
|
||||
/** Legacy, for loading version <= 1.4.x .irr files */
|
||||
ESNT_CAMERA_MAYA = MAKE_IRR_ID('c','a','m','M'),
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
// 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
|
||||
|
||||
#ifndef __E_TERRAIN_ELEMENTS_H__
|
||||
#define __E_TERRAIN_ELEMENTS_H__
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! enumeration for patch sizes specifying the size of patches in the TerrainSceneNode
|
||||
enum E_TERRAIN_PATCH_SIZE
|
||||
{
|
||||
//! patch size of 9, at most, use 4 levels of detail with this patch size.
|
||||
ETPS_9 = 9,
|
||||
|
||||
//! patch size of 17, at most, use 5 levels of detail with this patch size.
|
||||
ETPS_17 = 17,
|
||||
|
||||
//! patch size of 33, at most, use 6 levels of detail with this patch size.
|
||||
ETPS_33 = 33,
|
||||
|
||||
//! patch size of 65, at most, use 7 levels of detail with this patch size.
|
||||
ETPS_65 = 65,
|
||||
|
||||
//! patch size of 129, at most, use 8 levels of detail with this patch size.
|
||||
ETPS_129 = 129
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
||||
// 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
|
||||
|
||||
#ifndef __E_TERRAIN_ELEMENTS_H__
|
||||
#define __E_TERRAIN_ELEMENTS_H__
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! enumeration for patch sizes specifying the size of patches in the TerrainSceneNode
|
||||
enum E_TERRAIN_PATCH_SIZE
|
||||
{
|
||||
//! patch size of 9, at most, use 4 levels of detail with this patch size.
|
||||
ETPS_9 = 9,
|
||||
|
||||
//! patch size of 17, at most, use 5 levels of detail with this patch size.
|
||||
ETPS_17 = 17,
|
||||
|
||||
//! patch size of 33, at most, use 6 levels of detail with this patch size.
|
||||
ETPS_33 = 33,
|
||||
|
||||
//! patch size of 65, at most, use 7 levels of detail with this patch size.
|
||||
ETPS_65 = 65,
|
||||
|
||||
//! patch size of 129, at most, use 8 levels of detail with this patch size.
|
||||
ETPS_129 = 129
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -89,15 +89,15 @@ namespace scene
|
|||
struct SMD3Header
|
||||
{
|
||||
c8 headerID[4]; //id of file, always "IDP3"
|
||||
s32 Version; //this is a version number, always 15
|
||||
s32 Version; //this is a version number, always 15
|
||||
s8 fileName[68]; //sometimes left Blank... 65 chars, 32bit aligned == 68 chars
|
||||
s32 numFrames; //number of KeyFrames
|
||||
s32 numTags; //number of 'tags' per frame
|
||||
s32 numMeshes; //number of meshes/skins
|
||||
s32 numMaxSkins; //maximum number of unique skins used in md3 file
|
||||
s32 headerSize; //always equal to the length of this header
|
||||
s32 tagStart; //starting position of tag-structures
|
||||
s32 tagEnd; //ending position of tag-structures/starting position of mesh-structures
|
||||
s32 numFrames; //number of KeyFrames
|
||||
s32 numTags; //number of 'tags' per frame
|
||||
s32 numMeshes; //number of meshes/skins
|
||||
s32 numMaxSkins; //maximum number of unique skins used in md3 file. artefact md2
|
||||
s32 frameStart; //starting position of frame-structur
|
||||
s32 tagStart; //starting position of tag-structures
|
||||
s32 tagEnd; //ending position of tag-structures/starting position of mesh-structures
|
||||
s32 fileSize;
|
||||
};
|
||||
|
||||
|
@ -153,7 +153,7 @@ namespace scene
|
|||
{
|
||||
SMD3MeshHeader MeshHeader;
|
||||
|
||||
core::array < core::stringc > Shader;
|
||||
core::stringc Shader;
|
||||
core::array < s32 > Indices;
|
||||
core::array < SMD3Vertex > Vertices;
|
||||
core::array < SMD3TexCoord > Tex;
|
||||
|
@ -161,44 +161,74 @@ namespace scene
|
|||
|
||||
//! hold a tag info for connecting meshes
|
||||
/** Basically its an alternate way to describe a transformation. */
|
||||
struct SMD3QuaterionTag
|
||||
struct SMD3QuaternionTag
|
||||
{
|
||||
SMD3QuaterionTag() {}
|
||||
virtual ~SMD3QuaternionTag()
|
||||
{
|
||||
position.X = 0.f;
|
||||
}
|
||||
|
||||
SMD3QuaterionTag( const core::stringc& name )
|
||||
// construct copy constructor
|
||||
SMD3QuaternionTag( const SMD3QuaternionTag & copyMe )
|
||||
{
|
||||
*this = copyMe;
|
||||
}
|
||||
|
||||
// construct for searching
|
||||
SMD3QuaternionTag( const core::stringc& name )
|
||||
: Name ( name ) {}
|
||||
|
||||
// construct from a matrix
|
||||
SMD3QuaterionTag ( const core::stringc& name, const core::matrix4 &m ) : Name(name), position(m.getTranslation()), rotation(m)
|
||||
{ }
|
||||
SMD3QuaternionTag ( const core::stringc& name, const core::matrix4 &m )
|
||||
: Name(name), position(m.getTranslation()), rotation(m) {}
|
||||
|
||||
// construct from a position and euler angles in degrees
|
||||
SMD3QuaterionTag ( const core::vector3df &pos, const core::vector3df &angle ) : position(pos), rotation(angle * core::DEGTORAD)
|
||||
{ }
|
||||
SMD3QuaternionTag ( const core::vector3df &pos, const core::vector3df &angle )
|
||||
: position(pos), rotation(angle * core::DEGTORAD) {}
|
||||
|
||||
// set to matrix
|
||||
void setto ( core::matrix4 &m )
|
||||
{
|
||||
rotation.getMatrix ( m );
|
||||
m.setTranslation ( position );
|
||||
rotation.getMatrix ( m, position );
|
||||
}
|
||||
|
||||
bool operator == ( const SMD3QuaterionTag &other ) const
|
||||
bool operator == ( const SMD3QuaternionTag &other ) const
|
||||
{
|
||||
return Name == other.Name;
|
||||
}
|
||||
|
||||
SMD3QuaternionTag & operator=( const SMD3QuaternionTag & copyMe )
|
||||
{
|
||||
Name = copyMe.Name;
|
||||
position = copyMe.position;
|
||||
rotation = copyMe.rotation;
|
||||
return *this;
|
||||
}
|
||||
|
||||
core::stringc Name;
|
||||
core::vector3df position;
|
||||
core::quaternion rotation;
|
||||
};
|
||||
|
||||
//! holds a associative list of named quaternions
|
||||
struct SMD3QuaterionTagList : public virtual IReferenceCounted
|
||||
struct SMD3QuaternionTagList
|
||||
{
|
||||
SMD3QuaterionTag* get ( const core::stringc& name )
|
||||
SMD3QuaternionTagList ()
|
||||
{
|
||||
SMD3QuaterionTag search ( name );
|
||||
Container.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE );
|
||||
}
|
||||
|
||||
// construct copy constructor
|
||||
SMD3QuaternionTagList( const SMD3QuaternionTagList & copyMe )
|
||||
{
|
||||
*this = copyMe;
|
||||
}
|
||||
|
||||
virtual ~SMD3QuaternionTagList () {}
|
||||
|
||||
SMD3QuaternionTag* get ( const core::stringc& name )
|
||||
{
|
||||
SMD3QuaternionTag search ( name );
|
||||
s32 index = Container.linear_search ( search );
|
||||
if ( index >= 0 )
|
||||
return &Container[index];
|
||||
|
@ -210,39 +240,61 @@ namespace scene
|
|||
return Container.size();
|
||||
}
|
||||
|
||||
const SMD3QuaterionTag& operator[](u32 index) const
|
||||
void set_used ( u32 new_size)
|
||||
{
|
||||
s32 diff = (s32) new_size - (s32) Container.allocated_size ();
|
||||
if ( diff > 0 )
|
||||
{
|
||||
SMD3QuaternionTag e ( "" );
|
||||
for ( s32 i = 0; i < diff; ++i )
|
||||
Container.push_back ( e );
|
||||
}
|
||||
}
|
||||
|
||||
const SMD3QuaternionTag& operator[](u32 index) const
|
||||
{
|
||||
return Container[index];
|
||||
}
|
||||
|
||||
SMD3QuaterionTag& operator[](u32 index)
|
||||
SMD3QuaternionTag& operator[](u32 index)
|
||||
{
|
||||
return Container[index];
|
||||
}
|
||||
|
||||
SMD3QuaterionTagList & operator = (const SMD3QuaterionTagList & copyMe)
|
||||
void push_back ( const SMD3QuaternionTag& other )
|
||||
{
|
||||
Container.push_back ( other );
|
||||
}
|
||||
|
||||
SMD3QuaternionTagList& operator = (const SMD3QuaternionTagList & copyMe)
|
||||
{
|
||||
Container = copyMe.Container;
|
||||
return *this;
|
||||
}
|
||||
|
||||
core::array < SMD3QuaterionTag > Container;
|
||||
private:
|
||||
core::array < SMD3QuaternionTag > Container;
|
||||
};
|
||||
|
||||
|
||||
//! Holding Frames Buffers and Tag Infos
|
||||
struct SMD3Mesh: public IReferenceCounted
|
||||
{
|
||||
~SMD3Mesh()
|
||||
SMD3Mesh ()
|
||||
{
|
||||
MD3Header.numFrames = 0;
|
||||
}
|
||||
|
||||
virtual ~SMD3Mesh()
|
||||
{
|
||||
for (u32 i=0; i<Buffer.size(); ++i)
|
||||
Buffer[i]->drop();
|
||||
}
|
||||
|
||||
SMD3Header MD3Header;
|
||||
core::stringc Name;
|
||||
core::array < SMD3MeshBuffer * > Buffer;
|
||||
SMD3QuaterionTagList TagList;
|
||||
SMD3QuaternionTagList TagList;
|
||||
SMD3Header MD3Header;
|
||||
};
|
||||
|
||||
|
||||
|
@ -255,7 +307,7 @@ namespace scene
|
|||
virtual void setInterpolationShift ( u32 shift, u32 loopMode ) = 0;
|
||||
|
||||
//! get the tag list of the mesh.
|
||||
virtual SMD3QuaterionTagList *getTagList(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) = 0;
|
||||
virtual SMD3QuaternionTagList *getTagList(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) = 0;
|
||||
|
||||
//! get the original md3 mesh.
|
||||
virtual SMD3Mesh * getOriginalMesh () = 0;
|
||||
|
|
|
@ -193,7 +193,7 @@ namespace scene
|
|||
virtual IAnimatedMesh* getMesh(void) = 0;
|
||||
|
||||
//! Get the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh, or the absolutetransformation if it's a normal scenenode
|
||||
virtual const SMD3QuaterionTag& getMD3TagTransformation( const core::stringc & tagname) = 0;
|
||||
virtual const SMD3QuaternionTag* getMD3TagTransformation( const core::stringc & tagname) = 0;
|
||||
|
||||
//! Set how the joints should be updated on render
|
||||
virtual void setJointMode(E_JOINT_UPDATE_ON_RENDER mode)=0;
|
||||
|
|
|
@ -42,15 +42,26 @@ namespace scene
|
|||
\param isOrthogonal Set this to true if the matrix is an
|
||||
orthogonal one (e.g. from matrix4::buildProjectionMatrixOrtho).
|
||||
*/
|
||||
virtual void setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal = false) = 0;
|
||||
virtual void setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal=false) =0;
|
||||
|
||||
//! Gets the current projection matrix of the camera.
|
||||
/** \return The current projection matrix of the camera. */
|
||||
virtual const core::matrix4& getProjectionMatrix() const = 0;
|
||||
virtual const core::matrix4& getProjectionMatrix() const =0;
|
||||
|
||||
//! Gets the current view matrix of the camera.
|
||||
/** \return The current view matrix of the camera. */
|
||||
virtual const core::matrix4& getViewMatrix() const = 0;
|
||||
virtual const core::matrix4& getViewMatrix() const =0;
|
||||
|
||||
//! Sets a custom view matrix affector.
|
||||
/** The matrix passed here, will be multiplied with the view
|
||||
matrix when it gets updated. This allows for custom camera
|
||||
setups like, for example, a reflection camera.
|
||||
\param affector The affector matrix. */
|
||||
virtual void setViewMatrixAffector(const core::matrix4& affector) =0;
|
||||
|
||||
//! Get the custom view matrix affector.
|
||||
/** \return The affector matrix. */
|
||||
virtual const core::matrix4& getViewMatrixAffector() const =0;
|
||||
|
||||
//! It is possible to send mouse and key events to the camera.
|
||||
/** Most cameras may ignore this input, but camera scene nodes
|
||||
|
@ -59,14 +70,14 @@ namespace scene
|
|||
ISceneManager::addCameraSceneNodeFPS, may want to get
|
||||
this input for changing their position, look at target or
|
||||
whatever. */
|
||||
virtual bool OnEvent(const SEvent& event) = 0;
|
||||
virtual bool OnEvent(const SEvent& event) =0;
|
||||
|
||||
//! Sets the look at target of the camera
|
||||
/** If the camera's target and rotation are bound ( @see
|
||||
bindTargetAndRotation() ) then calling this will also change
|
||||
the camera's scene node rotation to match the target.
|
||||
\param pos Look at target of the camera, in world co-ordinates. */
|
||||
virtual void setTarget(const core::vector3df& pos) = 0;
|
||||
virtual void setTarget(const core::vector3df& pos) =0;
|
||||
|
||||
//! Sets the rotation of the node.
|
||||
/** This only modifies the relative rotation of the node.
|
||||
|
@ -74,64 +85,64 @@ namespace scene
|
|||
bindTargetAndRotation() ) then calling this will also change
|
||||
the camera's target to match the rotation.
|
||||
\param rotation New rotation of the node in degrees. */
|
||||
virtual void setRotation(const core::vector3df& rotation) = 0;
|
||||
virtual void setRotation(const core::vector3df& rotation) =0;
|
||||
|
||||
//! Gets the current look at target of the camera
|
||||
/** \return The current look at target of the camera, in world co-ordinates */
|
||||
virtual const core::vector3df& getTarget() const = 0;
|
||||
virtual const core::vector3df& getTarget() const =0;
|
||||
|
||||
//! Sets the up vector of the camera.
|
||||
/** \param pos: New upvector of the camera. */
|
||||
virtual void setUpVector(const core::vector3df& pos) = 0;
|
||||
virtual void setUpVector(const core::vector3df& pos) =0;
|
||||
|
||||
//! Gets the up vector of the camera.
|
||||
/** \return The up vector of the camera, in world space. */
|
||||
virtual const core::vector3df& getUpVector() const = 0;
|
||||
virtual const core::vector3df& getUpVector() const =0;
|
||||
|
||||
//! Gets the value of the near plane of the camera.
|
||||
/** \return The value of the near plane of the camera. */
|
||||
virtual f32 getNearValue() const = 0;
|
||||
virtual f32 getNearValue() const =0;
|
||||
|
||||
//! Gets the value of the far plane of the camera.
|
||||
/** \return The value of the far plane of the camera. */
|
||||
virtual f32 getFarValue() const = 0;
|
||||
virtual f32 getFarValue() const =0;
|
||||
|
||||
//! Gets the aspect ratio of the camera.
|
||||
/** \return The aspect ratio of the camera. */
|
||||
virtual f32 getAspectRatio() const = 0;
|
||||
virtual f32 getAspectRatio() const =0;
|
||||
|
||||
//! Gets the field of view of the camera.
|
||||
/** \return The field of view of the camera in radiants. */
|
||||
virtual f32 getFOV() const = 0;
|
||||
virtual f32 getFOV() const =0;
|
||||
|
||||
//! Sets the value of the near clipping plane. (default: 1.0f)
|
||||
/** \param zn: New z near value. */
|
||||
virtual void setNearValue(f32 zn) = 0;
|
||||
virtual void setNearValue(f32 zn) =0;
|
||||
|
||||
//! Sets the value of the far clipping plane (default: 2000.0f)
|
||||
/** \param zf: New z far value. */
|
||||
virtual void setFarValue(f32 zf) = 0;
|
||||
virtual void setFarValue(f32 zf) =0;
|
||||
|
||||
//! Sets the aspect ratio (default: 4.0f / 3.0f)
|
||||
/** \param aspect: New aspect ratio. */
|
||||
virtual void setAspectRatio(f32 aspect) = 0;
|
||||
virtual void setAspectRatio(f32 aspect) =0;
|
||||
|
||||
//! Sets the field of view (Default: PI / 2.5f)
|
||||
/** \param fovy: New field of view in radiants. */
|
||||
virtual void setFOV(f32 fovy) = 0;
|
||||
virtual void setFOV(f32 fovy) =0;
|
||||
|
||||
//! Get the view frustum.
|
||||
/** Needed sometimes by bspTree or LOD render nodes.
|
||||
\return The current view frustum. */
|
||||
virtual const SViewFrustum* getViewFrustum() const = 0;
|
||||
virtual const SViewFrustum* getViewFrustum() const =0;
|
||||
|
||||
//! Disables or enables the camera to get key or mouse inputs.
|
||||
/** If this is set to true, the camera will respond to key
|
||||
inputs otherwise not. */
|
||||
virtual void setInputReceiverEnabled(bool enabled) = 0;
|
||||
virtual void setInputReceiverEnabled(bool enabled) =0;
|
||||
|
||||
//! Checks if the input receiver of the camera is currently enabled.
|
||||
virtual bool isInputReceiverEnabled() const = 0;
|
||||
virtual bool isInputReceiverEnabled() const =0;
|
||||
|
||||
//! Checks if a camera is orthogonal.
|
||||
virtual bool isOrthogonal() const
|
||||
|
@ -149,11 +160,11 @@ namespace scene
|
|||
\param bound True to bind the camera's scene node rotation
|
||||
and targetting, false to unbind them.
|
||||
@see getTargetAndRotationBinding() */
|
||||
virtual void bindTargetAndRotation(bool bound) = 0;
|
||||
virtual void bindTargetAndRotation(bool bound) =0;
|
||||
|
||||
//! Queries if the camera scene node's rotation and its target position are bound together.
|
||||
/** @see bindTargetAndRotation() */
|
||||
virtual bool getTargetAndRotationBinding(void) const = 0;
|
||||
virtual bool getTargetAndRotationBinding(void) const =0;
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -103,6 +103,18 @@ namespace irr
|
|||
EMIE_COUNT
|
||||
};
|
||||
|
||||
//! Masks for mouse button states
|
||||
enum E_MOUSE_BUTTON_STATE_MASK
|
||||
{
|
||||
EMBSM_LEFT = 0x01,
|
||||
EMBSM_RIGHT = 0x02,
|
||||
EMBSM_MIDDLE = 0x04,
|
||||
EMBSM_EXTRA1 = 0x08,
|
||||
EMBSM_EXTRA2 = 0x10,
|
||||
|
||||
EMBSM_FORCE_32_BIT = 0x7fffffff
|
||||
};
|
||||
|
||||
namespace gui
|
||||
{
|
||||
|
||||
|
@ -149,6 +161,9 @@ namespace irr
|
|||
//! A file has been selected in the file dialog
|
||||
EGET_FILE_SELECTED,
|
||||
|
||||
//! A directory has been selected in the file dialog
|
||||
EGET_DIRECTORY_SELECTED,
|
||||
|
||||
//! A file open dialog has been closed without choosing a file
|
||||
EGET_FILE_CHOOSE_DIALOG_CANCELLED,
|
||||
|
||||
|
@ -178,10 +193,23 @@ namespace irr
|
|||
|
||||
//! The value of a spin box has changed
|
||||
EGET_SPINBOX_CHANGED,
|
||||
|
||||
//! A table has changed
|
||||
EGET_TABLE_CHANGED,
|
||||
EGET_TABLE_HEADER_CHANGED,
|
||||
EGET_TABLE_SELECTED_AGAIN
|
||||
EGET_TABLE_SELECTED_AGAIN,
|
||||
|
||||
//! A tree view node lost selection. See IGUITreeView::getLastEventNode().
|
||||
EGET_TREEVIEW_NODE_DESELECT,
|
||||
|
||||
//! A tree view node was selected. See IGUITreeView::getLastEventNode().
|
||||
EGET_TREEVIEW_NODE_SELECT,
|
||||
|
||||
//! A tree view node was expanded. See IGUITreeView::getLastEventNode().
|
||||
EGET_TREEVIEW_NODE_EXPAND,
|
||||
|
||||
//! A tree view node was collapsed. See IGUITreeView::getLastEventNode().
|
||||
EGET_TREEVIEW_NODE_COLLAPS,
|
||||
|
||||
};
|
||||
} // end namespace gui
|
||||
|
@ -217,6 +245,20 @@ struct SEvent
|
|||
/** Only valid if event was EMIE_MOUSE_WHEEL */
|
||||
f32 Wheel;
|
||||
|
||||
//! A bitmap of button states. You can use isButtonPressed() to determine
|
||||
//! if a button is pressed or not.
|
||||
//! Currently only valid if the event was EMIE_MOUSE_MOVED
|
||||
u32 ButtonStates;
|
||||
|
||||
//! Is the left button pressed down?
|
||||
bool isLeftPressed() const { return 0 != ( ButtonStates & EMBSM_LEFT ); }
|
||||
|
||||
//! Is the right button pressed down?
|
||||
bool isRightPressed() const { return 0 != ( ButtonStates & EMBSM_RIGHT ); }
|
||||
|
||||
//! Is the middle button pressed down?
|
||||
bool isMiddlePressed() const { return 0 != ( ButtonStates & EMBSM_MIDDLE ); }
|
||||
|
||||
//! Type of mouse event
|
||||
EMOUSE_INPUT_EVENT Event;
|
||||
};
|
||||
|
@ -231,13 +273,13 @@ struct SEvent
|
|||
EKEY_CODE Key;
|
||||
|
||||
//! If not true, then the key was left up
|
||||
bool PressedDown;
|
||||
bool PressedDown:1;
|
||||
|
||||
//! True if shift was also pressed
|
||||
bool Shift;
|
||||
bool Shift:1;
|
||||
|
||||
//! True if ctrl was also pressed
|
||||
bool Control;
|
||||
bool Control:1;
|
||||
};
|
||||
|
||||
//! A joystick event.
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
// Copyright (C) 2002-2009 Nikolaus Gebhardt/ Thomas Alten
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_FILE_ARCHIVE_H_INCLUDED__
|
||||
#define __I_FILE_ARCHIVE_H_INCLUDED__
|
||||
|
||||
#include "IReadFile.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
namespace io
|
||||
{
|
||||
|
||||
//! FileSystemType: which Filesystem should be used for e.g. browsing
|
||||
enum EFileSystemType
|
||||
{
|
||||
FILESYSTEM_NATIVE = 0, // Native OS FileSystem
|
||||
FILESYSTEM_VIRTUAL, // Virtual FileSystem
|
||||
};
|
||||
|
||||
|
||||
//! Base Info which all File archives must support on browsing
|
||||
struct IFileArchiveEntry
|
||||
{
|
||||
IFileArchiveEntry() {}
|
||||
|
||||
core::string<c16> simpleFileName;
|
||||
core::string<c16> path;
|
||||
|
||||
bool operator < (const IFileArchiveEntry& other) const
|
||||
{
|
||||
return simpleFileName < other.simpleFileName;
|
||||
}
|
||||
|
||||
bool operator == (const IFileArchiveEntry& other) const
|
||||
{
|
||||
return simpleFileName == other.simpleFileName;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//! The FileArchive manages files and archives and provides access to them.
|
||||
/** It manages where files are, so that modules which use the the IO do not
|
||||
need to know where every file is located. A file could be in a .zip-Archive or
|
||||
as file on disk, using the IFileSystem makes no difference to this. */
|
||||
struct IFileArchive : public virtual IReferenceCounted
|
||||
{
|
||||
//! return the id of the file Archive
|
||||
virtual const core::string<c16>& getArchiveName() =0;
|
||||
|
||||
//! get the class Type
|
||||
virtual const core::string<c16>& getArchiveType() =0;
|
||||
|
||||
//! opens a file by file name
|
||||
virtual IReadFile* openFile(const core::string<c16>& filename) =0;
|
||||
|
||||
//! opens a file by position
|
||||
virtual IReadFile* openFile(s32 index) =0;
|
||||
|
||||
//! returns fileindex
|
||||
virtual s32 findFile(const core::string<c16>& filename) =0;
|
||||
|
||||
//! Returns the amount of files in the filelist.
|
||||
/** \return Amount of files and directories in the file list. */
|
||||
virtual u32 getFileCount() const =0;
|
||||
|
||||
//! returns data of known file
|
||||
virtual const IFileArchiveEntry* getFileInfo(u32 index) =0;
|
||||
};
|
||||
|
||||
//! Class which is able to create an archive from a file.
|
||||
/** If you want the Irrlicht Engine be able to load archives of
|
||||
currently unsupported file formats (e.g .wad), then implement
|
||||
this and add your new Archive loader with
|
||||
IFileSystem::addArchiveLoader() to the engine. */
|
||||
struct IArchiveLoader : public virtual IReferenceCounted
|
||||
{
|
||||
//! Check if the file might be loaded by this class
|
||||
/** Check is based on the file extension (e.g. ".zip")
|
||||
\param fileName Name of file to check.
|
||||
\return True if file seems to be loadable. */
|
||||
virtual bool isALoadableFileFormat(const core::string<c16>& filename) const =0;
|
||||
|
||||
//! Creates an archive from the filename
|
||||
/** \param file File handle to check.
|
||||
\return Pointer to newly created archive, or 0 upon error. */
|
||||
virtual IFileArchive* createArchive(const core::string<c16>& filename, bool ignoreCase, bool ignorePaths) const =0;
|
||||
|
||||
//! Check if the file might be loaded by this class
|
||||
/** Check might look into the file.
|
||||
\param file File handle to check.
|
||||
\return True if file seems to be loadable. */
|
||||
virtual bool isALoadableFileFormat(io::IReadFile* file) const =0;
|
||||
|
||||
//! Creates an archive from the file
|
||||
/** \param file File handle to check.
|
||||
\return Pointer to newly created archive, or 0 upon error. */
|
||||
virtual IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const =0;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace io
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
#define __I_FILE_LIST_H_INCLUDED__
|
||||
|
||||
#include "IReferenceCounted.h"
|
||||
#include "irrString.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
@ -25,13 +26,13 @@ public:
|
|||
\param index is the zero based index of the file which name should
|
||||
be returned. The index has to be smaller than the amount getFileCount() returns.
|
||||
\return File name of the file. Returns 0, if an error occured. */
|
||||
virtual const c8* getFileName(u32 index) const = 0;
|
||||
virtual const core::string<c16>& getFileName(u32 index) const = 0;
|
||||
|
||||
//! Gets the full name of a file in the list, path included, based on an index.
|
||||
/** \param index is the zero based index of the file which name should
|
||||
be returned. The index has to be smaller than the amount getFileCount() returns.
|
||||
\return File name of the file. Returns 0, if an error occured. */
|
||||
virtual const c8* getFullFileName(u32 index) = 0;
|
||||
virtual const core::string<c16>& getFullFileName(u32 index) = 0;
|
||||
|
||||
//! Check if the file is a directory
|
||||
/** \param index The zero based index of the file whose name shall
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "IReferenceCounted.h"
|
||||
#include "IXMLReader.h"
|
||||
#include "irrString.h"
|
||||
#include "IFileArchive.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
@ -24,6 +24,7 @@ class IFileList;
|
|||
class IXMLWriter;
|
||||
class IAttributes;
|
||||
|
||||
|
||||
//! The FileSystem manages files and archives and provides access to them.
|
||||
/** It manages where files are, so that modules which use the the IO do not
|
||||
need to know where every file is located. A file could be in a .zip-Archive or
|
||||
|
@ -37,7 +38,7 @@ public:
|
|||
\return Returns a pointer to the created file interface.
|
||||
The returned pointer should be dropped when no longer needed.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IReadFile* createAndOpenFile(const c8* filename) = 0;
|
||||
virtual IReadFile* createAndOpenFile(const core::string<c16>& filename) =0;
|
||||
|
||||
//! Creates an IReadFile interface for accessing memory like a file.
|
||||
/** This allows you to use a pointer to memory where an IReadFile is requested.
|
||||
|
@ -50,7 +51,20 @@ public:
|
|||
The returned pointer should be dropped when no longer needed.
|
||||
See IReferenceCounted::drop() for more information.
|
||||
*/
|
||||
virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const c8* fileName, bool deleteMemoryWhenDropped=false) = 0;
|
||||
virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const core::string<c16>& fileName, bool deleteMemoryWhenDropped=false) =0;
|
||||
|
||||
//! Creates an IReadFile interface for accessing files inside files.
|
||||
/** This is useful e.g. for archives.
|
||||
\param fileName: The name given to this file
|
||||
\param alreadyOpenedFile: Pointer to the enclosing file
|
||||
\param pos: Start of the file inside alreadyOpenedFile
|
||||
\param areaSize: The length of the file
|
||||
\return A pointer to the created file interface.
|
||||
The returned pointer should be dropped when no longer needed.
|
||||
See IReferenceCounted::drop() for more information.
|
||||
*/
|
||||
virtual IReadFile* createLimitReadFile(const core::string<c16>& fileName,
|
||||
IReadFile* alreadyOpenedFile, long pos, long areaSize) =0;
|
||||
|
||||
//! Creates an IWriteFile interface for accessing memory like a file.
|
||||
/** This allows you to use a pointer to memory where an IWriteFile is requested.
|
||||
|
@ -64,7 +78,7 @@ public:
|
|||
The returned pointer should be dropped when no longer needed.
|
||||
See IReferenceCounted::drop() for more information.
|
||||
*/
|
||||
virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const c8* fileName, bool deleteMemoryWhenDropped=false) = 0;
|
||||
virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const core::string<c16>& fileName, bool deleteMemoryWhenDropped=false) =0;
|
||||
|
||||
|
||||
//! Opens a file for write access.
|
||||
|
@ -75,7 +89,37 @@ public:
|
|||
file could not created or opened for writing.
|
||||
The returned pointer should be dropped when no longer needed.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IWriteFile* createAndWriteFile(const c8* filename, bool append=false) = 0;
|
||||
virtual IWriteFile* createAndWriteFile(const core::string<c16>& filename, bool append=false) =0;
|
||||
|
||||
//! Adds an archive to the file system.
|
||||
/** After calling this, the Irrlicht Engine will search and open files directly from this archive too.
|
||||
This is useful for hiding data from the end user, speeding up file access and making it possible to
|
||||
access for example Quake3 .pk3 files, which are nothing different than .zip files.
|
||||
\param filename: Filename of the zip archive to add to the file system.
|
||||
\param ignoreCase: If set to true, files in the archive can be accessed without
|
||||
writing all letters in the right case.
|
||||
\param ignorePaths: If set to true, files in the added archive can be accessed
|
||||
without its complete path.
|
||||
\return Returns true if the archive was added successful, false if not. */
|
||||
virtual bool registerFileArchive(const core::string<c16>& filename, bool ignoreCase=true, bool ignorePaths=true) =0;
|
||||
|
||||
//! Adds an external archive loader to the engine.
|
||||
virtual void addArchiveLoader(IArchiveLoader* loader) =0;
|
||||
|
||||
//! return the amount of currently attached Archives
|
||||
virtual u32 getFileArchiveCount() const =0;
|
||||
|
||||
//! removes an archive from the file system.
|
||||
virtual bool unregisterFileArchive(u32 index) =0;
|
||||
|
||||
//! removes an archive from the file system.
|
||||
virtual bool unregisterFileArchive(const core::string<c16>& filename) =0;
|
||||
|
||||
//! move the hirarchy of the filesystem. moves sourceIndex relative up or down
|
||||
virtual bool moveFileArchive(u32 sourceIndex, s32 relative) =0;
|
||||
|
||||
//! get the Archive number index
|
||||
virtual IFileArchive* getFileArchive(u32 index) =0;
|
||||
|
||||
//! Adds an zip archive to the file system.
|
||||
/** After calling this, the Irrlicht Engine will search and open files directly from this archive too.
|
||||
|
@ -87,9 +131,12 @@ public:
|
|||
\param ignorePaths: If set to true, files in the added archive can be accessed
|
||||
without its complete path.
|
||||
\return Returns true if the archive was added successful, false if not. */
|
||||
virtual bool addZipFileArchive(const c8* filename, bool ignoreCase = true, bool ignorePaths = true) = 0;
|
||||
virtual bool addZipFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
|
||||
{
|
||||
return registerFileArchive(filename, ignoreCase, ignorePaths);
|
||||
}
|
||||
|
||||
//! Adds an unzipped archive ( or basedirectory with subdirectories..) to the file system.
|
||||
//! Adds an unzipped archive (or basedirectory with subdirectories..) to the file system.
|
||||
/** Useful for handling data which will be in a zip file
|
||||
\param filename: Filename of the unzipped zip archive base directory to add to the file system.
|
||||
\param ignoreCase: If set to true, files in the archive can be accessed without
|
||||
|
@ -97,7 +144,10 @@ public:
|
|||
\param ignorePaths: If set to true, files in the added archive can be accessed
|
||||
without its complete path.
|
||||
\return Returns true if the archive was added successful, false if not. */
|
||||
virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase = true, bool ignorePaths = true) = 0;
|
||||
virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
|
||||
{
|
||||
return registerFileArchive(filename, ignoreCase, ignorePaths);
|
||||
}
|
||||
|
||||
//! Adds an pak archive to the file system.
|
||||
/** After calling this, the Irrlicht Engine will search and open files directly from this archive too.
|
||||
|
@ -109,51 +159,55 @@ public:
|
|||
\param ignorePaths: If set to true, files in the added archive can be accessed
|
||||
without its complete path.(should not use with Quake2 paks
|
||||
\return Returns true if the archive was added successful, false if not. */
|
||||
virtual bool addPakFileArchive(const c8* filename, bool ignoreCase = true, bool ignorePaths = true) = 0;
|
||||
virtual bool addPakFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
|
||||
{
|
||||
return registerFileArchive(filename, ignoreCase, ignorePaths);
|
||||
}
|
||||
|
||||
//! Get the current working directory.
|
||||
/** \return Current working directory as a string. */
|
||||
virtual const c8* getWorkingDirectory() = 0;
|
||||
virtual const core::string<c16>& getWorkingDirectory() =0;
|
||||
|
||||
//! Changes the current working directory.
|
||||
/** \param newDirectory: A string specifying the new working directory.
|
||||
The string is operating system dependent. Under Windows it has
|
||||
the form "<drive>:\<directory>\<sudirectory>\<..>". An example would be: "C:\Windows\"
|
||||
\return True if successful, otherwise false. */
|
||||
virtual bool changeWorkingDirectoryTo(const c8* newDirectory) = 0;
|
||||
virtual bool changeWorkingDirectoryTo(const core::string<c16>& newDirectory) =0;
|
||||
|
||||
//! Converts a relative path to an absolute (unique) path, resolving symbolic links if required
|
||||
/** \param filename Possibly relative filename begin queried.
|
||||
\result Absolute filename which points to the same file. */
|
||||
virtual core::stringc getAbsolutePath(const core::stringc& filename) const = 0;
|
||||
virtual core::string<c16> getAbsolutePath(const core::string<c16>& filename) const =0;
|
||||
|
||||
//! Returns the directory a file is located in.
|
||||
/** \param filename: The file to get the directory from.
|
||||
\return String containing the directory of the file. */
|
||||
virtual core::stringc getFileDir(const core::stringc& filename) const = 0;
|
||||
virtual core::string<c16> getFileDir(const core::string<c16>& filename) const =0;
|
||||
|
||||
//! Returns the base part of a filename, i.e. the name without the directory
|
||||
//! part. If no directory is prefixed, the full name is returned.
|
||||
/** \param filename: The file to get the basename from
|
||||
//! Returns the base part of a filename, i.e. the name without the directory part.
|
||||
/** If no directory is prefixed, the full name is returned.
|
||||
\param filename: The file to get the basename from
|
||||
\param keepExtension True if filename with extension is returned otherwise everything
|
||||
after the final '.' is removed as well. */
|
||||
virtual core::stringc getFileBasename(const core::stringc& filename, bool keepExtension=true) const = 0;
|
||||
virtual core::string<c16> getFileBasename(const core::string<c16>& filename, bool keepExtension=true) const =0;
|
||||
|
||||
//! flatten a path and file name for example: "/you/me/../." becomes "/you"
|
||||
virtual core::string<c16>& flattenFilename(core::string<c16>& directory, const core::string<c16>& root="/") const =0;
|
||||
|
||||
//! Creates a list of files and directories in the current working directory and returns it.
|
||||
/** \return a Pointer to the created IFileList is returned. After the list has been used
|
||||
it has to be deleted using its IFileList::drop() method.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IFileList* createFileList() const = 0;
|
||||
virtual IFileList* createFileList() =0;
|
||||
|
||||
//! Set the active type of file system.
|
||||
virtual EFileSystemType setFileListSystem(EFileSystemType listType) =0;
|
||||
|
||||
//! Determines if a file exists and could be opened.
|
||||
/** \param filename is the string identifying the file which should be tested for existence.
|
||||
\return Returns true if file exists, and false if it does not exist or an error occured. */
|
||||
virtual bool existFile(const c8* filename) const = 0;
|
||||
|
||||
//! Determines if a file exists and could be opened.
|
||||
/** \param filename is the string identifying the file which should be tested for existence.
|
||||
\return Returns true if file exists, and false if it does not exist or an error occured. */
|
||||
virtual bool existFile(const core::stringc& filename) const = 0;
|
||||
virtual bool existFile(const core::string<c16>& filename) const =0;
|
||||
|
||||
//! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
|
||||
/** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for
|
||||
|
@ -162,7 +216,7 @@ public:
|
|||
IXMLReader is returned. After use, the reader
|
||||
has to be deleted using its IXMLReader::drop() method.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IXMLReader* createXMLReader(const c8* filename) = 0;
|
||||
virtual IXMLReader* createXMLReader(const core::string<c16>& filename) =0;
|
||||
|
||||
//! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
|
||||
/** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for
|
||||
|
@ -171,7 +225,7 @@ public:
|
|||
IXMLReader is returned. After use, the reader
|
||||
has to be deleted using its IXMLReader::drop() method.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IXMLReader* createXMLReader(IReadFile* file) = 0;
|
||||
virtual IXMLReader* createXMLReader(IReadFile* file) =0;
|
||||
|
||||
//! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*).
|
||||
/** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for
|
||||
|
@ -180,7 +234,7 @@ public:
|
|||
IXMLReader is returned. After use, the reader
|
||||
has to be deleted using its IXMLReaderUTF8::drop() method.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IXMLReaderUTF8* createXMLReaderUTF8(const c8* filename) = 0;
|
||||
virtual IXMLReaderUTF8* createXMLReaderUTF8(const core::string<c16>& filename) =0;
|
||||
|
||||
//! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*).
|
||||
/** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for
|
||||
|
@ -189,21 +243,21 @@ public:
|
|||
IXMLReader is returned. After use, the reader
|
||||
has to be deleted using its IXMLReaderUTF8::drop() method.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) = 0;
|
||||
virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) =0;
|
||||
|
||||
//! Creates a XML Writer from a file.
|
||||
/** \return 0, if file could not be opened, otherwise a pointer to the created
|
||||
IXMLWriter is returned. After use, the reader
|
||||
has to be deleted using its IXMLWriter::drop() method.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IXMLWriter* createXMLWriter(const c8* filename) = 0;
|
||||
virtual IXMLWriter* createXMLWriter(const core::string<c16>& filename) =0;
|
||||
|
||||
//! Creates a XML Writer from a file.
|
||||
/** \return 0, if file could not be opened, otherwise a pointer to the created
|
||||
IXMLWriter is returned. After use, the reader
|
||||
has to be deleted using its IXMLWriter::drop() method.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IXMLWriter* createXMLWriter(IWriteFile* file) = 0;
|
||||
virtual IXMLWriter* createXMLWriter(IWriteFile* file) =0;
|
||||
|
||||
//! Creates a new empty collection of attributes, usable for serialization and more.
|
||||
/** \param driver: Video driver to be used to load textures when specified as attribute values.
|
||||
|
@ -211,12 +265,12 @@ public:
|
|||
\return Pointer to the created object.
|
||||
If you no longer need the object, you should call IAttributes::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver=0) = 0;
|
||||
virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver=0) =0;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace io
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -156,10 +156,10 @@ public:
|
|||
then printed to the error log and can be catched with a custom event
|
||||
receiver. */
|
||||
virtual s32 addHighLevelShaderMaterialFromFiles(
|
||||
const c8* vertexShaderProgram,
|
||||
const core::string<c16>& vertexShaderProgramFileName,
|
||||
const c8* vertexShaderEntryPointName = "main",
|
||||
E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
|
||||
const c8* pixelShaderProgram = 0,
|
||||
const core::string<c16>& pixelShaderProgramFileName = "",
|
||||
const c8* pixelShaderEntryPointName = "main",
|
||||
E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
|
||||
IShaderConstantSetCallBack* callback = 0,
|
||||
|
@ -293,8 +293,8 @@ public:
|
|||
error occured. -1 is returned for example if a vertex or pixel shader
|
||||
program could not be compiled, the error strings are then printed out
|
||||
into the error log, and can be catched with a custom event receiver. */
|
||||
virtual s32 addShaderMaterialFromFiles(const c8* vertexShaderProgramFileName,
|
||||
const c8* pixelShaderProgramFileName,
|
||||
virtual s32 addShaderMaterialFromFiles(const core::string<c16>& vertexShaderProgramFileName,
|
||||
const core::string<c16>& pixelShaderProgramFileName,
|
||||
IShaderConstantSetCallBack* callback = 0,
|
||||
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
|
||||
s32 userData = 0) = 0;
|
||||
|
|
|
@ -27,8 +27,14 @@ namespace gui
|
|||
//! Returns string of an item. the idx may be a value from 0 to itemCount-1
|
||||
virtual const wchar_t* getItem(u32 idx) const = 0;
|
||||
|
||||
//! Returns item data of an item. the idx may be a value from 0 to itemCount-1
|
||||
virtual u32 getItemData(u32 idx) const = 0;
|
||||
|
||||
//! Returns index based on item data
|
||||
virtual s32 getIndexForItemData(u32 data ) const = 0;
|
||||
|
||||
//! Adds an item and returns the index of it
|
||||
virtual u32 addItem(const wchar_t* text) = 0;
|
||||
virtual u32 addItem(const wchar_t* text, u32 data = 0) = 0;
|
||||
|
||||
//! Removes an item from the combo box.
|
||||
/** Warning. This will change the index of all following items */
|
||||
|
|
|
@ -44,14 +44,6 @@ public:
|
|||
if (parent)
|
||||
parent->addChild(this);
|
||||
|
||||
// if we succeeded in becoming a child
|
||||
if (Parent)
|
||||
{
|
||||
LastParentRect = Parent->getAbsolutePosition();
|
||||
AbsoluteRect += LastParentRect.UpperLeftCorner;
|
||||
AbsoluteClippingRect = AbsoluteRect;
|
||||
AbsoluteClippingRect.clipAgainst(Parent->AbsoluteClippingRect);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -160,6 +152,7 @@ public:
|
|||
void setNotClipped(bool noClip)
|
||||
{
|
||||
NoClip = noClip;
|
||||
updateAbsolutePosition();
|
||||
}
|
||||
|
||||
|
||||
|
@ -397,15 +390,15 @@ public:
|
|||
{
|
||||
if (child)
|
||||
{
|
||||
child->grab();
|
||||
child->grab(); // prevent destruction when removed
|
||||
child->remove(); // remove from old parent
|
||||
child->LastParentRect = getAbsolutePosition();
|
||||
child->Parent = this;
|
||||
Children.push_back(child);
|
||||
child->updateAbsolutePosition();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//! Removes a child.
|
||||
virtual void removeChild(IGUIElement* child)
|
||||
{
|
||||
|
@ -432,24 +425,24 @@ public:
|
|||
//! Draws the element and its children.
|
||||
virtual void draw()
|
||||
{
|
||||
if (!IsVisible)
|
||||
return;
|
||||
|
||||
core::list<IGUIElement*>::Iterator it = Children.begin();
|
||||
for (; it != Children.end(); ++it)
|
||||
(*it)->draw();
|
||||
if ( IsVisible )
|
||||
{
|
||||
core::list<IGUIElement*>::Iterator it = Children.begin();
|
||||
for (; it != Children.end(); ++it)
|
||||
(*it)->draw();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//! animate the element and its children.
|
||||
virtual void OnPostRender(u32 timeMs)
|
||||
{
|
||||
if (!IsVisible)
|
||||
return;
|
||||
|
||||
core::list<IGUIElement*>::Iterator it = Children.begin();
|
||||
for (; it != Children.end(); ++it)
|
||||
(*it)->OnPostRender( timeMs );
|
||||
if ( IsVisible )
|
||||
{
|
||||
core::list<IGUIElement*>::Iterator it = Children.begin();
|
||||
for (; it != Children.end(); ++it)
|
||||
(*it)->OnPostRender( timeMs );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -825,7 +818,6 @@ public:
|
|||
out->addRect("Rect", DesiredRect);
|
||||
out->addPosition2d("MinSize", core::position2di(MinSize.Width, MinSize.Height));
|
||||
out->addPosition2d("MaxSize", core::position2di(MaxSize.Width, MaxSize.Height));
|
||||
out->addBool("NoClip", NoClip);
|
||||
out->addEnum("LeftAlign", AlignLeft, GUIAlignmentNames);
|
||||
out->addEnum("RightAlign", AlignRight, GUIAlignmentNames);
|
||||
out->addEnum("TopAlign", AlignTop, GUIAlignmentNames);
|
||||
|
@ -835,6 +827,7 @@ public:
|
|||
out->addBool("TabStop", IsTabStop);
|
||||
out->addBool("TabGroup", IsTabGroup);
|
||||
out->addInt("TabOrder", TabOrder);
|
||||
out->addBool("NoClip", NoClip);
|
||||
}
|
||||
|
||||
|
||||
|
@ -857,13 +850,14 @@ public:
|
|||
p = in->getAttributeAsPosition2d("MinSize");
|
||||
setMinSize(core::dimension2du(p.X,p.Y));
|
||||
|
||||
setNotClipped(in->getAttributeAsBool("NoClip"));
|
||||
setAlignment((EGUI_ALIGNMENT) in->getAttributeAsEnumeration("LeftAlign", GUIAlignmentNames),
|
||||
(EGUI_ALIGNMENT)in->getAttributeAsEnumeration("RightAlign", GUIAlignmentNames),
|
||||
(EGUI_ALIGNMENT)in->getAttributeAsEnumeration("TopAlign", GUIAlignmentNames),
|
||||
(EGUI_ALIGNMENT)in->getAttributeAsEnumeration("BottomAlign", GUIAlignmentNames));
|
||||
|
||||
setRelativePosition(in->getAttributeAsRect("Rect"));
|
||||
|
||||
setNotClipped(in->getAttributeAsBool("NoClip"));
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -41,6 +41,8 @@ class IGUIImage;
|
|||
class IGUIMeshViewer;
|
||||
class IGUICheckBox;
|
||||
class IGUIListBox;
|
||||
class IGUITreeView;
|
||||
class IGUIImageList;
|
||||
class IGUIFileOpenDialog;
|
||||
class IGUIColorSelectDialog;
|
||||
class IGUIInOutFader;
|
||||
|
@ -144,13 +146,23 @@ public:
|
|||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUISkin* createSkin(EGUI_SKIN_TYPE type) = 0;
|
||||
|
||||
|
||||
//! Creates the image list from the given texture.
|
||||
/** Loads the font if it was not loaded before.
|
||||
\param filename Filename of the Font.
|
||||
\return Pointer to the font. Returns 0 if the font could not be loaded.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIImageList* createImageList( video::ITexture* texture,
|
||||
core::dimension2d<s32> imageSize, bool useAlphaChannel ) = 0;
|
||||
|
||||
//! Returns pointer to the font with the specified filename.
|
||||
/** Loads the font if it was not loaded before.
|
||||
\param filename Filename of the Font.
|
||||
\return Pointer to the font. Returns 0 if the font could not be loaded.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIFont* getFont(const c8* filename) = 0;
|
||||
virtual IGUIFont* getFont(const core::string<c16>& filename) = 0;
|
||||
|
||||
//! Returns the default built-in font.
|
||||
/** \return Pointer to the default built-in font.
|
||||
|
@ -163,13 +175,13 @@ public:
|
|||
\param filename Filename of the sprite bank's origin.
|
||||
\return Pointer to the sprite bank. Returns 0 if it could not be loaded.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUISpriteBank* getSpriteBank(const c8* filename) = 0;
|
||||
virtual IGUISpriteBank* getSpriteBank(const core::string<c16>& filename) = 0;
|
||||
|
||||
//! Adds an empty sprite bank to the manager
|
||||
/** \param name Name of the new sprite bank.
|
||||
\return Pointer to the sprite bank.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUISpriteBank* addEmptySpriteBank(const c8 *name) = 0;
|
||||
virtual IGUISpriteBank* addEmptySpriteBank(const core::string<c16>& name) = 0;
|
||||
|
||||
//! Returns the root gui element.
|
||||
/** This is the first gui element, the (direct or indirect) parent of all
|
||||
|
@ -182,7 +194,7 @@ public:
|
|||
virtual IGUIElement* getRootGUIElement() = 0;
|
||||
|
||||
//! Adds a button element.
|
||||
/** \param rectangle Position and dimension of the button.
|
||||
/** \param rectangle Rectangle specifying the borders of the button.
|
||||
\param parent Parent gui element of the button.
|
||||
\param id Id with which the gui element can be identified.
|
||||
\param text Text displayed on the button.
|
||||
|
@ -194,7 +206,7 @@ public:
|
|||
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, const wchar_t* tooltiptext = 0) = 0;
|
||||
|
||||
//! Adds an empty window element.
|
||||
/** \param rectangle Position and dimension of the window.
|
||||
/** \param rectangle Rectangle specifying the borders of the window.
|
||||
\param modal Defines if the dialog is modal. This means, that all other
|
||||
gui elements which were created before the window cannot be used until
|
||||
it is removed.
|
||||
|
@ -236,7 +248,7 @@ public:
|
|||
//! Adds a scrollbar.
|
||||
/** \param horizontal Specifies if the scroll bar is drawn horizontal
|
||||
or vertical.
|
||||
\param rectangle Position and dimension of the scroll bar.
|
||||
\param rectangle Rectangle specifying the borders of the scrollbar.
|
||||
\param parent Parent gui element of the scroll bar.
|
||||
\param id Id to identify the gui element.
|
||||
\return Pointer to the created scrollbar. Returns 0 if an error
|
||||
|
@ -262,7 +274,7 @@ public:
|
|||
|
||||
//! Adds an image element.
|
||||
/** Use IGUIImage::setImage later to set the image to be displayed.
|
||||
\param rectangle Position and dimension of the image.
|
||||
\param rectangle Rectangle specifying the borders of the image.
|
||||
\param parent Parent gui element of the image.
|
||||
\param id Id to identify the gui element.
|
||||
\param text Title text of the image.
|
||||
|
@ -274,7 +286,7 @@ public:
|
|||
|
||||
//! Adds a checkbox element.
|
||||
/** \param checked Define the initial state of the check box.
|
||||
\param rectangle Position and dimension of check box.
|
||||
\param rectangle Rectangle specifying the borders of the check box.
|
||||
\param parent Parent gui element of the check box.
|
||||
\param id Id to identify the gui element.
|
||||
\param text Title text of the check box.
|
||||
|
@ -285,7 +297,7 @@ public:
|
|||
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
|
||||
|
||||
//! Adds a list box element.
|
||||
/** \param rectangle Position and dimension of list box.
|
||||
/** \param rectangle Rectangle specifying the borders of the list box.
|
||||
\param parent Parent gui element of the list box.
|
||||
\param id Id to identify the gui element.
|
||||
\param drawBackground Flag whether the background should be drawn.
|
||||
|
@ -295,8 +307,20 @@ public:
|
|||
virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) = 0;
|
||||
|
||||
//! Adds a tree view element.
|
||||
/** \param rectangle Position and dimension of list box.
|
||||
\param parent Parent gui element of the list box.
|
||||
\param id Id to identify the gui element.
|
||||
\param drawBackground Flag whether the background should be drawn.
|
||||
\return Pointer to the created list box. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUITreeView* addTreeView(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, bool drawBackground=false,
|
||||
bool scrollBarVertical = true, bool scrollBarHorizontal = false) = 0;
|
||||
|
||||
//! Adds a mesh viewer. Not 100% implemented yet.
|
||||
/** \param rectangle Position and dimension of mesh viewer.
|
||||
/** \param rectangle Rectangle specifying the borders of the mesh viewer.
|
||||
\param parent Parent gui element of the mesh viewer.
|
||||
\param id Id to identify the gui element.
|
||||
\param text Title text of the mesh viewer.
|
||||
|
@ -334,7 +358,7 @@ public:
|
|||
|
||||
//! Adds a static text.
|
||||
/** \param text Text to be displayed. Can be altered after creation by SetText().
|
||||
\param rectangle Position and dimension of the static text.
|
||||
\param rectangle Rectangle specifying the borders of the static text
|
||||
\param border Set to true if the static text should have a 3d border.
|
||||
\param wordWrap Enable if the text should wrap into multiple lines.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
|
@ -355,7 +379,7 @@ public:
|
|||
ctrl+X, ctrl+V, ctrl+C, shift+Left, shift+Right, Home, End, and so on.
|
||||
\param text Text to be displayed. Can be altered after creation
|
||||
by setText().
|
||||
\param rectangle Position and dimension of the edit box.
|
||||
\param rectangle Rectangle specifying the borders of the edit box.
|
||||
\param border Set to true if the edit box should have a 3d border.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the edit box directly in the environment.
|
||||
|
@ -369,7 +393,7 @@ public:
|
|||
//! Adds a spin box.
|
||||
/** An edit box with up and down buttons
|
||||
\param text Text to be displayed. Can be altered after creation by setText().
|
||||
\param rectangle Position and dimension of the spin box.
|
||||
\param rectangle Rectangle specifying the borders of the spin box.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the spin box directly in the environment.
|
||||
\param id The ID of the element.
|
||||
|
@ -377,10 +401,10 @@ public:
|
|||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUISpinBox* addSpinBox(const wchar_t* text, const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
bool border=true,IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds an element for fading in or out.
|
||||
/* \param rectangle Rectangle specifying the borders of the element.
|
||||
/** \param rectangle Rectangle specifying the borders of the fader.
|
||||
If the pointer is NULL, the whole screen is used.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
\param id An identifier for the fader.
|
||||
|
@ -390,7 +414,7 @@ public:
|
|||
virtual IGUIInOutFader* addInOutFader(const core::rect<s32>* rectangle=0, IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a tab control to the environment.
|
||||
/** \param rectangle Position and dimension of the tab control.
|
||||
/** \param rectangle Rectangle specifying the borders of the tab control.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the tab control directly in the environment.
|
||||
\param fillbackground Specifies if the background of the tab control
|
||||
|
@ -410,7 +434,7 @@ public:
|
|||
/** You can use this element to group other elements. This is not used
|
||||
for creating tabs on tab controls, please use IGUITabControl::addTab()
|
||||
for this instead.
|
||||
\param rectangle Position and dimension of the tab.
|
||||
\param rectangle Rectangle specifying the borders of the tab.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the tab directly in the environment.
|
||||
\param id An identifier for the tab.
|
||||
|
@ -421,8 +445,8 @@ public:
|
|||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a context menu to the environment.
|
||||
/** \param rectangle Position and dimension of the menu. Note that the
|
||||
menu is resizing itself based on what items you add.
|
||||
/** \param rectangle Rectangle specifying the borders of the menu.
|
||||
Note that the menu is resizing itself based on what items you add.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the menu directly in the environment.
|
||||
\param id An identifier for the menu.
|
||||
|
@ -455,7 +479,7 @@ public:
|
|||
virtual IGUIToolBar* addToolBar(IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a combo box to the environment.
|
||||
/** \param rectangle Position and dimension of the combo box.
|
||||
/** \param rectangle Rectangle specifying the borders of the combo box.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the combo box directly in the environment.
|
||||
\param id An identifier for the combo box.
|
||||
|
@ -466,7 +490,7 @@ public:
|
|||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a table to the environment
|
||||
/** \param rectangle Position and dimension of the table.
|
||||
/** \param rectangle Rectangle specifying the borders of the table.
|
||||
\param parent Parent item of the element, e.g. a window. Set it to 0
|
||||
to place the element directly in the environment.
|
||||
\param id An identifier for the table.
|
||||
|
@ -475,9 +499,9 @@ public:
|
|||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUITable* addTable(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, bool drawBackground = false) = 0;
|
||||
IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) =0;
|
||||
|
||||
//! Returns the default element factory which can create all built in elements
|
||||
//! Get the default element factory which can create all built-in elements
|
||||
/** \return Pointer to the factory.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
|
@ -490,34 +514,45 @@ public:
|
|||
\param factoryToAdd Pointer to new factory. */
|
||||
virtual void registerGUIElementFactory(IGUIElementFactory* factoryToAdd) = 0;
|
||||
|
||||
//! Returns amount of registered gui element factories.
|
||||
//! Get amount of registered gui element factories.
|
||||
/** \return Amount of registered gui element factories. */
|
||||
virtual u32 getRegisteredGUIElementFactoryCount() const = 0;
|
||||
|
||||
//! Returns a gui element factory by index
|
||||
//! Get a gui element factory by index
|
||||
/** \param index Index of the factory.
|
||||
\return Factory at given index, or 0 if no such factory exists. */
|
||||
virtual IGUIElementFactory* getGUIElementFactory(u32 index) const = 0;
|
||||
|
||||
//! Adds a GUI Element by its name
|
||||
//! Adds a GUI element by its name
|
||||
/** Each factory is checked if it can create an element of the given
|
||||
name. The first match will be created.
|
||||
\param elementName Name of the element to be created.
|
||||
\param parent Parent of the new element, if not 0.
|
||||
\return New GUI element, or 0 if no such element exists. */
|
||||
virtual IGUIElement* addGUIElement(const c8* elementName, IGUIElement* parent=0) = 0;
|
||||
|
||||
//! Saves the current gui into a file.
|
||||
/** \param filename Name of the file.
|
||||
\param start The GUIElement to start with. Root if 0. */
|
||||
virtual bool saveGUI(const c8* filename, IGUIElement* start=0) = 0;
|
||||
\param start The GUIElement to start with. Root if 0.
|
||||
\return True if saving succeeded, else false. */
|
||||
virtual bool saveGUI(const core::string<c16>& filename, IGUIElement* start=0) = 0;
|
||||
|
||||
//! Saves the current gui into a file.
|
||||
/** \param file The file to write to.
|
||||
\param start The GUIElement to start with. Root if 0. */
|
||||
\param start The GUIElement to start with. Root if 0.
|
||||
\return True if saving succeeded, else false. */
|
||||
virtual bool saveGUI(io::IWriteFile* file, IGUIElement* start=0) = 0;
|
||||
|
||||
//! Loads the gui. Note that the current gui is not cleared before.
|
||||
/** \param filename Name of the file.
|
||||
\param parent Parent for the loaded GUI, root if 0. */
|
||||
virtual bool loadGUI(const c8* filename, IGUIElement* parent=0) = 0;
|
||||
\param parent Parent for the loaded GUI, root if 0.
|
||||
\return True if loading succeeded, else false. */
|
||||
virtual bool loadGUI(const c16* filename, IGUIElement* parent=0) = 0;
|
||||
|
||||
//! Loads the gui. Note that the current gui is not cleared before.
|
||||
/** \param file The file to load from.
|
||||
\param parent Parent for the loaded GUI, root if 0. */
|
||||
\param parent Parent for the loaded GUI, root if 0.
|
||||
\return True if loading succeeded, else false. */
|
||||
virtual bool loadGUI(io::IReadFile* file, IGUIElement* parent=0) = 0;
|
||||
|
||||
//! Writes attributes of the gui environment
|
||||
|
|
|
@ -23,6 +23,10 @@ namespace gui
|
|||
|
||||
//! Returns the filename of the selected file. Returns NULL, if no file was selected.
|
||||
virtual const wchar_t* getFileName() const = 0;
|
||||
|
||||
//! Returns the directory of the selected file. Returns NULL, if no directory was selected.
|
||||
virtual const core::string<c16>& getDirectoryName() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class IGUIFont : public virtual IReferenceCounted
|
|||
{
|
||||
public:
|
||||
|
||||
//! Draws an text and clips it to the specified rectangle if wanted.
|
||||
//! Draws some text and clips it to the specified rectangle if wanted.
|
||||
/** \param text: Text to draw
|
||||
\param position: Rectangle specifying position where to draw the text.
|
||||
\param color: Color of the text
|
||||
|
@ -51,7 +51,7 @@ public:
|
|||
video::SColor color, bool hcenter=false, bool vcenter=false,
|
||||
const core::rect<s32>* clip=0) = 0;
|
||||
|
||||
//! Calculates the dimension of a text.
|
||||
//! Calculates the width and height of a given string of text.
|
||||
/** \return Returns width and height of the area covered by the text if
|
||||
it would be drawn. */
|
||||
virtual core::dimension2d<u32> getDimension(const wchar_t* text) const = 0;
|
||||
|
@ -74,17 +74,26 @@ public:
|
|||
|
||||
//! Gets kerning values (distance between letters) for the font. If no parameters are provided,
|
||||
/** the global kerning distance is returned.
|
||||
\param thisLetter: If this parameter is provided, the left side kerning for this letter is added
|
||||
to the global kerning value. For example, a space might only be one pixel wide, but it may
|
||||
be displayed as several pixels.
|
||||
\param previousLetter: If provided, kerning is calculated for both letters and added to the global
|
||||
kerning value. For example, in a font which supports kerning pairs a string such as 'Wo' may have
|
||||
the 'o' tucked neatly under the 'W'.
|
||||
\param thisLetter: If this parameter is provided, the left side kerning
|
||||
for this letter is added to the global kerning value. For example, a
|
||||
space might only be one pixel wide, but it may be displayed as several
|
||||
pixels.
|
||||
\param previousLetter: If provided, kerning is calculated for both
|
||||
letters and added to the global kerning value. For example, in a font
|
||||
which supports kerning pairs a string such as 'Wo' may have the 'o'
|
||||
tucked neatly under the 'W'.
|
||||
*/
|
||||
virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const = 0;
|
||||
|
||||
//! Returns the distance between letters
|
||||
virtual s32 getKerningHeight() const = 0;
|
||||
|
||||
//! Define which characters should not be drawn by the font.
|
||||
/** For example " " would not draw any space which is usually blank in
|
||||
most fonts.
|
||||
\param invisible: string of symbols, which are not send down to the videodriver
|
||||
*/
|
||||
virtual void setInvisibleCharacters( const wchar_t *s ) = 0;
|
||||
};
|
||||
|
||||
} // end namespace gui
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
// This file is part of the "Irrlicht Engine".
|
||||
// written by Reinhard Ostermeier, reinhard@nospam.r-ostermeier.de
|
||||
|
||||
#ifndef __I_GUI_IMAGE_LIST_H_INCLUDED__
|
||||
#define __I_GUI_IMAGE_LIST_H_INCLUDED__
|
||||
|
||||
#include "IGUIElement.h"
|
||||
#include "rect.h"
|
||||
#include "irrTypes.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
//! Font interface.
|
||||
class IGUIImageList : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor
|
||||
virtual ~IGUIImageList() {};
|
||||
|
||||
//! Draws an image and clips it to the specified rectangle if wanted
|
||||
//! \param index: Index of the image
|
||||
//! \param destPos: Position of the image to draw
|
||||
//! \param clip: Optional pointer to a rectalgle against which the text will be clipped.
|
||||
//! If the pointer is null, no clipping will be done.
|
||||
virtual void draw( s32 index, const core::position2d<s32>& destPos,
|
||||
const core::rect<s32>* clip = 0 ) = 0;
|
||||
|
||||
//! Returns the count of Images in the list.
|
||||
//! \return Returns the count of Images in the list.
|
||||
virtual s32 getImageCount() const = 0;
|
||||
|
||||
//! Returns the size of the images in the list.
|
||||
//! \return Returns the size of the images in the list.
|
||||
virtual core::dimension2d<s32> getImageSize() const = 0;
|
||||
};
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
|
@ -75,6 +75,9 @@ namespace gui
|
|||
//! sets the selected item. Set this to -1 if no item should be selected
|
||||
virtual void setSelected(s32 index) = 0;
|
||||
|
||||
//! sets the selected item. Set this to 0 if no item should be selected
|
||||
virtual void setSelected(const wchar_t *item) = 0;
|
||||
|
||||
//! set whether the listbox should scroll to new or newly selected items
|
||||
virtual void setAutoScrollEnabled(bool scroll) = 0;
|
||||
|
||||
|
@ -111,6 +114,10 @@ namespace gui
|
|||
|
||||
//! Swap the items at the given indices
|
||||
virtual void swapItems(u32 index1, u32 index2) = 0;
|
||||
|
||||
//! set global itemHeight
|
||||
virtual void setItemHeight( s32 height ) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -21,11 +21,15 @@ namespace gui
|
|||
IGUIScrollBar(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
|
||||
: IGUIElement(EGUIET_SCROLL_BAR, environment, parent, id, rectangle) {}
|
||||
|
||||
//! sets the maximum value of the scrollbar.
|
||||
virtual void setMax(s32 max) = 0;
|
||||
//! gets the maximum value of the scrollbar.
|
||||
virtual s32 getMax() const = 0;
|
||||
|
||||
//! sets the maximum value of the scrollbar.
|
||||
virtual void setMax(s32 max) = 0;
|
||||
virtual void setMin(s32 max) = 0;
|
||||
//! gets the maximum value of the scrollbar.
|
||||
virtual s32 getMin() const = 0;
|
||||
|
||||
//! gets the small step value
|
||||
virtual s32 getSmallStep() const = 0;
|
||||
|
|
|
@ -1,65 +1,65 @@
|
|||
// Copyright (C) 2006-2009 Michael Zeilfelder
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_GUI_SPIN_BOX_H_INCLUDED__
|
||||
#define __I_GUI_SPIN_BOX_H_INCLUDED__
|
||||
|
||||
#include "IGUIElement.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
class IGUIEditBox;
|
||||
|
||||
//! Single line edit box + spin buttons
|
||||
class IGUISpinBox : public IGUIElement
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
IGUISpinBox(IGUIEnvironment* environment, IGUIElement* parent,
|
||||
s32 id, core::rect<s32> rectangle)
|
||||
: IGUIElement(EGUIET_SPIN_BOX, environment, parent, id, rectangle) {}
|
||||
|
||||
//! Access the edit box used in the spin control
|
||||
virtual IGUIEditBox* getEditBox() const = 0;
|
||||
|
||||
//! set the current value of the spinbox
|
||||
/** \param val: value to be set in the spinbox */
|
||||
virtual void setValue(f32 val) = 0;
|
||||
|
||||
//! Get the current value of the spinbox
|
||||
virtual f32 getValue() const = 0;
|
||||
|
||||
//! set the range of values which can be used in the spinbox
|
||||
/** \param min: minimum value
|
||||
\param max: maximum value */
|
||||
virtual void setRange(f32 min, f32 max) = 0;
|
||||
|
||||
//! get the minimum value which can be used in the spinbox
|
||||
virtual f32 getMin() const = 0;
|
||||
|
||||
//! get the maximum value which can be used in the spinbox
|
||||
virtual f32 getMax() const = 0;
|
||||
|
||||
//! Step size by which values are changed when pressing the spinbuttons
|
||||
/** The step size also determines the number of decimal places to display
|
||||
\param step: stepsize used for value changes when pressing spinbuttons */
|
||||
virtual void setStepSize(f32 step=1.f) = 0;
|
||||
|
||||
//! Sets the number of decimal places to display.
|
||||
/** \param places: The number of decimal places to display, use -1 to reset */
|
||||
virtual void setDecimalPlaces(s32 places) = 0;
|
||||
|
||||
//! get the current step size
|
||||
virtual f32 getStepSize() const = 0;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
#endif // __I_GUI_SPIN_BOX_H_INCLUDED__
|
||||
|
||||
// Copyright (C) 2006-2009 Michael Zeilfelder
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_GUI_SPIN_BOX_H_INCLUDED__
|
||||
#define __I_GUI_SPIN_BOX_H_INCLUDED__
|
||||
|
||||
#include "IGUIElement.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
class IGUIEditBox;
|
||||
|
||||
//! Single line edit box + spin buttons
|
||||
class IGUISpinBox : public IGUIElement
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
IGUISpinBox(IGUIEnvironment* environment, IGUIElement* parent,
|
||||
s32 id, core::rect<s32> rectangle)
|
||||
: IGUIElement(EGUIET_SPIN_BOX, environment, parent, id, rectangle) {}
|
||||
|
||||
//! Access the edit box used in the spin control
|
||||
virtual IGUIEditBox* getEditBox() const = 0;
|
||||
|
||||
//! set the current value of the spinbox
|
||||
/** \param val: value to be set in the spinbox */
|
||||
virtual void setValue(f32 val) = 0;
|
||||
|
||||
//! Get the current value of the spinbox
|
||||
virtual f32 getValue() const = 0;
|
||||
|
||||
//! set the range of values which can be used in the spinbox
|
||||
/** \param min: minimum value
|
||||
\param max: maximum value */
|
||||
virtual void setRange(f32 min, f32 max) = 0;
|
||||
|
||||
//! get the minimum value which can be used in the spinbox
|
||||
virtual f32 getMin() const = 0;
|
||||
|
||||
//! get the maximum value which can be used in the spinbox
|
||||
virtual f32 getMax() const = 0;
|
||||
|
||||
//! Step size by which values are changed when pressing the spinbuttons
|
||||
/** The step size also determines the number of decimal places to display
|
||||
\param step: stepsize used for value changes when pressing spinbuttons */
|
||||
virtual void setStepSize(f32 step=1.f) = 0;
|
||||
|
||||
//! Sets the number of decimal places to display.
|
||||
/** \param places: The number of decimal places to display, use -1 to reset */
|
||||
virtual void setDecimalPlaces(s32 places) = 0;
|
||||
|
||||
//! get the current step size
|
||||
virtual f32 getStepSize() const = 0;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
#endif // __I_GUI_SPIN_BOX_H_INCLUDED__
|
||||
|
||||
|
|
|
@ -127,7 +127,10 @@ namespace gui
|
|||
//! Returns which row is currently selected
|
||||
virtual s32 getSelected() const = 0;
|
||||
|
||||
//! Returns amount of rows in the tabcontrol
|
||||
//! set wich row is currently selected
|
||||
virtual void setSelected( s32 index ) = 0;
|
||||
|
||||
//! Get amount of rows in the tabcontrol
|
||||
virtual s32 getRowCount() const = 0;
|
||||
|
||||
//! adds a row to the table
|
||||
|
@ -136,8 +139,9 @@ namespace gui
|
|||
will be placed after it. If the row is larger than the actual
|
||||
number of row by more than one, it won't be created. Note that
|
||||
if you create a row that's not at the end, there might be
|
||||
performance issues. */
|
||||
virtual void addRow(u32 rowIndex) = 0;
|
||||
performance issues.
|
||||
\return index of inserted row. */
|
||||
virtual u32 addRow(u32 rowIndex) = 0;
|
||||
|
||||
//! Remove a row from the table
|
||||
virtual void removeRow(u32 rowIndex) = 0;
|
||||
|
@ -158,10 +162,10 @@ namespace gui
|
|||
virtual void orderRows(s32 columnIndex=-1, EGUI_ORDERING_MODE mode=EGOM_NONE) = 0;
|
||||
|
||||
//! Set the text of a cell
|
||||
virtual void setCellText(u32 rowIndex, u32 columnIndex, const wchar_t* text) = 0;
|
||||
virtual void setCellText(u32 rowIndex, u32 columnIndex, const core::stringw& text) = 0;
|
||||
|
||||
//! Set the text of a cell, and set a color of this cell.
|
||||
virtual void setCellText(u32 rowIndex, u32 columnIndex, const wchar_t* text, video::SColor color) = 0;
|
||||
virtual void setCellText(u32 rowIndex, u32 columnIndex, const core::stringw& text, video::SColor color) = 0;
|
||||
|
||||
//! Set the data of a cell
|
||||
virtual void setCellData(u32 rowIndex, u32 columnIndex, void *data) = 0;
|
||||
|
|
|
@ -0,0 +1,277 @@
|
|||
// This file is part of the "Irrlicht Engine".
|
||||
// written by Reinhard Ostermeier, reinhard@nospam.r-ostermeier.de
|
||||
|
||||
#ifndef __I_GUI_TREE_VIEW_H_INCLUDED__
|
||||
#define __I_GUI_TREE_VIEW_H_INCLUDED__
|
||||
|
||||
#include "IGUIElement.h"
|
||||
#include "IGUIImageList.h"
|
||||
#include "irrTypes.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
class IGUIFont;
|
||||
class IGUITreeView;
|
||||
|
||||
|
||||
//! Node for gui tree view
|
||||
class IGUITreeViewNode : public IReferenceCounted
|
||||
{
|
||||
public:
|
||||
//! constructor
|
||||
IGUITreeViewNode() {}
|
||||
|
||||
//! destructor
|
||||
virtual ~IGUITreeViewNode() {}
|
||||
|
||||
//! returns the owner (tree view) of this node
|
||||
virtual IGUITreeView* getOwner() const = 0;
|
||||
|
||||
//! Returns the parent node of this node.
|
||||
//! For the root node this will return 0.
|
||||
virtual IGUITreeViewNode* getParent() const = 0;
|
||||
|
||||
//! returns the text of the node
|
||||
virtual const wchar_t* getText() const = 0;
|
||||
|
||||
//! sets the text of the node
|
||||
virtual void setText( const wchar_t* text ) = 0;
|
||||
|
||||
//! returns the icon text of the node
|
||||
virtual const wchar_t* getIcon() const = 0;
|
||||
|
||||
//! sets the icon text of the node
|
||||
virtual void setIcon( const wchar_t* icon ) = 0;
|
||||
|
||||
//! returns the image index of the node
|
||||
virtual u32 getImageIndex() const = 0;
|
||||
|
||||
//! sets the image index of the node
|
||||
virtual void setImageIndex( u32 imageIndex ) = 0;
|
||||
|
||||
//! returns the image index of the node
|
||||
virtual u32 getSelectedImageIndex() const = 0;
|
||||
|
||||
//! sets the image index of the node
|
||||
virtual void setSelectedImageIndex( u32 imageIndex ) = 0;
|
||||
|
||||
//! returns the user data (void*) of this node
|
||||
virtual void* getData() const = 0;
|
||||
|
||||
//! sets the user data (void*) of this node
|
||||
virtual void setData( void* data ) = 0;
|
||||
|
||||
//! returns the user data2 (IReferenceCounted) of this node
|
||||
virtual IReferenceCounted* getData2() const = 0;
|
||||
|
||||
//! sets the user data2 (IReferenceCounted) of this node
|
||||
virtual void setData2( IReferenceCounted* data ) = 0;
|
||||
|
||||
//! returns the child item count
|
||||
virtual u32 getChildCount() const = 0;
|
||||
|
||||
//! removes all childs (recursive) from this node
|
||||
virtual void clearChilds() = 0;
|
||||
|
||||
//! returns true if this node has child nodes
|
||||
virtual bool hasChilds() const = 0;
|
||||
|
||||
//! Adds a new node behind the last child node.
|
||||
//! \param text text of the new node
|
||||
//! \param icon icon text of the new node
|
||||
//! \param imageIndex index of the image for the new node (-1 = none)
|
||||
//! \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
|
||||
//! \param data user data (void*) of the new node
|
||||
//! \param data2 user data2 (IReferenceCounted*) of the new node
|
||||
//! \return
|
||||
//! returns the new node
|
||||
virtual IGUITreeViewNode* addChildBack(
|
||||
const wchar_t* text,
|
||||
const wchar_t* icon = 0,
|
||||
s32 imageIndex = -1,
|
||||
s32 selectedImageIndex = -1,
|
||||
void* data = 0,
|
||||
IReferenceCounted* data2 = 0 ) = 0;
|
||||
|
||||
//! Adds a new node before the first child node.
|
||||
//! \param text text of the new node
|
||||
//! \param icon icon text of the new node
|
||||
//! \param imageIndex index of the image for the new node (-1 = none)
|
||||
//! \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
|
||||
//! \param data user data (void*) of the new node
|
||||
//! \param data2 user data2 (IReferenceCounted*) of the new node
|
||||
//! \return
|
||||
//! returns the new node
|
||||
virtual IGUITreeViewNode* addChildFront(
|
||||
const wchar_t* text,
|
||||
const wchar_t* icon = 0,
|
||||
s32 imageIndex = -1,
|
||||
s32 selectedImageIndex = -1,
|
||||
void* data = 0,
|
||||
IReferenceCounted* data2 = 0 ) = 0;
|
||||
|
||||
//! Adds a new node behind the other node.
|
||||
//! The other node has also te be a child node from this node.
|
||||
//! \param text text of the new node
|
||||
//! \param icon icon text of the new node
|
||||
//! \param imageIndex index of the image for the new node (-1 = none)
|
||||
//! \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
|
||||
//! \param data user data (void*) of the new node
|
||||
//! \param data2 user data2 (IReferenceCounted*) of the new node
|
||||
//! \return
|
||||
//! returns the new node or 0 if other is no child node from this
|
||||
virtual IGUITreeViewNode* insertChildAfter(
|
||||
IGUITreeViewNode* other,
|
||||
const wchar_t* text,
|
||||
const wchar_t* icon = 0,
|
||||
s32 imageIndex = -1,
|
||||
s32 selectedImageIndex = -1,
|
||||
void* data = 0,
|
||||
IReferenceCounted* data2 = 0 ) = 0;
|
||||
|
||||
//! Adds a new node before the other node.
|
||||
//! The other node has also te be a child node from this node.
|
||||
//! \param text text of the new node
|
||||
//! \param icon icon text of the new node
|
||||
//! \param imageIndex index of the image for the new node (-1 = none)
|
||||
//! \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
|
||||
//! \param data user data (void*) of the new node
|
||||
//! \param data2 user data2 (IReferenceCounted*) of the new node
|
||||
//! \return
|
||||
//! returns the new node or 0 if other is no child node from this
|
||||
virtual IGUITreeViewNode* insertChildBefore(
|
||||
IGUITreeViewNode* other,
|
||||
const wchar_t* text,
|
||||
const wchar_t* icon = 0,
|
||||
s32 imageIndex = -1,
|
||||
s32 selectedImageIndex = -1,
|
||||
void* data = 0,
|
||||
IReferenceCounted* data2 = 0 ) = 0;
|
||||
|
||||
//! Return the first child node from this node.
|
||||
//! \return
|
||||
//! Returns the first child node or 0 if this node has no childs.
|
||||
virtual IGUITreeViewNode* getFirstChild() const = 0;
|
||||
|
||||
//! Return the last child node from this node.
|
||||
//! \return
|
||||
//! Returns the last child node or 0 if this node has no childs.
|
||||
virtual IGUITreeViewNode* getLastChild() const = 0;
|
||||
|
||||
//! Returns the preverse sibling node from this node.
|
||||
//! \return
|
||||
//! Returns the preverse sibling node from this node or 0 if this is
|
||||
//! the first node from the parent node.
|
||||
virtual IGUITreeViewNode* getPrevSibling() const = 0;
|
||||
|
||||
//! Returns the next sibling node from this node.
|
||||
//! \return
|
||||
//! Returns the next sibling node from this node or 0 if this is
|
||||
//! the last node from the parent node.
|
||||
virtual IGUITreeViewNode* getNextSibling() const = 0;
|
||||
|
||||
//! Returns the next visible (expanded, may be out of scrolling) node from this node.
|
||||
//! \return
|
||||
//! Returns the next visible node from this node or 0 if this is
|
||||
//! the last visible node.
|
||||
virtual IGUITreeViewNode* getNextVisible() const = 0;
|
||||
|
||||
//! Deletes a child node.
|
||||
// \return
|
||||
//! Returns true if the node was found as a child and is deleted.
|
||||
virtual bool deleteChild( IGUITreeViewNode* child ) = 0;
|
||||
|
||||
//! Moves a child node one position up.
|
||||
//! \return
|
||||
//! Returns true if the node was found as achild node and was not already the first child.
|
||||
virtual bool moveChildUp( IGUITreeViewNode* child ) = 0;
|
||||
|
||||
//! Moves a child node one position down.
|
||||
//! \return
|
||||
//! Returns true if the node was found as achild node and was not already the last child.
|
||||
virtual bool moveChildDown( IGUITreeViewNode* child ) = 0;
|
||||
|
||||
//! Returns true if the node is expanded (childs are visible).
|
||||
virtual bool getExpanded() const = 0;
|
||||
|
||||
//! Sets if the node is expanded.
|
||||
virtual void setExpanded( bool expanded ) = 0;
|
||||
|
||||
//! Returns true if the node is currently selected.
|
||||
virtual bool getSelected() const = 0;
|
||||
|
||||
//! Sets this node as selected.
|
||||
virtual void setSelected( bool selected ) = 0;
|
||||
|
||||
//! Returns true if this node is the root node.
|
||||
virtual bool isRoot() const = 0;
|
||||
|
||||
//! Returns the level of this node.
|
||||
//! The root node has level 0. Direct childs of the root has level 1 ...
|
||||
virtual s32 getLevel() const = 0;
|
||||
|
||||
//! Returns true if this node is visible (all parents are expanded).
|
||||
virtual bool isVisible() const = 0;
|
||||
};
|
||||
|
||||
|
||||
//! Default tree view GUI element.
|
||||
//! Displays a windows like tree buttons to expand/collaps the child nodes of an node
|
||||
//! and optional tree lines.
|
||||
//! Each node consits of an text, an icon text and a void pointer for user data.
|
||||
class IGUITreeView : public IGUIElement
|
||||
{
|
||||
public:
|
||||
//! constructor
|
||||
IGUITreeView( IGUIEnvironment* environment, IGUIElement* parent, s32 id,
|
||||
core::rect<s32> rectangle )
|
||||
: IGUIElement( EGUIET_TREE_VIEW, environment, parent, id, rectangle ) {}
|
||||
|
||||
//! destructor
|
||||
virtual ~IGUITreeView() {}
|
||||
|
||||
//! returns the root node (not visible) from the tree.
|
||||
virtual IGUITreeViewNode* getRoot() const = 0;
|
||||
|
||||
//! returns the selected node of the tree or 0 if none is selected
|
||||
virtual IGUITreeViewNode* getSelected() const = 0;
|
||||
|
||||
//! returns true if the tree lines are visible
|
||||
virtual bool getLinesVisible() const = 0;
|
||||
|
||||
//! sets if the tree lines are visible
|
||||
//! \param visible true for visible, false for invisible
|
||||
virtual void setLinesVisible( bool visible ) = 0;
|
||||
|
||||
//! Sets the font which should be used as icon font. This font is set to the Irrlicht engine
|
||||
//! built-in-font by default. Icons can be displayed in front of every list item.
|
||||
//! An icon is a string, displayed with the icon font. When using the build-in-font of the
|
||||
//! Irrlicht engine as icon font, the icon strings defined in GUIIcons.h can be used.
|
||||
virtual void setIconFont( IGUIFont* font ) = 0;
|
||||
|
||||
//! Sets the image list which should be used for the image and selected image of every node.
|
||||
//! The default is 0 (no images).
|
||||
virtual void setImageList( IGUIImageList* imageList ) = 0;
|
||||
|
||||
//! Returns the image list which is used for the nodes.
|
||||
virtual IGUIImageList* getImageList() const = 0;
|
||||
|
||||
//! Sets if the image is left of the icon. Default is true.
|
||||
virtual void setImageLeftOfIcon( bool bLeftOf ) = 0;
|
||||
|
||||
//! Returns if the Image is left of the icon. Default is true.
|
||||
virtual bool getImageLeftOfIcon() const = 0;
|
||||
|
||||
//! Returns the node which is associated to the last event.
|
||||
//! This pointer is only valid inside the OnEvent call!
|
||||
virtual IGUITreeViewNode* getLastEventNode() const = 0;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue