Merged from 1.4 branch revisions 1316:1328.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1329 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
cf0038ca5a
commit
755e117078
|
@ -24,91 +24,226 @@ using namespace gui;
|
|||
#pragma comment(lib, "Irrlicht.lib")
|
||||
#endif
|
||||
|
||||
gui::IGUIButton *buttonMain;
|
||||
gui::IGUIWindow *windowMain;
|
||||
bool isWindowMinimized = false;
|
||||
|
||||
class : public IEventReceiver
|
||||
IrrlichtDevice *device = 0;
|
||||
s32 cnt = 0;
|
||||
IGUIListBox* listbox = 0;
|
||||
|
||||
|
||||
/*
|
||||
The Event Receiver is not only capable of getting keyboard and
|
||||
mouse input events, but also events of the graphical user interface
|
||||
(gui). There are events for almost everything: Button click,
|
||||
Listbox selection change, events that say that a element was hovered
|
||||
and so on. To be able to react to some of these events, we create
|
||||
an event receiver.
|
||||
We only react to gui events, and if it's such an event, we get the
|
||||
id of the caller (the gui element which caused the event) and get
|
||||
the pointer to the gui environment.
|
||||
*/
|
||||
class MyEventReceiver : public IEventReceiver
|
||||
{
|
||||
virtual bool OnEvent(const SEvent& event)
|
||||
{
|
||||
static s32 windowHeight;
|
||||
public:
|
||||
virtual bool OnEvent(const SEvent& event)
|
||||
{
|
||||
if (event.EventType == EET_GUI_EVENT)
|
||||
{
|
||||
s32 id = event.GUIEvent.Caller->getID();
|
||||
IGUIEnvironment* env = device->getGUIEnvironment();
|
||||
|
||||
if (event.EventType==EET_GUI_EVENT)
|
||||
{
|
||||
if (event.GUIEvent.EventType==gui::EGET_BUTTON_CLICKED)
|
||||
{
|
||||
if (event.GUIEvent.Caller==buttonMain)
|
||||
{
|
||||
isWindowMinimized = !isWindowMinimized;
|
||||
switch(event.GUIEvent.EventType)
|
||||
{
|
||||
|
||||
rect<s32> pos = windowMain->getRelativePosition();
|
||||
if (isWindowMinimized)
|
||||
{
|
||||
windowHeight = pos.LowerRightCorner.Y - pos.UpperLeftCorner.Y;
|
||||
pos.LowerRightCorner.Y = pos.UpperLeftCorner.Y + 22;
|
||||
} else {
|
||||
pos.LowerRightCorner.Y = pos.UpperLeftCorner.Y + windowHeight;
|
||||
}
|
||||
/*
|
||||
If a scrollbar changed its scroll position, and it is 'our'
|
||||
scrollbar (the one with id 104), then we change the
|
||||
transparency of all gui elements. This is a very easy task:
|
||||
There is a skin object, in which all color settings are stored.
|
||||
We simply go through all colors stored in the skin and change
|
||||
their alpha value.
|
||||
*/
|
||||
case EGET_SCROLL_BAR_CHANGED:
|
||||
if (id == 104)
|
||||
{
|
||||
s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos();
|
||||
|
||||
for (u32 i=0; i<EGDC_COUNT ; ++i)
|
||||
{
|
||||
SColor col = env->getSkin()->getColor((EGUI_DEFAULT_COLOR)i);
|
||||
col.setAlpha(pos);
|
||||
env->getSkin()->setColor((EGUI_DEFAULT_COLOR)i, col);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
windowMain->setRelativePosition(pos);
|
||||
/*
|
||||
If a button was clicked, it could be one of 'our'
|
||||
three buttons. If it is the first, we shut down the engine.
|
||||
If it is the second, we create a little window with some
|
||||
text on it. We also add a string to the list box to log
|
||||
what happened. And if it is the third button, we create
|
||||
a file open dialog, and add also this as string to the list box.
|
||||
That's all for the event receiver.
|
||||
*/
|
||||
case EGET_BUTTON_CLICKED:
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (id == 101)
|
||||
{
|
||||
device->closeDevice();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
} eventReceiver;
|
||||
if (id == 102)
|
||||
{
|
||||
listbox->addItem(L"Window created");
|
||||
cnt += 30;
|
||||
if (cnt > 200)
|
||||
cnt = 0;
|
||||
|
||||
IGUIWindow* window = env->addWindow(
|
||||
rect<s32>(100 + cnt, 100 + cnt, 300 + cnt, 200 + cnt),
|
||||
false, // modal?
|
||||
L"Test window");
|
||||
|
||||
env->addStaticText(L"Please close me",
|
||||
rect<s32>(35,35,140,50),
|
||||
true, // border?
|
||||
false, // wordwrap?
|
||||
window);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (id == 103)
|
||||
{
|
||||
listbox->addItem(L"File open");
|
||||
env->addFileOpenDialog(L"Please choose a file.");
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Ok, now for the more interesting part. First, create the
|
||||
Irrlicht device. As in some examples before, we ask the user which
|
||||
driver he wants to use for this example:
|
||||
*/
|
||||
int main()
|
||||
{
|
||||
// irr device and pointers
|
||||
IrrlichtDevice *irrDevice = createDevice(video::EDT_DIRECT3D9);
|
||||
video::IVideoDriver *irrVideo = irrDevice->getVideoDriver();
|
||||
gui::IGUIEnvironment *irrGUI = irrDevice->getGUIEnvironment();
|
||||
// ask user for driver
|
||||
|
||||
video::E_DRIVER_TYPE driverType;
|
||||
|
||||
irrDevice->setEventReceiver(&eventReceiver);
|
||||
printf("Please select the driver you want for this example:\n"\
|
||||
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
|
||||
" (d) Software Renderer\n (e) Burning's Software Renderer\n"\
|
||||
" (f) NullDevice\n (otherKey) exit\n\n");
|
||||
|
||||
// gui mass
|
||||
|
||||
buttonMain = irrGUI->addButton(rect<s32>(4,4,100,40), 0, -1, L"CLICK ME");
|
||||
windowMain = irrGUI->addWindow(rect<s32>(40,40,400,400), false, L"Main Window");
|
||||
char i;
|
||||
std::cin >> i;
|
||||
|
||||
irrGUI->addButton(rect<s32>(4,24,100,40), windowMain, -1, L"button");
|
||||
irrGUI->addCheckBox(true, rect<s32>(4,40,100,60), windowMain);
|
||||
irrGUI->addComboBox(rect<s32>(4,60,100,80), windowMain)->addItem(L"item");
|
||||
irrGUI->addEditBox(L"test", rect<s32>(4,80,100,100), true, windowMain);
|
||||
irrGUI->addImage(rect<s32>(4,100,100,120), windowMain);
|
||||
irrGUI->addListBox(rect<s32>(4,120,100,160), windowMain)->addItem(L"item");
|
||||
gui::IGUIContextMenu *m = irrGUI->addMenu(windowMain);
|
||||
m->setMinSize(dimension2di(100,40));
|
||||
m->addItem(L"menuitem1");
|
||||
m->addItem(L"menuitem2");
|
||||
irrGUI->addMeshViewer(rect<s32>(4,160,100,180), windowMain);
|
||||
irrGUI->addScrollBar(true, rect<s32>(4,180,100,200), windowMain);
|
||||
irrGUI->addSpinBox(L"spinbox", rect<s32>(4,200,100,220), windowMain);
|
||||
irrGUI->addStaticText(L"statictext", rect<s32>(4,220,100,240), false, true, windowMain);
|
||||
irrGUI->addTabControl(rect<s32>(120,24,220,64), windowMain);
|
||||
// irrGUI->addTable(rect<s32>(120,80,220,120), windowMain)->addColumn(L"column1");
|
||||
gui::IGUIToolBar *t = irrGUI->addToolBar(windowMain);
|
||||
t->setMinSize(dimension2di(100,80));
|
||||
t->addButton(-1, L"toolbarButton1");
|
||||
t->addButton(-1, L"toolbarButton2");
|
||||
irrGUI->addWindow(rect<s32>(120,150,250,300), false, L"testWindow", windowMain);
|
||||
switch(i)
|
||||
{
|
||||
case 'a': driverType = video::EDT_DIRECT3D9;break;
|
||||
case 'b': driverType = video::EDT_DIRECT3D8;break;
|
||||
case 'c': driverType = video::EDT_OPENGL; break;
|
||||
case 'd': driverType = video::EDT_SOFTWARE; break;
|
||||
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
|
||||
case 'f': driverType = video::EDT_NULL; break;
|
||||
default: return 1;
|
||||
}
|
||||
|
||||
// show time!
|
||||
while(irrDevice->run())
|
||||
if (irrDevice->isWindowActive())
|
||||
{
|
||||
irrVideo->beginScene(true, true, video::SColor(0x204060));
|
||||
irrGUI->drawAll();
|
||||
irrVideo->endScene();
|
||||
}
|
||||
// create device and exit if creation failed
|
||||
|
||||
// drop time
|
||||
irrDevice->drop();
|
||||
device = createDevice(driverType, core::dimension2d<s32>(640, 480));
|
||||
|
||||
return 0;
|
||||
}
|
||||
if (device == 0)
|
||||
return 1; // could not create selected driver.
|
||||
|
||||
/* The creation was successful, now we set the event receiver and
|
||||
store pointers to the driver and to the gui environment. */
|
||||
|
||||
MyEventReceiver receiver;
|
||||
device->setEventReceiver(&receiver);
|
||||
device->setWindowCaption(L"Irrlicht Engine - User Interface Demo");
|
||||
|
||||
video::IVideoDriver* driver = device->getVideoDriver();
|
||||
IGUIEnvironment* env = device->getGUIEnvironment();
|
||||
|
||||
/*
|
||||
To make the font a little bit nicer, we load an external font
|
||||
and set it as the new default font in the skin.
|
||||
To keep the standard font for tool tip text, we set it to
|
||||
the built-in font.
|
||||
*/
|
||||
|
||||
IGUISkin* skin = env->getSkin();
|
||||
IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp");
|
||||
if (font)
|
||||
skin->setFont(font);
|
||||
|
||||
skin->setFont(env->getBuiltInFont(), EGDF_TOOLTIP);
|
||||
|
||||
/*
|
||||
We add three buttons. The first one closes the engine. The second
|
||||
creates a window and the third opens a file open dialog. The third
|
||||
parameter is the id of the button, with which we can easily identify
|
||||
the button in the event receiver.
|
||||
*/
|
||||
|
||||
env->addButton(rect<s32>(10,240,110,240 + 32), 0, 101, L"Quit", L"Exits Program");
|
||||
env->addButton(rect<s32>(10,280,110,280 + 32), 0, 102, L"New Window", L"Launches a new Window");
|
||||
env->addButton(rect<s32>(10,320,110,320 + 32), 0, 103, L"File Open", L"Opens a file");
|
||||
|
||||
/*
|
||||
Now, we add a static text and a scrollbar, which modifies the
|
||||
transparency of all gui elements. We set the maximum value of
|
||||
the scrollbar to 255, because that's the maximal value for
|
||||
a color value.
|
||||
Then we create an other static text and a list box.
|
||||
*/
|
||||
|
||||
env->addStaticText(L"Transparent Control:", rect<s32>(150,20,350,40), true);
|
||||
IGUIScrollBar* scrollbar = env->addScrollBar(true, rect<s32>(150, 45, 350, 60), 0, 104);
|
||||
scrollbar->setMax(255);
|
||||
|
||||
// set scrollbar position to alpha value of an arbitrary element
|
||||
scrollbar->setPos(env->getSkin()->getColor(EGDC_WINDOW).getAlpha());
|
||||
|
||||
env->addStaticText(L"Logging ListBox:", rect<s32>(50,110,250,130), true);
|
||||
listbox = env->addListBox(rect<s32>(50, 140, 250, 210));
|
||||
env->addEditBox(L"Editable Text", rect<s32>(350, 80, 550, 100));
|
||||
|
||||
// add the engine logo
|
||||
env->addImage(driver->getTexture("../../media/irrlichtlogo2.png"),
|
||||
position2d<int>(10,10));
|
||||
|
||||
|
||||
/*
|
||||
That's all, we only have to draw everything.
|
||||
*/
|
||||
|
||||
while(device->run() && driver)
|
||||
if (device->isWindowActive())
|
||||
{
|
||||
driver->beginScene(true, true, SColor(0,200,200,200));
|
||||
|
||||
env->drawAll();
|
||||
|
||||
driver->endScene();
|
||||
}
|
||||
|
||||
device->drop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -244,7 +244,8 @@ public:
|
|||
/** \return
|
||||
Returns a pointer to the created mesh viewer. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIMeshViewer* addMeshViewer(const core::rect<s32>& rectangle, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
|
||||
virtual IGUIMeshViewer* addMeshViewer(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
|
||||
|
||||
//! Adds a file open dialog.
|
||||
/** \param modal: Defines if the dialog is modal. This means, that all other
|
||||
|
@ -272,7 +273,8 @@ public:
|
|||
\param rectangle is the position of the static text.
|
||||
\param border has to be set to true if the static text should have a 3d border.
|
||||
\param wordWrap specifies, if the text should be wrapped into multiple lines.
|
||||
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the fader directly in the environment.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the fader directly in the environment.
|
||||
\param id is a s32 to identify the static text element.
|
||||
\param fillBackground specifies if the background will be filled. Default: false.
|
||||
\return
|
||||
|
@ -290,7 +292,8 @@ public:
|
|||
\param text is the text to be displayed. Can be altered after creation with setText().
|
||||
\param rectangle is the position of the edit box.
|
||||
\param border has to be set to true if the edit box should have a 3d border.
|
||||
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the edit box directly in the environment.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the edit box directly in the environment.
|
||||
\param id is a s32 to identify the edit box.
|
||||
\return
|
||||
Returns a pointer to the created edit box. Returns 0 if an error occured.
|
||||
|
@ -302,7 +305,8 @@ public:
|
|||
/** An edit box with up and down buttons
|
||||
\param text is the text to be displayed. Can be altered after creation with setText().
|
||||
\param rectangle is the position of the spin box.
|
||||
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the spin box directly in the environment.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the spin box directly in the environment.
|
||||
\param id is a s32 to identify the spin box.
|
||||
\return
|
||||
Returns a pointer to the created spin box. Returns 0 if an error occured.
|
||||
|
@ -313,7 +317,8 @@ public:
|
|||
//! Adds an element for fading in or out.
|
||||
/* \param rectangle: Pointer to rectangle specifing the borders of the element.
|
||||
If the pointer is NULL, the whole screen is used.
|
||||
\param parent: Parent item of the element. E.g. a window. Set it to 0 to place the static text directly in the environment.
|
||||
\param parent: Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the static text directly in the environment.
|
||||
\param id: A s32 to identify the text.
|
||||
\return
|
||||
Returns a pointer to the created in-out-fader. Returns 0 if an error occured.
|
||||
|
@ -322,10 +327,12 @@ public:
|
|||
|
||||
//! Adds a tab control to the environment.
|
||||
/** \param rectangle is the position of the tab control.
|
||||
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the tab control directly in the environment.
|
||||
\param parent is the 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 should be drawn to.
|
||||
\param border specifiys if a flat 3d border should be drawn.
|
||||
This is usually not necesarry unless you don't place the control directly into the environment without a window as parent.
|
||||
\param border specifiys if a flat 3d border should be drawn. This is
|
||||
usually not necesarry unless you don't place the control directly into
|
||||
the environment without a window as parent.
|
||||
\param id is a s32 to identify the tab control.
|
||||
\return
|
||||
Returns a pointer to the created tab control element. Returns 0 if an error occured.
|
||||
|
@ -338,7 +345,8 @@ 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 is the position of the tab.
|
||||
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the tab directly in the environment.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the tab directly in the environment.
|
||||
\param id is a s32 to identify the tab. */
|
||||
virtual IGUITab* addTab(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
@ -346,26 +354,30 @@ public:
|
|||
//! Adds a context menu to the environment.
|
||||
/** \param rectangle is the position of the menu. Note that the menu is
|
||||
resizing itself based on what items you add.
|
||||
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the menu directly in the environment.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the menu directly in the environment.
|
||||
\param id is a s32 to identify the menu. */
|
||||
virtual IGUIContextMenu* addContextMenu(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a menu to the environment.
|
||||
/* This is like the menu you can find on top of most windows in modern graphical user interfaces.
|
||||
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the menu directly in the environment.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the menu directly in the environment.
|
||||
\param id is a s32 to identify the menu. */
|
||||
virtual IGUIContextMenu* addMenu(IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a toolbar to the environment.
|
||||
/** It is like a menu is always placed on top
|
||||
in its parent, and contains buttons.
|
||||
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the tool bar directly in the environment.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the tool bar directly in the environment.
|
||||
\param id is a s32 to identify the tool bar. */
|
||||
virtual IGUIToolBar* addToolBar(IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a combo box to the environment.
|
||||
/** \param parent is the parent item of the element. E.g. a window. Set it to 0 to place the combo box directly in the environment.
|
||||
/** \param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the combo box directly in the environment.
|
||||
\param id is a s32 to identify the combo box. */
|
||||
virtual IGUIComboBox* addComboBox(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
|
|
@ -17,10 +17,9 @@ namespace video
|
|||
class IVideoDriver;
|
||||
class IMaterialRendererServices;
|
||||
|
||||
//! Interface for material rendering. Can be used to extend the engine with new materials.
|
||||
/** Refer to IVideoDriver::addMaterialRenderer() for more informations on how to extend the engine
|
||||
with new materials.
|
||||
*/
|
||||
//! Interface for material rendering. Can be used to extend the engine with
|
||||
//! new materials. Refer to IVideoDriver::addMaterialRenderer() for more
|
||||
//! informations on how to extend the engine with new materials.
|
||||
class IMaterialRenderer : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
@ -28,41 +27,51 @@ public:
|
|||
//! destructor
|
||||
virtual ~IMaterialRenderer() {}
|
||||
|
||||
//! Called by the IVideoDriver implementation the let the renderer set its needed render states.
|
||||
//! Called by the IVideoDriver implementation the let the renderer set
|
||||
//! its needed render states.
|
||||
/** This is called during the IVideoDriver::setMaterial() call.
|
||||
When overriding this, you can set some renderstates or for example a vertex or pixel shader
|
||||
if you like.
|
||||
\param material: The new material parameters to be set. The renderer may change the material
|
||||
flags in this material. For example if this material does not accept the zbuffer = true, it
|
||||
can set it to false. This is useful, because in the next lastMaterial will be just the material
|
||||
in this call.
|
||||
\param lastMaterial: The material parameters which have been set before this material.
|
||||
\param resetAllRenderstates: True if all renderstates should really be reset. This is usually
|
||||
true if the last rendering mode was not a usual 3d rendering mode, but for example
|
||||
a 2d rendering mode.
|
||||
You should reset really all renderstates if this is true, no matter if the lastMaterial had
|
||||
some similar settings. This is used because in most cases, some common renderstates are not
|
||||
changed if they are already there, for example bilinear filtering, wireframe, gouraudshading,
|
||||
lighting, zbuffer, zwriteenable, backfaceculling and fogenable.
|
||||
\param services: Interface providing some methods for changing advanced, internal
|
||||
states of a IVideoDriver. */
|
||||
When overriding this, you can set some renderstates or for example a
|
||||
vertex or pixel shader if you like.
|
||||
\param material: The new material parameters to be set. The renderer
|
||||
may change the material flags in this material. For example if this
|
||||
material does not accept the zbuffer = true, it can set it to false.
|
||||
This is useful, because in the next lastMaterial will be just the
|
||||
material in this call.
|
||||
\param lastMaterial: The material parameters which have been set before
|
||||
this material.
|
||||
\param resetAllRenderstates: True if all renderstates should really be
|
||||
reset. This is usually true if the last rendering mode was not a usual
|
||||
3d rendering mode, but for example a 2d rendering mode.
|
||||
You should reset really all renderstates if this is true, no matter if
|
||||
the lastMaterial had some similar settings. This is used because in
|
||||
most cases, some common renderstates are not changed if they are
|
||||
already there, for example bilinear filtering, wireframe,
|
||||
gouraudshading, lighting, zbuffer, zwriteenable, backfaceculling and
|
||||
fogenable.
|
||||
\param services: Interface providing some methods for changing
|
||||
advanced, internal states of a IVideoDriver. */
|
||||
virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial,
|
||||
bool resetAllRenderstates, IMaterialRendererServices* services) {};
|
||||
|
||||
//! Called every time before a new bunch of geometry is being drawn using this material with
|
||||
//! for example drawIndexedTriangleList() call.
|
||||
/** OnSetMaterial should normally only be called if the renderer decides that the renderstates should be changed, it won't be called if for
|
||||
example two drawIndexedTriangleList() will be called with the same material set. This
|
||||
method will be called every time. This is useful for example for materials with shaders,
|
||||
which don't only set new renderstates but also shader constants.
|
||||
\param service: Pointer to interface providing methos for setting constants and other things.
|
||||
\param vtxtype: Vertex type with which the next rendering will be done. This can be used
|
||||
by the material renderer to set some specific optimized shaders or if this is an incompatible
|
||||
vertex type for this renderer, to refuse rendering for example.
|
||||
\return Returns true if everything is ok, and false if nothing should be rendered.
|
||||
The material renderer can choose to return false for example if he doesn't support the
|
||||
specified vertex type. This is actually done in D3D8 and D3D9 when using a
|
||||
normal mapped material with a vertex type other than EVT_TANGENTS. */
|
||||
//! Called every time before a new bunch of geometry is being drawn
|
||||
//! using this material with for example drawIndexedTriangleList() call.
|
||||
/** OnSetMaterial should normally only be called if the renderer decides
|
||||
that the renderstates should be changed, it won't be called if for
|
||||
example two drawIndexedTriangleList() will be called with the same
|
||||
material set. This method will be called every time. This is useful for
|
||||
example for materials with shaders, which don't only set new
|
||||
renderstates but also shader constants.
|
||||
\param service: Pointer to interface providing methos for setting
|
||||
constants and other things.
|
||||
\param vtxtype: Vertex type with which the next rendering will be done.
|
||||
This can be used by the material renderer to set some specific
|
||||
optimized shaders or if this is an incompatible vertex type for this
|
||||
renderer, to refuse rendering for example.
|
||||
\return Returns true if everything is ok, and false if nothing should
|
||||
be rendered. The material renderer can choose to return false for
|
||||
example if he doesn't support the specified vertex type. This is
|
||||
actually done in D3D8 and D3D9 when using a normal mapped material with
|
||||
a vertex type other than EVT_TANGENTS. */
|
||||
virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) { return true; };
|
||||
|
||||
//! Called by the IVideoDriver to unset this material.
|
||||
|
|
|
@ -118,20 +118,22 @@ namespace scene
|
|||
} // end namespace quake3
|
||||
|
||||
//! The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff.
|
||||
/** All Scene nodes can be created only here. There is a always growing list of scene
|
||||
nodes for lots of purposes: Indoor rendering scene nodes like the Octree
|
||||
(addOctTreeSceneNode()) or the terrain renderer (addTerrainSceneNode()),
|
||||
different Camera scene nodes (addCameraSceneNode(), addCameraSceneNodeMaya()),
|
||||
scene nodes for Light (addLightSceneNode()), Billboards (addBillboardSceneNode())
|
||||
and so on.
|
||||
A scene node is a node in the hierachical scene graph. Every scene node may have children,
|
||||
which are other scene nodes. Children move relative the their parents position. If the parent of a node is not
|
||||
visible, its children won't be visible, too. In this way, it is for example easily possible
|
||||
to attach a light to a moving car or to place a walking character on a moving platform
|
||||
on a moving ship.
|
||||
The SceneManager is also able to load 3d mesh files of different formats. Take a look
|
||||
at getMesh() to find out what formats are supported. And if these formats are not enough
|
||||
use addExternalMeshLoader() to add new formats to the engine.
|
||||
/** All Scene nodes can be created only here. There is a always growing
|
||||
list of scene nodes for lots of purposes: Indoor rendering scene nodes
|
||||
like the Octree (addOctTreeSceneNode()) or the terrain renderer
|
||||
(addTerrainSceneNode()), different Camera scene nodes
|
||||
(addCameraSceneNode(), addCameraSceneNodeMaya()), scene nodes for Light
|
||||
(addLightSceneNode()), Billboards (addBillboardSceneNode()) and so on.
|
||||
A scene node is a node in the hierachical scene graph. Every scene node
|
||||
may have children, which are other scene nodes. Children move relative
|
||||
the their parents position. If the parent of a node is not visible, its
|
||||
children won't be visible, too. In this way, it is for example easily
|
||||
possible to attach a light to a moving car or to place a walking
|
||||
character on a moving platform on a moving ship.
|
||||
The SceneManager is also able to load 3d mesh files of different
|
||||
formats. Take a look at getMesh() to find out what formats are
|
||||
supported. And if these formats are not enough use
|
||||
addExternalMeshLoader() to add new formats to the engine.
|
||||
*/
|
||||
class ISceneManager : public virtual IReferenceCounted
|
||||
{
|
||||
|
@ -151,128 +153,171 @@ namespace scene
|
|||
* </TR>
|
||||
* <TR>
|
||||
* <TD>3D Studio (.3ds)</TD>
|
||||
* <TD>Loader for 3D-Studio files which lots of 3D packages are able to export.
|
||||
* Only static meshes are currently supported by this importer. </TD>
|
||||
* <TD>Loader for 3D-Studio files which lots of 3D packages
|
||||
* are able to export. Only static meshes are currently
|
||||
* supported by this importer. </TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Bliz Basic B3D (.b3d)</TD>
|
||||
* <TD>Loader for blitz basic files, developed by Mark Sibly, also supports animations.</TD>
|
||||
* <TD>Loader for blitz basic files, developed by Mark
|
||||
* Sibly, also supports animations.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Cartography shop 4 (.csm)</TD>
|
||||
* <TD>Cartography Shop is a modeling program for creating architecture and calculating
|
||||
* lighting. Irrlicht can directly import .csm files thanks to the IrrCSM library
|
||||
* created by Saurav Mohapatra which is now integrated directly in Irrlicht.
|
||||
* If you are using this loader, please note that you'll have to set the path
|
||||
* of the textures before loading .csm files. You can do this using SceneManager->getParameters()->setParameter(scene::CSM_TEXTURE_PATH,
|
||||
* <TD>Cartography Shop is a modeling program for creating
|
||||
* architecture and calculating lighting. Irrlicht can
|
||||
* directly import .csm files thanks to the IrrCSM library
|
||||
* created by Saurav Mohapatra which is now integrated
|
||||
* directly in Irrlicht. If you are using this loader,
|
||||
* please note that you'll have to set the path of the
|
||||
* textures before loading .csm files. You can do this
|
||||
* using
|
||||
* SceneManager->getParameters()->setParameter(scene::CSM_TEXTURE_PATH,
|
||||
* "path/to/your/textures");</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>COLLADA (.dae, .xml)</TD>
|
||||
* <TD>COLLADA is an open Digital Asset Exchange Schema for the interactive 3D industry. There are
|
||||
* exporters and importers for this format available for most of the big 3d packages
|
||||
* at http://collada.org. Irrlicht can import COLLADA files by using the
|
||||
* ISceneManager::getMesh() method. COLLADA files need not contain only one single mesh
|
||||
* but multiple meshes and a whole scene setup with lights, cameras and mesh instances,
|
||||
* this loader can set up a scene as described by the COLLADA file instead of loading
|
||||
* and returning one single mesh. By default, this loader behaves like the other loaders
|
||||
* and does not create instances, but it can be switched into this mode by using
|
||||
* <TD>COLLADA is an open Digital Asset Exchange Schema for
|
||||
* the interactive 3D industry. There are exporters and
|
||||
* importers for this format available for most of the
|
||||
* big 3d packagesat http://collada.org. Irrlicht can
|
||||
* import COLLADA files by using the
|
||||
* ISceneManager::getMesh() method. COLLADA files need
|
||||
* not contain only one single mesh but multiple meshes
|
||||
* and a whole scene setup with lights, cameras and mesh
|
||||
* instances, this loader can set up a scene as
|
||||
* described by the COLLADA file instead of loading and
|
||||
* returning one single mesh. By default, this loader
|
||||
* behaves like the other loaders and does not create
|
||||
* instances, but it can be switched into this mode by
|
||||
* using
|
||||
* SceneManager->getParameters()->setParameter(COLLADA_CREATE_SCENE_INSTANCES, true);
|
||||
* Created scene nodes will be named as the names of the nodes in the
|
||||
* COLLADA file. The returned mesh is just a dummy object in this mode. Meshes included in
|
||||
* the scene will be added into the scene manager with the following naming scheme:
|
||||
* path/to/file/file.dea#meshname. The loading of such meshes is logged.
|
||||
* Currently, this loader is able to create meshes (made of only polygons), lights,
|
||||
* and cameras. Materials and animations are currently not supported but this will
|
||||
* change with future releases.
|
||||
* Created scene nodes will be named as the names of the
|
||||
* nodes in the COLLADA file. The returned mesh is just
|
||||
* a dummy object in this mode. Meshes included in the
|
||||
* scene will be added into the scene manager with the
|
||||
* following naming scheme:
|
||||
* path/to/file/file.dea#meshname. The loading of such
|
||||
* meshes is logged. Currently, this loader is able to
|
||||
* create meshes (made of only polygons), lights, and
|
||||
* cameras. Materials and animations are currently not
|
||||
* supported but this will change with future releases.
|
||||
* </TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Delgine DeleD (.dmf)</TD>
|
||||
* <TD>DeleD (delgine.com) is a 3D editor and level-editor combined into one and is specifically
|
||||
* designed for 3D game-development. With this loader, it is possible to directly load
|
||||
* all geometry is as well as textures and lightmaps from .dmf files. To set texture and
|
||||
* material paths, see scene::DMF_USE_MATERIALS_DIRS and scene::DMF_TEXTURE_PATH. It is also
|
||||
* possible to flip the alpha texture by setting scene::DMF_FLIP_ALPHA_TEXTURES to true and
|
||||
* to set the material transparent reference value by setting scene::DMF_ALPHA_CHANNEL_REF to
|
||||
* a float between 0 and 1. The loader is
|
||||
* based on Salvatore Russo's .dmf loader, I just changed some parts of it. Thanks to
|
||||
* Salvatore for his work and for allowing me to use his code in Irrlicht and put it under Irrlicht's
|
||||
* license. For newer and more enchanced versions of the loader, take a look at delgine.com.
|
||||
* <TD>DeleD (delgine.com) is a 3D editor and level-editor
|
||||
* combined into one and is specifically designed for 3D
|
||||
* game-development. With this loader, it is possible to
|
||||
* directly load all geometry is as well as textures and
|
||||
* lightmaps from .dmf files. To set texture and
|
||||
* material paths, see scene::DMF_USE_MATERIALS_DIRS and
|
||||
* scene::DMF_TEXTURE_PATH. It is also possible to flip
|
||||
* the alpha texture by setting
|
||||
* scene::DMF_FLIP_ALPHA_TEXTURES to true and to set the
|
||||
* material transparent reference value by setting
|
||||
* scene::DMF_ALPHA_CHANNEL_REF to a float between 0 and
|
||||
* 1. The loader is based on Salvatore Russo's .dmf
|
||||
* loader, I just changed some parts of it. Thanks to
|
||||
* Salvatore for his work and for allowing me to use his
|
||||
* code in Irrlicht and put it under Irrlicht's license.
|
||||
* For newer and more enchanced versions of the loader,
|
||||
* take a look at delgine.com.
|
||||
* </TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>DirectX (.x)</TD>
|
||||
* <TD>Platform independent importer (so not D3D-only) for .x files. Most 3D
|
||||
* packages can export these natively and there are several tools for them
|
||||
* available. (e.g. the Maya exporter included in the DX SDK) .x files can
|
||||
* include skeletal animations and Irrlicht is able to play and display them.
|
||||
* Currently, Irrlicht only supports uncompressed .x files.</TD>
|
||||
* <TD>Platform independent importer (so not D3D-only) for
|
||||
* .x files. Most 3D packages can export these natively
|
||||
* and there are several tools for them available, e.g.
|
||||
* the Maya exporter included in the DX SDK.
|
||||
* .x files can include skeletal animations and Irrlicht
|
||||
* is able to play and display them. Currently, Irrlicht
|
||||
* only supports uncompressed .x files.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Maya (.obj)</TD>
|
||||
* <TD>Most 3D software can create .obj files which contain static geometry without
|
||||
* material data. The material files .mtl are also supported. This importer
|
||||
* for Irrlicht can load them directly. </TD>
|
||||
* <TD>Most 3D software can create .obj files which contain
|
||||
* static geometry without material data. The material
|
||||
* files .mtl are also supported. This importer for
|
||||
* Irrlicht can load them directly. </TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Milkshape (.ms3d)</TD>
|
||||
* <TD>.MS3D files contain models and sometimes skeletal animations from the
|
||||
* Milkshape 3D modeling and animation software. This importer for Irrlicht
|
||||
* can display and/or animate these files. </TD>
|
||||
* <TD>.MS3D files contain models and sometimes skeletal
|
||||
* animations from the Milkshape 3D modeling and animation
|
||||
* software. This importer for Irrlicht can display and/or
|
||||
* animate these files. </TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>My3D (.my3d)</TD>
|
||||
* <TD>.my3D is a flexible 3D file format. The My3DTools contains plug-ins to
|
||||
* export .my3D files from several 3D packages. With this built-in importer,
|
||||
* Irrlicht can read and display those files directly. This loader was written
|
||||
* by Zhuck Dimitry who also created the whole My3DTools package. If you are using this loader, please
|
||||
* note that you can set the path of the textures before loading .my3d files.
|
||||
* You can do this using SceneManager->getParameters()->setParameter(scene::MY3D_TEXTURE_PATH,
|
||||
* "path/to/your/textures"); </TD>
|
||||
* <TD>.my3D is a flexible 3D file format. The My3DTools
|
||||
* contains plug-ins to export .my3D files from several
|
||||
* 3D packages. With this built-in importer, Irrlicht
|
||||
* can read and display those files directly. This
|
||||
* loader was written by Zhuck Dimitry who also created
|
||||
* the whole My3DTools package. If you are using this
|
||||
* loader, please note that you can set the path of the
|
||||
* textures before loading .my3d files. You can do this
|
||||
* using
|
||||
* SceneManager->getParameters()->setParameter(scene::MY3D_TEXTURE_PATH,
|
||||
* "path/to/your/textures");
|
||||
* </TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>OCT (.oct)</TD>
|
||||
* <TD>The oct file format contains 3D geometry and lightmaps and can be loaded
|
||||
* directly by Irrlicht. OCT files<br>
|
||||
* can be created by FSRad, Paul Nette's radiosity processor or exported from
|
||||
* Blender using OCTTools which can be found in the exporters/OCTTools directory
|
||||
* of the SDK. Thanks to Murphy McCauley for creating all this.</TD>
|
||||
* <TD>The oct file format contains 3D geometry and
|
||||
* lightmaps and can be loaded directly by Irrlicht. OCT
|
||||
* files<br> can be created by FSRad, Paul Nette's
|
||||
* radiosity processor or exported from Blender using
|
||||
* OCTTools which can be found in the exporters/OCTTools
|
||||
* directory of the SDK. Thanks to Murphy McCauley for
|
||||
* creating all this.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>OGRE Meshes (.mesh)</TD>
|
||||
* <TD>Ogre .mesh files contain 3D data for the OGRE 3D engine. Irrlicht can read and
|
||||
* display them directly with this importer. To define materials for the mesh,
|
||||
* copy a .material file named like the corresponding .mesh file where the .mesh
|
||||
* file is. (For example ogrehead.material for ogrehead.mesh). Thanks to Christian Stehno
|
||||
* who wrote and contributed this loader.</TD>
|
||||
* <TD>Ogre .mesh files contain 3D data for the OGRE 3D
|
||||
* engine. Irrlicht can read and display them directly
|
||||
* with this importer. To define materials for the mesh,
|
||||
* copy a .material file named like the corresponding
|
||||
* .mesh file where the .mesh file is. (For example
|
||||
* ogrehead.material for ogrehead.mesh). Thanks to
|
||||
* Christian Stehno who wrote and contributed this
|
||||
* loader.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Pulsar LMTools (.lmts)</TD>
|
||||
* <TD>LMTools is a set of tools (Windows & Linux) for creating lightmaps.
|
||||
* Irrlicht can directly read .lmts files thanks to<br>
|
||||
* the importer created by Jonas Petersen. If you are using this loader, please
|
||||
* note that you can set the path of the textures before loading .lmts files.
|
||||
* You can do this using SceneManager->getParameters()->setParameter(scene::LMTS_TEXTURE_PATH,
|
||||
* "path/to/your/textures"); Notes for<br>
|
||||
* this version of the loader:<br>
|
||||
* - It does not recognice/support user data in the *.lmts files.<br>
|
||||
* - The TGAs generated by LMTools don't work in Irrlicht for some reason (the
|
||||
* textures are upside down). Opening and resaving them in a graphics app will
|
||||
* solve the problem.</TD>
|
||||
* <TD>LMTools is a set of tools (Windows & Linux) for
|
||||
* creating lightmaps. Irrlicht can directly read .lmts
|
||||
* files thanks to<br> the importer created by Jonas
|
||||
* Petersen. If you are using this loader, please note
|
||||
* that you can set the path of the textures before
|
||||
* loading .lmts files. You can do this using
|
||||
* SceneManager->getParameters()->setParameter(scene::LMTS_TEXTURE_PATH,
|
||||
* "path/to/your/textures");
|
||||
* Notes for<br> this version of the loader:<br>
|
||||
* - It does not recognise/support user data in the
|
||||
* *.lmts files.<br>
|
||||
* - The TGAs generated by LMTools don't work in
|
||||
* Irrlicht for some reason (the textures are upside
|
||||
* down). Opening and resaving them in a graphics app
|
||||
* will solve the problem.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Quake 3 levels (.bsp)</TD>
|
||||
* <TD>Quake 3 is a popular game by IDSoftware, and .pk3 files contain .bsp files
|
||||
* and textures/lightmaps describing huge<br>
|
||||
* prelighted levels. Irrlicht can read .pk3 and .bsp files directly and thus
|
||||
* render Quake 3 levels directly. Written by Nikolaus Gebhardt enhanced by
|
||||
* Dean P. Macri with the curved surfaces feature. </TD>
|
||||
* <TD>Quake 3 is a popular game by IDSoftware, and .pk3
|
||||
* files contain .bsp files and textures/lightmaps
|
||||
* describing huge prelighted levels. Irrlicht can read
|
||||
* .pk3 and .bsp files directly and thus render Quake 3
|
||||
* levels directly. Written by Nikolaus Gebhardt
|
||||
* enhanced by Dean P. Macri with the curved surfaces
|
||||
* feature. </TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TD>Quake 2 models (.md2)</TD>
|
||||
* <TD>Quake 2 models are characters with morph target animation. Irrlicht can
|
||||
* read, display and animate them directly with this importer. </TD>
|
||||
* <TD>Quake 2 models are characters with morph target
|
||||
* animation. Irrlicht can read, display and animate
|
||||
* them directly with this importer. </TD>
|
||||
* </TR>
|
||||
* </TABLE>
|
||||
*
|
||||
|
@ -368,10 +413,11 @@ namespace scene
|
|||
\param scale: Initial scale of the scene node.
|
||||
\return Returns pointer to the created test scene node.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16, ISceneNode* parent=0, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
|
||||
virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16,
|
||||
ISceneNode* parent=0, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
|
||||
|
||||
//! Adds a scene node for rendering an animated mesh model.
|
||||
/** \param mesh: Pointer to the loaded animated mesh to be displayed.
|
||||
|
@ -384,11 +430,12 @@ namespace scene
|
|||
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
|
||||
\return Returns pointer to the created scene node.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IAnimatedMeshSceneNode* addAnimatedMeshSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f),
|
||||
bool alsoAddIfMeshPointerZero=false) = 0;
|
||||
virtual IAnimatedMeshSceneNode* addAnimatedMeshSceneNode(IAnimatedMesh* mesh,
|
||||
ISceneNode* parent=0, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f),
|
||||
bool alsoAddIfMeshPointerZero=false) = 0;
|
||||
|
||||
//! Adds a scene node for rendering a static mesh.
|
||||
/** \param mesh: Pointer to the loaded static mesh to be displayed.
|
||||
|
@ -488,10 +535,11 @@ namespace scene
|
|||
\return Returns a pointer to the interface of the camera if successful, otherwise 0.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ICameraSceneNode* addCameraSceneNodeMaya(ISceneNode* parent = 0,
|
||||
f32 rotateSpeed = -1500.0f, f32 zoomSpeed = 200.0f, f32 translationSpeed = 1500.0f, s32 id=-1) = 0;
|
||||
f32 rotateSpeed = -1500.0f, f32 zoomSpeed = 200.0f,
|
||||
f32 translationSpeed = 1500.0f, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a camera scene node with an animator which provides mouse and keyboard control
|
||||
//! like in most first person shooters (FPS).
|
||||
//! Adds a camera scene node with an animator which provides
|
||||
//! mouse and keyboard control like in most first person shooters (FPS).
|
||||
/** Look with the mouse, move with cursor keys. If you do not like the default
|
||||
key layout, you may want to specify your own. For example to make the camera
|
||||
be controlled by the cursor keys AND the keys W,A,S, and D, do something
|
||||
|
@ -566,7 +614,8 @@ namespace scene
|
|||
lensflares and things like that.
|
||||
\param parent: Parent scene node of the billboard. Can be null. If the parent moves,
|
||||
the billboard will move too.
|
||||
\param position: Position of the space relative to its parent where the billboard will be placed.
|
||||
\param position: Position of the space relative to its parent
|
||||
where the billboard will be placed.
|
||||
\param size: Size of the billboard. This size is 2 dimensional because a billboard only has
|
||||
width and height.
|
||||
\param id: An id of the node. This id can be used to identify the node.
|
||||
|
@ -604,8 +653,11 @@ namespace scene
|
|||
\param texture: Texture for the dome.
|
||||
\param horiRes: Number of vertices of a horizontal layer of the sphere.
|
||||
\param vertRes: Number of vertices of a vertical layer of the sphere.
|
||||
\param texturePercentage: How much of the height of the texture is used. Should be between 0 and 1.
|
||||
\param spherePercentage: How much of the sphere is drawn. Value should be between 0 and 2, where 1 is an exact half-sphere and 2 is a full sphere.
|
||||
\param texturePercentage: How much of the height of the
|
||||
texture is used. Should be between 0 and 1.
|
||||
\param spherePercentage: How much of the sphere is drawn.
|
||||
Value should be between 0 and 2, where 1 is an exact
|
||||
half-sphere and 2 is a full sphere.
|
||||
\param parent: Parent scene node of the dome. A dome usually has no parent,
|
||||
so this should be null. Note: If a parent is set, the dome will not
|
||||
change how it is drawn.
|
||||
|
@ -652,24 +704,32 @@ namespace scene
|
|||
a LOD (Level of Detail) which is determined based on a patch's
|
||||
distance from the camera.
|
||||
|
||||
The patch size of the terrain must always be a size of ( 2^N+1, i.e. 8+1(9), 16+1(17), etc. ).
|
||||
The MaxLOD available is directly dependent on the patch size of the terrain. LOD 0 contains all
|
||||
of the indices to draw all the triangles at the max detail for a patch. As each LOD goes up by 1
|
||||
the step taken, in generating indices increases by - 2^LOD, so for LOD 1, the step taken is 2, for
|
||||
LOD 2, the step taken is 4, LOD 3 - 8, etc. The step can be no larger than the size of the patch,
|
||||
so having a LOD of 8, with a patch size of 17, is asking the algoritm to generate indices every
|
||||
2^8 ( 256 ) vertices, which is not possible with a patch size of 17. The maximum LOD for a patch
|
||||
size of 17 is 2^4 ( 16 ). So, with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 ( every
|
||||
2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every 8 vertices ) and LOD 4 ( every 16 vertices ).
|
||||
The patch size of the terrain must always be a size of 2^N+1,
|
||||
i.e. 8+1(9), 16+1(17), etc.
|
||||
The MaxLOD available is directly dependent on the patch size
|
||||
of the terrain. LOD 0 contains all of the indices to draw all
|
||||
the triangles at the max detail for a patch. As each LOD goes
|
||||
up by 1 the step taken, in generating indices increases by
|
||||
-2^LOD, so for LOD 1, the step taken is 2, for LOD 2, the step
|
||||
taken is 4, LOD 3 - 8, etc. The step can be no larger than
|
||||
the size of the patch, so having a LOD of 8, with a patch size
|
||||
of 17, is asking the algoritm to generate indices every 2^8 (
|
||||
256 ) vertices, which is not possible with a patch size of 17.
|
||||
The maximum LOD for a patch size of 17 is 2^4 ( 16 ). So,
|
||||
with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 (
|
||||
every 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every
|
||||
8 vertices ) and LOD 4 ( every 16 vertices ).
|
||||
\param heightMapFileName: The name of the file on disk, to read vertex data from. This should
|
||||
be a gray scale bitmap.
|
||||
\param parent: Parent of the scene node. Can be 0 if no parent.
|
||||
\param id: Id of the node. This id can be used to identify the scene node.
|
||||
\param position: The absolute position of this node.
|
||||
\param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
|
||||
\param scale: The scale factor for the terrain. If you're using a heightmap of size 129x129 and would like
|
||||
your terrain to be 12900x12900 in game units, then use a scale factor of ( core::vector ( 100.0f, 100.0f, 100.0f ).
|
||||
If you use a Y scaling factor of 0.0f, then your terrain will be flat.
|
||||
\param scale: The scale factor for the terrain. If you're
|
||||
using a heightmap of size 129x129 and would like your terrain
|
||||
to be 12900x12900 in game units, then use a scale factor of (
|
||||
core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y
|
||||
scaling factor of 0.0f, then your terrain will be flat.
|
||||
\param vertexColor: The default color of all the vertices. If no texture is associated
|
||||
with the scene node, then all vertices will be this color. Defaults to white.
|
||||
\param maxLOD: The maximum LOD (level of detail) for the node. Only change if you
|
||||
|
@ -678,9 +738,11 @@ namespace scene
|
|||
know what you are doing, this might lead to strange behaviour.
|
||||
\param smoothFactor: The number of times the vertices are smoothed.
|
||||
\param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
|
||||
\return Returns pointer to the created scene node. Can be null if the
|
||||
terrain could not be created, for example because the heightmap could not be loaded.
|
||||
The returned pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
\return Returns pointer to the created scene node. Can be null
|
||||
if the terrain could not be created, for example because the
|
||||
heightmap could not be loaded. The returned pointer should
|
||||
not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual ITerrainSceneNode* addTerrainSceneNode(
|
||||
const c8* heightMapFileName,
|
||||
ISceneNode* parent=0, s32 id=-1,
|
||||
|
@ -701,9 +763,11 @@ namespace scene
|
|||
\param id: Id of the node. This id can be used to identify the scene node.
|
||||
\param position: The absolute position of this node.
|
||||
\param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
|
||||
\param scale: The scale factor for the terrain. If you're using a heightmap of size 129x129 and would like
|
||||
your terrain to be 12900x12900 in game units, then use a scale factor of ( core::vector ( 100.0f, 100.0f, 100.0f ).
|
||||
If you use a Y scaling factor of 0.0f, then your terrain will be flat.
|
||||
\param scale: The scale factor for the terrain. If you're
|
||||
using a heightmap of size 129x129 and would like your terrain
|
||||
to be 12900x12900 in game units, then use a scale factor of (
|
||||
core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y
|
||||
scaling factor of 0.0f, then your terrain will be flat.
|
||||
\param vertexColor: The default color of all the vertices. If no texture is associated
|
||||
with the scene node, then all vertices will be this color. Defaults to white.
|
||||
\param maxLOD: The maximum LOD (level of detail) for the node. Only change if you
|
||||
|
@ -712,9 +776,11 @@ namespace scene
|
|||
know what you are doing, this might lead to strange behaviour.
|
||||
\param smoothFactor: The number of times the vertices are smoothed.
|
||||
\param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
|
||||
\return Returns pointer to the created scene node. Can be null if the
|
||||
terrain could not be created, for example because the heightmap could not be loaded.
|
||||
The returned pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
\return Returns pointer to the created scene node. Can be null
|
||||
if the terrain could not be created, for example because the
|
||||
heightmap could not be loaded. The returned pointer should
|
||||
not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual ITerrainSceneNode* addTerrainSceneNode(
|
||||
io::IReadFile* heightMapFile,
|
||||
ISceneNode* parent=0, s32 id=-1,
|
||||
|
@ -751,7 +817,8 @@ namespace scene
|
|||
virtual IDummyTransformationSceneNode* addDummyTransformationSceneNode(
|
||||
ISceneNode* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a text scene node, which is able to display 2d text at a position in three dimensional space
|
||||
//! Adds a text scene node, which is able to display 2d text at
|
||||
//! a position in three dimensional space
|
||||
virtual ITextSceneNode* addTextSceneNode(gui::IGUIFont* font, const wchar_t* text,
|
||||
video::SColor color=video::SColor(100,255,255,255),
|
||||
ISceneNode* parent = 0, const core::vector3df& position = core::vector3df(0,0,0),
|
||||
|
@ -880,7 +947,9 @@ namespace scene
|
|||
\param start: Scene node to start from. All children of this scene
|
||||
node are searched. If null is specified, the root scene node is
|
||||
taken. */
|
||||
virtual void getSceneNodesFromType(ESCENE_NODE_TYPE type, core::array<scene::ISceneNode*>& outNodes, ISceneNode* start=0) = 0;
|
||||
virtual void getSceneNodesFromType(ESCENE_NODE_TYPE type,
|
||||
core::array<scene::ISceneNode*>& outNodes,
|
||||
ISceneNode* start=0) = 0;
|
||||
|
||||
//! Returns the current active camera.
|
||||
/** \return The active camera is returned. Note that this can be NULL, if there
|
||||
|
@ -935,9 +1004,11 @@ namespace scene
|
|||
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNodeAnimator* createFlyCircleAnimator(const core::vector3df& center,
|
||||
f32 radius, f32 speed=0.001f, const core::vector3df& direction= core::vector3df ( 0.f, 1.f, 0.f ) ) = 0;
|
||||
f32 radius, f32 speed=0.001f,
|
||||
const core::vector3df& direction=core::vector3df ( 0.f, 1.f, 0.f ) ) = 0;
|
||||
|
||||
//! Creates a fly straight animator, which lets the attached scene node fly or move along a line between two points.
|
||||
//! Creates a fly straight animator, which lets the attached
|
||||
//! scene node fly or move along a line between two points.
|
||||
/** \param startPoint: Start point of the line.
|
||||
\param endPoint: End point of the line.
|
||||
\param timeForWay: Time in milli seconds how long the node should need to
|
||||
|
@ -951,7 +1022,8 @@ namespace scene
|
|||
virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint,
|
||||
const core::vector3df& endPoint, u32 timeForWay, bool loop=false) = 0;
|
||||
|
||||
//! Creates a texture animator, which switches the textures of the target scene node based on a list of textures.
|
||||
//! Creates a texture animator, which switches the textures of
|
||||
//! the target scene node based on a list of textures.
|
||||
/** \param textures: List of textures to use.
|
||||
\param timePerFrame: Time in milliseconds, how long any texture in the list
|
||||
should be visible.
|
||||
|
@ -1159,7 +1231,8 @@ namespace scene
|
|||
//! Returns a scene node factory by index
|
||||
virtual ISceneNodeFactory* getSceneNodeFactory(u32 index) = 0;
|
||||
|
||||
//! Returns the default scene node animator factory which can create all built-in scene node animators
|
||||
//! Returns the default scene node animator factory which can
|
||||
//! create all built-in scene node animators
|
||||
virtual ISceneNodeAnimatorFactory* getDefaultSceneNodeAnimatorFactory() = 0;
|
||||
|
||||
//! Adds a scene node animator factory to the scene manager.
|
||||
|
@ -1180,16 +1253,23 @@ namespace scene
|
|||
virtual ISceneNode* addSceneNode(const char* sceneNodeTypeName, ISceneNode* parent=0) = 0;
|
||||
|
||||
//! Creates a new scene manager.
|
||||
/** This can be used to easily draw and/or store two independent scenes at the same time.
|
||||
The mesh cache will be shared between all existing scene managers, which means if you load
|
||||
a mesh in the original scene manager using for example getMesh(), the mesh will be available
|
||||
in all other scene managers too, without loading.
|
||||
The original/main scene manager will still be there and accessible via IrrlichtDevice::getSceneManager().
|
||||
If you need input event in this new scene manager, for example for FPS cameras, you'll need
|
||||
to forward input to this manually: Just implement an IEventReceiver and call
|
||||
yourNewSceneManager->postEventFromUser(), and return true so that the original scene manager
|
||||
doesn't get the event. Otherwise, all input will go automaticly to the main scene manager.
|
||||
If you no longer need the new scene manager, you should call ISceneManager::drop().
|
||||
/** This can be used to easily draw and/or store two
|
||||
independent scenes at the same time. The mesh cache will be
|
||||
shared between all existing scene managers, which means if you
|
||||
load a mesh in the original scene manager using for example
|
||||
getMesh(), the mesh will be available in all other scene
|
||||
managers too, without loading.
|
||||
The original/main scene manager will still be there and
|
||||
accessible via IrrlichtDevice::getSceneManager(). If you need
|
||||
input event in this new scene manager, for example for FPS
|
||||
cameras, you'll need to forward input to this manually: Just
|
||||
implement an IEventReceiver and call
|
||||
yourNewSceneManager->postEventFromUser(), and return true so
|
||||
that the original scene manager doesn't get the event.
|
||||
Otherwise, all input will go to the main scene manager
|
||||
automatically.
|
||||
If you no longer need the new scene manager, you should call
|
||||
ISceneManager::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneManager* createNewSceneManager(bool cloneContent=false) = 0;
|
||||
|
||||
|
@ -1222,9 +1302,11 @@ namespace scene
|
|||
Be edited with the Irrlicht Engine Editor, irrEdit (http://irredit.irrlicht3d.org) or
|
||||
saved directly by the engine using ISceneManager::saveScene().
|
||||
\param filename: Name of the file.
|
||||
\param userDataSerializer: If you want to load user data possibily saved in that file for
|
||||
some scene nodes in the file, implement the ISceneUserDataSerializer interface and provide it as parameter here.
|
||||
Otherwise, simply specify 0 as this parameter.
|
||||
\param userDataSerializer: If you want to load user data
|
||||
possibily saved in that file for some scene nodes in the file,
|
||||
implement the ISceneUserDataSerializer interface and provide it
|
||||
as parameter here. Otherwise, simply specify 0 as this
|
||||
parameter.
|
||||
\return Returns true if successful. */
|
||||
virtual bool loadScene(const c8* filename, ISceneUserDataSerializer* userDataSerializer=0) = 0;
|
||||
|
||||
|
@ -1233,10 +1315,12 @@ namespace scene
|
|||
Be edited with the Irrlicht Engine Editor, irrEdit (http://irredit.irrlicht3d.org) or
|
||||
saved directly by the engine using ISceneManager::saveScene().
|
||||
\param file: File where the scene is going to be saved into.
|
||||
\param userDataSerializer: If you want to load user data possibily saved in that file for
|
||||
some scene nodes in the file, implement the ISceneUserDataSerializer interface and provide it as parameter here.
|
||||
Otherwise, simply specify 0 as this parameter.
|
||||
\return Returns true if successful. */
|
||||
\param userDataSerializer: If you want to load user data
|
||||
possibily saved in that file for some scene nodes in the file,
|
||||
implement the ISceneUserDataSerializer interface and provide it
|
||||
as parameter here. Otherwise, simply specify 0 as this
|
||||
parameter.
|
||||
\return Returns true if successful. */
|
||||
virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0) = 0;
|
||||
|
||||
//! Returns a mesh writer implementation if available
|
||||
|
|
|
@ -633,7 +633,8 @@ namespace scene
|
|||
setScale(in->getAttributeAsVector3d("Scale"));
|
||||
|
||||
IsVisible = in->getAttributeAsBool("Visible");
|
||||
AutomaticCullingState = (scene::E_CULLING_TYPE ) in->getAttributeAsEnumeration("AutomaticCulling", scene::AutomaticCullingNames);
|
||||
AutomaticCullingState = (scene::E_CULLING_TYPE) in->getAttributeAsEnumeration("AutomaticCulling",
|
||||
scene::AutomaticCullingNames);
|
||||
|
||||
DebugDataVisible = in->getAttributeAsInt("DebugDataVisible");
|
||||
IsDebugObject = in->getAttributeAsBool("IsDebugObject");
|
||||
|
|
|
@ -50,8 +50,9 @@ namespace scene
|
|||
|
||||
//! uses animation from another mesh
|
||||
//! the animation is linked (not copied) based on joint names (so make sure they are unique)
|
||||
//! \return Returns true if all joints in this mesh were matched up (empty names will not be matched, and it's case sensitive)
|
||||
//! unmatched joints will not be animated
|
||||
//! \return Returns true if all joints in this mesh were
|
||||
//! matched up (empty names will not be matched, and it's case
|
||||
//! sensitive). Unmatched joints will not be animated.
|
||||
virtual bool useAnimationFrom(const ISkinnedMesh *mesh) = 0;
|
||||
|
||||
//!Update Normals when Animating
|
||||
|
|
|
@ -290,7 +290,9 @@ namespace video
|
|||
\param triangleCount: amount of Triangles.
|
||||
\param vType: Vertex type, e.g. EVT_STANDARD for S3DVertex.
|
||||
\param pType: Primitive type, e.g. EPT_TRIANGLE_FAN for a triangle fan. */
|
||||
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const u16* indexList, u32 triangleCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType) = 0;
|
||||
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
|
||||
const u16* indexList, u32 triangleCount,
|
||||
E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType) = 0;
|
||||
|
||||
//! Draws an indexed triangle list.
|
||||
/** Note that there may be at maximum 65536 vertices, because the
|
||||
|
|
|
@ -79,7 +79,10 @@ struct S3DVertex
|
|||
|
||||
bool operator<(const S3DVertex& other) const
|
||||
{
|
||||
return ((Pos < other.Pos) || ((Pos == other.Pos) && (Normal < other.Normal)) || ((Pos == other.Pos) && (Normal == other.Normal) && (Color < other.Color)) || ((Pos == other.Pos) && (Normal == other.Normal) && (Color == other.Color) && (TCoords < other.TCoords)));
|
||||
return ((Pos < other.Pos) ||
|
||||
((Pos == other.Pos) && (Normal < other.Normal)) ||
|
||||
((Pos == other.Pos) && (Normal == other.Normal) && (Color < other.Color)) ||
|
||||
((Pos == other.Pos) && (Normal == other.Normal) && (Color == other.Color) && (TCoords < other.TCoords)));
|
||||
}
|
||||
|
||||
E_VERTEX_TYPE getType() const
|
||||
|
@ -147,7 +150,8 @@ struct S3DVertex2TCoords : public S3DVertex
|
|||
|
||||
bool operator<(const S3DVertex2TCoords& other) const
|
||||
{
|
||||
return ((static_cast<S3DVertex>(*this) < other) || ((static_cast<S3DVertex>(*this) == other) && (TCoords2 < other.TCoords2)));
|
||||
return ((static_cast<S3DVertex>(*this) < other) ||
|
||||
((static_cast<S3DVertex>(*this) == other) && (TCoords2 < other.TCoords2)));
|
||||
}
|
||||
|
||||
E_VERTEX_TYPE getType() const
|
||||
|
@ -166,7 +170,10 @@ struct S3DVertexTangents : public S3DVertex
|
|||
S3DVertexTangents() : S3DVertex() { }
|
||||
|
||||
//! constructor
|
||||
S3DVertexTangents(f32 x, f32 y, f32 z, f32 nx=0.0f, f32 ny=0.0f, f32 nz=0.0f, SColor c = 0xFFFFFFFF, f32 tu=0.0f, f32 tv=0.0f, f32 tanx=0.0f, f32 tany=0.0f, f32 tanz=0.0f, f32 bx=0.0f, f32 by=0.0f, f32 bz=0.0f)
|
||||
S3DVertexTangents(f32 x, f32 y, f32 z, f32 nx=0.0f, f32 ny=0.0f, f32 nz=0.0f,
|
||||
SColor c = 0xFFFFFFFF, f32 tu=0.0f, f32 tv=0.0f,
|
||||
f32 tanx=0.0f, f32 tany=0.0f, f32 tanz=0.0f,
|
||||
f32 bx=0.0f, f32 by=0.0f, f32 bz=0.0f)
|
||||
: S3DVertex(x,y,z, nx,ny,nz, c, tu,tv), Tangent(tanx,tany,tanz), Binormal(bx,by,bz) { }
|
||||
|
||||
//! constructor
|
||||
|
@ -204,7 +211,9 @@ struct S3DVertexTangents : public S3DVertex
|
|||
|
||||
bool operator<(const S3DVertexTangents& other) const
|
||||
{
|
||||
return ((static_cast<S3DVertex>(*this) < other) || ((static_cast<S3DVertex>(*this) == other) && (Tangent < other.Tangent)) || ((static_cast<S3DVertex>(*this) == other) && (Tangent == other.Tangent) && (Binormal < other.Binormal)));
|
||||
return ((static_cast<S3DVertex>(*this) < other) ||
|
||||
((static_cast<S3DVertex>(*this) == other) && (Tangent < other.Tangent)) ||
|
||||
((static_cast<S3DVertex>(*this) == other) && (Tangent == other.Tangent) && (Binormal < other.Binormal)));
|
||||
}
|
||||
|
||||
E_VERTEX_TYPE getType() const
|
||||
|
|
|
@ -274,7 +274,10 @@ namespace video
|
|||
//! \param b: Sets the blue component of the Color.
|
||||
//! Has to be a value between 0 and 255.
|
||||
//! 0 means no blue, 255 means full blue.
|
||||
void set(u32 a, u32 r, u32 g, u32 b) { color = (((a & 0xff)<<24) | ((r & 0xff)<<16) | ((g & 0xff)<<8) | (b & 0xff)); }
|
||||
void set(u32 a, u32 r, u32 g, u32 b)
|
||||
{
|
||||
color = (((a & 0xff)<<24) | ((r & 0xff)<<16) | ((g & 0xff)<<8) | (b & 0xff));
|
||||
}
|
||||
void set(u32 col) { color = col; }
|
||||
|
||||
//! Compares the color to another color.
|
||||
|
@ -327,10 +330,15 @@ namespace video
|
|||
const f32 mul1 = 2.f * d * inv;
|
||||
const f32 mul2 = d * d;
|
||||
|
||||
return SColor ( core::clamp ( core::floor32 ( getAlpha() * mul0 + c1.getAlpha() * mul1 + c2.getAlpha() * mul2 ), 0, 255 ),
|
||||
core::clamp ( core::floor32 ( getRed() * mul0 + c1.getRed() * mul1 + c2.getRed() * mul2 ), 0, 255 ),
|
||||
core::clamp ( core::floor32 ( getGreen() * mul0 + c1.getGreen() * mul1 + c2.getGreen() * mul2 ), 0, 255 ),
|
||||
core::clamp ( core::floor32 ( getBlue() * mul0 + c1.getBlue() * mul1 + c2.getBlue() * mul2 ), 0, 255 ));
|
||||
return SColor(
|
||||
core::clamp( core::floor32(
|
||||
getAlpha() * mul0 + c1.getAlpha() * mul1 + c2.getAlpha() * mul2 ), 0, 255 ),
|
||||
core::clamp( core::floor32(
|
||||
getRed() * mul0 + c1.getRed() * mul1 + c2.getRed() * mul2 ), 0, 255 ),
|
||||
core::clamp ( core::floor32(
|
||||
getGreen() * mul0 + c1.getGreen() * mul1 + c2.getGreen() * mul2 ), 0, 255 ),
|
||||
core::clamp ( core::floor32(
|
||||
getBlue() * mul0 + c1.getBlue() * mul1 + c2.getBlue() * mul2 ), 0, 255 ));
|
||||
}
|
||||
|
||||
//! color in A8R8G8B8 Format
|
||||
|
@ -415,7 +423,8 @@ namespace video
|
|||
/** \param c1: first color to interpolate with
|
||||
\param c2: second color to interpolate with
|
||||
\param d: value between 0.0f and 1.0f. */
|
||||
inline SColorf getInterpolated_quadratic(const SColorf& c1, const SColorf& c2, f32 d) const
|
||||
inline SColorf getInterpolated_quadratic(const SColorf& c1, const SColorf& c2,
|
||||
f32 d) const
|
||||
{
|
||||
d = core::clamp(d, 0.f, 1.f);
|
||||
// this*(1-d)*(1-d) + 2 * c1 * (1-d) + c2 * d * d;
|
||||
|
@ -534,7 +543,8 @@ namespace video
|
|||
else if (rh < 180.0f * core::DEGTORAD )
|
||||
rm1 = rm2;
|
||||
else if (rh < 240.0f * core::DEGTORAD )
|
||||
rm1 = rm1 + (rm2 - rm1) * ( ( 240.0f * core::DEGTORAD ) - rh) / (60.0f * core::DEGTORAD);
|
||||
rm1 = rm1 + (rm2 - rm1) * ( ( 240.0f * core::DEGTORAD ) - rh) /
|
||||
(60.0f * core::DEGTORAD);
|
||||
|
||||
return (u32) (rm1 * 255.f);
|
||||
}
|
||||
|
|
|
@ -50,7 +50,8 @@ namespace video
|
|||
}
|
||||
|
||||
//! EMT_ONETEXTURE_BLEND: unpack srcFact & dstFact and Modulo to MaterialTypeParam
|
||||
inline void unpack_texureBlendFunc ( E_BLEND_FACTOR &srcFact, E_BLEND_FACTOR &dstFact, E_MODULATE_FUNC &modulo, const f32 param )
|
||||
inline void unpack_texureBlendFunc ( E_BLEND_FACTOR &srcFact, E_BLEND_FACTOR &dstFact,
|
||||
E_MODULATE_FUNC &modulo, const f32 param )
|
||||
{
|
||||
const u32 state = (u32)param;
|
||||
modulo = E_MODULATE_FUNC ( ( state & 0x00FF0000 ) >> 16 );
|
||||
|
@ -342,7 +343,10 @@ namespace video
|
|||
case EMF_NORMALIZE_NORMALS:
|
||||
return NormalizeNormals;
|
||||
case EMF_TEXTURE_WRAP:
|
||||
return !(TextureLayer[0].TextureWrap || TextureLayer[1].TextureWrap || TextureLayer[2].TextureWrap || TextureLayer[3].TextureWrap);
|
||||
return !(TextureLayer[0].TextureWrap ||
|
||||
TextureLayer[1].TextureWrap ||
|
||||
TextureLayer[2].TextureWrap ||
|
||||
TextureLayer[3].TextureWrap);
|
||||
case EMF_MATERIAL_FLAG_COUNT:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -154,7 +154,9 @@ namespace video
|
|||
if (different)
|
||||
return true;
|
||||
else
|
||||
different |= (TextureMatrix != b.TextureMatrix) && TextureMatrix && b.TextureMatrix && (*TextureMatrix != *(b.TextureMatrix));
|
||||
different |= (TextureMatrix != b.TextureMatrix) &&
|
||||
TextureMatrix && b.TextureMatrix &&
|
||||
(*TextureMatrix != *(b.TextureMatrix));
|
||||
return different;
|
||||
}
|
||||
|
||||
|
|
|
@ -251,7 +251,8 @@ namespace scene
|
|||
|
||||
for (s32 i=0; i<6; ++i)
|
||||
{
|
||||
const f32 len = core::reciprocal_squareroot ( planes[i].Normal.getLengthSQ() );
|
||||
const f32 len = core::reciprocal_squareroot(
|
||||
planes[i].Normal.getLengthSQ() );
|
||||
planes[i].Normal *= len;
|
||||
planes[i].D *= len;
|
||||
}
|
||||
|
@ -305,7 +306,8 @@ namespace scene
|
|||
u32 i;
|
||||
for ( i=0; i != VF_PLANE_COUNT; ++i)
|
||||
{
|
||||
const f32 len = - core::reciprocal_squareroot ( planes[i].Normal.getLengthSQ() );
|
||||
const f32 len = -core::reciprocal_squareroot(
|
||||
planes[i].Normal.getLengthSQ());
|
||||
planes[i].Normal *= len;
|
||||
planes[i].D *= len;
|
||||
}
|
||||
|
@ -319,13 +321,16 @@ namespace scene
|
|||
switch ( state )
|
||||
{
|
||||
case video::ETS_VIEW:
|
||||
Matrices[ETS_VIEW_PROJECTION_3].setbyproduct_nocheck( Matrices[ video::ETS_PROJECTION], Matrices[ video::ETS_VIEW] );
|
||||
Matrices[ETS_VIEW_PROJECTION_3].setbyproduct_nocheck(
|
||||
Matrices[video::ETS_PROJECTION],
|
||||
Matrices[video::ETS_VIEW]);
|
||||
Matrices[ETS_VIEW_MODEL_INVERSE_3] = Matrices[video::ETS_VIEW];
|
||||
Matrices[ETS_VIEW_MODEL_INVERSE_3].makeInverse();
|
||||
break;
|
||||
|
||||
case video::ETS_WORLD:
|
||||
Matrices[ETS_CURRENT_3].setbyproduct( Matrices[ETS_VIEW_PROJECTION_3],
|
||||
Matrices[ETS_CURRENT_3].setbyproduct(
|
||||
Matrices[ETS_VIEW_PROJECTION_3 ],
|
||||
Matrices[video::ETS_WORLD]);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -199,16 +199,18 @@ namespace core
|
|||
|
||||
//! code is taken from IceFPU
|
||||
//! Integer representation of a floating-point value.
|
||||
#define IR(x) ((u32&)(x))
|
||||
#define IR(x) ((u32&)(x))
|
||||
|
||||
//! Absolute integer representation of a floating-point value
|
||||
#define AIR(x) (IR(x)&0x7fffffff)
|
||||
#define AIR(x) (IR(x)&0x7fffffff)
|
||||
|
||||
//! Floating-point representation of an integer value.
|
||||
#define FR(x) ((f32&)(x))
|
||||
#define FR(x) ((f32&)(x))
|
||||
|
||||
#define IEEE_1_0 0x3f800000 //!< integer representation of 1.0
|
||||
#define IEEE_255_0 0x437f0000 //!< integer representation of 255.0
|
||||
//! integer representation of 1.0
|
||||
#define IEEE_1_0 0x3f800000
|
||||
//! integer representation of 255.0
|
||||
#define IEEE_255_0 0x437f0000
|
||||
|
||||
#ifdef IRRLICHT_FAST_MATH
|
||||
#define F32_LOWER_0(f) (F32_AS_U32(f) > F32_SIGN_BIT)
|
||||
|
|
|
@ -279,7 +279,8 @@ namespace irr
|
|||
*/
|
||||
IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDevice(
|
||||
video::E_DRIVER_TYPE deviceType = video::EDT_SOFTWARE,
|
||||
const core::dimension2d<s32>& windowSize = (core::dimension2d<s32>(640,480)), // paranthese are necessary for some compilers
|
||||
// parantheses are necessary for some compilers
|
||||
const core::dimension2d<s32>& windowSize = (core::dimension2d<s32>(640,480)),
|
||||
u32 bits = 16,
|
||||
bool fullscreen = false,
|
||||
bool stencilbuffer = false,
|
||||
|
@ -312,12 +313,14 @@ namespace irr
|
|||
{
|
||||
}
|
||||
|
||||
//! This namespace provides interfaces for input/output: Reading and writing files, accessing zip archives, xml files, ...
|
||||
//! This namespace provides interfaces for input/output: Reading and
|
||||
//! writing files, accessing zip archives, xml files, ...
|
||||
namespace io
|
||||
{
|
||||
}
|
||||
|
||||
//! All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees and billboards, ...
|
||||
//! All scene management can be found in this namespace: Mesh loading,
|
||||
//! special scene nodes like octrees and billboards, ...
|
||||
namespace scene
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,8 +32,10 @@ class line2d
|
|||
line2d<T> operator-(const vector2d<T>& point) const { return line2d<T>(start - point, end - point); }
|
||||
line2d<T>& operator-=(const vector2d<T>& point) { start -= point; end -= point; return *this; }
|
||||
|
||||
bool operator==(const line2d<T>& other) const { return (start==other.start && end==other.end) || (end==other.start && start==other.end);}
|
||||
bool operator!=(const line2d<T>& other) const { return !(start==other.start && end==other.end) || (end==other.start && start==other.end);}
|
||||
bool operator==(const line2d<T>& other) const
|
||||
{ return (start==other.start && end==other.end) || (end==other.start && start==other.end);}
|
||||
bool operator!=(const line2d<T>& other) const
|
||||
{ return !(start==other.start && end==other.end) || (end==other.start && start==other.end);}
|
||||
|
||||
// functions
|
||||
|
||||
|
|
|
@ -33,14 +33,19 @@ class line3d
|
|||
line3d<T> operator-(const vector3d<T>& point) const { return line3d<T>(start - point, end - point); }
|
||||
line3d<T>& operator-=(const vector3d<T>& point) { start -= point; end -= point; return *this; }
|
||||
|
||||
bool operator==(const line3d<T>& other) const { return (start==other.start && end==other.end) || (end==other.start && start==other.end);}
|
||||
bool operator!=(const line3d<T>& other) const { return !(start==other.start && end==other.end) || (end==other.start && start==other.end);}
|
||||
bool operator==(const line3d<T>& other) const
|
||||
{ return (start==other.start && end==other.end) || (end==other.start && start==other.end);}
|
||||
bool operator!=(const line3d<T>& other) const
|
||||
{ return !(start==other.start && end==other.end) || (end==other.start && start==other.end);}
|
||||
|
||||
// functions
|
||||
|
||||
void setLine(const T& xa, const T& ya, const T& za, const T& xb, const T& yb, const T& zb) {start.set(xa, ya, za); end.set(xb, yb, zb);}
|
||||
void setLine(const vector3d<T>& nstart, const vector3d<T>& nend) {start.set(nstart); end.set(nend);}
|
||||
void setLine(const line3d<T>& line) {start.set(line.start); end.set(line.end);}
|
||||
void setLine(const T& xa, const T& ya, const T& za, const T& xb, const T& yb, const T& zb)
|
||||
{start.set(xa, ya, za); end.set(xb, yb, zb);}
|
||||
void setLine(const vector3d<T>& nstart, const vector3d<T>& nend)
|
||||
{start.set(nstart); end.set(nend);}
|
||||
void setLine(const line3d<T>& line)
|
||||
{start.set(line.start); end.set(line.end);}
|
||||
|
||||
//! Returns length of line
|
||||
//! \return Returns length of line.
|
||||
|
|
|
@ -221,10 +221,16 @@ namespace core
|
|||
CMatrix4<T>& buildProjectionMatrixOrthoRH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar);
|
||||
|
||||
//! Builds a left-handed look-at matrix.
|
||||
CMatrix4<T>& buildCameraLookAtMatrixLH(const vector3df& position, const vector3df& target, const vector3df& upVector);
|
||||
CMatrix4<T>& buildCameraLookAtMatrixLH(
|
||||
const vector3df& position,
|
||||
const vector3df& target,
|
||||
const vector3df& upVector);
|
||||
|
||||
//! Builds a right-handed look-at matrix.
|
||||
CMatrix4<T>& buildCameraLookAtMatrixRH(const vector3df& position, const vector3df& target, const vector3df& upVector);
|
||||
CMatrix4<T>& buildCameraLookAtMatrixRH(
|
||||
const vector3df& position,
|
||||
const vector3df& target,
|
||||
const vector3df& upVector);
|
||||
|
||||
//! Builds a matrix that flattens geometry into a plane.
|
||||
//! \param light: light source
|
||||
|
@ -793,9 +799,8 @@ namespace core
|
|||
|
||||
for (s32 i=0; i<4; ++i)
|
||||
for (s32 j=0; j<4; ++j)
|
||||
if (j != i)
|
||||
if (!iszero((*this)(i,j)))
|
||||
return false;
|
||||
if ((j != i) && (!iszero((*this)(i,j))))
|
||||
return false;
|
||||
|
||||
definitelyIdentityMatrix=true;
|
||||
return true;
|
||||
|
@ -1078,22 +1083,54 @@ namespace core
|
|||
|
||||
d = core::reciprocal ( d );
|
||||
|
||||
out(0, 0) = d * (m(1, 1) * (m(2, 2) * m(3, 3) - m(2, 3) * m(3, 2)) + m(1, 2) * (m(2, 3) * m(3, 1) - m(2, 1) * m(3, 3)) + m(1, 3) * (m(2, 1) * m(3, 2) - m(2, 2) * m(3, 1)));
|
||||
out(0, 1) = d * (m(2, 1) * (m(0, 2) * m(3, 3) - m(0, 3) * m(3, 2)) + m(2, 2) * (m(0, 3) * m(3, 1) - m(0, 1) * m(3, 3)) + m(2, 3) * (m(0, 1) * m(3, 2) - m(0, 2) * m(3, 1)));
|
||||
out(0, 2) = d * (m(3, 1) * (m(0, 2) * m(1, 3) - m(0, 3) * m(1, 2)) + m(3, 2) * (m(0, 3) * m(1, 1) - m(0, 1) * m(1, 3)) + m(3, 3) * (m(0, 1) * m(1, 2) - m(0, 2) * m(1, 1)));
|
||||
out(0, 3) = d * (m(0, 1) * (m(1, 3) * m(2, 2) - m(1, 2) * m(2, 3)) + m(0, 2) * (m(1, 1) * m(2, 3) - m(1, 3) * m(2, 1)) + m(0, 3) * (m(1, 2) * m(2, 1) - m(1, 1) * m(2, 2)));
|
||||
out(1, 0) = d * (m(1, 2) * (m(2, 0) * m(3, 3) - m(2, 3) * m(3, 0)) + m(1, 3) * (m(2, 2) * m(3, 0) - m(2, 0) * m(3, 2)) + m(1, 0) * (m(2, 3) * m(3, 2) - m(2, 2) * m(3, 3)));
|
||||
out(1, 1) = d * (m(2, 2) * (m(0, 0) * m(3, 3) - m(0, 3) * m(3, 0)) + m(2, 3) * (m(0, 2) * m(3, 0) - m(0, 0) * m(3, 2)) + m(2, 0) * (m(0, 3) * m(3, 2) - m(0, 2) * m(3, 3)));
|
||||
out(1, 2) = d * (m(3, 2) * (m(0, 0) * m(1, 3) - m(0, 3) * m(1, 0)) + m(3, 3) * (m(0, 2) * m(1, 0) - m(0, 0) * m(1, 2)) + m(3, 0) * (m(0, 3) * m(1, 2) - m(0, 2) * m(1, 3)));
|
||||
out(1, 3) = d * (m(0, 2) * (m(1, 3) * m(2, 0) - m(1, 0) * m(2, 3)) + m(0, 3) * (m(1, 0) * m(2, 2) - m(1, 2) * m(2, 0)) + m(0, 0) * (m(1, 2) * m(2, 3) - m(1, 3) * m(2, 2)));
|
||||
out(2, 0) = d * (m(1, 3) * (m(2, 0) * m(3, 1) - m(2, 1) * m(3, 0)) + m(1, 0) * (m(2, 1) * m(3, 3) - m(2, 3) * m(3, 1)) + m(1, 1) * (m(2, 3) * m(3, 0) - m(2, 0) * m(3, 3)));
|
||||
out(2, 1) = d * (m(2, 3) * (m(0, 0) * m(3, 1) - m(0, 1) * m(3, 0)) + m(2, 0) * (m(0, 1) * m(3, 3) - m(0, 3) * m(3, 1)) + m(2, 1) * (m(0, 3) * m(3, 0) - m(0, 0) * m(3, 3)));
|
||||
out(2, 2) = d * (m(3, 3) * (m(0, 0) * m(1, 1) - m(0, 1) * m(1, 0)) + m(3, 0) * (m(0, 1) * m(1, 3) - m(0, 3) * m(1, 1)) + m(3, 1) * (m(0, 3) * m(1, 0) - m(0, 0) * m(1, 3)));
|
||||
out(2, 3) = d * (m(0, 3) * (m(1, 1) * m(2, 0) - m(1, 0) * m(2, 1)) + m(0, 0) * (m(1, 3) * m(2, 1) - m(1, 1) * m(2, 3)) + m(0, 1) * (m(1, 0) * m(2, 3) - m(1, 3) * m(2, 0)));
|
||||
out(3, 0) = d * (m(1, 0) * (m(2, 2) * m(3, 1) - m(2, 1) * m(3, 2)) + m(1, 1) * (m(2, 0) * m(3, 2) - m(2, 2) * m(3, 0)) + m(1, 2) * (m(2, 1) * m(3, 0) - m(2, 0) * m(3, 1)));
|
||||
out(3, 1) = d * (m(2, 0) * (m(0, 2) * m(3, 1) - m(0, 1) * m(3, 2)) + m(2, 1) * (m(0, 0) * m(3, 2) - m(0, 2) * m(3, 0)) + m(2, 2) * (m(0, 1) * m(3, 0) - m(0, 0) * m(3, 1)));
|
||||
out(3, 2) = d * (m(3, 0) * (m(0, 2) * m(1, 1) - m(0, 1) * m(1, 2)) + m(3, 1) * (m(0, 0) * m(1, 2) - m(0, 2) * m(1, 0)) + m(3, 2) * (m(0, 1) * m(1, 0) - m(0, 0) * m(1, 1)));
|
||||
out(3, 3) = d * (m(0, 0) * (m(1, 1) * m(2, 2) - m(1, 2) * m(2, 1)) + m(0, 1) * (m(1, 2) * m(2, 0) - m(1, 0) * m(2, 2)) + m(0, 2) * (m(1, 0) * m(2, 1) - m(1, 1) * m(2, 0)));
|
||||
out(0, 0) = d * (m(1, 1) * (m(2, 2) * m(3, 3) - m(2, 3) * m(3, 2)) +
|
||||
m(1, 2) * (m(2, 3) * m(3, 1) - m(2, 1) * m(3, 3)) +
|
||||
m(1, 3) * (m(2, 1) * m(3, 2) - m(2, 2) * m(3, 1)));
|
||||
out(0, 1) = d * (m(2, 1) * (m(0, 2) * m(3, 3) - m(0, 3) * m(3, 2)) +
|
||||
m(2, 2) * (m(0, 3) * m(3, 1) - m(0, 1) * m(3, 3)) +
|
||||
m(2, 3) * (m(0, 1) * m(3, 2) - m(0, 2) * m(3, 1)));
|
||||
out(0, 2) = d * (m(3, 1) * (m(0, 2) * m(1, 3) - m(0, 3) * m(1, 2)) +
|
||||
m(3, 2) * (m(0, 3) * m(1, 1) - m(0, 1) * m(1, 3)) +
|
||||
m(3, 3) * (m(0, 1) * m(1, 2) - m(0, 2) * m(1, 1)));
|
||||
out(0, 3) = d * (m(0, 1) * (m(1, 3) * m(2, 2) - m(1, 2) * m(2, 3)) +
|
||||
m(0, 2) * (m(1, 1) * m(2, 3) - m(1, 3) * m(2, 1)) +
|
||||
m(0, 3) * (m(1, 2) * m(2, 1) - m(1, 1) * m(2, 2)));
|
||||
out(1, 0) = d * (m(1, 2) * (m(2, 0) * m(3, 3) - m(2, 3) * m(3, 0)) +
|
||||
m(1, 3) * (m(2, 2) * m(3, 0) - m(2, 0) * m(3, 2)) +
|
||||
m(1, 0) * (m(2, 3) * m(3, 2) - m(2, 2) * m(3, 3)));
|
||||
out(1, 1) = d * (m(2, 2) * (m(0, 0) * m(3, 3) - m(0, 3) * m(3, 0)) +
|
||||
m(2, 3) * (m(0, 2) * m(3, 0) - m(0, 0) * m(3, 2)) +
|
||||
m(2, 0) * (m(0, 3) * m(3, 2) - m(0, 2) * m(3, 3)));
|
||||
out(1, 2) = d * (m(3, 2) * (m(0, 0) * m(1, 3) - m(0, 3) * m(1, 0)) +
|
||||
m(3, 3) * (m(0, 2) * m(1, 0) - m(0, 0) * m(1, 2)) +
|
||||
m(3, 0) * (m(0, 3) * m(1, 2) - m(0, 2) * m(1, 3)));
|
||||
out(1, 3) = d * (m(0, 2) * (m(1, 3) * m(2, 0) - m(1, 0) * m(2, 3)) +
|
||||
m(0, 3) * (m(1, 0) * m(2, 2) - m(1, 2) * m(2, 0)) +
|
||||
m(0, 0) * (m(1, 2) * m(2, 3) - m(1, 3) * m(2, 2)));
|
||||
out(2, 0) = d * (m(1, 3) * (m(2, 0) * m(3, 1) - m(2, 1) * m(3, 0)) +
|
||||
m(1, 0) * (m(2, 1) * m(3, 3) - m(2, 3) * m(3, 1)) +
|
||||
m(1, 1) * (m(2, 3) * m(3, 0) - m(2, 0) * m(3, 3)));
|
||||
out(2, 1) = d * (m(2, 3) * (m(0, 0) * m(3, 1) - m(0, 1) * m(3, 0)) +
|
||||
m(2, 0) * (m(0, 1) * m(3, 3) - m(0, 3) * m(3, 1)) +
|
||||
m(2, 1) * (m(0, 3) * m(3, 0) - m(0, 0) * m(3, 3)));
|
||||
out(2, 2) = d * (m(3, 3) * (m(0, 0) * m(1, 1) - m(0, 1) * m(1, 0)) +
|
||||
m(3, 0) * (m(0, 1) * m(1, 3) - m(0, 3) * m(1, 1)) +
|
||||
m(3, 1) * (m(0, 3) * m(1, 0) - m(0, 0) * m(1, 3)));
|
||||
out(2, 3) = d * (m(0, 3) * (m(1, 1) * m(2, 0) - m(1, 0) * m(2, 1)) +
|
||||
m(0, 0) * (m(1, 3) * m(2, 1) - m(1, 1) * m(2, 3)) +
|
||||
m(0, 1) * (m(1, 0) * m(2, 3) - m(1, 3) * m(2, 0)));
|
||||
out(3, 0) = d * (m(1, 0) * (m(2, 2) * m(3, 1) - m(2, 1) * m(3, 2)) +
|
||||
m(1, 1) * (m(2, 0) * m(3, 2) - m(2, 2) * m(3, 0)) +
|
||||
m(1, 2) * (m(2, 1) * m(3, 0) - m(2, 0) * m(3, 1)));
|
||||
out(3, 1) = d * (m(2, 0) * (m(0, 2) * m(3, 1) - m(0, 1) * m(3, 2)) +
|
||||
m(2, 1) * (m(0, 0) * m(3, 2) - m(0, 2) * m(3, 0)) +
|
||||
m(2, 2) * (m(0, 1) * m(3, 0) - m(0, 0) * m(3, 1)));
|
||||
out(3, 2) = d * (m(3, 0) * (m(0, 2) * m(1, 1) - m(0, 1) * m(1, 2)) +
|
||||
m(3, 1) * (m(0, 0) * m(1, 2) - m(0, 2) * m(1, 0)) +
|
||||
m(3, 2) * (m(0, 1) * m(1, 0) - m(0, 0) * m(1, 1)));
|
||||
out(3, 3) = d * (m(0, 0) * (m(1, 1) * m(2, 2) - m(1, 2) * m(2, 1)) +
|
||||
m(0, 1) * (m(1, 2) * m(2, 0) - m(1, 0) * m(2, 2)) +
|
||||
m(0, 2) * (m(1, 0) * m(2, 1) - m(1, 1) * m(2, 0)));
|
||||
out.definitelyIdentityMatrix = definitelyIdentityMatrix;
|
||||
return true;
|
||||
}
|
||||
|
@ -1195,7 +1232,8 @@ namespace core
|
|||
|
||||
//! Builds a right-handed perspective projection matrix based on a field of view
|
||||
template <class T>
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveFovRH(f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar)
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveFovRH(
|
||||
f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar)
|
||||
{
|
||||
const f64 h = 1.0/tan(fieldOfViewRadians/2.0);
|
||||
const T w = h / aspectRatio;
|
||||
|
@ -1229,7 +1267,8 @@ namespace core
|
|||
|
||||
//! Builds a left-handed perspective projection matrix based on a field of view
|
||||
template <class T>
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveFovLH(f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar)
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveFovLH(
|
||||
f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar)
|
||||
{
|
||||
const f64 h = 1.0/tan(fieldOfViewRadians/2.0);
|
||||
const T w = (T)(h / aspectRatio);
|
||||
|
@ -1260,7 +1299,8 @@ namespace core
|
|||
|
||||
//! Builds a left-handed orthogonal projection matrix.
|
||||
template <class T>
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixOrthoLH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar)
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixOrthoLH(
|
||||
f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar)
|
||||
{
|
||||
M[0] = (T)(2/widthOfViewVolume);
|
||||
M[1] = 0;
|
||||
|
@ -1289,7 +1329,8 @@ namespace core
|
|||
|
||||
//! Builds a right-handed orthogonal projection matrix.
|
||||
template <class T>
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixOrthoRH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar)
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixOrthoRH(
|
||||
f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar)
|
||||
{
|
||||
M[0] = (T)(2/widthOfViewVolume);
|
||||
M[1] = 0;
|
||||
|
@ -1317,7 +1358,8 @@ namespace core
|
|||
|
||||
//! Builds a right-handed perspective projection matrix.
|
||||
template <class T>
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveRH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar)
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveRH(
|
||||
f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar)
|
||||
{
|
||||
M[0] = (T)(2*zNear/widthOfViewVolume);
|
||||
M[1] = 0;
|
||||
|
@ -1345,7 +1387,8 @@ namespace core
|
|||
|
||||
//! Builds a left-handed perspective projection matrix.
|
||||
template <class T>
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveLH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar)
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveLH(
|
||||
f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar)
|
||||
{
|
||||
M[0] = (T)(2*zNear/widthOfViewVolume);
|
||||
M[1] = 0;
|
||||
|
@ -1563,9 +1606,9 @@ namespace core
|
|||
|
||||
template <class T>
|
||||
inline CMatrix4<T>& CMatrix4<T>::buildTextureTransform( f32 rotateRad,
|
||||
const core::vector2df &rotatecenter,
|
||||
const core::vector2df &translate,
|
||||
const core::vector2df &scale)
|
||||
const core::vector2df &rotatecenter,
|
||||
const core::vector2df &translate,
|
||||
const core::vector2df &scale)
|
||||
{
|
||||
const f32 c = cosf(rotateRad);
|
||||
const f32 s = sinf(rotateRad);
|
||||
|
|
|
@ -34,7 +34,8 @@ class plane3d
|
|||
plane3d(): Normal(0,1,0) { recalculateD(vector3d<T>(0,0,0)); }
|
||||
plane3d(const vector3d<T>& MPoint, const vector3d<T>& Normal) : Normal(Normal) { recalculateD(MPoint); }
|
||||
plane3d(T px, T py, T pz, T nx, T ny, T nz) : Normal(nx, ny, nz) { recalculateD(vector3d<T>(px, py, pz)); }
|
||||
plane3d(const vector3d<T>& point1, const vector3d<T>& point2, const vector3d<T>& point3) { setPlane(point1, point2, point3); }
|
||||
plane3d(const vector3d<T>& point1, const vector3d<T>& point2, const vector3d<T>& point3)
|
||||
{ setPlane(point1, point2, point3); }
|
||||
|
||||
// operators
|
||||
|
||||
|
|
|
@ -421,7 +421,9 @@ void CAnimatedMeshSceneNode::render()
|
|||
|
||||
for (u32 n=0;n<joint->Children.size();++n)
|
||||
{
|
||||
driver->draw3DLine(joint->GlobalAnimatedMatrix.getTranslation(), joint->Children[n]->GlobalAnimatedMatrix.getTranslation(), video::SColor(0,51,66,255));
|
||||
driver->draw3DLine(joint->GlobalAnimatedMatrix.getTranslation(),
|
||||
joint->Children[n]->GlobalAnimatedMatrix.getTranslation(),
|
||||
video::SColor(0,51,66,255));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -794,7 +794,9 @@ const core::rect<s32>& CD3D8Driver::getViewPort() const
|
|||
|
||||
|
||||
//! draws a vertex primitive list
|
||||
void CD3D8Driver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const u16* indexList, u32 primitiveCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType)
|
||||
void CD3D8Driver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
|
||||
const u16* indexList, u32 primitiveCount,
|
||||
E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType)
|
||||
{
|
||||
if (!checkPrimitiveCount(primitiveCount))
|
||||
return;
|
||||
|
@ -981,10 +983,22 @@ void CD3D8Driver::draw2DImage(const video::ITexture* texture, const core::positi
|
|||
setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture);
|
||||
|
||||
S3DVertex vtx[4];
|
||||
vtx[0] = S3DVertex((f32)(poss.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-poss.UpperLeftCorner.Y ) * yFact , 0.0f, 0.0f, 0.0f, 0.0f, color, tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[1] = S3DVertex((f32)(poss.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus- poss.UpperLeftCorner.Y) * yFact, 0.0f, 0.0f, 0.0f, 0.0f, color, tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[2] = S3DVertex((f32)(poss.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus-poss.LowerRightCorner.Y) * yFact, 0.0f, 0.0f, 0.0f, 0.0f, color, tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
|
||||
vtx[3] = S3DVertex((f32)(poss.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-poss.LowerRightCorner.Y) * yFact, 0.0f, 0.0f, 0.0f, 0.0f, color, tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
|
||||
vtx[0] = S3DVertex((f32)(poss.UpperLeftCorner.X+xPlus) * xFact,
|
||||
(f32)(yPlus-poss.UpperLeftCorner.Y ) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, color,
|
||||
tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[1] = S3DVertex((f32)(poss.LowerRightCorner.X+xPlus) * xFact,
|
||||
(f32)(yPlus- poss.UpperLeftCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, color,
|
||||
tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[2] = S3DVertex((f32)(poss.LowerRightCorner.X+xPlus) * xFact,
|
||||
(f32)(yPlus-poss.LowerRightCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, color,
|
||||
tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
|
||||
vtx[3] = S3DVertex((f32)(poss.UpperLeftCorner.X+xPlus) * xFact,
|
||||
(f32)(yPlus-poss.LowerRightCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, color,
|
||||
tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
|
||||
|
||||
s16 indices[6] = {0,1,2,0,2,3};
|
||||
|
||||
|
@ -1030,14 +1044,24 @@ void CD3D8Driver::draw2DImage(const video::ITexture* texture, const core::rect<s
|
|||
video::SColor* useColor = colors ? colors : temp;
|
||||
|
||||
S3DVertex vtx[4]; // clock wise
|
||||
vtx[0] = S3DVertex(npos.UpperLeftCorner.X, npos.UpperLeftCorner.Y , 0.0f, 0.0f, 0.0f, 0.0f, useColor[0], tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[1] = S3DVertex(npos.LowerRightCorner.X, npos.UpperLeftCorner.Y , 0.0f, 0.0f, 0.0f, 0.0f, useColor[3], tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[2] = S3DVertex(npos.LowerRightCorner.X, npos.LowerRightCorner.Y, 0.0f, 0.0f, 0.0f, 0.0f, useColor[2], tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
|
||||
vtx[3] = S3DVertex(npos.UpperLeftCorner.X, npos.LowerRightCorner.Y, 0.0f, 0.0f, 0.0f, 0.0f, useColor[1], tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
|
||||
vtx[0] = S3DVertex(npos.UpperLeftCorner.X, npos.UpperLeftCorner.Y, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, useColor[0],
|
||||
tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[1] = S3DVertex(npos.LowerRightCorner.X, npos.UpperLeftCorner.Y, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, useColor[3],
|
||||
tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[2] = S3DVertex(npos.LowerRightCorner.X, npos.LowerRightCorner.Y, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, useColor[2],
|
||||
tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
|
||||
vtx[3] = S3DVertex(npos.UpperLeftCorner.X, npos.LowerRightCorner.Y, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, useColor[1],
|
||||
tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
|
||||
|
||||
s16 indices[6] = {0,1,2,0,2,3};
|
||||
|
||||
setRenderStates2DMode(useColor[0].getAlpha()<255 || useColor[1].getAlpha()<255 || useColor[2].getAlpha()<255 || useColor[3].getAlpha()<255, true, useAlphaChannelOfTexture);
|
||||
setRenderStates2DMode(useColor[0].getAlpha()<255 || useColor[1].getAlpha()<255 ||
|
||||
useColor[2].getAlpha()<255 || useColor[3].getAlpha()<255,
|
||||
true, useAlphaChannelOfTexture);
|
||||
|
||||
setTexture(0, texture);
|
||||
|
||||
|
@ -1070,10 +1094,14 @@ void CD3D8Driver::draw2DRectangle(const core::rect<s32>& position,
|
|||
f32 yFact = 1.0f / (renderTargetSize.Height>>1);
|
||||
|
||||
S3DVertex vtx[4];
|
||||
vtx[0] = S3DVertex((f32)(pos.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-pos.UpperLeftCorner.Y) * yFact , 0.0f, 0.0f, 0.0f, 0.0f, colorLeftUp, 0.0f, 0.0f);
|
||||
vtx[1] = S3DVertex((f32)(pos.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus- pos.UpperLeftCorner.Y) * yFact, 0.0f, 0.0f, 0.0f, 0.0f, colorRightUp, 0.0f, 1.0f);
|
||||
vtx[2] = S3DVertex((f32)(pos.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus-pos.LowerRightCorner.Y) * yFact, 0.0f, 0.0f, 0.0f, 0.0f, colorRightDown, 1.0f, 0.0f);
|
||||
vtx[3] = S3DVertex((f32)(pos.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-pos.LowerRightCorner.Y) * yFact, 0.0f, 0.0f, 0.0f, 0.0f, colorLeftDown, 1.0f, 1.0f);
|
||||
vtx[0] = S3DVertex((f32)(pos.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-pos.UpperLeftCorner.Y) * yFact , 0.0f,
|
||||
0.0f, 0.0f, 0.0f, colorLeftUp, 0.0f, 0.0f);
|
||||
vtx[1] = S3DVertex((f32)(pos.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus- pos.UpperLeftCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, colorRightUp, 0.0f, 1.0f);
|
||||
vtx[2] = S3DVertex((f32)(pos.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus-pos.LowerRightCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, colorRightDown, 1.0f, 0.0f);
|
||||
vtx[3] = S3DVertex((f32)(pos.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-pos.LowerRightCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, colorLeftDown, 1.0f, 1.0f);
|
||||
|
||||
s16 indices[6] = {0,1,2,0,2,3};
|
||||
|
||||
|
@ -1381,8 +1409,10 @@ void CD3D8Driver::setBasicRenderStates(const SMaterial& material, const SMateria
|
|||
{
|
||||
if (material.TextureLayer[st].BilinearFilter || material.TextureLayer[st].TrilinearFilter || material.TextureLayer[st].AnisotropicFilter)
|
||||
{
|
||||
D3DTEXTUREFILTERTYPE tftMag = ((Caps.TextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) && material.TextureLayer[st].AnisotropicFilter) ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR;
|
||||
D3DTEXTUREFILTERTYPE tftMin = ((Caps.TextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) && material.TextureLayer[st].AnisotropicFilter) ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR;
|
||||
D3DTEXTUREFILTERTYPE tftMag = ((Caps.TextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) &&
|
||||
material.TextureLayer[st].AnisotropicFilter) ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR;
|
||||
D3DTEXTUREFILTERTYPE tftMin = ((Caps.TextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) &&
|
||||
material.TextureLayer[st].AnisotropicFilter) ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR;
|
||||
D3DTEXTUREFILTERTYPE tftMip = material.TextureLayer[st].TrilinearFilter ? D3DTEXF_LINEAR : D3DTEXF_POINT;
|
||||
|
||||
pID3DDevice->SetTextureStageState(st, D3DTSS_MAGFILTER, tftMag);
|
||||
|
|
|
@ -66,7 +66,9 @@ namespace video
|
|||
virtual const core::rect<s32>& getViewPort() const;
|
||||
|
||||
//! draws a vertex primitive list
|
||||
void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const u16* indexList, u32 primitiveCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
|
||||
void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
|
||||
const u16* indexList, u32 primitiveCount,
|
||||
E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
|
||||
|
||||
//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted.
|
||||
virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
|
||||
|
|
|
@ -1021,7 +1021,9 @@ void CD3D9Driver::drawHardwareBuffer(SHWBufferLink *_HWBuffer)
|
|||
}
|
||||
|
||||
//! draws a vertex primitive list
|
||||
void CD3D9Driver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const u16* indexList, u32 primitiveCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType)
|
||||
void CD3D9Driver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
|
||||
const u16* indexList, u32 primitiveCount,
|
||||
E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType)
|
||||
{
|
||||
if (!checkPrimitiveCount(primitiveCount))
|
||||
return;
|
||||
|
@ -1184,14 +1186,24 @@ void CD3D9Driver::draw2DImage(const video::ITexture* texture, const core::rect<s
|
|||
video::SColor* useColor = colors ? colors : temp;
|
||||
|
||||
S3DVertex vtx[4]; // clock wise
|
||||
vtx[0] = S3DVertex(npos.UpperLeftCorner.X, npos.UpperLeftCorner.Y , 0.0f, 0.0f, 0.0f, 0.0f, useColor[0], tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[1] = S3DVertex(npos.LowerRightCorner.X, npos.UpperLeftCorner.Y , 0.0f, 0.0f, 0.0f, 0.0f, useColor[3], tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[2] = S3DVertex(npos.LowerRightCorner.X, npos.LowerRightCorner.Y, 0.0f, 0.0f, 0.0f, 0.0f, useColor[2], tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
|
||||
vtx[3] = S3DVertex(npos.UpperLeftCorner.X, npos.LowerRightCorner.Y, 0.0f, 0.0f, 0.0f, 0.0f, useColor[1], tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
|
||||
vtx[0] = S3DVertex(npos.UpperLeftCorner.X, npos.UpperLeftCorner.Y, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, useColor[0],
|
||||
tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[1] = S3DVertex(npos.LowerRightCorner.X, npos.UpperLeftCorner.Y, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, useColor[3],
|
||||
tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[2] = S3DVertex(npos.LowerRightCorner.X, npos.LowerRightCorner.Y, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, useColor[2],
|
||||
tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
|
||||
vtx[3] = S3DVertex(npos.UpperLeftCorner.X, npos.LowerRightCorner.Y, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, useColor[1],
|
||||
tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
|
||||
|
||||
s16 indices[6] = {0,1,2,0,2,3};
|
||||
|
||||
setRenderStates2DMode(useColor[0].getAlpha()<255 || useColor[1].getAlpha()<255 || useColor[2].getAlpha()<255 || useColor[3].getAlpha()<255, true, useAlphaChannelOfTexture);
|
||||
setRenderStates2DMode(useColor[0].getAlpha()<255 || useColor[1].getAlpha()<255 ||
|
||||
useColor[2].getAlpha()<255 || useColor[3].getAlpha()<255,
|
||||
true, useAlphaChannelOfTexture);
|
||||
|
||||
setTexture(0, const_cast<video::ITexture*>(texture));
|
||||
|
||||
|
@ -1320,10 +1332,18 @@ void CD3D9Driver::draw2DImage(const video::ITexture* texture,
|
|||
setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture);
|
||||
|
||||
S3DVertex vtx[4];
|
||||
vtx[0] = S3DVertex((f32)(poss.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-poss.UpperLeftCorner.Y ) * yFact , 0.0f, 0.0f, 0.0f, 0.0f, color, tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[1] = S3DVertex((f32)(poss.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus- poss.UpperLeftCorner.Y) * yFact, 0.0f, 0.0f, 0.0f, 0.0f, color, tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[2] = S3DVertex((f32)(poss.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus-poss.LowerRightCorner.Y) * yFact, 0.0f, 0.0f, 0.0f, 0.0f, color, tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
|
||||
vtx[3] = S3DVertex((f32)(poss.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-poss.LowerRightCorner.Y) * yFact, 0.0f, 0.0f, 0.0f, 0.0f, color, tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
|
||||
vtx[0] = S3DVertex((f32)(poss.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-poss.UpperLeftCorner.Y ) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, color,
|
||||
tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[1] = S3DVertex((f32)(poss.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus- poss.UpperLeftCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, color,
|
||||
tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y);
|
||||
vtx[2] = S3DVertex((f32)(poss.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus-poss.LowerRightCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, color,
|
||||
tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y);
|
||||
vtx[3] = S3DVertex((f32)(poss.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-poss.LowerRightCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, color,
|
||||
tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y);
|
||||
|
||||
s16 indices[6] = {0,1,2,0,2,3};
|
||||
|
||||
|
@ -1357,10 +1377,14 @@ void CD3D9Driver::draw2DRectangle(const core::rect<s32>& position,
|
|||
f32 yFact = 2.0f / renderTargetSize.Height;
|
||||
|
||||
S3DVertex vtx[4];
|
||||
vtx[0] = S3DVertex((f32)(pos.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-pos.UpperLeftCorner.Y) * yFact , 0.0f, 0.0f, 0.0f, 0.0f, colorLeftUp, 0.0f, 0.0f);
|
||||
vtx[1] = S3DVertex((f32)(pos.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus- pos.UpperLeftCorner.Y) * yFact, 0.0f, 0.0f, 0.0f, 0.0f, colorRightUp, 0.0f, 1.0f);
|
||||
vtx[2] = S3DVertex((f32)(pos.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus-pos.LowerRightCorner.Y) * yFact, 0.0f, 0.0f, 0.0f, 0.0f, colorRightDown, 1.0f, 0.0f);
|
||||
vtx[3] = S3DVertex((f32)(pos.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-pos.LowerRightCorner.Y) * yFact, 0.0f, 0.0f, 0.0f, 0.0f, colorLeftDown, 1.0f, 1.0f);
|
||||
vtx[0] = S3DVertex((f32)(pos.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-pos.UpperLeftCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, colorLeftUp, 0.0f, 0.0f);
|
||||
vtx[1] = S3DVertex((f32)(pos.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus- pos.UpperLeftCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, colorRightUp, 0.0f, 1.0f);
|
||||
vtx[2] = S3DVertex((f32)(pos.LowerRightCorner.X+xPlus) * xFact, (f32)(yPlus-pos.LowerRightCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, colorRightDown, 1.0f, 0.0f);
|
||||
vtx[3] = S3DVertex((f32)(pos.UpperLeftCorner.X+xPlus) * xFact, (f32)(yPlus-pos.LowerRightCorner.Y) * yFact, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, colorLeftDown, 1.0f, 1.0f);
|
||||
|
||||
s16 indices[6] = {0,1,2,0,2,3};
|
||||
|
||||
|
@ -1662,8 +1686,10 @@ void CD3D9Driver::setBasicRenderStates(const SMaterial& material, const SMateria
|
|||
{
|
||||
if (material.TextureLayer[st].BilinearFilter || material.TextureLayer[st].TrilinearFilter || material.TextureLayer[st].AnisotropicFilter)
|
||||
{
|
||||
D3DTEXTUREFILTERTYPE tftMag = ((Caps.TextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) && material.TextureLayer[st].AnisotropicFilter) ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR;
|
||||
D3DTEXTUREFILTERTYPE tftMin = ((Caps.TextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) && material.TextureLayer[st].AnisotropicFilter) ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR;
|
||||
D3DTEXTUREFILTERTYPE tftMag = ((Caps.TextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) &&
|
||||
material.TextureLayer[st].AnisotropicFilter) ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR;
|
||||
D3DTEXTUREFILTERTYPE tftMin = ((Caps.TextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) &&
|
||||
material.TextureLayer[st].AnisotropicFilter) ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR;
|
||||
D3DTEXTUREFILTERTYPE tftMip = material.TextureLayer[st].TrilinearFilter ? D3DTEXF_LINEAR : D3DTEXF_POINT;
|
||||
|
||||
pID3DDevice->SetSamplerState(st, D3DSAMP_MAGFILTER, tftMag);
|
||||
|
|
|
@ -86,7 +86,9 @@ namespace video
|
|||
virtual void drawHardwareBuffer(SHWBufferLink *HWBuffer);
|
||||
|
||||
//! draws a vertex primitive list
|
||||
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const u16* indexList, u32 primitiveCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
|
||||
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
|
||||
const u16* indexList, u32 primitiveCount,
|
||||
E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
|
||||
|
||||
//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted.
|
||||
virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
|
||||
|
|
|
@ -137,9 +137,14 @@ CGUIEnvironment::~CGUIEnvironment()
|
|||
CurrentSkin = 0;
|
||||
}
|
||||
|
||||
// delete all fonts
|
||||
u32 i;
|
||||
|
||||
// delete all sprite banks
|
||||
for (i=0; i<Banks.size(); ++i)
|
||||
if (Banks[i].Bank)
|
||||
Banks[i].Bank->drop();
|
||||
|
||||
// delete all fonts
|
||||
for (i=0; i<Fonts.size(); ++i)
|
||||
Fonts[i].Font->drop();
|
||||
|
||||
|
@ -1409,11 +1414,10 @@ IGUISpriteBank* CGUIEnvironment::addEmptySpriteBank(const c8 *name)
|
|||
else
|
||||
b.Filename = name;
|
||||
|
||||
s32 index = Banks.binary_search(b);
|
||||
const s32 index = Banks.binary_search(b);
|
||||
if (index != -1)
|
||||
return 0;
|
||||
|
||||
|
||||
// create a new sprite bank
|
||||
|
||||
b.Bank = new CGUISpriteBank(this);
|
||||
|
@ -1434,7 +1438,6 @@ IGUIFont* CGUIEnvironment::getBuiltInFont() const
|
|||
}
|
||||
|
||||
|
||||
|
||||
//! Returns the root gui element.
|
||||
IGUIElement* CGUIEnvironment::getRootGUIElement()
|
||||
{
|
||||
|
|
|
@ -33,6 +33,8 @@ CGUIFont::CGUIFont(IGUIEnvironment *env, const c8* filename)
|
|||
Driver = Environment->getVideoDriver();
|
||||
|
||||
SpriteBank = Environment->addEmptySpriteBank(filename);
|
||||
if (SpriteBank)
|
||||
SpriteBank->grab();
|
||||
}
|
||||
|
||||
if (Driver)
|
||||
|
@ -48,7 +50,6 @@ CGUIFont::~CGUIFont()
|
|||
|
||||
if (SpriteBank)
|
||||
SpriteBank->drop();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -49,7 +49,9 @@ public:
|
|||
bool load(io::IXMLReader* xml);
|
||||
|
||||
//! draws an text and clips it to the specified rectangle if wanted
|
||||
virtual void draw(const wchar_t* text, const core::rect<s32>& position, video::SColor color, bool hcenter=false, bool vcenter=false, const core::rect<s32>* clip=0);
|
||||
virtual void draw(const wchar_t* text, const core::rect<s32>& position,
|
||||
video::SColor color, bool hcenter=false,
|
||||
bool vcenter=false, const core::rect<s32>* clip=0);
|
||||
|
||||
//! returns the dimension of a text
|
||||
virtual core::dimension2d<s32> getDimension(const wchar_t* text) const;
|
||||
|
|
|
@ -515,7 +515,8 @@ void CGUIListBox::draw()
|
|||
if ( i==Selected && hl )
|
||||
{
|
||||
IconBank->draw2DSprite( (u32)Items[i].icon, iconPos, &clientClip,
|
||||
hasItemOverrideColor(i, EGUI_LBC_ICON_HIGHLIGHT) ? getItemOverrideColor(i, EGUI_LBC_ICON_HIGHLIGHT) : getItemDefaultColor(EGUI_LBC_ICON_HIGHLIGHT),
|
||||
hasItemOverrideColor(i, EGUI_LBC_ICON_HIGHLIGHT) ?
|
||||
getItemOverrideColor(i, EGUI_LBC_ICON_HIGHLIGHT) : getItemDefaultColor(EGUI_LBC_ICON_HIGHLIGHT),
|
||||
selectTime, os::Timer::getTime(), false, true);
|
||||
}
|
||||
else
|
||||
|
@ -531,7 +532,8 @@ void CGUIListBox::draw()
|
|||
if ( i==Selected && hl )
|
||||
{
|
||||
Font->draw(Items[i].text.c_str(), textRect,
|
||||
hasItemOverrideColor(i, EGUI_LBC_TEXT_HIGHLIGHT) ? getItemOverrideColor(i, EGUI_LBC_TEXT_HIGHLIGHT) : getItemDefaultColor(EGUI_LBC_TEXT_HIGHLIGHT),
|
||||
hasItemOverrideColor(i, EGUI_LBC_TEXT_HIGHLIGHT) ?
|
||||
getItemOverrideColor(i, EGUI_LBC_TEXT_HIGHLIGHT) : getItemDefaultColor(EGUI_LBC_TEXT_HIGHLIGHT),
|
||||
false, true, &clientClip);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -154,7 +154,10 @@ void CGUIMeshViewer::draw()
|
|||
for (u32 i=0; i<m->getMeshBufferCount(); ++i)
|
||||
{
|
||||
scene::IMeshBuffer* mb = m->getMeshBuffer(i);
|
||||
driver->drawVertexPrimitiveList(mb->getVertices(), mb->getVertexCount(), mb->getIndices(), mb->getIndexCount()/ 3, mb->getVertexType(), scene::EPT_TRIANGLES);
|
||||
driver->drawVertexPrimitiveList(mb->getVertices(),
|
||||
mb->getVertexCount(), mb->getIndices(),
|
||||
mb->getIndexCount()/ 3, mb->getVertexType(),
|
||||
scene::EPT_TRIANGLES);
|
||||
}
|
||||
|
||||
driver->setViewPort(oldViewPort);
|
||||
|
|
|
@ -515,7 +515,6 @@ void CGUIScrollBar::deserializeAttributes(io::IAttributes* in, io::SAttributeRea
|
|||
setPos(in->getAttributeAsInt("Value"));
|
||||
setSmallStep(in->getAttributeAsInt("SmallStep"));
|
||||
setLargeStep(in->getAttributeAsInt("LargeStep"));
|
||||
NoClip = in->getAttributeAsBool("NoClip");
|
||||
|
||||
refreshControls();
|
||||
}
|
||||
|
|
|
@ -94,7 +94,9 @@ public:
|
|||
void copyTo(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect=0);
|
||||
|
||||
//! copies this surface into another, using the alpha mask, an cliprect and a color to add with
|
||||
void copyToWithAlpha(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const SColor &color, const core::rect<s32>* clipRect = 0);
|
||||
void copyToWithAlpha(IImage* target, const core::position2d<s32>& pos,
|
||||
const core::rect<s32>& sourceRect, const SColor &color,
|
||||
const core::rect<s32>* clipRect = 0);
|
||||
|
||||
//! copies this surface into another, scaling it to fit.
|
||||
void copyToScaling(void* target, s32 width, s32 height, ECOLOR_FORMAT format, u32 pitch=0);
|
||||
|
|
|
@ -209,7 +209,11 @@ bool CIrrDeviceLinux::createWindow(const core::dimension2d<s32>& windowSize,
|
|||
{
|
||||
if (bestMode==-1 && modes[i]->hdisplay >= Width && modes[i]->vdisplay >= Height)
|
||||
bestMode = i;
|
||||
else if (bestMode!=-1 && modes[i]->hdisplay >= Width && modes[i]->vdisplay >= Height && modes[i]->hdisplay < modes[bestMode]->hdisplay && modes[i]->vdisplay < modes[bestMode]->vdisplay)
|
||||
else if (bestMode!=-1 &&
|
||||
modes[i]->hdisplay >= Width &&
|
||||
modes[i]->vdisplay >= Height &&
|
||||
modes[i]->hdisplay < modes[bestMode]->hdisplay &&
|
||||
modes[i]->vdisplay < modes[bestMode]->vdisplay)
|
||||
bestMode = i;
|
||||
VideoModeList.addMode(core::dimension2d<s32>(
|
||||
modes[i]->hdisplay, modes[i]->vdisplay), defaultDepth);
|
||||
|
@ -244,7 +248,11 @@ bool CIrrDeviceLinux::createWindow(const core::dimension2d<s32>& windowSize,
|
|||
{
|
||||
if (bestMode==-1 && (u32)modes[i].width >= Width && (u32)modes[i].height >= Height)
|
||||
bestMode = i;
|
||||
else if (bestMode!=-1 && (u32)modes[i].width >= Width && (u32)modes[i].height >= Height && modes[i].width < modes[bestMode].width && modes[i].height < modes[bestMode].height)
|
||||
else if (bestMode!=-1 &&
|
||||
(u32)modes[i].width >= Width &&
|
||||
(u32)modes[i].height >= Height &&
|
||||
modes[i].width < modes[bestMode].width &&
|
||||
modes[i].height < modes[bestMode].height)
|
||||
bestMode = i;
|
||||
VideoModeList.addMode(core::dimension2d<s32>(
|
||||
modes[i].width, modes[i].height), defaultDepth);
|
||||
|
|
|
@ -324,7 +324,10 @@ void CIrrDeviceSDL::setWindowCaption(const wchar_t* text)
|
|||
void CIrrDeviceSDL::present(video::IImage* surface, void* windowId, core::rect<s32>* src)
|
||||
{
|
||||
SDL_Rect srcClip;
|
||||
SDL_Surface *sdlSurface = SDL_CreateRGBSurfaceFrom (surface->lock(), surface->getDimension().Width, surface->getDimension().Height, surface->getBitsPerPixel(), surface->getPitch(), surface->getRedMask(), surface->getGreenMask(), surface->getBlueMask(), 0);
|
||||
SDL_Surface *sdlSurface = SDL_CreateRGBSurfaceFrom(
|
||||
surface->lock(), surface->getDimension().Width, surface->getDimension().Height,
|
||||
surface->getBitsPerPixel(), surface->getPitch(),
|
||||
surface->getRedMask(), surface->getGreenMask(), surface->getBlueMask(), 0);
|
||||
if (src)
|
||||
{
|
||||
srcClip.x = src->UpperLeftCorner.X;
|
||||
|
|
|
@ -35,8 +35,12 @@ namespace irr
|
|||
|
||||
namespace video
|
||||
{
|
||||
IVideoDriver* createSoftwareDriver(const core::dimension2d<s32>& windowSize, bool fullscreen, io::IFileSystem* io, video::IImagePresenter* presenter);
|
||||
IVideoDriver* createSoftwareDriver2(const core::dimension2d<s32>& windowSize, bool fullscreen, io::IFileSystem* io, video::IImagePresenter* presenter);
|
||||
IVideoDriver* createSoftwareDriver(const core::dimension2d<s32>& windowSize,
|
||||
bool fullscreen, io::IFileSystem* io,
|
||||
video::IImagePresenter* presenter);
|
||||
IVideoDriver* createSoftwareDriver2(const core::dimension2d<s32>& windowSize,
|
||||
bool fullscreen, io::IFileSystem* io,
|
||||
video::IImagePresenter* presenter);
|
||||
IVideoDriver* createNullDriver(io::IFileSystem* io, const core::dimension2d<s32>& screenSize);
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,9 @@ namespace video
|
|||
virtual const core::rect<s32>& getViewPort() const;
|
||||
|
||||
//! draws a vertex primitive list
|
||||
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const u16* indexList, u32 primitiveCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
|
||||
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
|
||||
const u16* indexList, u32 primitiveCount,
|
||||
E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
|
||||
|
||||
//! draws an indexed triangle list
|
||||
virtual void drawIndexedTriangleList(const S3DVertex* vertices, u32 vertexCount, const u16* indexList, u32 triangleCount);
|
||||
|
|
|
@ -59,7 +59,10 @@ namespace scene
|
|||
class COCTLoader : public IMeshLoader
|
||||
{
|
||||
public:
|
||||
void OCTLoadLights(io::IReadFile* file, ISceneManager * scene, ISceneNode * parent = 0, f32 radius = 500.0f, f32 intensityScale = 0.0000001f*2.5, bool rewind = true);
|
||||
void OCTLoadLights(io::IReadFile* file, ISceneManager * scene,
|
||||
ISceneNode * parent = 0, f32 radius = 500.0f,
|
||||
f32 intensityScale = 0.0000001f*2.5,
|
||||
bool rewind = true);
|
||||
|
||||
//! constructor
|
||||
COCTLoader(video::IVideoDriver* driver);
|
||||
|
|
|
@ -31,7 +31,9 @@ namespace video
|
|||
// -----------------------------------------------------------------------
|
||||
#ifdef _IRR_USE_WINDOWS_DEVICE_
|
||||
//! Windows constructor and init code
|
||||
COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize, HWND window, bool fullscreen, bool stencilBuffer, io::IFileSystem* io, bool antiAlias)
|
||||
COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize,
|
||||
HWND window, bool fullscreen, bool stencilBuffer,
|
||||
io::IFileSystem* io, bool antiAlias)
|
||||
: CNullDriver(io, screenSize), COpenGLExtensionHandler(),
|
||||
CurrentRenderMode(ERM_NONE), ResetRenderStates(true), Transformation3DChanged(true),
|
||||
AntiAlias(antiAlias), RenderTargetTexture(0), LastSetLight(-1),
|
||||
|
@ -161,7 +163,9 @@ bool COpenGLDriver::initDriver(const core::dimension2d<s32>& screenSize,
|
|||
// -----------------------------------------------------------------------
|
||||
#ifdef _IRR_USE_OSX_DEVICE_
|
||||
//! Windows constructor and init code
|
||||
COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize, bool fullscreen, bool stencilBuffer, CIrrDeviceMacOSX *device, io::IFileSystem* io, bool vsync, bool antiAlias)
|
||||
COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize,
|
||||
bool fullscreen, bool stencilBuffer, CIrrDeviceMacOSX *device,
|
||||
io::IFileSystem* io, bool vsync, bool antiAlias)
|
||||
: CNullDriver(io, screenSize), COpenGLExtensionHandler(),
|
||||
CurrentRenderMode(ERM_NONE), ResetRenderStates(true), Transformation3DChanged(true),
|
||||
AntiAlias(antiAlias), RenderTargetTexture(0), LastSetLight(-1),
|
||||
|
@ -180,7 +184,9 @@ COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize, bool full
|
|||
// -----------------------------------------------------------------------
|
||||
#ifdef _IRR_USE_LINUX_DEVICE_
|
||||
//! Linux constructor and init code
|
||||
COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize, bool fullscreen, bool stencilBuffer, io::IFileSystem* io, bool vsync, bool antiAlias)
|
||||
COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize,
|
||||
bool fullscreen, bool stencilBuffer, io::IFileSystem* io,
|
||||
bool vsync, bool antiAlias)
|
||||
: CNullDriver(io, screenSize), COpenGLExtensionHandler(),
|
||||
CurrentRenderMode(ERM_NONE), ResetRenderStates(true),
|
||||
Transformation3DChanged(true), AntiAlias(antiAlias),
|
||||
|
@ -215,7 +221,9 @@ COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize, bool full
|
|||
// -----------------------------------------------------------------------
|
||||
#ifdef _IRR_USE_SDL_DEVICE_
|
||||
//! SDL constructor and init code
|
||||
COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize, bool fullscreen, bool stencilBuffer, io::IFileSystem* io, bool vsync, bool antiAlias)
|
||||
COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize,
|
||||
bool fullscreen, bool stencilBuffer, io::IFileSystem* io,
|
||||
bool vsync, bool antiAlias)
|
||||
: CNullDriver(io, screenSize), COpenGLExtensionHandler(),
|
||||
CurrentRenderMode(ERM_NONE), ResetRenderStates(true),
|
||||
Transformation3DChanged(true), AntiAlias(antiAlias),
|
||||
|
@ -772,7 +780,9 @@ void COpenGLDriver::drawHardwareBuffer(SHWBufferLink *_HWBuffer)
|
|||
|
||||
|
||||
//! draws a vertex primitive list
|
||||
void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const u16* indexList, u32 primitiveCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType)
|
||||
void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
|
||||
const u16* indexList, u32 primitiveCount,
|
||||
E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType)
|
||||
{
|
||||
if (!primitiveCount || !vertexCount)
|
||||
return;
|
||||
|
@ -1167,7 +1177,9 @@ void COpenGLDriver::draw2DImage(const video::ITexture* texture, const core::rect
|
|||
|
||||
disableTextures(1);
|
||||
setTexture(0, texture);
|
||||
setRenderStates2DMode(useColor[0].getAlpha()<255 || useColor[1].getAlpha()<255 || useColor[2].getAlpha()<255 || useColor[3].getAlpha()<255, true, useAlphaChannelOfTexture);
|
||||
setRenderStates2DMode(useColor[0].getAlpha()<255 || useColor[1].getAlpha()<255 ||
|
||||
useColor[2].getAlpha()<255 || useColor[3].getAlpha()<255,
|
||||
true, useAlphaChannelOfTexture);
|
||||
|
||||
if (clipRect)
|
||||
{
|
||||
|
@ -1618,7 +1630,9 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
|
|||
|
||||
if (material.getTexture(i) && material.getTexture(i)->hasMipMaps())
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
|
||||
material.TextureLayer[i].TrilinearFilter ? GL_LINEAR_MIPMAP_LINEAR : material.TextureLayer[i].BilinearFilter ? GL_LINEAR_MIPMAP_NEAREST : GL_NEAREST_MIPMAP_NEAREST );
|
||||
material.TextureLayer[i].TrilinearFilter ? GL_LINEAR_MIPMAP_LINEAR :
|
||||
material.TextureLayer[i].BilinearFilter ? GL_LINEAR_MIPMAP_NEAREST :
|
||||
GL_NEAREST_MIPMAP_NEAREST );
|
||||
else
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
|
||||
(material.TextureLayer[i].BilinearFilter || material.TextureLayer[i].TrilinearFilter) ? GL_LINEAR : GL_NEAREST);
|
||||
|
|
|
@ -136,7 +136,9 @@ namespace video
|
|||
virtual void drawHardwareBuffer(SHWBufferLink *HWBuffer);
|
||||
|
||||
//! draws a vertex primitive list
|
||||
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const u16* indexList, u32 primitiveCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
|
||||
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
|
||||
const u16* indexList, u32 primitiveCount,
|
||||
E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
|
||||
|
||||
//! queries the features of the driver, returns true if feature is available
|
||||
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
|
||||
|
@ -275,8 +277,9 @@ namespace video
|
|||
//! Returns whether disabling was successful or not.
|
||||
bool disableTextures(u32 fromStage=0);
|
||||
|
||||
//! Adds a new material renderer to the VideoDriver, using extGLGetObjectParameteriv(shaderHandle, GL_OBJECT_COMPILE_STATUS_ARB, &status) pixel and/or
|
||||
//! vertex shaders to render geometry.
|
||||
//! Adds a new material renderer to the VideoDriver, using
|
||||
//! extGLGetObjectParameteriv(shaderHandle, GL_OBJECT_COMPILE_STATUS_ARB, &status)
|
||||
//! pixel and/or vertex shaders to render geometry.
|
||||
virtual s32 addShaderMaterial(const c8* vertexShaderProgram, const c8* pixelShaderProgram,
|
||||
IShaderConstantSetCallBack* callback, E_MATERIAL_TYPE baseMaterial, s32 userData);
|
||||
|
||||
|
|
|
@ -461,9 +461,9 @@ bool COpenGLExtensionHandler::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
|
|||
case EVDF_ARB_FRAGMENT_PROGRAM_1:
|
||||
return FeatureAvailable[IRR_ARB_fragment_program];
|
||||
case EVDF_ARB_GLSL:
|
||||
return FeatureAvailable[IRR_ARB_shading_language_100];
|
||||
return (FeatureAvailable[IRR_ARB_shading_language_100]||Version>=200);
|
||||
case EVDF_TEXTURE_NPOT:
|
||||
return FeatureAvailable[IRR_ARB_texture_non_power_of_two];
|
||||
return (FeatureAvailable[IRR_ARB_texture_non_power_of_two]||Version>=200);
|
||||
case EVDF_FRAMEBUFFER_OBJECT:
|
||||
return FeatureAvailable[IRR_EXT_framebuffer_object];
|
||||
case EVDF_VERTEX_BUFFER_OBJECT:
|
||||
|
|
|
@ -1135,7 +1135,9 @@ inline void COpenGLExtensionHandler::extGlUniformMatrix4fv(GLint loc, GLsizei co
|
|||
#endif
|
||||
}
|
||||
|
||||
inline void COpenGLExtensionHandler::extGlGetActiveUniform(GLhandleARB program, GLuint index, GLsizei maxlength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name)
|
||||
inline void COpenGLExtensionHandler::extGlGetActiveUniform(GLhandleARB program,
|
||||
GLuint index, GLsizei maxlength, GLsizei *length,
|
||||
GLint *size, GLenum *type, GLcharARB *name)
|
||||
{
|
||||
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
|
||||
if (pGlGetActiveUniformARB)
|
||||
|
|
|
@ -62,7 +62,8 @@ s32 CParticleAnimatedMeshSceneNodeEmitter::emitt(u32 now, u32 timeSinceLastCall,
|
|||
amount = MaxParticlesPerSecond * 2;
|
||||
|
||||
// Get Mesh for this frame
|
||||
IMesh* frameMesh = AnimatedMesh->getMesh( core::floor32(Node->getFrameNr()), 255, Node->getStartFrame(), Node->getEndFrame() );
|
||||
IMesh* frameMesh = AnimatedMesh->getMesh( core::floor32(Node->getFrameNr()),
|
||||
255, Node->getStartFrame(), Node->getEndFrame() );
|
||||
for(u32 i=0; i<amount; ++i)
|
||||
{
|
||||
if( EveryMeshVertex )
|
||||
|
@ -73,7 +74,8 @@ s32 CParticleAnimatedMeshSceneNodeEmitter::emitt(u32 now, u32 timeSinceLastCall,
|
|||
{
|
||||
p.pos = frameMesh->getMeshBuffer(j)->getPosition(k);
|
||||
if( UseNormalDirection )
|
||||
p.vector = frameMesh->getMeshBuffer(j)->getNormal(k) / NormalDirectionModifier;
|
||||
p.vector = frameMesh->getMeshBuffer(j)->getNormal(k) /
|
||||
NormalDirectionModifier;
|
||||
else
|
||||
p.vector = Direction;
|
||||
|
||||
|
@ -120,7 +122,8 @@ s32 CParticleAnimatedMeshSceneNodeEmitter::emitt(u32 now, u32 timeSinceLastCall,
|
|||
|
||||
p.pos = frameMesh->getMeshBuffer(randomMB)->getPosition(vertexNumber);
|
||||
if( UseNormalDirection )
|
||||
p.vector = frameMesh->getMeshBuffer(randomMB)->getNormal(vertexNumber) / NormalDirectionModifier;
|
||||
p.vector = frameMesh->getMeshBuffer(randomMB)->getNormal(vertexNumber) /
|
||||
NormalDirectionModifier;
|
||||
else
|
||||
p.vector = Direction;
|
||||
|
||||
|
|
|
@ -67,7 +67,8 @@ s32 CParticleMeshEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& outA
|
|||
{
|
||||
p.pos = Mesh->getMeshBuffer(j)->getPosition(k);
|
||||
if( UseNormalDirection )
|
||||
p.vector = Mesh->getMeshBuffer(j)->getNormal(k) / NormalDirectionModifier;
|
||||
p.vector = Mesh->getMeshBuffer(j)->getNormal(k) /
|
||||
NormalDirectionModifier;
|
||||
else
|
||||
p.vector = Direction;
|
||||
|
||||
|
@ -114,7 +115,8 @@ s32 CParticleMeshEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& outA
|
|||
|
||||
p.pos = Mesh->getMeshBuffer(randomMB)->getPosition(vertexNumber);
|
||||
if( UseNormalDirection )
|
||||
p.vector = Mesh->getMeshBuffer(randomMB)->getNormal(vertexNumber) / NormalDirectionModifier;
|
||||
p.vector = Mesh->getMeshBuffer(randomMB)->getNormal(vertexNumber) /
|
||||
NormalDirectionModifier;
|
||||
else
|
||||
p.vector = Direction;
|
||||
|
||||
|
|
|
@ -29,14 +29,19 @@ namespace scene
|
|||
//! destructor
|
||||
virtual ~CQ3LevelMesh();
|
||||
|
||||
//! loads a level from a .bsp-File. Also tries to load all needed textures. Returns true if successful.
|
||||
//! loads a level from a .bsp-File. Also tries to load all
|
||||
//! needed textures. Returns true if successful.
|
||||
bool loadFile(io::IReadFile* file);
|
||||
|
||||
//! returns the amount of frames in milliseconds. If the amount is 1, it is a static (=non animated) mesh.
|
||||
//! returns the amount of frames in milliseconds. If the amount
|
||||
//! is 1, it is a static (=non animated) mesh.
|
||||
virtual u32 getFrameCount() const;
|
||||
|
||||
//! returns the animated mesh based on a detail level. 0 is the lowest, 255 the highest detail. Note, that some Meshes will ignore the detail level.
|
||||
virtual IMesh* getMesh(s32 frameInMs, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1);
|
||||
//! returns the animated mesh based on a detail level. 0 is the
|
||||
//! lowest, 255 the highest detail. Note, that some Meshes will
|
||||
//! ignore the detail level.
|
||||
virtual IMesh* getMesh(s32 frameInMs, s32 detailLevel=255,
|
||||
s32 startFrameLoop=-1, s32 endFrameLoop=-1);
|
||||
|
||||
virtual void releaseMesh ( s32 index );
|
||||
|
||||
|
@ -259,38 +264,32 @@ namespace scene
|
|||
u8 direction[2]; // The direction of the light: [phi,theta]
|
||||
};
|
||||
|
||||
void loadTextures (tBSPLump* l, io::IReadFile* file); // Load the textures
|
||||
void loadLightmaps (tBSPLump* l, io::IReadFile* file); // Load the lightmaps
|
||||
void loadVerts (tBSPLump* l, io::IReadFile* file); // Load the vertices
|
||||
void loadFaces (tBSPLump* l, io::IReadFile* file); // Load the faces
|
||||
void loadPlanes (tBSPLump* l, io::IReadFile* file); // Load the Planes of the BSP
|
||||
void loadNodes (tBSPLump* l, io::IReadFile* file); // load the Nodes of the BSP
|
||||
void loadLeafs (tBSPLump* l, io::IReadFile* file); // load the Leafs of the BSP
|
||||
void loadLeafFaces (tBSPLump* l, io::IReadFile* file); // load the Faces of the Leafs of the BSP
|
||||
void loadVisData (tBSPLump* l, io::IReadFile* file); // load the visibility data of the clusters
|
||||
void loadEntities (tBSPLump* l, io::IReadFile* file); // load the entities
|
||||
void loadModels (tBSPLump* l, io::IReadFile* file); // load the models
|
||||
void loadMeshVerts (tBSPLump* l, io::IReadFile* file); // load the mesh vertices
|
||||
void loadBrushes (tBSPLump* l, io::IReadFile* file); // load the brushes of the BSP
|
||||
void loadBrushSides (tBSPLump* l, io::IReadFile* file); // load the brushsides of the BSP
|
||||
void loadLeafBrushes(tBSPLump* l, io::IReadFile* file); // load the brushes of the leaf
|
||||
void loadShaders (tBSPLump* l, io::IReadFile* file); // load the shaders
|
||||
void loadTextures (tBSPLump* l, io::IReadFile* file); // Load the textures
|
||||
void loadLightmaps (tBSPLump* l, io::IReadFile* file); // Load the lightmaps
|
||||
void loadVerts (tBSPLump* l, io::IReadFile* file); // Load the vertices
|
||||
void loadFaces (tBSPLump* l, io::IReadFile* file); // Load the faces
|
||||
void loadPlanes (tBSPLump* l, io::IReadFile* file); // Load the Planes of the BSP
|
||||
void loadNodes (tBSPLump* l, io::IReadFile* file); // load the Nodes of the BSP
|
||||
void loadLeafs (tBSPLump* l, io::IReadFile* file); // load the Leafs of the BSP
|
||||
void loadLeafFaces (tBSPLump* l, io::IReadFile* file); // load the Faces of the Leafs of the BSP
|
||||
void loadVisData (tBSPLump* l, io::IReadFile* file); // load the visibility data of the clusters
|
||||
void loadEntities (tBSPLump* l, io::IReadFile* file); // load the entities
|
||||
void loadModels (tBSPLump* l, io::IReadFile* file); // load the models
|
||||
void loadMeshVerts (tBSPLump* l, io::IReadFile* file); // load the mesh vertices
|
||||
void loadBrushes (tBSPLump* l, io::IReadFile* file); // load the brushes of the BSP
|
||||
void loadBrushSides (tBSPLump* l, io::IReadFile* file); // load the brushsides of the BSP
|
||||
void loadLeafBrushes(tBSPLump* l, io::IReadFile* file); // load the brushes of the leaf
|
||||
void loadShaders (tBSPLump* l, io::IReadFile* file); // load the shaders
|
||||
|
||||
// second parameter i is the zero based index of the current face.
|
||||
void createCurvedSurface(SMeshBufferLightMap* meshBuffer, s32 i);
|
||||
|
||||
//bi-quadratic bezier patches
|
||||
void createCurvedSurface2 ( SMeshBufferLightMap* meshBuffer,
|
||||
s32 faceIndex,
|
||||
s32 patchTesselation,
|
||||
s32 storevertexcolor
|
||||
);
|
||||
void createCurvedSurface2(SMeshBufferLightMap* meshBuffer,
|
||||
s32 faceIndex, s32 patchTesselation, s32 storevertexcolor);
|
||||
|
||||
void createCurvedSurface3 ( SMeshBufferLightMap* meshBuffer,
|
||||
s32 faceIndex,
|
||||
s32 patchTesselation,
|
||||
s32 storevertexcolor
|
||||
);
|
||||
void createCurvedSurface3(SMeshBufferLightMap* meshBuffer,
|
||||
s32 faceIndex, s32 patchTesselation, s32 storevertexcolor);
|
||||
|
||||
f32 Blend( const f64 s[3], const f64 t[3], const tBSPVertex *v[9], int offset);
|
||||
|
||||
|
@ -309,19 +308,20 @@ namespace scene
|
|||
const core::vector2d<f64>& tcoords, const core::vector2d<f64>& tcoords2)
|
||||
: Pos(pos), Normal(normal), Color(color), TCoords(tcoords), TCoords2(tcoords2) {}
|
||||
|
||||
S3DVertex2TCoords_64 getInterpolated_quadratic(const S3DVertex2TCoords_64& v2, const S3DVertex2TCoords_64& v3, const f64 d) const
|
||||
S3DVertex2TCoords_64 getInterpolated_quadratic(const S3DVertex2TCoords_64& v2,
|
||||
const S3DVertex2TCoords_64& v3, const f64 d) const
|
||||
{
|
||||
return S3DVertex2TCoords_64 (
|
||||
Pos.getInterpolated_quadratic ( v2.Pos, v3.Pos, d ),
|
||||
Normal.getInterpolated_quadratic ( v2.Normal, v3.Normal, d ),
|
||||
Color.getInterpolated_quadratic ( v2.Color, v3.Color, (f32) d ),
|
||||
TCoords.getInterpolated_quadratic ( v2.TCoords, v3.TCoords, d ),
|
||||
TCoords2.getInterpolated_quadratic ( v2.TCoords2, v3.TCoords2, d )
|
||||
);
|
||||
TCoords2.getInterpolated_quadratic ( v2.TCoords2, v3.TCoords2, d ));
|
||||
}
|
||||
};
|
||||
|
||||
inline void copy ( video::S3DVertex2TCoords * dest, const tBSPVertex * source, s32 vertexcolor ) const;
|
||||
inline void copy ( video::S3DVertex2TCoords * dest, const tBSPVertex * source,
|
||||
s32 vertexcolor ) const;
|
||||
void copy ( S3DVertex2TCoords_64 * dest, const tBSPVertex * source, s32 vertexcolor ) const;
|
||||
|
||||
|
||||
|
|
|
@ -59,7 +59,9 @@ namespace scene
|
|||
const u32 subdivU = 32, const u32 subdivV = 32,
|
||||
const video::SColor foot = video::SColor(51, 0, 230, 180),
|
||||
const video::SColor tail = video::SColor(0, 0, 0, 0),
|
||||
const core::vector3df& position = core::vector3df(0,0,0), const core::vector3df& rotation = core::vector3df(0,0,0), const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
|
||||
|
||||
//! adds a cube scene node to the scene. It is a simple cube of (1,1,1) size.
|
||||
//! the returned pointer must not be dropped.
|
||||
|
|
|
@ -99,15 +99,17 @@ namespace scene
|
|||
virtual void transferOnlyJointsHintsToMesh(const core::array<IBoneSceneNode*> &JointChildSceneNodes);
|
||||
|
||||
//! Creates an array of joints from this mesh
|
||||
virtual void createJoints(core::array<IBoneSceneNode*> &JointChildSceneNodes, IAnimatedMeshSceneNode* AnimatedMeshSceneNode, ISceneManager* SceneManager);
|
||||
|
||||
virtual void createJoints(core::array<IBoneSceneNode*> &JointChildSceneNodes,
|
||||
IAnimatedMeshSceneNode* AnimatedMeshSceneNode,
|
||||
ISceneManager* SceneManager);
|
||||
|
||||
//! Convertes the mesh to contain tangent information
|
||||
virtual void convertMeshToTangents();
|
||||
|
||||
//! Does the mesh have non animation
|
||||
//! Does the mesh have no animation
|
||||
virtual bool isStatic();
|
||||
|
||||
//! (This feature is not implementated in irrlicht yet)
|
||||
//! (This feature is not implemented in irrlicht yet)
|
||||
virtual bool setHardwareSkinning(bool on);
|
||||
|
||||
//Interface for the mesh loaders (finalize should lock these functions, and they should have some prefix like loader_
|
||||
|
@ -146,7 +148,10 @@ private:
|
|||
|
||||
void buildAll_GlobalAnimatedMatrices(SJoint *Joint=0, SJoint *ParentJoint=0);
|
||||
|
||||
void getFrameData(f32 frame,SJoint *Node,core::vector3df &position, s32 &positionHint, core::vector3df &scale, s32 &scaleHint, core::quaternion &rotation, s32 &rotationHint);
|
||||
void getFrameData(f32 frame, SJoint *Node,
|
||||
core::vector3df &position, s32 &positionHint,
|
||||
core::vector3df &scale, s32 &scaleHint,
|
||||
core::quaternion &rotation, s32 &rotationHint);
|
||||
|
||||
void CalculateGlobalMatrices(SJoint *Joint,SJoint *ParentJoint);
|
||||
|
||||
|
@ -157,8 +162,6 @@ private:
|
|||
core::vector3df& vt1, core::vector3df& vt2, core::vector3df& vt3,
|
||||
core::vector2df& tc1, core::vector2df& tc2, core::vector2df& tc3);
|
||||
|
||||
//void createSkelton_Helper(ISceneManager* SceneManager, core::array<IBoneSceneNode*> &JointChildSceneNodes, IAnimatedMeshSceneNode *AnimatedMeshSceneNode, ISceneNode* ParentNode, SJoint *ParentNode, SJoint *Node);
|
||||
|
||||
|
||||
core::array<SSkinMeshBuffer*> *SkinningBuffers; //Meshbuffer to skin, default is to skin localBuffers
|
||||
|
||||
|
|
|
@ -53,7 +53,9 @@ namespace video
|
|||
virtual const core::dimension2d<s32>& getCurrentRenderTargetSize() const;
|
||||
|
||||
//! draws a vertex primitive list
|
||||
void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const u16* indexList, u32 primitiveCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
|
||||
void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
|
||||
const u16* indexList, u32 primitiveCount,
|
||||
E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
|
||||
|
||||
//! Draws a 3d line.
|
||||
virtual void draw3DLine(const core::vector3df& start,
|
||||
|
|
|
@ -69,7 +69,9 @@ namespace video
|
|||
virtual void setAmbientLight(const SColorf& color);
|
||||
|
||||
//! draws a vertex primitive list
|
||||
void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const u16* indexList, u32 primitiveCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
|
||||
void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
|
||||
const u16* indexList, u32 primitiveCount,
|
||||
E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
|
||||
|
||||
//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted.
|
||||
virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
|
||||
|
|
|
@ -100,8 +100,7 @@ public:
|
|||
if (!TriangleRect.isRectCollided(ViewPortRect))
|
||||
continue;
|
||||
|
||||
|
||||
// höhe des dreiecks berechnen
|
||||
// calculate height of triangle
|
||||
height = v3->Pos.Y - v1->Pos.Y;
|
||||
if (!height)
|
||||
continue;
|
||||
|
|
|
@ -98,8 +98,7 @@ public:
|
|||
if (!TriangleRect.isRectCollided(ViewPortRect))
|
||||
continue;
|
||||
|
||||
|
||||
// höhe des dreiecks berechnen
|
||||
// calculate height of triangle
|
||||
height = v3->Pos.Y - v1->Pos.Y;
|
||||
if (!height)
|
||||
continue;
|
||||
|
|
|
@ -105,8 +105,7 @@ public:
|
|||
if (!TriangleRect.isRectCollided(ViewPortRect))
|
||||
continue;
|
||||
|
||||
|
||||
// höhe des dreiecks berechnen
|
||||
// calculate height of triangle
|
||||
height = v3->Pos.Y - v1->Pos.Y;
|
||||
if (!height)
|
||||
continue;
|
||||
|
|
|
@ -101,8 +101,7 @@ public:
|
|||
if (!TriangleRect.isRectCollided(ViewPortRect))
|
||||
continue;
|
||||
|
||||
|
||||
// höhe des dreiecks berechnen
|
||||
// calculate height of triangle
|
||||
height = v3->Pos.Y - v1->Pos.Y;
|
||||
if (!height)
|
||||
continue;
|
||||
|
|
|
@ -103,8 +103,7 @@ public:
|
|||
if (!TriangleRect.isRectCollided(ViewPortRect))
|
||||
continue;
|
||||
|
||||
|
||||
// höhe des dreiecks berechnen
|
||||
// calculate height of triangle
|
||||
height = v3->Pos.Y - v1->Pos.Y;
|
||||
if (!height)
|
||||
continue;
|
||||
|
|
|
@ -100,8 +100,7 @@ public:
|
|||
if (!TriangleRect.isRectCollided(ViewPortRect))
|
||||
continue;
|
||||
|
||||
|
||||
// höhe des dreiecks berechnen
|
||||
// calculate height of triangle
|
||||
height = v3->Pos.Y - v1->Pos.Y;
|
||||
if (!height)
|
||||
continue;
|
||||
|
|
|
@ -174,8 +174,7 @@ void CTRTextureGouraud::drawIndexedTriangleList(S2DVertex* vertices, s32 vertexC
|
|||
if (!TriangleRect.isRectCollided(ViewPortRect))
|
||||
continue;
|
||||
|
||||
|
||||
// höhe des dreiecks berechnen
|
||||
// calculate height of triangle
|
||||
height = v3->Pos.Y - v1->Pos.Y;
|
||||
if (!height)
|
||||
continue;
|
||||
|
@ -340,7 +339,9 @@ void CTRTextureGouraud::drawIndexedTriangleList(S2DVertex* vertices, s32 vertexC
|
|||
{
|
||||
*spanZTarget = spanZValue;
|
||||
u16 color = lockedTexture[((spanTy>>8)&textureYMask) * lockedTextureWidth + ((spanTx>>8)&textureXMask)];
|
||||
*hSpanBegin = video::RGB16(video::getRedSigned(color) * (spanR>>8) >>2, video::getGreenSigned(color) * (spanG>>8) >>2, video::getBlueSigned(color) * (spanB>>8) >>2);
|
||||
*hSpanBegin = video::RGB16(video::getRedSigned(color) * (spanR>>8) >>2,
|
||||
video::getGreenSigned(color) * (spanG>>8) >>2,
|
||||
video::getBlueSigned(color) * (spanB>>8) >>2);
|
||||
}
|
||||
|
||||
spanR += spanStepR;
|
||||
|
|
|
@ -120,8 +120,7 @@ void CTRTextureGouraudAdd::drawIndexedTriangleList(S2DVertex* vertices, s32 vert
|
|||
if (!TriangleRect.isRectCollided(ViewPortRect))
|
||||
continue;
|
||||
|
||||
|
||||
// höhe des dreiecks berechnen
|
||||
// calculate height of triangle
|
||||
height = v3->Pos.Y - v1->Pos.Y;
|
||||
if (!height)
|
||||
continue;
|
||||
|
|
|
@ -103,8 +103,7 @@ public:
|
|||
if (!TriangleRect.isRectCollided(ViewPortRect))
|
||||
continue;
|
||||
|
||||
|
||||
// höhe des dreiecks berechnen
|
||||
// calculate height of triangle
|
||||
height = v3->Pos.Y - v1->Pos.Y;
|
||||
if (!height)
|
||||
continue;
|
||||
|
@ -252,7 +251,9 @@ public:
|
|||
while (hSpanBegin < hSpanEnd)
|
||||
{
|
||||
color = lockedTexture[((spanTy>>8)&textureYMask) * lockedTextureWidth + ((spanTx>>8)&textureXMask)];
|
||||
*hSpanBegin = video::RGB16(video::getRed(color) * (spanR>>8) >>2, video::getGreen(color) * (spanG>>8) >>2, video::getBlue(color) * (spanB>>8) >>2);
|
||||
*hSpanBegin = video::RGB16(video::getRed(color) * (spanR>>8) >>2,
|
||||
video::getGreen(color) * (spanG>>8) >>2,
|
||||
video::getBlue(color) * (spanB>>8) >>2);
|
||||
|
||||
spanR += spanStepR;
|
||||
spanG += spanStepG;
|
||||
|
|
|
@ -104,8 +104,7 @@ public:
|
|||
if (!TriangleRect.isRectCollided(ViewPortRect))
|
||||
continue;
|
||||
|
||||
|
||||
// höhe des dreiecks berechnen
|
||||
// calculate height of triangle
|
||||
height = v3->Pos.Y - v1->Pos.Y;
|
||||
if (!height)
|
||||
continue;
|
||||
|
@ -234,7 +233,9 @@ public:
|
|||
{
|
||||
*(zTarget + leftx) = leftZValue;
|
||||
color = lockedTexture[((leftTy>>8)&textureYMask) * lockedTextureWidth + ((leftTx>>8)&textureXMask)];
|
||||
*(targetSurface + leftx) = video::RGB16(video::getRed(color) * (leftR>>8) >>2, video::getGreen(color) * (leftG>>8) >>2, video::getBlue(color) * (leftR>>8) >>2);
|
||||
*(targetSurface + leftx) = video::RGB16(video::getRed(color) * (leftR>>8) >>2,
|
||||
video::getGreen(color) * (leftG>>8) >>2,
|
||||
video::getBlue(color) * (leftR>>8) >>2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,7 +247,9 @@ public:
|
|||
{
|
||||
*(zTarget + rightx) = rightZValue;
|
||||
color = lockedTexture[((rightTy>>8)&textureYMask) * lockedTextureWidth + ((rightTx>>8)&textureXMask)];
|
||||
*(targetSurface + rightx) = video::RGB16(video::getRed(color) * (rightR>>8) >>2, video::getGreen(color) * (rightG>>8) >>2, video::getBlue(color) * (rightR>>8) >>2);
|
||||
*(targetSurface + rightx) = video::RGB16(video::getRed(color) * (rightR>>8) >>2,
|
||||
video::getGreen(color) * (rightG>>8) >>2,
|
||||
video::getBlue(color) * (rightR>>8) >>2);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,11 +15,11 @@ namespace irr
|
|||
{
|
||||
namespace io
|
||||
{
|
||||
|
||||
const s16 ZIP_FILE_ENCRYPTED = 0x0001; // set if the file is encrypted
|
||||
const s16 ZIP_INFO_IN_DATA_DESCRITOR = 0x0008; // the fields crc-32, compressed size
|
||||
// and uncompressed size are set to zero in the local
|
||||
// header
|
||||
// set if the file is encrypted
|
||||
const s16 ZIP_FILE_ENCRYPTED = 0x0001;
|
||||
// the fields crc-32, compressed size and uncompressed size are set to
|
||||
// zero in the local header
|
||||
const s16 ZIP_INFO_IN_DATA_DESCRITOR = 0x0008;
|
||||
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
|
||||
# pragma pack( push, packing )
|
||||
|
@ -111,7 +111,8 @@ namespace io
|
|||
|
||||
private:
|
||||
|
||||
//! scans for a local header, returns false if there is no more local file header.
|
||||
//! scans for a local header, returns false if there is no more
|
||||
//! local file header.
|
||||
bool scanLocalHeader();
|
||||
IReadFile* File;
|
||||
|
||||
|
@ -134,7 +135,8 @@ namespace io
|
|||
{
|
||||
public:
|
||||
|
||||
CUnZipReader( IFileSystem *parent, const c8* basename, bool ignoreCase, bool ignorePaths);
|
||||
CUnZipReader(IFileSystem *parent, const c8* basename,
|
||||
bool ignoreCase, bool ignorePaths);
|
||||
|
||||
//! opens a file by file name
|
||||
virtual IReadFile* openFile(const c8* filename);
|
||||
|
|
Loading…
Reference in New Issue