Commit e8fa33e1 authored by hybrid's avatar hybrid

Merged from 1.7 branch, revisions 3300-3357. Huge number of bug fixes, mostly...

Merged from 1.7 branch, revisions 3300-3357. Huge number of bug fixes, mostly in GUI and serialization.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3358 dfc29bdd-3216-0410-991c-e03cc46cb475
parent ab95e198
This diff is collapsed.
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="9.00" Version="9,00"
Name="09.Meshviewer_vc9" Name="09.Meshviewer_vc9"
ProjectGUID="{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}" ProjectGUID="{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}"
RootNamespace="Meshviewer_vc9" RootNamespace="Meshviewer_vc9"
......
...@@ -87,8 +87,10 @@ enum ...@@ -87,8 +87,10 @@ enum
GUI_ID_BUTTON_SHOW_TOOLBOX, GUI_ID_BUTTON_SHOW_TOOLBOX,
GUI_ID_BUTTON_SELECT_ARCHIVE, GUI_ID_BUTTON_SELECT_ARCHIVE,
GUI_ID_ANIMATION_INFO,
// And some magic numbers // And some magic numbers
MAX_FRAMERATE = 1000, MAX_FRAMERATE = 80,
DEFAULT_FRAMERATE = 30 DEFAULT_FRAMERATE = 30
}; };
...@@ -111,7 +113,7 @@ void setActiveCamera(scene::ICameraSceneNode* newActive) ...@@ -111,7 +113,7 @@ void setActiveCamera(scene::ICameraSceneNode* newActive)
/* /*
Set the skin transparency by changing the alpha values of all skin-colors Set the skin transparency by changing the alpha values of all skin-colors
*/ */
void SetSkinTransparency(s32 alpha, irr::gui::IGUISkin * skin) void setSkinTransparency(s32 alpha, irr::gui::IGUISkin * skin)
{ {
for (s32 i=0; i<irr::gui::EGDC_COUNT ; ++i) for (s32 i=0; i<irr::gui::EGDC_COUNT ; ++i)
{ {
...@@ -124,7 +126,7 @@ void SetSkinTransparency(s32 alpha, irr::gui::IGUISkin * skin) ...@@ -124,7 +126,7 @@ void SetSkinTransparency(s32 alpha, irr::gui::IGUISkin * skin)
/* /*
Update the display of the model scaling Update the display of the model scaling
*/ */
void UpdateScaleInfo(scene::ISceneNode* model) void updateScaleInfo(scene::ISceneNode* model)
{ {
IGUIElement* toolboxWnd = Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(GUI_ID_DIALOG_ROOT_WINDOW, true); IGUIElement* toolboxWnd = Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(GUI_ID_DIALOG_ROOT_WINDOW, true);
if (!toolboxWnd) if (!toolboxWnd)
...@@ -252,7 +254,7 @@ void loadModel(const c8* fn) ...@@ -252,7 +254,7 @@ void loadModel(const c8* fn)
if (menu) if (menu)
for(int item = 1; item < 6; ++item) for(int item = 1; item < 6; ++item)
menu->setItemChecked(item, false); menu->setItemChecked(item, false);
UpdateScaleInfo(Model); updateScaleInfo(Model);
} }
...@@ -285,7 +287,7 @@ void createToolBox() ...@@ -285,7 +287,7 @@ void createToolBox()
core::rect<s32>(10,20,60,45), false, false, t1); core::rect<s32>(10,20,60,45), false, false, t1);
env->addStaticText(L"X:", core::rect<s32>(22,48,40,66), false, false, t1); env->addStaticText(L"X:", core::rect<s32>(22,48,40,66), false, false, t1);
env->addEditBox(L"1.0", core::rect<s32>(40,46,130,66), true, t1, GUI_ID_X_SCALE); env->addEditBox(L"1.0", core::rect<s32>(40,46,130,66), true, t1, GUI_ID_X_SCALE);
env->addStaticText(L"Y:", core::rect<s32>(22,82,40,GUI_ID_OPEN_MODEL), false, false, t1); env->addStaticText(L"Y:", core::rect<s32>(22,82,40,96), false, false, t1);
env->addEditBox(L"1.0", core::rect<s32>(40,76,130,96), true, t1, GUI_ID_Y_SCALE); env->addEditBox(L"1.0", core::rect<s32>(40,76,130,96), true, t1, GUI_ID_Y_SCALE);
env->addStaticText(L"Z:", core::rect<s32>(22,108,40,126), false, false, t1); env->addStaticText(L"Z:", core::rect<s32>(22,108,40,126), false, false, t1);
env->addEditBox(L"1.0", core::rect<s32>(40,106,130,126), true, t1, GUI_ID_Z_SCALE); env->addEditBox(L"1.0", core::rect<s32>(40,106,130,126), true, t1, GUI_ID_Z_SCALE);
...@@ -296,7 +298,7 @@ void createToolBox() ...@@ -296,7 +298,7 @@ void createToolBox()
env->addButton(core::rect<s32>(65,20,95,40), t1, GUI_ID_BUTTON_SCALE_MUL10, L"* 10"); env->addButton(core::rect<s32>(65,20,95,40), t1, GUI_ID_BUTTON_SCALE_MUL10, L"* 10");
env->addButton(core::rect<s32>(100,20,130,40), t1, GUI_ID_BUTTON_SCALE_DIV10, L"* 0.1"); env->addButton(core::rect<s32>(100,20,130,40), t1, GUI_ID_BUTTON_SCALE_DIV10, L"* 0.1");
UpdateScaleInfo(Model); updateScaleInfo(Model);
// add transparency control // add transparency control
env->addStaticText(L"GUI Transparency Control:", env->addStaticText(L"GUI Transparency Control:",
...@@ -307,17 +309,43 @@ void createToolBox() ...@@ -307,17 +309,43 @@ void createToolBox()
scrollbar->setPos(255); scrollbar->setPos(255);
// add framerate control // add framerate control
env->addStaticText(L":", core::rect<s32>(10,240,150,265), true, false, t1);
env->addStaticText(L"Framerate:", env->addStaticText(L"Framerate:",
core::rect<s32>(10,240,150,265), true, false, t1); core::rect<s32>(12,240,75,265), false, false, t1);
env->addStaticText(L"", core::rect<s32>(75,240,200,265), false, false, t1,
GUI_ID_ANIMATION_INFO);
scrollbar = env->addScrollBar(true, scrollbar = env->addScrollBar(true,
core::rect<s32>(10,265,150,280), t1, GUI_ID_SKIN_ANIMATION_FPS); core::rect<s32>(10,265,150,280), t1, GUI_ID_SKIN_ANIMATION_FPS);
scrollbar->setMax(MAX_FRAMERATE); scrollbar->setMax(MAX_FRAMERATE);
scrollbar->setMin(-MAX_FRAMERATE); scrollbar->setMin(-MAX_FRAMERATE);
scrollbar->setPos(DEFAULT_FRAMERATE); scrollbar->setPos(DEFAULT_FRAMERATE);
scrollbar->setSmallStep(1);
}
void updateToolBox()
{
IGUIEnvironment* env = Device->getGUIEnvironment();
IGUIElement* root = env->getRootGUIElement();
IGUIElement* dlg = root->getElementFromId(GUI_ID_DIALOG_ROOT_WINDOW, true);
if (!dlg )
return;
// bring irrlicht engine logo to front, because it // update the info we have about the animation of the model
// now may be below the newly created toolbox IGUIStaticText * aniInfo = (IGUIStaticText *)(dlg->getElementFromId(GUI_ID_ANIMATION_INFO, true));
root->bringToFront(root->getElementFromId(666, true)); if (aniInfo)
{
if ( Model && scene::ESNT_ANIMATED_MESH == Model->getType() )
{
scene::IAnimatedMeshSceneNode* animatedModel = (scene::IAnimatedMeshSceneNode*)Model;
core::stringw str( (s32)core::round_(animatedModel->getAnimationSpeed()) );
str += L" Frame: ";
str += core::stringw((s32)animatedModel->getFrameNr());
aniInfo->setText(str.c_str());
}
else
aniInfo->setText(L"");
}
} }
/* /*
...@@ -366,7 +394,7 @@ public: ...@@ -366,7 +394,7 @@ public:
if (id == GUI_ID_SKIN_TRANSPARENCY) if (id == GUI_ID_SKIN_TRANSPARENCY)
{ {
const s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos(); const s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos();
SetSkinTransparency(pos, env->getSkin()); setSkinTransparency(pos, env->getSkin());
} }
// control animation speed // control animation speed
else if (id == GUI_ID_SKIN_ANIMATION_FPS) else if (id == GUI_ID_SKIN_ANIMATION_FPS)
...@@ -406,18 +434,18 @@ public: ...@@ -406,18 +434,18 @@ public:
if (Model) if (Model)
Model->setScale(scale); Model->setScale(scale);
UpdateScaleInfo(Model); updateScaleInfo(Model);
} }
break; break;
case GUI_ID_BUTTON_SCALE_MUL10: case GUI_ID_BUTTON_SCALE_MUL10:
if (Model) if (Model)
Model->setScale(Model->getScale()*10.f); Model->setScale(Model->getScale()*10.f);
UpdateScaleInfo(Model); updateScaleInfo(Model);
break; break;
case GUI_ID_BUTTON_SCALE_DIV10: case GUI_ID_BUTTON_SCALE_DIV10:
if (Model) if (Model)
Model->setScale(Model->getScale()*0.1f); Model->setScale(Model->getScale()*0.1f);
UpdateScaleInfo(Model); updateScaleInfo(Model);
break; break;
case GUI_ID_BUTTON_OPEN_MODEL: case GUI_ID_BUTTON_OPEN_MODEL:
env->addFileOpenDialog(L"Please select a model file to open"); env->addFileOpenDialog(L"Please select a model file to open");
...@@ -810,7 +838,7 @@ int main(int argc, char* argv[]) ...@@ -810,7 +838,7 @@ int main(int argc, char* argv[])
image = driver->getTexture("help.png"); image = driver->getTexture("help.png");
bar->addButton(GUI_ID_BUTTON_SHOW_ABOUT, 0, L"Open Help", image, 0, false, true); bar->addButton(GUI_ID_BUTTON_SHOW_ABOUT, 0, L"Open Help", image, 0, false, true);
// create a combobox with some senseless texts // create a combobox for texture filters
gui::IGUIComboBox* box = env->addComboBox(core::rect<s32>(250,4,350,23), bar, GUI_ID_TEXTUREFILTER); gui::IGUIComboBox* box = env->addComboBox(core::rect<s32>(250,4,350,23), bar, GUI_ID_TEXTUREFILTER);
box->addItem(L"No filtering"); box->addItem(L"No filtering");
...@@ -914,12 +942,14 @@ int main(int argc, char* argv[]) ...@@ -914,12 +942,14 @@ int main(int argc, char* argv[])
driver->endScene(); driver->endScene();
// update information about current frame-rate
core::stringw str(L"FPS: "); core::stringw str(L"FPS: ");
str.append(core::stringw(driver->getFPS())); str.append(core::stringw(driver->getFPS()));
str += L" Tris: "; str += L" Tris: ";
str.append(core::stringw(driver->getPrimitiveCountDrawn())); str.append(core::stringw(driver->getPrimitiveCountDrawn()));
fpstext->setText(str.c_str()); fpstext->setText(str.c_str());
// update information about the active camera
scene::ICameraSceneNode* cam = Device->getSceneManager()->getActiveCamera(); scene::ICameraSceneNode* cam = Device->getSceneManager()->getActiveCamera();
str = L"Pos: "; str = L"Pos: ";
str.append(core::stringw(cam->getPosition().X)); str.append(core::stringw(cam->getPosition().X));
...@@ -934,6 +964,9 @@ int main(int argc, char* argv[]) ...@@ -934,6 +964,9 @@ int main(int argc, char* argv[])
str += L" "; str += L" ";
str.append(core::stringw(cam->getTarget().Z)); str.append(core::stringw(cam->getTarget().Z));
postext->setText(str.c_str()); postext->setText(str.c_str());
// update the tool dialog
updateToolBox();
} }
else else
Device->yield(); Device->yield();
......
Microsoft Visual Studio Solution File, Format Version 8.00 Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18.SplitScreen", "SplitScreen.vcproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18.SplitScreen", "SplitScreen.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
...@@ -9,10 +9,10 @@ Global ...@@ -9,10 +9,10 @@ Global
Release = Release Release = Release
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution GlobalSection(ProjectConfiguration) = postSolution
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug.ActiveCfg = Debug|Win32 {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug.ActiveCfg = Debug|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug.Build.0 = Debug|Win32 {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug.Build.0 = Debug|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.ActiveCfg = Release|Win32 {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release.ActiveCfg = Release|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.Build.0 = Release|Win32 {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.10" Version="7.10"
Name="18.SplitScreen" Name="18.SplitScreen"
ProjectGUID="{EB3B38EA-5CE7-4983-845B-880661E69D09}" ProjectGUID="{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}"
Keyword="Win32Proj"> Keyword="Win32Proj">
<Platforms> <Platforms>
<Platform <Platform
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8,00" Version="8,00"
Name="18.SplitScreen_vc8" Name="18.SplitScreen_vc8"
ProjectGUID="{E6F60924-57CD-47F9-A485-853A3BA08FBD}" ProjectGUID="{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}"
Keyword="Win32Proj" Keyword="Win32Proj"
> >
<Platforms> <Platforms>
......
Microsoft Visual Studio Solution File, Format Version 8.00 Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MouseAndJoystick", "MouseAndJoystick.vcproj", "{1A16BBE1-A49B-4406-8883-681E6EA8702C}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MouseAndJoystick", "MouseAndJoystick.vcproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
...@@ -9,10 +9,10 @@ Global ...@@ -9,10 +9,10 @@ Global
Release = Release Release = Release
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution GlobalSection(ProjectConfiguration) = postSolution
{1A16BBE1-A49B-4406-8883-681E6EA8702C}.Debug.ActiveCfg = Debug|Win32 {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug.ActiveCfg = Debug|Win32
{1A16BBE1-A49B-4406-8883-681E6EA8702C}.Debug.Build.0 = Debug|Win32 {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug.Build.0 = Debug|Win32
{1A16BBE1-A49B-4406-8883-681E6EA8702C}.Release.ActiveCfg = Release|Win32 {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release.ActiveCfg = Release|Win32
{1A16BBE1-A49B-4406-8883-681E6EA8702C}.Release.Build.0 = Release|Win32 {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.10" Version="7.10"
Name="19.MouseAndJoystick" Name="19.MouseAndJoystick"
ProjectGUID="{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" ProjectGUID="{FE853A36-E0D1-4AC5-A792-B643E70D2953}"
SccProjectName="" SccProjectName=""
SccLocalPath=""> SccLocalPath="">
<Platforms> <Platforms>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8.00" Version="8.00"
Name="19.MouseAndJoystick_vc8" Name="19.MouseAndJoystick_vc8"
ProjectGUID="{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" ProjectGUID="{FE853A36-E0D1-4AC5-A792-B643E70D2953}"
RootNamespace="MouseAndJoystick_vc8" RootNamespace="MouseAndJoystick_vc8"
> >
<Platforms> <Platforms>
......
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005 # Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "ManagedLights.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "ManagedLights.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
...@@ -8,8 +8,8 @@ Global ...@@ -8,8 +8,8 @@ Global
Release|Win32 = Release|Win32 Release|Win32 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.ActiveCfg = Debug|Win32 {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.ActiveCfg = Release|Win32 {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.10" Version="7.10"
Name="20.ManagedLights" Name="20.ManagedLights"
ProjectGUID="{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" ProjectGUID="{16007FE2-142B-47F8-93E1-519BA3F39E71}"
SccProjectName="" SccProjectName=""
SccLocalPath=""> SccLocalPath="">
<Platforms> <Platforms>
......
Microsoft Visual Studio Solution File, Format Version 8.00 Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MaterialViewer", "MaterialViewer.vcproj", "{C4F5BB37-D873-4DE2-B7D0-A60A936798E1}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MaterialViewer", "MaterialViewer.vcproj", "{4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
...@@ -9,10 +9,10 @@ Global ...@@ -9,10 +9,10 @@ Global
Release = Release Release = Release
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution GlobalSection(ProjectConfiguration) = postSolution
{C4F5BB37-D873-4DE2-B7D0-A60A936798E1}.Debug.ActiveCfg = Debug|Win32 {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug.ActiveCfg = Debug|Win32
{C4F5BB37-D873-4DE2-B7D0-A60A936798E1}.Debug.Build.0 = Debug|Win32 {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug.Build.0 = Debug|Win32
{C4F5BB37-D873-4DE2-B7D0-A60A936798E1}.Release.ActiveCfg = Release|Win32 {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release.ActiveCfg = Release|Win32
{C4F5BB37-D873-4DE2-B7D0-A60A936798E1}.Release.Build.0 = Release|Win32 {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection
......
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.10" Version="9,00"
Name="22.MaterialViewer" Name="22.MaterialViewer"
ProjectGUID="{AFC223BD-4371-4A8B-A90B-0D338BD2DEBB}" ProjectGUID="{4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}"
SccProjectName="" TargetFrameworkVersion="131072"
SccLocalPath=""> >
<Platforms> <Platforms>
<Platform <Platform
Name="Win32"/> Name="Win32"
/>
</Platforms> </Platforms>
<ToolFiles>
</ToolFiles>
<Configurations> <Configurations>
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
OutputDirectory=".\Release" OutputDirectory=".\Release"
IntermediateDirectory=".\Release" IntermediateDirectory=".\Release"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE" ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"> CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/MaterialViewer.tlb"
HeaderFileName=""
/>
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\include" AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE" StringPooling="true"
RuntimeLibrary="4" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="true"
UsePrecompiledHeader="2" UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/MaterialViewer.pch" PrecompiledHeaderFile=".\Release/MaterialViewer.pch"
AssemblerListingLocation=".\Release/" AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/" ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/" ProgramDataBaseFileName=".\Release/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="TRUE" SuppressStartupBanner="true"
CompileAs="0"/> CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="3079"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe" OutputFile="..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe"
LinkIncremental="0" LinkIncremental="0"
SuppressStartupBanner="TRUE" SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
ProgramDatabaseFile=".\Release/MaterialViewer.pdb" ProgramDatabaseFile=".\Release/MaterialViewer.pdb"
SubSystem="1" SubSystem="1"
TargetMachine="1"/> RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool <Tool
Name="VCMIDLTool" Name="VCALinkTool"
TypeLibraryName=".\Release/MaterialViewer.tlb" />
HeaderFileName=""/>
<Tool <Tool
Name="VCPostBuildEventTool"/> Name="VCManifestTool"
/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCXDCMakeTool"
/>
<Tool <Tool
Name="VCPreLinkEventTool"/> Name="VCBscMakeTool"
/>
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCFxCopTool"
PreprocessorDefinitions="NDEBUG" />
Culture="3079"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCAppVerifierTool"
/>
<Tool <Tool
Name="VCXMLDataGeneratorTool"/> Name="VCPostBuildEventTool"
<Tool />
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
<Configuration <Configuration
Name="Debug|Win32" Name="Debug|Win32"
OutputDirectory=".\Debug" OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug" IntermediateDirectory=".\Debug"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE" ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"> CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/MaterialViewer.tlb"
HeaderFileName=""
/>
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\include" AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="5" RuntimeLibrary="1"
UsePrecompiledHeader="2" UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/MaterialViewer.pch" PrecompiledHeaderFile=".\Debug/MaterialViewer.pch"
AssemblerListingLocation=".\Debug/" AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/" ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/" ProgramDataBaseFileName=".\Debug/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="TRUE" SuppressStartupBanner="true"
DebugInformationFormat="4" DebugInformationFormat="4"
CompileAs="0"/> CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="3079"
/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCPreLinkEventTool"
/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe" OutputFile="..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe"
LinkIncremental="0" LinkIncremental="0"
SuppressStartupBanner="TRUE" SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
GenerateDebugInformation="TRUE" GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/MaterialViewer.pdb" ProgramDatabaseFile=".\Debug/MaterialViewer.pdb"
SubSystem="1" SubSystem="1"
TargetMachine="1"/> RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool <Tool
Name="VCMIDLTool" Name="VCALinkTool"
TypeLibraryName=".\Debug/MaterialViewer.tlb" />
HeaderFileName=""/>
<Tool <Tool
Name="VCPostBuildEventTool"/> Name="VCManifestTool"
/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCXDCMakeTool"
/>
<Tool <Tool
Name="VCPreLinkEventTool"/> Name="VCBscMakeTool"
/>
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCFxCopTool"
PreprocessorDefinitions="_DEBUG" />
Culture="3079"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCAppVerifierTool"
/>
<Tool <Tool
Name="VCXMLDataGeneratorTool"/> Name="VCPostBuildEventTool"
<Tool />
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>
<Files> <Files>
<File <File
RelativePath="main.cpp"> RelativePath="main.cpp"
>
<FileConfiguration <FileConfiguration
Name="Release|Win32"> Name="Release|Win32"
>
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
AdditionalIncludeDirectories="" AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/> PreprocessorDefinitions=""
/>
</FileConfiguration> </FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Debug|Win32"> Name="Debug|Win32"
>
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="" AdditionalIncludeDirectories=""
PreprocessorDefinitions="" PreprocessorDefinitions=""
BasicRuntimeChecks="3"/> BasicRuntimeChecks="3"
/>
</FileConfiguration> </FileConfiguration>
</File> </File>
</Files> </Files>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8,00" Version="8,00"
Name="22.MaterialViewer_vc8" Name="22.MaterialViewer_vc8"
ProjectGUID="{2856AB41-9BC5-4716-9B35-762A65F6F5D1}" ProjectGUID="{4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}"
RootNamespace="MaterialViewer_vc8" RootNamespace="MaterialViewer_vc8"
> >
<Platforms> <Platforms>
......
Microsoft Visual Studio Solution File, Format Version 8.00 Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.SMeshHandling", "SMeshHandling.vcproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.SMeshHandling", "SMeshHandling.vcproj", "{6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
...@@ -9,10 +9,10 @@ Global ...@@ -9,10 +9,10 @@ Global
Release = Release Release = Release
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution GlobalSection(ProjectConfiguration) = postSolution
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug.ActiveCfg = Debug|Win32 {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug.ActiveCfg = Debug|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug.Build.0 = Debug|Win32 {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug.Build.0 = Debug|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.ActiveCfg = Release|Win32 {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release.ActiveCfg = Release|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.Build.0 = Release|Win32 {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.10" Version="7.10"
Name="23.SMeshHandling" Name="23.SMeshHandling"
ProjectGUID="{EB3B38EA-5CE7-4983-845B-880661E69D09}" ProjectGUID="{6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}"
Keyword="Win32Proj"> Keyword="Win32Proj">
<Platforms> <Platforms>
<Platform <Platform
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8,00" Version="8,00"
Name="23.SMeshHandling_vc8" Name="23.SMeshHandling_vc8"
ProjectGUID="{08D2F676-9DEB-4443-AEF7-52CC6F7D5F7C}" ProjectGUID="{6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}"
Keyword="Win32Proj" Keyword="Win32Proj"
> >
<Platforms> <Platforms>
......
...@@ -74,7 +74,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader", "16.Qu ...@@ -74,7 +74,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader", "16.Qu
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.MouseAndJoystick\MouseAndJoystick.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.MouseAndJoystick\MouseAndJoystick.vcproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
...@@ -83,7 +83,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer", "21.Qua ...@@ -83,7 +83,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer", "21.Qua
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "20.ManagedLights\ManagedLights.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "20.ManagedLights\ManagedLights.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
...@@ -165,16 +165,16 @@ Global ...@@ -165,16 +165,16 @@ Global
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug.Build.0 = Debug|Win32 {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug.Build.0 = Debug|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.ActiveCfg = Release|Win32 {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.ActiveCfg = Release|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.Build.0 = Release|Win32 {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.Build.0 = Release|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug.ActiveCfg = Debug|Win32 {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug.ActiveCfg = Debug|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release.ActiveCfg = Release|Win32 {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release.ActiveCfg = Release|Win32
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug.ActiveCfg = Debug|Win32 {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug.ActiveCfg = Debug|Win32
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug.Build.0 = Debug|Win32 {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug.Build.0 = Debug|Win32
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release.ActiveCfg = Release|Win32 {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release.ActiveCfg = Release|Win32
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release.Build.0 = Release|Win32 {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release.Build.0 = Release|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug.ActiveCfg = Debug|Win32 {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug.ActiveCfg = Debug|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug.Build.0 = Debug|Win32 {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug.Build.0 = Debug|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release.ActiveCfg = Release|Win32 {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release.ActiveCfg = Release|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release.Build.0 = Release|Win32 {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection
......
...@@ -52,7 +52,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_vc8", "Demo\Demo_vc8.v ...@@ -52,7 +52,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_vc8", "Demo\Demo_vc8.v
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader_vc8", "16.Quake3MapShader\Quake3MapShader_vc8.vcproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader_vc8", "16.Quake3MapShader\Quake3MapShader_vc8.vcproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick_vc8", "19.MouseAndJoystick\MouseAndJoystick_vc8.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick_vc8", "19.MouseAndJoystick\MouseAndJoystick_vc8.vcproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights_vc8", "20.ManagedLights\ManagedLights_vc8.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights_vc8", "20.ManagedLights\ManagedLights_vc8.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
...@@ -150,10 +150,10 @@ Global ...@@ -150,10 +150,10 @@ Global
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.Build.0 = Debug|Win32 {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.Build.0 = Debug|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.ActiveCfg = Release|Win32 {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.ActiveCfg = Release|Win32
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.Build.0 = Release|Win32 {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.Build.0 = Release|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.ActiveCfg = Debug|Win32 {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.ActiveCfg = Debug|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.Build.0 = Debug|Win32 {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.Build.0 = Debug|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.ActiveCfg = Release|Win32 {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.ActiveCfg = Release|Win32
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.Build.0 = Release|Win32 {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.Build.0 = Release|Win32
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32 {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.Build.0 = Debug|Win32 {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.Build.0 = Debug|Win32
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32 {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#define __I_EVENT_RECEIVER_H_INCLUDED__ #define __I_EVENT_RECEIVER_H_INCLUDED__
#include "ILogger.h" #include "ILogger.h"
#include "position2d.h"
#include "Keycodes.h" #include "Keycodes.h"
#include "irrString.h" #include "irrString.h"
...@@ -246,9 +245,12 @@ namespace irr ...@@ -246,9 +245,12 @@ namespace irr
//! A tree view node was expanded. See IGUITreeView::getLastEventNode(). //! A tree view node was expanded. See IGUITreeView::getLastEventNode().
EGET_TREEVIEW_NODE_EXPAND, EGET_TREEVIEW_NODE_EXPAND,
//! A tree view node was collapsed. See IGUITreeView::getLastEventNode(). //! deprecated - use EGET_TREEVIEW_NODE_COLLAPSE instead
EGET_TREEVIEW_NODE_COLLAPS, EGET_TREEVIEW_NODE_COLLAPS,
//! A tree view node was collapsed. See IGUITreeView::getLastEventNode().
EGET_TREEVIEW_NODE_COLLAPSE = EGET_TREEVIEW_NODE_COLLAPS,
//! No real event. Just for convenience to get number of events //! No real event. Just for convenience to get number of events
EGET_COUNT EGET_COUNT
}; };
......
...@@ -12,7 +12,7 @@ namespace irr ...@@ -12,7 +12,7 @@ namespace irr
namespace gui namespace gui
{ {
//! Standard file chooser dialog. //! Standard color chooser dialog.
class IGUIColorSelectDialog : public IGUIElement class IGUIColorSelectDialog : public IGUIElement
{ {
public: public:
......
...@@ -164,7 +164,7 @@ namespace scene ...@@ -164,7 +164,7 @@ namespace scene
parameters) the position of the collision, and the triangle that was hit. parameters) the position of the collision, and the triangle that was hit.
All scene nodes in the hierarchy tree under the specified node are checked. Only All scene nodes in the hierarchy tree under the specified node are checked. Only
notes that are visible, with an ID that matches at least one bit in the supplied nodes that are visible, with an ID that matches at least one bit in the supplied
bitmask, and which have a triangle selector are considered as candidates for being hit. bitmask, and which have a triangle selector are considered as candidates for being hit.
You do not have to build a meta triangle selector; the individual triangle selectors You do not have to build a meta triangle selector; the individual triangle selectors
of each candidate scene node are used automatically. of each candidate scene node are used automatically.
......
...@@ -145,7 +145,7 @@ namespace scene ...@@ -145,7 +145,7 @@ namespace scene
//! Returns the last triangle that caused a collision //! Returns the last triangle that caused a collision
virtual const core::triangle3df & getCollisionTriangle() const = 0; virtual const core::triangle3df & getCollisionTriangle() const = 0;
//! Returns the position that the target node will be moved to, unless the collision is consumed in a callback). //! Returns the position that the target node will be moved to, unless the collision is consumed in a callback.
/** /**
If you have a collision callback registered, and it consumes the collision, then the If you have a collision callback registered, and it consumes the collision, then the
node will ignore the collision and will not stop at this position. Instead, it will node will ignore the collision and will not stop at this position. Instead, it will
......
...@@ -78,7 +78,7 @@ struct SLight ...@@ -78,7 +78,7 @@ struct SLight
/** If Type is ELT_POINT, it is ignored. Changed via light scene node's rotation. */ /** If Type is ELT_POINT, it is ignored. Changed via light scene node's rotation. */
core::vector3df Direction; core::vector3df Direction;
//! Read-ONLY! Radius of light. Everything within this radius be be lighted. //! Read-ONLY! Radius of light. Everything within this radius will be lighted.
f32 Radius; f32 Radius;
//! Read-ONLY! Type of the light. Default: ELT_POINT //! Read-ONLY! Type of the light. Default: ELT_POINT
......
...@@ -195,8 +195,8 @@ namespace core ...@@ -195,8 +195,8 @@ namespace core
\return Interpolated dimension. */ \return Interpolated dimension. */
dimension2d<T> getInterpolated(const dimension2d<T>& other, f32 d) const dimension2d<T> getInterpolated(const dimension2d<T>& other, f32 d) const
{ {
T inv = (T) (1.0f - d); f32 inv = (1.0f - d);
return dimension2d<T>(other.Width*inv + Width*d, other.Height*inv + Height*d); return dimension2d<T>( (T)(other.Width*inv + Width*d), (T)(other.Height*inv + Height*d));
} }
......
...@@ -162,10 +162,10 @@ namespace core ...@@ -162,10 +162,10 @@ namespace core
} }
//! swaps the content of the passed parameters //! swaps the content of the passed parameters
// Note: We use the same trick as boost and use two template arguments to // Note: We use the same trick as boost and use two template arguments to
// avoid ambiguity when swapping objectsof an Irrlicht type that has not // avoid ambiguity when swapping objects of an Irrlicht type that has not
// it's own swap overload. Otherwise we get conflicts with some compilers // it's own swap overload. Otherwise we get conflicts with some compilers
// in combination with stl. // in combination with stl.
template <class T1, class T2> template <class T1, class T2>
inline void swap(T1& a, T2& b) inline void swap(T1& a, T2& b)
{ {
......
...@@ -204,7 +204,7 @@ namespace core ...@@ -204,7 +204,7 @@ namespace core
//! Get the area of the triangle //! Get the area of the triangle
T getArea() const T getArea() const
{ {
return (pointB - pointA).crossProduct(pointC - pointA).getLength() * 0.5; return (pointB - pointA).crossProduct(pointC - pointA).getLength() * 0.5f;
} }
......
...@@ -192,14 +192,14 @@ public: ...@@ -192,14 +192,14 @@ public:
if ( Y > 0) if ( Y > 0)
if (X > 0) if (X > 0)
return atan(Y/X) * RADTODEG64; return atan((irr::f64)Y/(irr::f64)X) * RADTODEG64;
else else
return 180.0-atan(Y/-X) * RADTODEG64; return 180.0-atan((irr::f64)Y/-(irr::f64)X) * RADTODEG64;
else else
if (X > 0) if (X > 0)
return 360.0-atan(-Y/X) * RADTODEG64; return 360.0-atan(-(irr::f64)Y/(irr::f64)X) * RADTODEG64;
else else
return 180.0+atan(-Y/-X) * RADTODEG64; return 180.0+atan(-(irr::f64)Y/-(irr::f64)X) * RADTODEG64;
} }
//! Calculates the angle of this vector in degrees in the counter trigonometric sense. //! Calculates the angle of this vector in degrees in the counter trigonometric sense.
......
...@@ -32,7 +32,7 @@ CAnimatedMeshSceneNode::CAnimatedMeshSceneNode(IAnimatedMesh* mesh, ...@@ -32,7 +32,7 @@ CAnimatedMeshSceneNode::CAnimatedMeshSceneNode(IAnimatedMesh* mesh,
const core::vector3df& rotation, const core::vector3df& rotation,
const core::vector3df& scale) const core::vector3df& scale)
: IAnimatedMeshSceneNode(parent, mgr, id, position, rotation, scale), Mesh(0), : IAnimatedMeshSceneNode(parent, mgr, id, position, rotation, scale), Mesh(0),
BeginFrameTime(0), StartFrame(0), EndFrame(0), FramesPerSecond(0.f), StartFrame(0), EndFrame(0), FramesPerSecond(0.f),
CurrentFrameNr(0.f), LastTimeMs(0), CurrentFrameNr(0.f), LastTimeMs(0),
TransitionTime(0), Transiting(0.f), TransitingBlend(0.f), TransitionTime(0), Transiting(0.f), TransitingBlend(0.f),
JointMode(EJUOR_NONE), JointsUsed(false), JointMode(EJUOR_NONE), JointsUsed(false),
...@@ -44,7 +44,6 @@ CAnimatedMeshSceneNode::CAnimatedMeshSceneNode(IAnimatedMesh* mesh, ...@@ -44,7 +44,6 @@ CAnimatedMeshSceneNode::CAnimatedMeshSceneNode(IAnimatedMesh* mesh,
setDebugName("CAnimatedMeshSceneNode"); setDebugName("CAnimatedMeshSceneNode");
#endif #endif
BeginFrameTime = os::Timer::getTime();
FramesPerSecond = 25.f/1000.f; FramesPerSecond = 25.f/1000.f;
setMesh(mesh); setMesh(mesh);
...@@ -78,12 +77,6 @@ void CAnimatedMeshSceneNode::setCurrentFrame(f32 frame) ...@@ -78,12 +77,6 @@ void CAnimatedMeshSceneNode::setCurrentFrame(f32 frame)
// if you pass an out of range value, we just clamp it // if you pass an out of range value, we just clamp it
CurrentFrameNr = core::clamp ( frame, (f32)StartFrame, (f32)EndFrame ); CurrentFrameNr = core::clamp ( frame, (f32)StartFrame, (f32)EndFrame );
BeginFrameTime = os::Timer::getTime();
if (FramesPerSecond > 0)
BeginFrameTime += (s32)((CurrentFrameNr - StartFrame) / FramesPerSecond);
else if (FramesPerSecond < 0)
BeginFrameTime += (s32)((CurrentFrameNr - EndFrame) / -FramesPerSecond);
beginTransition(); //transit to this frame if enabled beginTransition(); //transit to this frame if enabled
} }
...@@ -115,15 +108,18 @@ void CAnimatedMeshSceneNode::buildFrameNr(u32 timeMs) ...@@ -115,15 +108,18 @@ void CAnimatedMeshSceneNode::buildFrameNr(u32 timeMs)
{ {
// play animation looped // play animation looped
CurrentFrameNr += timeMs * FramesPerSecond; CurrentFrameNr += timeMs * FramesPerSecond;
// We have no interpolation between EndFrame and StartFrame,
// the last frame must be identical to first one with our current solution.
if (FramesPerSecond > 0.f) //forwards... if (FramesPerSecond > 0.f) //forwards...
{ {
if (CurrentFrameNr > EndFrame) if (CurrentFrameNr > EndFrame)
CurrentFrameNr -= (EndFrame-StartFrame); CurrentFrameNr = StartFrame + fmod(CurrentFrameNr - StartFrame, (f32)(EndFrame-StartFrame));
} }
else //backwards... else //backwards...
{ {
if (CurrentFrameNr < StartFrame) if (CurrentFrameNr < StartFrame)
CurrentFrameNr += (EndFrame-StartFrame); CurrentFrameNr = EndFrame - fmod(EndFrame - CurrentFrameNr, (f32)(EndFrame-StartFrame));
} }
} }
else else
...@@ -1076,7 +1072,6 @@ ISceneNode* CAnimatedMeshSceneNode::clone(ISceneNode* newParent, ISceneManager* ...@@ -1076,7 +1072,6 @@ ISceneNode* CAnimatedMeshSceneNode::clone(ISceneNode* newParent, ISceneManager*
newNode->Materials = Materials; newNode->Materials = Materials;
newNode->Box = Box; newNode->Box = Box;
newNode->Mesh = Mesh; newNode->Mesh = Mesh;
newNode->BeginFrameTime = BeginFrameTime;
newNode->StartFrame = StartFrame; newNode->StartFrame = StartFrame;
newNode->EndFrame = EndFrame; newNode->EndFrame = EndFrame;
newNode->FramesPerSecond = FramesPerSecond; newNode->FramesPerSecond = FramesPerSecond;
......
...@@ -175,7 +175,6 @@ namespace scene ...@@ -175,7 +175,6 @@ namespace scene
core::aabbox3d<f32> Box; core::aabbox3d<f32> Box;
IAnimatedMesh* Mesh; IAnimatedMesh* Mesh;
u32 BeginFrameTime;
s32 StartFrame; s32 StartFrame;
s32 EndFrame; s32 EndFrame;
f32 FramesPerSecond; f32 FramesPerSecond;
......
...@@ -2223,6 +2223,12 @@ IImage* CD3D8Driver::createScreenShot() ...@@ -2223,6 +2223,12 @@ IImage* CD3D8Driver::createScreenShot()
clientRect.top = clientPoint.y; clientRect.top = clientPoint.y;
clientRect.right = clientRect.left + ScreenSize.Width; clientRect.right = clientRect.left + ScreenSize.Width;
clientRect.bottom = clientRect.top + ScreenSize.Height; clientRect.bottom = clientRect.top + ScreenSize.Height;
// window can be off-screen partly, we can't take screenshots from that
clientRect.left = core::max_(clientRect.left, 0l);
clientRect.top = core::max_(clientRect.top, 0l);
clientRect.right = core::min_(clientRect.right, (long)displayMode.Width);
clientRect.bottom = core::min_(clientRect.bottom, (long)displayMode.Height );
} }
// lock our area of the surface // lock our area of the surface
...@@ -2233,8 +2239,12 @@ IImage* CD3D8Driver::createScreenShot() ...@@ -2233,8 +2239,12 @@ IImage* CD3D8Driver::createScreenShot()
return 0; return 0;
} }
irr::core::dimension2d<u32> shotSize;
shotSize.Width = core::min_( ScreenSize.Width, (u32)(clientRect.right-clientRect.left) );
shotSize.Height = core::min_( ScreenSize.Height, (u32)(clientRect.bottom-clientRect.top) );
// this could throw, but we aren't going to worry about that case very much // this could throw, but we aren't going to worry about that case very much
IImage* newImage = new CImage(ECF_A8R8G8B8, ScreenSize); IImage* newImage = new CImage(ECF_A8R8G8B8, shotSize);
// d3d pads the image, so we need to copy the correct number of bytes // d3d pads the image, so we need to copy the correct number of bytes
u32* dP = (u32*)newImage->lock(); u32* dP = (u32*)newImage->lock();
...@@ -2245,26 +2255,26 @@ IImage* CD3D8Driver::createScreenShot() ...@@ -2245,26 +2255,26 @@ IImage* CD3D8Driver::createScreenShot()
// set each pixel alpha value to 255. // set each pixel alpha value to 255.
if(D3DFMT_X8R8G8B8 == displayMode.Format && (0xFF000000 != (*dP & 0xFF000000))) if(D3DFMT_X8R8G8B8 == displayMode.Format && (0xFF000000 != (*dP & 0xFF000000)))
{ {
for (u32 y = 0; y < ScreenSize.Height; ++y) for (u32 y = 0; y < shotSize.Height; ++y)
{ {
for(u32 x = 0; x < ScreenSize.Width; ++x) for(u32 x = 0; x < shotSize.Width; ++x)
{ {
*dP = *((u32*)sP) | 0xFF000000; *dP = *((u32*)sP) | 0xFF000000;
dP++; dP++;
sP += 4; sP += 4;
} }
sP += lockedRect.Pitch - (4 * ScreenSize.Width); sP += lockedRect.Pitch - (4 * shotSize.Width);
} }
} }
else else
{ {
for (u32 y = 0; y < ScreenSize.Height; ++y) for (u32 y = 0; y < shotSize.Height; ++y)
{ {
memcpy(dP, sP, ScreenSize.Width * 4); memcpy(dP, sP, shotSize.Width * 4);
sP += lockedRect.Pitch; sP += lockedRect.Pitch;
dP += ScreenSize.Width; dP += shotSize.Width;
} }
} }
......
...@@ -3136,6 +3136,12 @@ IImage* CD3D9Driver::createScreenShot() ...@@ -3136,6 +3136,12 @@ IImage* CD3D9Driver::createScreenShot()
clientRect.top = clientPoint.y; clientRect.top = clientPoint.y;
clientRect.right = clientRect.left + ScreenSize.Width; clientRect.right = clientRect.left + ScreenSize.Width;
clientRect.bottom = clientRect.top + ScreenSize.Height; clientRect.bottom = clientRect.top + ScreenSize.Height;
// window can be off-screen partly, we can't take screenshots from that
clientRect.left = core::max_(clientRect.left, 0l);
clientRect.top = core::max_(clientRect.top, 0l);
clientRect.right = core::min_(clientRect.right, (long)displayMode.Width);
clientRect.bottom = core::min_(clientRect.bottom, (long)displayMode.Height );
} }
// lock our area of the surface // lock our area of the surface
...@@ -3146,8 +3152,12 @@ IImage* CD3D9Driver::createScreenShot() ...@@ -3146,8 +3152,12 @@ IImage* CD3D9Driver::createScreenShot()
return 0; return 0;
} }
irr::core::dimension2d<u32> shotSize;
shotSize.Width = core::min_( ScreenSize.Width, (u32)(clientRect.right-clientRect.left) );
shotSize.Height = core::min_( ScreenSize.Height, (u32)(clientRect.bottom-clientRect.top) );
// this could throw, but we aren't going to worry about that case very much // this could throw, but we aren't going to worry about that case very much
IImage* newImage = new CImage(ECF_A8R8G8B8, ScreenSize); IImage* newImage = new CImage(ECF_A8R8G8B8, shotSize);
// d3d pads the image, so we need to copy the correct number of bytes // d3d pads the image, so we need to copy the correct number of bytes
u32* dP = (u32*)newImage->lock(); u32* dP = (u32*)newImage->lock();
...@@ -3158,26 +3168,26 @@ IImage* CD3D9Driver::createScreenShot() ...@@ -3158,26 +3168,26 @@ IImage* CD3D9Driver::createScreenShot()
// set each pixel alpha value to 255. // set each pixel alpha value to 255.
if(D3DFMT_X8R8G8B8 == displayMode.Format && (0xFF000000 != (*dP & 0xFF000000))) if(D3DFMT_X8R8G8B8 == displayMode.Format && (0xFF000000 != (*dP & 0xFF000000)))
{ {
for (u32 y = 0; y < ScreenSize.Height; ++y) for (u32 y = 0; y < shotSize.Height; ++y)
{ {
for(u32 x = 0; x < ScreenSize.Width; ++x) for(u32 x = 0; x < shotSize.Width; ++x)
{ {
*dP = *((u32*)sP) | 0xFF000000; *dP = *((u32*)sP) | 0xFF000000;
dP++; dP++;
sP += 4; sP += 4;
} }
sP += lockedRect.Pitch - (4 * ScreenSize.Width); sP += lockedRect.Pitch - (4 * shotSize.Width);
} }
} }
else else
{ {
for (u32 y = 0; y < ScreenSize.Height; ++y) for (u32 y = 0; y < shotSize.Height; ++y)
{ {
memcpy(dP, sP, ScreenSize.Width * 4); memcpy(dP, sP, shotSize.Width * 4);
sP += lockedRect.Pitch; sP += lockedRect.Pitch;
dP += ScreenSize.Width; dP += shotSize.Width;
} }
} }
......
...@@ -64,7 +64,7 @@ CGUIComboBox::CGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent, ...@@ -64,7 +64,7 @@ CGUIComboBox::CGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent,
SelectedText->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT); SelectedText->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
SelectedText->setTextAlignment(EGUIA_UPPERLEFT, EGUIA_CENTER); SelectedText->setTextAlignment(EGUIA_UPPERLEFT, EGUIA_CENTER);
if (skin) if (skin)
SelectedText->setOverrideColor(skin->getColor(EGDC_BUTTON_TEXT)); SelectedText->setOverrideColor(skin->getColor(EGDC_BUTTON_TEXT));
SelectedText->enableOverrideColor(true); SelectedText->enableOverrideColor(true);
// this element can be tabbed to // this element can be tabbed to
...@@ -363,20 +363,23 @@ void CGUIComboBox::draw() ...@@ -363,20 +363,23 @@ void CGUIComboBox::draw()
{ {
HasFocus = currentFocus == this || isMyChild(currentFocus); HasFocus = currentFocus == this || isMyChild(currentFocus);
LastFocus = currentFocus; LastFocus = currentFocus;
}
SelectedText->setBackgroundColor(skin->getColor(EGDC_HIGH_LIGHT)); // set colors each time as skin-colors can be changed
SelectedText->setBackgroundColor(skin->getColor(EGDC_HIGH_LIGHT));
if(isEnabled()) if(isEnabled())
{ {
SelectedText->setDrawBackground(HasFocus); SelectedText->setDrawBackground(HasFocus);
SelectedText->setOverrideColor(skin->getColor(HasFocus ? EGDC_HIGH_LIGHT_TEXT : EGDC_BUTTON_TEXT)); SelectedText->setOverrideColor(skin->getColor(HasFocus ? EGDC_HIGH_LIGHT_TEXT : EGDC_BUTTON_TEXT));
}
else
{
SelectedText->setDrawBackground(false);
SelectedText->setOverrideColor(skin->getColor(EGDC_GRAY_TEXT));
}
} }
else
{
SelectedText->setDrawBackground(false);
SelectedText->setOverrideColor(skin->getColor(EGDC_GRAY_TEXT));
}
ListButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_DOWN), skin->getColor(EGDC_WINDOW_SYMBOL));
ListButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_DOWN), skin->getColor(EGDC_WINDOW_SYMBOL));
core::rect<s32> frameRect(AbsoluteRect); core::rect<s32> frameRect(AbsoluteRect);
......
...@@ -498,6 +498,7 @@ void CGUIEnvironment::updateHoveredElement(core::position2d<s32> mousePos) ...@@ -498,6 +498,7 @@ void CGUIEnvironment::updateHoveredElement(core::position2d<s32> mousePos)
if (lastHovered) if (lastHovered)
{ {
event.GUIEvent.Caller = lastHovered; event.GUIEvent.Caller = lastHovered;
event.GUIEvent.Element = 0;
event.GUIEvent.EventType = EGET_ELEMENT_LEFT; event.GUIEvent.EventType = EGET_ELEMENT_LEFT;
lastHovered->OnEvent(event); lastHovered->OnEvent(event);
} }
......
...@@ -280,6 +280,13 @@ void CGUIScrollBar::draw() ...@@ -280,6 +280,13 @@ void CGUIScrollBar::draw()
return; return;
video::SColor iconColor = skin->getColor(EGDC_WINDOW_SYMBOL);
if ( iconColor != CurrentIconColor )
{
refreshControls();
}
SliderRect = AbsoluteRect; SliderRect = AbsoluteRect;
// draws the background // draws the background
...@@ -436,7 +443,7 @@ s32 CGUIScrollBar::getPos() const ...@@ -436,7 +443,7 @@ s32 CGUIScrollBar::getPos() const
//! refreshes the position and text on child buttons //! refreshes the position and text on child buttons
void CGUIScrollBar::refreshControls() void CGUIScrollBar::refreshControls()
{ {
video::SColor color(255,255,255,255); CurrentIconColor = video::SColor(255,255,255,255);
IGUISkin* skin = Environment->getSkin(); IGUISkin* skin = Environment->getSkin();
IGUISpriteBank* sprites = 0; IGUISpriteBank* sprites = 0;
...@@ -444,7 +451,7 @@ void CGUIScrollBar::refreshControls() ...@@ -444,7 +451,7 @@ void CGUIScrollBar::refreshControls()
if (skin) if (skin)
{ {
sprites = skin->getSpriteBank(); sprites = skin->getSpriteBank();
color = skin->getColor(EGDC_WINDOW_SYMBOL); CurrentIconColor = skin->getColor(EGDC_WINDOW_SYMBOL);
} }
if (Horizontal) if (Horizontal)
...@@ -459,8 +466,8 @@ void CGUIScrollBar::refreshControls() ...@@ -459,8 +466,8 @@ void CGUIScrollBar::refreshControls()
if (sprites) if (sprites)
{ {
UpButton->setSpriteBank(sprites); UpButton->setSpriteBank(sprites);
UpButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_LEFT), color); UpButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_LEFT), CurrentIconColor);
UpButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_LEFT), color); UpButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_LEFT), CurrentIconColor);
} }
UpButton->setRelativePosition(core::rect<s32>(0,0, h, h)); UpButton->setRelativePosition(core::rect<s32>(0,0, h, h));
UpButton->setAlignment(EGUIA_UPPERLEFT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT); UpButton->setAlignment(EGUIA_UPPERLEFT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
...@@ -473,8 +480,8 @@ void CGUIScrollBar::refreshControls() ...@@ -473,8 +480,8 @@ void CGUIScrollBar::refreshControls()
if (sprites) if (sprites)
{ {
DownButton->setSpriteBank(sprites); DownButton->setSpriteBank(sprites);
DownButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_RIGHT), color); DownButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_RIGHT), CurrentIconColor);
DownButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_RIGHT), color); DownButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_RIGHT), CurrentIconColor);
} }
DownButton->setRelativePosition(core::rect<s32>(RelativeRect.getWidth()-h, 0, RelativeRect.getWidth(), h)); DownButton->setRelativePosition(core::rect<s32>(RelativeRect.getWidth()-h, 0, RelativeRect.getWidth(), h));
DownButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT); DownButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
...@@ -491,8 +498,8 @@ void CGUIScrollBar::refreshControls() ...@@ -491,8 +498,8 @@ void CGUIScrollBar::refreshControls()
if (sprites) if (sprites)
{ {
UpButton->setSpriteBank(sprites); UpButton->setSpriteBank(sprites);
UpButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_UP), color); UpButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_UP), CurrentIconColor);
UpButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_UP), color); UpButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_UP), CurrentIconColor);
} }
UpButton->setRelativePosition(core::rect<s32>(0,0, w, w)); UpButton->setRelativePosition(core::rect<s32>(0,0, w, w));
UpButton->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT); UpButton->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
...@@ -505,8 +512,8 @@ void CGUIScrollBar::refreshControls() ...@@ -505,8 +512,8 @@ void CGUIScrollBar::refreshControls()
if (sprites) if (sprites)
{ {
DownButton->setSpriteBank(sprites); DownButton->setSpriteBank(sprites);
DownButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_DOWN), color); DownButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_DOWN), CurrentIconColor);
DownButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_DOWN), color); DownButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_DOWN), CurrentIconColor);
} }
DownButton->setRelativePosition(core::rect<s32>(0,RelativeRect.getHeight()-w, w, RelativeRect.getHeight())); DownButton->setRelativePosition(core::rect<s32>(0,RelativeRect.getHeight()-w, w, RelativeRect.getHeight()));
DownButton->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT); DownButton->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT);
...@@ -525,6 +532,7 @@ void CGUIScrollBar::serializeAttributes(io::IAttributes* out, io::SAttributeRead ...@@ -525,6 +532,7 @@ void CGUIScrollBar::serializeAttributes(io::IAttributes* out, io::SAttributeRead
out->addInt ("Max", Max); out->addInt ("Max", Max);
out->addInt ("SmallStep", SmallStep); out->addInt ("SmallStep", SmallStep);
out->addInt ("LargeStep", LargeStep); out->addInt ("LargeStep", LargeStep);
// CurrentIconColor - not serialized as continuiously updated
} }
...@@ -539,6 +547,7 @@ void CGUIScrollBar::deserializeAttributes(io::IAttributes* in, io::SAttributeRea ...@@ -539,6 +547,7 @@ void CGUIScrollBar::deserializeAttributes(io::IAttributes* in, io::SAttributeRea
setPos(in->getAttributeAsInt("Value")); setPos(in->getAttributeAsInt("Value"));
setSmallStep(in->getAttributeAsInt("SmallStep")); setSmallStep(in->getAttributeAsInt("SmallStep"));
setLargeStep(in->getAttributeAsInt("LargeStep")); setLargeStep(in->getAttributeAsInt("LargeStep"));
// CurrentIconColor - not serialized as continuiously updated
refreshControls(); refreshControls();
} }
......
...@@ -99,6 +99,7 @@ namespace gui ...@@ -99,6 +99,7 @@ namespace gui
s32 LargeStep; s32 LargeStep;
s32 DesiredPos; s32 DesiredPos;
u32 LastChange; u32 LastChange;
video::SColor CurrentIconColor;
f32 range () const { return (f32) ( Max - Min ); } f32 range () const { return (f32) ( Max - Min ); }
}; };
......
...@@ -578,12 +578,12 @@ core::rect<s32> CGUISkin::draw3DWindowBackground(IGUIElement* element, ...@@ -578,12 +578,12 @@ core::rect<s32> CGUISkin::draw3DWindowBackground(IGUIElement* element,
//else //else
if ( Type == EGST_BURNING_SKIN ) if ( Type == EGST_BURNING_SKIN )
{ {
const video::SColor c = titleBarColor.getInterpolated( 0xffffffff, 0.8f); const video::SColor c = titleBarColor.getInterpolated( video::SColor(titleBarColor.getAlpha(),255,255,255), 0.8f);
Driver->draw2DRectangle(rect, titleBarColor, titleBarColor, c, c, clip); Driver->draw2DRectangle(rect, titleBarColor, titleBarColor, c, c, clip);
} }
else else
{ {
const video::SColor c = titleBarColor.getInterpolated(video::SColor(255,0,0,0), 0.2f); const video::SColor c = titleBarColor.getInterpolated(video::SColor(titleBarColor.getAlpha(),0,0,0), 0.2f);
Driver->draw2DRectangle(rect, titleBarColor, c, titleBarColor, c, clip); Driver->draw2DRectangle(rect, titleBarColor, c, titleBarColor, c, clip);
} }
} }
...@@ -909,8 +909,9 @@ void CGUISkin::drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon, ...@@ -909,8 +909,9 @@ void CGUISkin::drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
if (!SpriteBank) if (!SpriteBank)
return; return;
// TODO: we need another state for disabled elements (can't add now because it's an interface change)
SpriteBank->draw2DSprite(Icons[icon], position, clip, SpriteBank->draw2DSprite(Icons[icon], position, clip,
video::SColor(255,0,0,0), starttime, currenttime, loop, true); Colors[EGDC_WINDOW_SYMBOL], starttime, currenttime, loop, true);
} }
......
...@@ -29,6 +29,7 @@ CGUISpinBox::CGUISpinBox(const wchar_t* text, bool border,IGUIEnvironment* envir ...@@ -29,6 +29,7 @@ CGUISpinBox::CGUISpinBox(const wchar_t* text, bool border,IGUIEnvironment* envir
setDebugName("CGUISpinBox"); setDebugName("CGUISpinBox");
#endif #endif
CurrentIconColor = video::SColor(255,255,255,255);
s32 ButtonWidth = 16; s32 ButtonWidth = 16;
IGUISpriteBank *sb = 0; IGUISpriteBank *sb = 0;
if (environment && environment->getSkin()) if (environment && environment->getSkin())
...@@ -52,27 +53,14 @@ CGUISpinBox::CGUISpinBox(const wchar_t* text, bool border,IGUIEnvironment* envir ...@@ -52,27 +53,14 @@ CGUISpinBox::CGUISpinBox(const wchar_t* text, bool border,IGUIEnvironment* envir
ButtonSpinUp->setSubElement(true); ButtonSpinUp->setSubElement(true);
ButtonSpinUp->setTabStop(false); ButtonSpinUp->setTabStop(false);
ButtonSpinUp->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_CENTER); ButtonSpinUp->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_CENTER);
if (sb)
{
IGUISkin *skin = environment->getSkin();
ButtonSpinDown->setSpriteBank(sb);
ButtonSpinDown->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_SMALL_CURSOR_DOWN), skin->getColor(EGDC_WINDOW_SYMBOL));
ButtonSpinDown->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_SMALL_CURSOR_DOWN), skin->getColor(EGDC_WINDOW_SYMBOL));
ButtonSpinUp->setSpriteBank(sb);
ButtonSpinUp->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_SMALL_CURSOR_UP), skin->getColor(EGDC_WINDOW_SYMBOL));
ButtonSpinUp->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_SMALL_CURSOR_UP), skin->getColor(EGDC_WINDOW_SYMBOL));
}
else
{
ButtonSpinDown->setText(L"-");
ButtonSpinUp->setText(L"+");
}
const core::rect<s32> rectEdit(0, 0, rectangle.getWidth() - ButtonWidth - 1, rectangle.getHeight()); const core::rect<s32> rectEdit(0, 0, rectangle.getWidth() - ButtonWidth - 1, rectangle.getHeight());
EditBox = Environment->addEditBox(text, rectEdit, border, this, -1); EditBox = Environment->addEditBox(text, rectEdit, border, this, -1);
EditBox->grab(); EditBox->grab();
EditBox->setSubElement(true); EditBox->setSubElement(true);
EditBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT); EditBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
refreshSprites();
} }
...@@ -87,6 +75,31 @@ CGUISpinBox::~CGUISpinBox() ...@@ -87,6 +75,31 @@ CGUISpinBox::~CGUISpinBox()
EditBox->drop(); EditBox->drop();
} }
void CGUISpinBox::refreshSprites()
{
IGUISpriteBank *sb = 0;
if (Environment && Environment->getSkin())
{
sb = Environment->getSkin()->getSpriteBank();
}
if (sb)
{
IGUISkin * skin = Environment->getSkin();
CurrentIconColor = skin->getColor(EGDC_WINDOW_SYMBOL);
ButtonSpinDown->setSpriteBank(sb);
ButtonSpinDown->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_SMALL_CURSOR_DOWN), CurrentIconColor);
ButtonSpinDown->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_SMALL_CURSOR_DOWN), CurrentIconColor);
ButtonSpinUp->setSpriteBank(sb);
ButtonSpinUp->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_SMALL_CURSOR_UP), CurrentIconColor);
ButtonSpinUp->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_SMALL_CURSOR_UP), CurrentIconColor);
}
else
{
ButtonSpinDown->setText(L"-");
ButtonSpinUp->setText(L"+");
}
}
IGUIEditBox* CGUISpinBox::getEditBox() const IGUIEditBox* CGUISpinBox::getEditBox() const
{ {
...@@ -235,6 +248,11 @@ bool CGUISpinBox::OnEvent(const SEvent& event) ...@@ -235,6 +248,11 @@ bool CGUISpinBox::OnEvent(const SEvent& event)
void CGUISpinBox::verifyValueRange() void CGUISpinBox::verifyValueRange()
{ {
// TODO: This should be called in "draw" similar to the way it's done in CGUIWindow.
// But guess I can't in bugfix-release as overloading draw would break binary compitibility.
// So added here to allow users at least to manually force the element to having new skin-colors.
refreshSprites();
f32 val = getValue(); f32 val = getValue();
if ( val+core::ROUNDING_ERROR_f32 < RangeMin ) if ( val+core::ROUNDING_ERROR_f32 < RangeMin )
val = RangeMin; val = RangeMin;
......
...@@ -80,10 +80,12 @@ namespace gui ...@@ -80,10 +80,12 @@ namespace gui
protected: protected:
virtual void verifyValueRange(); virtual void verifyValueRange();
void refreshSprites();
IGUIEditBox * EditBox; IGUIEditBox * EditBox;
IGUIButton * ButtonSpinUp; IGUIButton * ButtonSpinUp;
IGUIButton * ButtonSpinDown; IGUIButton * ButtonSpinDown;
video::SColor CurrentIconColor;
f32 StepSize; f32 StepSize;
f32 RangeMin; f32 RangeMin;
f32 RangeMax; f32 RangeMax;
......
...@@ -23,7 +23,7 @@ CGUIStaticText::CGUIStaticText(const wchar_t* text, bool border, ...@@ -23,7 +23,7 @@ CGUIStaticText::CGUIStaticText(const wchar_t* text, bool border,
bool background) bool background)
: IGUIStaticText(environment, parent, id, rectangle), : IGUIStaticText(environment, parent, id, rectangle),
HAlign(EGUIA_UPPERLEFT), VAlign(EGUIA_UPPERLEFT), HAlign(EGUIA_UPPERLEFT), VAlign(EGUIA_UPPERLEFT),
Border(border), OverrideColorEnabled(false), WordWrap(false), Background(background), Border(border), OverrideColorEnabled(false), OverrideBGColorEnabled(false), WordWrap(false), Background(background),
OverrideColor(video::SColor(101,255,255,255)), BGColor(video::SColor(101,210,210,210)), OverrideColor(video::SColor(101,255,255,255)), BGColor(video::SColor(101,210,210,210)),
OverrideFont(0), LastBreakFont(0) OverrideFont(0), LastBreakFont(0)
{ {
...@@ -64,6 +64,9 @@ void CGUIStaticText::draw() ...@@ -64,6 +64,9 @@ void CGUIStaticText::draw()
if (Background) if (Background)
{ {
if ( !OverrideBGColorEnabled ) // skin-colors can change
BGColor = skin->getColor(gui::EGDC_3D_FACE);
driver->draw2DRectangle(BGColor, frameRect, &AbsoluteClippingRect); driver->draw2DRectangle(BGColor, frameRect, &AbsoluteClippingRect);
} }
...@@ -177,6 +180,7 @@ void CGUIStaticText::setOverrideColor(video::SColor color) ...@@ -177,6 +180,7 @@ void CGUIStaticText::setOverrideColor(video::SColor color)
void CGUIStaticText::setBackgroundColor(video::SColor color) void CGUIStaticText::setBackgroundColor(video::SColor color)
{ {
BGColor = color; BGColor = color;
OverrideBGColorEnabled = true;
Background = true; Background = true;
} }
...@@ -425,9 +429,11 @@ void CGUIStaticText::serializeAttributes(io::IAttributes* out, io::SAttributeRea ...@@ -425,9 +429,11 @@ void CGUIStaticText::serializeAttributes(io::IAttributes* out, io::SAttributeRea
out->addBool ("Border", Border); out->addBool ("Border", Border);
out->addBool ("OverrideColorEnabled",OverrideColorEnabled); out->addBool ("OverrideColorEnabled",OverrideColorEnabled);
out->addBool ("WordWrap", WordWrap); out->addBool ("OverrideBGColorEnabled",OverrideBGColorEnabled);
out->addBool ("WordWrap", WordWrap);
out->addBool ("Background", Background); out->addBool ("Background", Background);
out->addColor ("OverrideColor", OverrideColor); out->addColor ("OverrideColor", OverrideColor);
out->addColor ("BGColor", BGColor);
out->addEnum ("HTextAlign", HAlign, GUIAlignmentNames); out->addEnum ("HTextAlign", HAlign, GUIAlignmentNames);
out->addEnum ("VTextAlign", VAlign, GUIAlignmentNames); out->addEnum ("VTextAlign", VAlign, GUIAlignmentNames);
...@@ -441,11 +447,12 @@ void CGUIStaticText::deserializeAttributes(io::IAttributes* in, io::SAttributeRe ...@@ -441,11 +447,12 @@ void CGUIStaticText::deserializeAttributes(io::IAttributes* in, io::SAttributeRe
IGUIStaticText::deserializeAttributes(in,options); IGUIStaticText::deserializeAttributes(in,options);
Border = in->getAttributeAsBool("Border"); Border = in->getAttributeAsBool("Border");
OverrideColor = in->getAttributeAsColor("OverrideColor");
enableOverrideColor(in->getAttributeAsBool("OverrideColorEnabled")); enableOverrideColor(in->getAttributeAsBool("OverrideColorEnabled"));
OverrideBGColorEnabled = in->getAttributeAsBool("OverrideBGColorEnabled");
setWordWrap(in->getAttributeAsBool("WordWrap")); setWordWrap(in->getAttributeAsBool("WordWrap"));
Background = in->getAttributeAsBool("Background"); Background = in->getAttributeAsBool("Background");
OverrideColor = in->getAttributeAsColor("OverrideColor");
BGColor = in->getAttributeAsColor("BGColor");
setTextAlignment( (EGUI_ALIGNMENT) in->getAttributeAsEnumeration("HTextAlign", GUIAlignmentNames), setTextAlignment( (EGUI_ALIGNMENT) in->getAttributeAsEnumeration("HTextAlign", GUIAlignmentNames),
(EGUI_ALIGNMENT) in->getAttributeAsEnumeration("VTextAlign", GUIAlignmentNames)); (EGUI_ALIGNMENT) in->getAttributeAsEnumeration("VTextAlign", GUIAlignmentNames));
......
...@@ -94,6 +94,7 @@ namespace gui ...@@ -94,6 +94,7 @@ namespace gui
EGUI_ALIGNMENT HAlign, VAlign; EGUI_ALIGNMENT HAlign, VAlign;
bool Border; bool Border;
bool OverrideColorEnabled; bool OverrideColorEnabled;
bool OverrideBGColorEnabled;
bool WordWrap; bool WordWrap;
bool Background; bool Background;
......
...@@ -27,7 +27,7 @@ CGUITab::CGUITab(s32 number, IGUIEnvironment* environment, ...@@ -27,7 +27,7 @@ CGUITab::CGUITab(s32 number, IGUIEnvironment* environment,
IGUIElement* parent, const core::rect<s32>& rectangle, IGUIElement* parent, const core::rect<s32>& rectangle,
s32 id) s32 id)
: IGUITab(environment, parent, id, rectangle), Number(number), : IGUITab(environment, parent, id, rectangle), Number(number),
BackColor(0,0,0,0), TextColor(255,0,0,0), BackColor(0,0,0,0), OverrideTextColorEnabled(false), TextColor(255,0,0,0),
DrawBackground(false) DrawBackground(false)
{ {
#ifdef _DEBUG #ifdef _DEBUG
...@@ -54,6 +54,13 @@ void CGUITab::setNumber(s32 n) ...@@ -54,6 +54,13 @@ void CGUITab::setNumber(s32 n)
Number = n; Number = n;
} }
void CGUITab::refreshSkinColors()
{
if ( !OverrideTextColorEnabled )
{
TextColor = Environment->getSkin()->getColor(EGDC_BUTTON_TEXT);
}
}
//! draws the element and its children //! draws the element and its children
void CGUITab::draw() void CGUITab::draw()
...@@ -87,6 +94,7 @@ void CGUITab::setBackgroundColor(video::SColor c) ...@@ -87,6 +94,7 @@ void CGUITab::setBackgroundColor(video::SColor c)
//! sets the color of the text //! sets the color of the text
void CGUITab::setTextColor(video::SColor c) void CGUITab::setTextColor(video::SColor c)
{ {
OverrideTextColorEnabled = true;
TextColor = c; TextColor = c;
} }
...@@ -120,6 +128,7 @@ void CGUITab::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteO ...@@ -120,6 +128,7 @@ void CGUITab::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteO
out->addInt ("TabNumber", Number); out->addInt ("TabNumber", Number);
out->addBool ("DrawBackground", DrawBackground); out->addBool ("DrawBackground", DrawBackground);
out->addColor ("BackColor", BackColor); out->addColor ("BackColor", BackColor);
out->addBool ("OverrideTextColorEnabled", OverrideTextColorEnabled);
out->addColor ("TextColor", TextColor); out->addColor ("TextColor", TextColor);
} }
...@@ -133,7 +142,12 @@ void CGUITab::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWrite ...@@ -133,7 +142,12 @@ void CGUITab::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWrite
setNumber(in->getAttributeAsInt("TabNumber")); setNumber(in->getAttributeAsInt("TabNumber"));
setDrawBackground(in->getAttributeAsBool("DrawBackground")); setDrawBackground(in->getAttributeAsBool("DrawBackground"));
setBackgroundColor(in->getAttributeAsColor("BackColor")); setBackgroundColor(in->getAttributeAsColor("BackColor"));
bool override = in->getAttributeAsBool("OverrideTextColorEnabled");
setTextColor(in->getAttributeAsColor("TextColor")); setTextColor(in->getAttributeAsColor("TextColor"));
if ( !override )
{
OverrideTextColorEnabled = false;
}
if (Parent && Parent->getType() == EGUIET_TAB_CONTROL) if (Parent && Parent->getType() == EGUIET_TAB_CONTROL)
{ {
...@@ -395,18 +409,18 @@ s32 CGUITabControl::calcTabWidth(s32 pos, IGUIFont* font, const wchar_t* text, b ...@@ -395,18 +409,18 @@ s32 CGUITabControl::calcTabWidth(s32 pos, IGUIFont* font, const wchar_t* text, b
{ {
if ( !font ) if ( !font )
return 0; return 0;
s32 len = font->getDimension(text).Width + TabExtraWidth; s32 len = font->getDimension(text).Width + TabExtraWidth;
if ( TabMaxWidth > 0 && len > TabMaxWidth ) if ( TabMaxWidth > 0 && len > TabMaxWidth )
len = TabMaxWidth; len = TabMaxWidth;
// check if we miss the place to draw the tab-button // check if we miss the place to draw the tab-button
if ( withScrollControl && ScrollControl && pos+len > UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 ) if ( withScrollControl && ScrollControl && pos+len > UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 )
{ {
s32 tabMinWidth = font->getDimension(L"A").Width; s32 tabMinWidth = font->getDimension(L"A").Width;
if ( TabExtraWidth > 0 && TabExtraWidth > tabMinWidth ) if ( TabExtraWidth > 0 && TabExtraWidth > tabMinWidth )
tabMinWidth = TabExtraWidth; tabMinWidth = TabExtraWidth;
if ( ScrollControl && pos+tabMinWidth <= UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 ) if ( ScrollControl && pos+tabMinWidth <= UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 )
{ {
len = UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 - pos; len = UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 - pos;
...@@ -499,7 +513,7 @@ bool CGUITabControl::selectTab(core::position2d<s32> p) ...@@ -499,7 +513,7 @@ bool CGUITabControl::selectTab(core::position2d<s32> p)
s32 len = calcTabWidth(pos, font, text, true); s32 len = calcTabWidth(pos, font, text, true);
if ( ScrollControl && pos+len > UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 ) if ( ScrollControl && pos+len > UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 )
return false; return false;
frameRect.UpperLeftCorner.X = pos; frameRect.UpperLeftCorner.X = pos;
frameRect.LowerRightCorner.X = frameRect.UpperLeftCorner.X + len; frameRect.LowerRightCorner.X = frameRect.UpperLeftCorner.X + len;
...@@ -552,7 +566,7 @@ void CGUITabControl::draw() ...@@ -552,7 +566,7 @@ void CGUITabControl::draw()
bool needLeftScroll = CurrentScrollTabIndex > 0; bool needLeftScroll = CurrentScrollTabIndex > 0;
bool needRightScroll = false; bool needRightScroll = false;
// left and right pos of the active tab // left and right pos of the active tab
s32 left = 0; s32 left = 0;
s32 right = 0; s32 right = 0;
...@@ -581,6 +595,9 @@ void CGUITabControl::draw() ...@@ -581,6 +595,9 @@ void CGUITabControl::draw()
pos += len; pos += len;
if ( text )
Tabs[i]->refreshSkinColors();
if ((s32)i == ActiveTab) if ((s32)i == ActiveTab)
{ {
left = frameRect.UpperLeftCorner.X; left = frameRect.UpperLeftCorner.X;
...@@ -669,7 +686,7 @@ void CGUITabControl::draw() ...@@ -669,7 +686,7 @@ void CGUITabControl::draw()
} }
skin->draw3DTabBody(this, Border, FillBackground, AbsoluteRect, &AbsoluteClippingRect, TabHeight, VerticalAlignment); skin->draw3DTabBody(this, Border, FillBackground, AbsoluteRect, &AbsoluteClippingRect, TabHeight, VerticalAlignment);
// enable scrollcontrols on need // enable scrollcontrols on need
if ( UpButton ) if ( UpButton )
UpButton->setEnabled(needLeftScroll); UpButton->setEnabled(needLeftScroll);
...@@ -704,7 +721,7 @@ void CGUITabControl::setTabMaxWidth(s32 width ) ...@@ -704,7 +721,7 @@ void CGUITabControl::setTabMaxWidth(s32 width )
{ {
TabMaxWidth = width; TabMaxWidth = width;
} }
//! get the maximal width of a tab //! get the maximal width of a tab
s32 CGUITabControl::getTabMaxWidth() const s32 CGUITabControl::getTabMaxWidth() const
{ {
......
...@@ -65,11 +65,14 @@ namespace gui ...@@ -65,11 +65,14 @@ namespace gui
//! Reads attributes of the element //! Reads attributes of the element
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
//! only for internal use by CGUITabControl
void refreshSkinColors();
private: private:
s32 Number; s32 Number;
video::SColor BackColor; video::SColor BackColor;
bool OverrideTextColorEnabled;
video::SColor TextColor; video::SColor TextColor;
bool DrawBackground; bool DrawBackground;
}; };
...@@ -125,16 +128,16 @@ namespace gui ...@@ -125,16 +128,16 @@ namespace gui
//! Reads attributes of the element //! Reads attributes of the element
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
//! Get the height of the tabs //! Get the height of the tabs
virtual s32 getTabHeight() const; virtual s32 getTabHeight() const;
//! set the maximal width of a tab. Per default width is 0 which means "no width restriction". //! set the maximal width of a tab. Per default width is 0 which means "no width restriction".
virtual void setTabMaxWidth(s32 width ); virtual void setTabMaxWidth(s32 width );
//! get the maximal width of a tab //! get the maximal width of a tab
virtual s32 getTabMaxWidth() const; virtual s32 getTabMaxWidth() const;
//! Set the alignment of the tabs //! Set the alignment of the tabs
//! note: EGUIA_CENTER is not an option //! note: EGUIA_CENTER is not an option
virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ); virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment );
......
...@@ -78,12 +78,6 @@ void CGUITable::addColumn(const wchar_t* caption, s32 columnIndex) ...@@ -78,12 +78,6 @@ void CGUITable::addColumn(const wchar_t* caption, s32 columnIndex)
tabHeader.Width = Font->getDimension(caption).Width + (CellWidthPadding * 2) + ARROW_PAD; tabHeader.Width = Font->getDimension(caption).Width + (CellWidthPadding * 2) + ARROW_PAD;
tabHeader.OrderingMode = EGCO_NONE; tabHeader.OrderingMode = EGCO_NONE;
IGUISkin* skin = Environment->getSkin();
if (skin)
{
tabHeader.TextColor = skin->getColor(EGDC_BUTTON_TEXT);
}
if ( columnIndex < 0 || columnIndex >= (s32)Columns.size() ) if ( columnIndex < 0 || columnIndex >= (s32)Columns.size() )
{ {
Columns.push_back(tabHeader); Columns.push_back(tabHeader);
...@@ -166,6 +160,7 @@ bool CGUITable::setActiveColumn(s32 idx, bool doOrder ) ...@@ -166,6 +160,7 @@ bool CGUITable::setActiveColumn(s32 idx, bool doOrder )
SEvent event; SEvent event;
event.EventType = EET_GUI_EVENT; event.EventType = EET_GUI_EVENT;
event.GUIEvent.Caller = this; event.GUIEvent.Caller = this;
event.GUIEvent.Element = 0;
event.GUIEvent.EventType = EGET_TABLE_HEADER_CHANGED; event.GUIEvent.EventType = EGET_TABLE_HEADER_CHANGED;
Parent->OnEvent(event); Parent->OnEvent(event);
} }
...@@ -195,6 +190,7 @@ bool CGUITable::setActiveColumn(s32 idx, bool doOrder ) ...@@ -195,6 +190,7 @@ bool CGUITable::setActiveColumn(s32 idx, bool doOrder )
SEvent event; SEvent event;
event.EventType = EET_GUI_EVENT; event.EventType = EET_GUI_EVENT;
event.GUIEvent.Caller = this; event.GUIEvent.Caller = this;
event.GUIEvent.Element = 0;
event.GUIEvent.EventType = EGET_TABLE_HEADER_CHANGED; event.GUIEvent.EventType = EGET_TABLE_HEADER_CHANGED;
Parent->OnEvent(event); Parent->OnEvent(event);
} }
...@@ -306,6 +302,7 @@ void CGUITable::setCellText(u32 rowIndex, u32 columnIndex, const core::stringw& ...@@ -306,6 +302,7 @@ void CGUITable::setCellText(u32 rowIndex, u32 columnIndex, const core::stringw&
Rows[rowIndex].Items[columnIndex].Text = text; Rows[rowIndex].Items[columnIndex].Text = text;
breakText( Rows[rowIndex].Items[columnIndex].Text, Rows[rowIndex].Items[columnIndex].BrokenText, Columns[columnIndex].Width ); breakText( Rows[rowIndex].Items[columnIndex].Text, Rows[rowIndex].Items[columnIndex].BrokenText, Columns[columnIndex].Width );
Rows[rowIndex].Items[columnIndex].Color = color; Rows[rowIndex].Items[columnIndex].Color = color;
Rows[rowIndex].Items[columnIndex].IsOverrideColor = true;
} }
} }
...@@ -315,6 +312,7 @@ void CGUITable::setCellColor(u32 rowIndex, u32 columnIndex, video::SColor color) ...@@ -315,6 +312,7 @@ void CGUITable::setCellColor(u32 rowIndex, u32 columnIndex, video::SColor color)
if ( rowIndex < Rows.size() && columnIndex < Columns.size() ) if ( rowIndex < Rows.size() && columnIndex < Columns.size() )
{ {
Rows[rowIndex].Items[columnIndex].Color = color; Rows[rowIndex].Items[columnIndex].Color = color;
Rows[rowIndex].Items[columnIndex].IsOverrideColor = true;
} }
} }
...@@ -852,6 +850,7 @@ void CGUITable::selectNew(s32 ypos, bool onlyHover) ...@@ -852,6 +850,7 @@ void CGUITable::selectNew(s32 ypos, bool onlyHover)
SEvent event; SEvent event;
event.EventType = EET_GUI_EVENT; event.EventType = EET_GUI_EVENT;
event.GUIEvent.Caller = this; event.GUIEvent.Caller = this;
event.GUIEvent.Element = 0;
event.GUIEvent.EventType = (Selected != oldSelected) ? EGET_TABLE_CHANGED : EGET_TABLE_SELECTED_AGAIN; event.GUIEvent.EventType = (Selected != oldSelected) ? EGET_TABLE_CHANGED : EGET_TABLE_SELECTED_AGAIN;
Parent->OnEvent(event); Parent->OnEvent(event);
} }
...@@ -950,6 +949,8 @@ void CGUITable::draw() ...@@ -950,6 +949,8 @@ void CGUITable::draw()
} }
else else
{ {
if ( !Rows[i].Items[j].IsOverrideColor ) // skin-colors can change
Rows[i].Items[j].Color = skin->getColor(EGDC_BUTTON_TEXT);
font->draw(Rows[i].Items[j].BrokenText.c_str(), textRect, IsEnabled ? Rows[i].Items[j].Color : skin->getColor(EGDC_GRAY_TEXT), false, true, &clientClip); font->draw(Rows[i].Items[j].BrokenText.c_str(), textRect, IsEnabled ? Rows[i].Items[j].Color : skin->getColor(EGDC_GRAY_TEXT), false, true, &clientClip);
} }
...@@ -1092,8 +1093,6 @@ void CGUITable::serializeAttributes(io::IAttributes* out, io::SAttributeReadWrit ...@@ -1092,8 +1093,6 @@ void CGUITable::serializeAttributes(io::IAttributes* out, io::SAttributeReadWrit
label = "Column"; label += i; label += "name"; label = "Column"; label += i; label += "name";
out->addString(label.c_str(), Columns[i].Name.c_str() ); out->addString(label.c_str(), Columns[i].Name.c_str() );
label = "Column"; label += i; label += "color";
out->addColor(label.c_str(), Columns[i].TextColor );
label = "Column"; label += i; label += "width"; label = "Column"; label += i; label += "width";
out->addInt(label.c_str(), Columns[i].Width ); out->addInt(label.c_str(), Columns[i].Width );
label = "Column"; label += i; label += "OrderingMode"; label = "Column"; label += i; label += "OrderingMode";
...@@ -1119,6 +1118,8 @@ void CGUITable::serializeAttributes(io::IAttributes* out, io::SAttributeReadWrit ...@@ -1119,6 +1118,8 @@ void CGUITable::serializeAttributes(io::IAttributes* out, io::SAttributeReadWrit
// core::stringw BrokenText; // can be recalculated // core::stringw BrokenText; // can be recalculated
label = "Row"; label += i; label += "cell"; label += c; label += "color"; label = "Row"; label += i; label += "cell"; label += c; label += "color";
out->addColor(label.c_str(), Rows[i].Items[c].Color ); out->addColor(label.c_str(), Rows[i].Items[c].Color );
label = "Row"; label += i; label += "cell"; label += c; label += "IsOverrideColor";
out->addColor(label.c_str(), Rows[i].Items[c].IsOverrideColor );
// void *data; // can't be serialized // void *data; // can't be serialized
} }
} }
...@@ -1162,8 +1163,6 @@ void CGUITable::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWri ...@@ -1162,8 +1163,6 @@ void CGUITable::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWri
label = "Column"; label += i; label += "name"; label = "Column"; label += i; label += "name";
column.Name = core::stringw(in->getAttributeAsString(label.c_str()).c_str()); column.Name = core::stringw(in->getAttributeAsString(label.c_str()).c_str());
label = "Column"; label += i; label += "color";
column.TextColor = in->getAttributeAsColor(label.c_str());
label = "Column"; label += i; label += "width"; label = "Column"; label += i; label += "width";
column.Width = in->getAttributeAsInt(label.c_str()); column.Width = in->getAttributeAsInt(label.c_str());
label = "Column"; label += i; label += "OrderingMode"; label = "Column"; label += i; label += "OrderingMode";
...@@ -1202,6 +1201,9 @@ void CGUITable::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWri ...@@ -1202,6 +1201,9 @@ void CGUITable::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWri
breakText( cell.Text, cell.BrokenText, Columns[c].Width ); breakText( cell.Text, cell.BrokenText, Columns[c].Width );
label = "Row"; label += i; label += "cell"; label += c; label += "color"; label = "Row"; label += i; label += "cell"; label += c; label += "color";
cell.Color = in->getAttributeAsColor(label.c_str()); cell.Color = in->getAttributeAsColor(label.c_str());
label = "Row"; label += i; label += "cell"; label += c; label += "IsOverrideColor";
cell.IsOverrideColor = in->getAttributeAsBool(label.c_str());
cell.Data = NULL; cell.Data = NULL;
Rows[Rows.size()-1].Items.push_back(cell); Rows[Rows.size()-1].Items.push_back(cell);
......
...@@ -158,9 +158,10 @@ namespace gui ...@@ -158,9 +158,10 @@ namespace gui
struct Cell struct Cell
{ {
Cell() : Data(0) {} Cell() : IsOverrideColor(false), Data(0) {}
core::stringw Text; core::stringw Text;
core::stringw BrokenText; core::stringw BrokenText;
bool IsOverrideColor;
video::SColor Color; video::SColor Color;
void *Data; void *Data;
}; };
...@@ -175,7 +176,6 @@ namespace gui ...@@ -175,7 +176,6 @@ namespace gui
{ {
Column() : Width(0), OrderingMode(EGCO_NONE) {} Column() : Width(0), OrderingMode(EGCO_NONE) {}
core::stringw Name; core::stringw Name;
video::SColor TextColor;
u32 Width; u32 Width;
EGUI_COLUMN_ORDERING OrderingMode; EGUI_COLUMN_ORDERING OrderingMode;
}; };
......
...@@ -699,6 +699,7 @@ void CGUITreeView::mouseAction( s32 xpos, s32 ypos, bool onlyHover /*= false*/ ) ...@@ -699,6 +699,7 @@ void CGUITreeView::mouseAction( s32 xpos, s32 ypos, bool onlyHover /*= false*/ )
event.EventType = EET_GUI_EVENT; event.EventType = EET_GUI_EVENT;
event.GUIEvent.Caller = this; event.GUIEvent.Caller = this;
event.GUIEvent.Element = 0;
xpos -= AbsoluteRect.UpperLeftCorner.X; xpos -= AbsoluteRect.UpperLeftCorner.X;
ypos -= AbsoluteRect.UpperLeftCorner.Y; ypos -= AbsoluteRect.UpperLeftCorner.Y;
......
...@@ -29,15 +29,12 @@ CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id ...@@ -29,15 +29,12 @@ CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id
if (environment) if (environment)
skin = environment->getSkin(); skin = environment->getSkin();
IGUISpriteBank* sprites = 0; CurrentIconColor = video::SColor(255,255,255,255);
video::SColor color(255,255,255,255);
s32 buttonw = 15; s32 buttonw = 15;
if (skin) if (skin)
{ {
buttonw = skin->getSize(EGDS_WINDOW_BUTTON_WIDTH); buttonw = skin->getSize(EGDS_WINDOW_BUTTON_WIDTH);
sprites = skin->getSpriteBank();
color = skin->getColor(EGDC_WINDOW_SYMBOL);
} }
s32 posx = RelativeRect.getWidth() - buttonw - 4; s32 posx = RelativeRect.getWidth() - buttonw - 4;
...@@ -46,12 +43,6 @@ CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id ...@@ -46,12 +43,6 @@ CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id
CloseButton->setSubElement(true); CloseButton->setSubElement(true);
CloseButton->setTabStop(false); CloseButton->setTabStop(false);
CloseButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT); CloseButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
if (sprites)
{
CloseButton->setSpriteBank(sprites);
CloseButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_CLOSE), color);
CloseButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_WINDOW_CLOSE), color);
}
posx -= buttonw + 2; posx -= buttonw + 2;
RestoreButton = Environment->addButton(core::rect<s32>(posx, 3, posx + buttonw, 3 + buttonw), this, -1, RestoreButton = Environment->addButton(core::rect<s32>(posx, 3, posx + buttonw, 3 + buttonw), this, -1,
...@@ -60,12 +51,6 @@ CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id ...@@ -60,12 +51,6 @@ CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id
RestoreButton->setSubElement(true); RestoreButton->setSubElement(true);
RestoreButton->setTabStop(false); RestoreButton->setTabStop(false);
RestoreButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT); RestoreButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
if (sprites)
{
RestoreButton->setSpriteBank(sprites);
RestoreButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_RESTORE), color);
RestoreButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_WINDOW_RESTORE), color);
}
posx -= buttonw + 2; posx -= buttonw + 2;
MinButton = Environment->addButton(core::rect<s32>(posx, 3, posx + buttonw, 3 + buttonw), this, -1, MinButton = Environment->addButton(core::rect<s32>(posx, 3, posx + buttonw, 3 + buttonw), this, -1,
...@@ -74,12 +59,6 @@ CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id ...@@ -74,12 +59,6 @@ CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id
MinButton->setSubElement(true); MinButton->setSubElement(true);
MinButton->setTabStop(false); MinButton->setTabStop(false);
MinButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT); MinButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
if (sprites)
{
MinButton->setSpriteBank(sprites);
MinButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_MINIMIZE), color);
MinButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_WINDOW_MINIMIZE), color);
}
MinButton->grab(); MinButton->grab();
RestoreButton->grab(); RestoreButton->grab();
...@@ -90,6 +69,7 @@ CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id ...@@ -90,6 +69,7 @@ CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id
setTabStop(true); setTabStop(true);
setTabOrder(-1); setTabOrder(-1);
refreshSprites();
updateClientRect(); updateClientRect();
} }
...@@ -107,6 +87,35 @@ CGUIWindow::~CGUIWindow() ...@@ -107,6 +87,35 @@ CGUIWindow::~CGUIWindow()
CloseButton->drop(); CloseButton->drop();
} }
void CGUIWindow::refreshSprites()
{
if (!Environment)
return;
IGUISkin* skin = Environment->getSkin();
if ( !skin )
return;
IGUISpriteBank* sprites = skin->getSpriteBank();
if ( !sprites )
return;
CurrentIconColor = skin->getColor(EGDC_WINDOW_SYMBOL);
if (sprites)
{
CloseButton->setSpriteBank(sprites);
CloseButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_CLOSE), CurrentIconColor);
CloseButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_WINDOW_CLOSE), CurrentIconColor);
RestoreButton->setSpriteBank(sprites);
RestoreButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_RESTORE), CurrentIconColor);
RestoreButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_WINDOW_RESTORE), CurrentIconColor);
MinButton->setSpriteBank(sprites);
MinButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_MINIMIZE), CurrentIconColor);
MinButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_WINDOW_MINIMIZE), CurrentIconColor);
}
}
//! called if an event happened. //! called if an event happened.
bool CGUIWindow::OnEvent(const SEvent& event) bool CGUIWindow::OnEvent(const SEvent& event)
...@@ -223,9 +232,13 @@ void CGUIWindow::draw() ...@@ -223,9 +232,13 @@ void CGUIWindow::draw()
{ {
IGUISkin* skin = Environment->getSkin(); IGUISkin* skin = Environment->getSkin();
// update each time because the skin is allowed to change this always. // update each time because the skin is allowed to change this always.
updateClientRect(); updateClientRect();
if ( CurrentIconColor != skin->getColor(EGDC_WINDOW_SYMBOL) )
refreshSprites();
core::rect<s32> rect = AbsoluteRect; core::rect<s32> rect = AbsoluteRect;
// draw body fast // draw body fast
......
...@@ -75,11 +75,13 @@ namespace gui ...@@ -75,11 +75,13 @@ namespace gui
protected: protected:
void updateClientRect(); void updateClientRect();
void refreshSprites();
IGUIButton* CloseButton; IGUIButton* CloseButton;
IGUIButton* MinButton; IGUIButton* MinButton;
IGUIButton* RestoreButton; IGUIButton* RestoreButton;
core::rect<s32> ClientRect; core::rect<s32> ClientRect;
video::SColor CurrentIconColor;
core::position2d<s32> DragStart; core::position2d<s32> DragStart;
bool Dragging, IsDraggable; bool Dragging, IsDraggable;
......
...@@ -582,6 +582,8 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params) ...@@ -582,6 +582,8 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
HWnd = CreateWindow( ClassName, __TEXT(""), style, windowLeft, windowTop, HWnd = CreateWindow( ClassName, __TEXT(""), style, windowLeft, windowTop,
realWidth, realHeight, NULL, NULL, hInstance, NULL); realWidth, realHeight, NULL, NULL, hInstance, NULL);
CreationParams.WindowId = HWnd; CreationParams.WindowId = HWnd;
CreationParams.WindowSize.Width = realWidth;
CreationParams.WindowSize.Height = realHeight;
ShowWindow(HWnd, SW_SHOW); ShowWindow(HWnd, SW_SHOW);
UpdateWindow(HWnd); UpdateWindow(HWnd);
......
...@@ -203,6 +203,7 @@ bool CMD2MeshFileLoader::loadFile(io::IReadFile* file, CAnimatedMeshMD2* mesh) ...@@ -203,6 +203,7 @@ bool CMD2MeshFileLoader::loadFile(io::IReadFile* file, CAnimatedMeshMD2* mesh)
if (!file->read(textureCoords, sizeof(SMD2TextureCoordinate)*header.numTexcoords)) if (!file->read(textureCoords, sizeof(SMD2TextureCoordinate)*header.numTexcoords))
{ {
delete[] textureCoords;
os::Printer::log("MD2 Loader: Error reading TextureCoords.", file->getFileName(), ELL_ERROR); os::Printer::log("MD2 Loader: Error reading TextureCoords.", file->getFileName(), ELL_ERROR);
return false; return false;
} }
...@@ -222,6 +223,9 @@ bool CMD2MeshFileLoader::loadFile(io::IReadFile* file, CAnimatedMeshMD2* mesh) ...@@ -222,6 +223,9 @@ bool CMD2MeshFileLoader::loadFile(io::IReadFile* file, CAnimatedMeshMD2* mesh)
SMD2Triangle *triangles = new SMD2Triangle[header.numTriangles]; SMD2Triangle *triangles = new SMD2Triangle[header.numTriangles];
if (!file->read(triangles, header.numTriangles *sizeof(SMD2Triangle))) if (!file->read(triangles, header.numTriangles *sizeof(SMD2Triangle)))
{ {
delete[] triangles;
delete[] textureCoords;
os::Printer::log("MD2 Loader: Error reading triangles.", file->getFileName(), ELL_ERROR); os::Printer::log("MD2 Loader: Error reading triangles.", file->getFileName(), ELL_ERROR);
return false; return false;
} }
......
...@@ -246,8 +246,6 @@ IAnimatedMesh* CMY3DMeshFileLoader::createMesh(io::IReadFile* file) ...@@ -246,8 +246,6 @@ IAnimatedMesh* CMY3DMeshFileLoader::createMesh(io::IReadFile* file)
// loading meshes // loading meshes
SMesh* mesh = new SMesh();
if (id!=MY3D_MESH_LIST_ID) if (id!=MY3D_MESH_LIST_ID)
{ {
os::Printer::log("Can not find MY3D_MESH_LIST_ID, loading failed!", ELL_ERROR); os::Printer::log("Can not find MY3D_MESH_LIST_ID, loading failed!", ELL_ERROR);
...@@ -637,6 +635,7 @@ IAnimatedMesh* CMY3DMeshFileLoader::createMesh(io::IReadFile* file) ...@@ -637,6 +635,7 @@ IAnimatedMesh* CMY3DMeshFileLoader::createMesh(io::IReadFile* file)
} }
// creating mesh // creating mesh
SMesh* mesh = new SMesh();
for (u32 num=0; num<MeshBufferEntry.size(); ++num) for (u32 num=0; num<MeshBufferEntry.size(); ++num)
{ {
......
...@@ -174,10 +174,18 @@ s32 CParticleAnimatedMeshSceneNodeEmitter::emitt(u32 now, u32 timeSinceLastCall, ...@@ -174,10 +174,18 @@ s32 CParticleAnimatedMeshSceneNodeEmitter::emitt(u32 now, u32 timeSinceLastCall,
void CParticleAnimatedMeshSceneNodeEmitter::setAnimatedMeshSceneNode( IAnimatedMeshSceneNode* node ) void CParticleAnimatedMeshSceneNodeEmitter::setAnimatedMeshSceneNode( IAnimatedMeshSceneNode* node )
{ {
Node = node; Node = node;
AnimatedMesh = 0;
BaseMesh = 0;
TotalVertices = 0;
VertexPerMeshBufferList.clear();
if ( !node )
{
return;
}
AnimatedMesh = node->getMesh(); AnimatedMesh = node->getMesh();
BaseMesh = AnimatedMesh->getMesh(0); BaseMesh = AnimatedMesh->getMesh(0);
TotalVertices = 0;
MBCount = BaseMesh->getMeshBufferCount(); MBCount = BaseMesh->getMeshBufferCount();
VertexPerMeshBufferList.reallocate(MBCount); VertexPerMeshBufferList.reallocate(MBCount);
for( u32 i = 0; i < MBCount; ++i ) for( u32 i = 0; i < MBCount; ++i )
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CParticleAttractionAffector.h" #include "CParticleAttractionAffector.h"
#include "IAttributes.h"
namespace irr namespace irr
{ {
...@@ -56,6 +57,27 @@ void CParticleAttractionAffector::affect(u32 now, SParticle* particlearray, u32 ...@@ -56,6 +57,27 @@ void CParticleAttractionAffector::affect(u32 now, SParticle* particlearray, u32
} }
} }
//! Writes attributes of the object.
void CParticleAttractionAffector::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
{
out->addVector3d("Point", Point);
out->addFloat("Speed", Speed);
out->addBool("AffectX", AffectX);
out->addBool("AffectY", AffectY);
out->addBool("AffectZ", AffectZ);
out->addBool("Attract", Attract);
}
//! Reads attributes of the object.
void CParticleAttractionAffector::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
{
Point = in->getAttributeAsVector3d("Point");
Speed = in->getAttributeAsFloat("Speed");
AffectX = in->getAttributeAsBool("AffectX");
AffectY = in->getAttributeAsBool("AffectY");
AffectZ = in->getAttributeAsBool("AffectZ");
Attract = in->getAttributeAsBool("Attract");
}
} // end namespace scene } // end namespace scene
} // end namespace irr } // end namespace irr
......
...@@ -62,6 +62,12 @@ public: ...@@ -62,6 +62,12 @@ public:
//! Get whether or not the particles Z position are affected //! Get whether or not the particles Z position are affected
virtual bool getAffectZ() const { return AffectZ; } virtual bool getAffectZ() const { return AffectZ; }
//! Writes attributes of the object.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
//! Reads attributes of the object.
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
private: private:
core::vector3df Point; core::vector3df Point;
......
...@@ -109,6 +109,10 @@ void CParticleBoxEmitter::serializeAttributes(io::IAttributes* out, io::SAttribu ...@@ -109,6 +109,10 @@ void CParticleBoxEmitter::serializeAttributes(io::IAttributes* out, io::SAttribu
b *= 0.5f; b *= 0.5f;
out->addVector3d("Box", b); out->addVector3d("Box", b);
out->addVector3d("Direction", Direction); out->addVector3d("Direction", Direction);
out->addFloat("MinStartSizeWidth", MinStartSize.Width);
out->addFloat("MinStartSizeHeight", MinStartSize.Height);
out->addFloat("MaxStartSizeWidth", MaxStartSize.Width);
out->addFloat("MaxStartSizeHeight", MaxStartSize.Height);
out->addInt("MinParticlesPerSecond", MinParticlesPerSecond); out->addInt("MinParticlesPerSecond", MinParticlesPerSecond);
out->addInt("MaxParticlesPerSecond", MaxParticlesPerSecond); out->addInt("MaxParticlesPerSecond", MaxParticlesPerSecond);
out->addColor("MinStartColor", MinStartColor); out->addColor("MinStartColor", MinStartColor);
...@@ -144,6 +148,11 @@ void CParticleBoxEmitter::deserializeAttributes(io::IAttributes* in, io::SAttrib ...@@ -144,6 +148,11 @@ void CParticleBoxEmitter::deserializeAttributes(io::IAttributes* in, io::SAttrib
if (Direction.getLength() == 0) if (Direction.getLength() == 0)
Direction.set(0,0.01f,0); Direction.set(0,0.01f,0);
MinStartSize.Width = in->getAttributeAsFloat("MinStartSizeWidth");
MinStartSize.Height = in->getAttributeAsFloat("MinStartSizeHeight");
MaxStartSize.Width = in->getAttributeAsFloat("MaxStartSizeWidth");
MaxStartSize.Height = in->getAttributeAsFloat("MaxStartSizeHeight");
MinParticlesPerSecond = in->getAttributeAsInt("MinParticlesPerSecond"); MinParticlesPerSecond = in->getAttributeAsInt("MinParticlesPerSecond");
MaxParticlesPerSecond = in->getAttributeAsInt("MaxParticlesPerSecond"); MaxParticlesPerSecond = in->getAttributeAsInt("MaxParticlesPerSecond");
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "CParticleCylinderEmitter.h" #include "CParticleCylinderEmitter.h"
#include "os.h" #include "os.h"
#include "IAttributes.h"
namespace irr namespace irr
{ {
...@@ -115,6 +116,67 @@ s32 CParticleCylinderEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& ...@@ -115,6 +116,67 @@ s32 CParticleCylinderEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*&
return 0; return 0;
} }
//! Writes attributes of the object.
void CParticleCylinderEmitter::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
{
out->addVector3d("Center", Center);
out->addVector3d("Normal", Normal);
out->addVector3d("Direction", Direction);
out->addFloat("MinStartSizeWidth", MinStartSize.Width);
out->addFloat("MinStartSizeHeight", MinStartSize.Height);
out->addFloat("MaxStartSizeWidth", MaxStartSize.Width);
out->addFloat("MaxStartSizeHeight", MaxStartSize.Height);
out->addInt("MinParticlesPerSecond", MinParticlesPerSecond);
out->addInt("MaxParticlesPerSecond", MaxParticlesPerSecond);
out->addColor("MinStartColor", MinStartColor);
out->addColor("MaxStartColor", MaxStartColor);
out->addInt("MinLifeTime", MinLifeTime);
out->addInt("MaxLifeTime", MaxLifeTime);
out->addFloat("Radius", Radius);
out->addFloat("Length", Length);
out->addInt("MaxAngleDegrees", MaxAngleDegrees);
out->addBool("OutlineOnly", OutlineOnly);
}
//! Reads attributes of the object.
void CParticleCylinderEmitter::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
{
Center = in->getAttributeAsVector3d("Center");
Normal = in->getAttributeAsVector3d("Normal");
if (Normal.getLength() == 0)
Normal.set(0,1.f,0);
Direction = in->getAttributeAsVector3d("Direction");
if (Direction.getLength() == 0)
Direction.set(0,0.01f,0);
MinStartSize.Width = in->getAttributeAsFloat("MinStartSizeWidth");
MinStartSize.Height = in->getAttributeAsFloat("MinStartSizeHeight");
MaxStartSize.Width = in->getAttributeAsFloat("MaxStartSizeWidth");
MaxStartSize.Height = in->getAttributeAsFloat("MaxStartSizeHeight");
MinParticlesPerSecond = in->getAttributeAsInt("MinParticlesPerSecond");
MaxParticlesPerSecond = in->getAttributeAsInt("MaxParticlesPerSecond");
MinParticlesPerSecond = core::max_(1u, MinParticlesPerSecond);
MaxParticlesPerSecond = core::max_(MaxParticlesPerSecond, 1u);
MaxParticlesPerSecond = core::min_(MaxParticlesPerSecond, 200u);
MinParticlesPerSecond = core::min_(MinParticlesPerSecond, MaxParticlesPerSecond);
MinStartColor = in->getAttributeAsColor("MinStartColor");
MaxStartColor = in->getAttributeAsColor("MaxStartColor");
MinLifeTime = in->getAttributeAsInt("MinLifeTime");
MaxLifeTime = in->getAttributeAsInt("MaxLifeTime");
MinLifeTime = core::max_(0u, MinLifeTime);
MaxLifeTime = core::max_(MaxLifeTime, MinLifeTime);
MinLifeTime = core::min_(MinLifeTime, MaxLifeTime);
Radius = in->getAttributeAsFloat("Radius");
Length = in->getAttributeAsFloat("Length");
MaxAngleDegrees = in->getAttributeAsInt("MaxAngleDegrees");
OutlineOnly = in->getAttributeAsBool("OutlineOnly");
}
} // end namespace scene } // end namespace scene
} // end namespace irr } // end namespace irr
...@@ -110,6 +110,12 @@ public: ...@@ -110,6 +110,12 @@ public:
//! Gets the minimum starting size for particles //! Gets the minimum starting size for particles
virtual const core::dimension2df& getMinStartSize() const { return MinStartSize; }; virtual const core::dimension2df& getMinStartSize() const { return MinStartSize; };
//! Writes attributes of the object.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
//! Reads attributes of the object.
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
private: private:
core::array<SParticle> Particles; core::array<SParticle> Particles;
......
...@@ -178,6 +178,12 @@ void CParticleMeshEmitter::setMesh(IMesh* mesh) ...@@ -178,6 +178,12 @@ void CParticleMeshEmitter::setMesh(IMesh* mesh)
Mesh = mesh; Mesh = mesh;
TotalVertices = 0; TotalVertices = 0;
MBCount = 0;
VertexPerMeshBufferList.clear();
if ( !Mesh )
return;
MBCount = Mesh->getMeshBufferCount(); MBCount = Mesh->getMeshBufferCount();
VertexPerMeshBufferList.reallocate(MBCount); VertexPerMeshBufferList.reallocate(MBCount);
for( u32 i = 0; i < MBCount; ++i ) for( u32 i = 0; i < MBCount; ++i )
......
...@@ -88,6 +88,10 @@ s32 CParticlePointEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& out ...@@ -88,6 +88,10 @@ s32 CParticlePointEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& out
void CParticlePointEmitter::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const void CParticlePointEmitter::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
{ {
out->addVector3d("Direction", Direction); out->addVector3d("Direction", Direction);
out->addFloat("MinStartSizeWidth", MinStartSize.Width);
out->addFloat("MinStartSizeHeight", MinStartSize.Height);
out->addFloat("MaxStartSizeWidth", MaxStartSize.Width);
out->addFloat("MaxStartSizeHeight", MaxStartSize.Height);
out->addInt("MinParticlesPerSecond", MinParticlesPerSecond); out->addInt("MinParticlesPerSecond", MinParticlesPerSecond);
out->addInt("MaxParticlesPerSecond", MaxParticlesPerSecond); out->addInt("MaxParticlesPerSecond", MaxParticlesPerSecond);
out->addColor("MinStartColor", MinStartColor); out->addColor("MinStartColor", MinStartColor);
...@@ -97,7 +101,6 @@ void CParticlePointEmitter::serializeAttributes(io::IAttributes* out, io::SAttri ...@@ -97,7 +101,6 @@ void CParticlePointEmitter::serializeAttributes(io::IAttributes* out, io::SAttri
out->addInt("MaxAngleDegrees", MaxAngleDegrees); out->addInt("MaxAngleDegrees", MaxAngleDegrees);
} }
//! Reads attributes of the object. //! Reads attributes of the object.
void CParticlePointEmitter::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) void CParticlePointEmitter::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
{ {
...@@ -105,6 +108,11 @@ void CParticlePointEmitter::deserializeAttributes(io::IAttributes* in, io::SAttr ...@@ -105,6 +108,11 @@ void CParticlePointEmitter::deserializeAttributes(io::IAttributes* in, io::SAttr
if (Direction.getLength() == 0) if (Direction.getLength() == 0)
Direction.set(0,0.01f,0); Direction.set(0,0.01f,0);
MinStartSize.Width = in->getAttributeAsFloat("MinStartSizeWidth");
MinStartSize.Height = in->getAttributeAsFloat("MinStartSizeHeight");
MaxStartSize.Width = in->getAttributeAsFloat("MaxStartSizeWidth");
MaxStartSize.Height = in->getAttributeAsFloat("MaxStartSizeHeight");
MinParticlesPerSecond = in->getAttributeAsInt("MinParticlesPerSecond"); MinParticlesPerSecond = in->getAttributeAsInt("MinParticlesPerSecond");
MaxParticlesPerSecond = in->getAttributeAsInt("MaxParticlesPerSecond"); MaxParticlesPerSecond = in->getAttributeAsInt("MaxParticlesPerSecond");
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "CParticleRingEmitter.h" #include "CParticleRingEmitter.h"
#include "os.h" #include "os.h"
#include "IAttributes.h"
namespace irr namespace irr
{ {
...@@ -106,6 +107,62 @@ s32 CParticleRingEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& outA ...@@ -106,6 +107,62 @@ s32 CParticleRingEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& outA
return 0; return 0;
} }
//! Writes attributes of the object.
void CParticleRingEmitter::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
{
out->addVector3d("Center", Center);
out->addFloat("Radius", Radius);
out->addFloat("RingThickness", RingThickness);
out->addVector3d("Direction", Direction);
out->addFloat("MinStartSizeWidth", MinStartSize.Width);
out->addFloat("MinStartSizeHeight", MinStartSize.Height);
out->addFloat("MaxStartSizeWidth", MaxStartSize.Width);
out->addFloat("MaxStartSizeHeight", MaxStartSize.Height);
out->addInt("MinParticlesPerSecond", MinParticlesPerSecond);
out->addInt("MaxParticlesPerSecond", MaxParticlesPerSecond);
out->addColor("MinStartColor", MinStartColor);
out->addColor("MaxStartColor", MaxStartColor);
out->addInt("MinLifeTime", MinLifeTime);
out->addInt("MaxLifeTime", MaxLifeTime);
out->addInt("MaxAngleDegrees", MaxAngleDegrees);
}
//! Reads attributes of the object.
void CParticleRingEmitter::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
{
Center = in->getAttributeAsVector3d("Center");
Radius = in->getAttributeAsFloat("Radius");
RingThickness = in->getAttributeAsFloat("RingThickness");
Direction = in->getAttributeAsVector3d("Direction");
if (Direction.getLength() == 0)
Direction.set(0,0.01f,0);
MinStartSize.Width = in->getAttributeAsFloat("MinStartSizeWidth");
MinStartSize.Height = in->getAttributeAsFloat("MinStartSizeHeight");
MaxStartSize.Width = in->getAttributeAsFloat("MaxStartSizeWidth");
MaxStartSize.Height = in->getAttributeAsFloat("MaxStartSizeHeight");
MinParticlesPerSecond = in->getAttributeAsInt("MinParticlesPerSecond");
MaxParticlesPerSecond = in->getAttributeAsInt("MaxParticlesPerSecond");
MinParticlesPerSecond = core::max_(1u, MinParticlesPerSecond);
MaxParticlesPerSecond = core::max_(MaxParticlesPerSecond, 1u);
MaxParticlesPerSecond = core::min_(MaxParticlesPerSecond, 200u);
MinParticlesPerSecond = core::min_(MinParticlesPerSecond, MaxParticlesPerSecond);
MinStartColor = in->getAttributeAsColor("MinStartColor");
MaxStartColor = in->getAttributeAsColor("MaxStartColor");
MinLifeTime = in->getAttributeAsInt("MinLifeTime");
MaxLifeTime = in->getAttributeAsInt("MaxLifeTime");
MinLifeTime = core::max_(0u, MinLifeTime);
MaxLifeTime = core::max_(MaxLifeTime, MinLifeTime);
MinLifeTime = core::min_(MinLifeTime, MaxLifeTime);
MaxAngleDegrees = in->getAttributeAsInt("MaxAngleDegrees");
}
} // end namespace scene } // end namespace scene
} // end namespace irr } // end namespace irr
...@@ -97,6 +97,12 @@ public: ...@@ -97,6 +97,12 @@ public:
//! Get the thickness of the ring //! Get the thickness of the ring
virtual f32 getRingThickness() const { return RingThickness; } virtual f32 getRingThickness() const { return RingThickness; }
//! Writes attributes of the object.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
//! Reads attributes of the object.
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
private: private:
core::array<SParticle> Particles; core::array<SParticle> Particles;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CParticleRotationAffector.h" #include "CParticleRotationAffector.h"
#include "IAttributes.h"
namespace irr namespace irr
{ {
...@@ -47,6 +48,19 @@ void CParticleRotationAffector::affect(u32 now, SParticle* particlearray, u32 co ...@@ -47,6 +48,19 @@ void CParticleRotationAffector::affect(u32 now, SParticle* particlearray, u32 co
} }
} }
//! Writes attributes of the object.
void CParticleRotationAffector::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
{
out->addVector3d("PivotPoint", PivotPoint);
out->addVector3d("Speed", Speed);
}
//! Reads attributes of the object.
void CParticleRotationAffector::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
{
PivotPoint = in->getAttributeAsVector3d("PivotPoint");
Speed = in->getAttributeAsVector3d("Speed");
}
} // end namespace scene } // end namespace scene
} // end namespace irr } // end namespace irr
......
...@@ -35,6 +35,12 @@ public: ...@@ -35,6 +35,12 @@ public:
//! Get the speed in degrees per second //! Get the speed in degrees per second
virtual const core::vector3df& getSpeed() const { return Speed; } virtual const core::vector3df& getSpeed() const { return Speed; }
//! Writes attributes of the object.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
//! Reads attributes of the object.
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
private: private:
core::vector3df PivotPoint; core::vector3df PivotPoint;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "IrrCompileConfig.h" #include "IrrCompileConfig.h"
#include "CParticleSphereEmitter.h" #include "CParticleSphereEmitter.h"
#include "os.h" #include "os.h"
#include "IAttributes.h"
namespace irr namespace irr
{ {
...@@ -107,6 +108,60 @@ s32 CParticleSphereEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& ou ...@@ -107,6 +108,60 @@ s32 CParticleSphereEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& ou
return 0; return 0;
} }
//! Writes attributes of the object.
void CParticleSphereEmitter::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
{
out->addVector3d("Center", Direction);
out->addFloat("Radius", Radius);
out->addVector3d("Direction", Direction);
out->addFloat("MinStartSizeWidth", MinStartSize.Width);
out->addFloat("MinStartSizeHeight", MinStartSize.Height);
out->addFloat("MaxStartSizeWidth", MaxStartSize.Width);
out->addFloat("MaxStartSizeHeight", MaxStartSize.Height);
out->addInt("MinParticlesPerSecond", MinParticlesPerSecond);
out->addInt("MaxParticlesPerSecond", MaxParticlesPerSecond);
out->addColor("MinStartColor", MinStartColor);
out->addColor("MaxStartColor", MaxStartColor);
out->addInt("MinLifeTime", MinLifeTime);
out->addInt("MaxLifeTime", MaxLifeTime);
out->addInt("MaxAngleDegrees", MaxAngleDegrees);
}
//! Reads attributes of the object.
void CParticleSphereEmitter::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
{
Center = in->getAttributeAsVector3d("Center");
Radius = in->getAttributeAsFloat("Radius");
Direction = in->getAttributeAsVector3d("Direction");
if (Direction.getLength() == 0)
Direction.set(0,0.01f,0);
MinStartSize.Width = in->getAttributeAsFloat("MinStartSizeWidth");
MinStartSize.Height = in->getAttributeAsFloat("MinStartSizeHeight");
MaxStartSize.Width = in->getAttributeAsFloat("MaxStartSizeWidth");
MaxStartSize.Height = in->getAttributeAsFloat("MaxStartSizeHeight");
MinParticlesPerSecond = in->getAttributeAsInt("MinParticlesPerSecond");
MaxParticlesPerSecond = in->getAttributeAsInt("MaxParticlesPerSecond");
MinParticlesPerSecond = core::max_(1u, MinParticlesPerSecond);
MaxParticlesPerSecond = core::max_(MaxParticlesPerSecond, 1u);
MaxParticlesPerSecond = core::min_(MaxParticlesPerSecond, 200u);
MinParticlesPerSecond = core::min_(MinParticlesPerSecond, MaxParticlesPerSecond);
MinStartColor = in->getAttributeAsColor("MinStartColor");
MaxStartColor = in->getAttributeAsColor("MaxStartColor");
MinLifeTime = in->getAttributeAsInt("MinLifeTime");
MaxLifeTime = in->getAttributeAsInt("MaxLifeTime");
MinLifeTime = core::max_(0u, MinLifeTime);
MaxLifeTime = core::max_(MaxLifeTime, MinLifeTime);
MinLifeTime = core::min_(MinLifeTime, MaxLifeTime);
MaxAngleDegrees = in->getAttributeAsInt("MaxAngleDegrees");
}
} // end namespace scene } // end namespace scene
} // end namespace irr } // end namespace irr
...@@ -91,6 +91,12 @@ public: ...@@ -91,6 +91,12 @@ public:
//! Get the radius of the sphere for particle emissions //! Get the radius of the sphere for particle emissions
virtual f32 getRadius() const { return Radius; } virtual f32 getRadius() const { return Radius; }
//! Writes attributes of the object.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
//! Reads attributes of the object.
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
private: private:
core::array<SParticle> Particles; core::array<SParticle> Particles;
......
...@@ -607,9 +607,24 @@ void CParticleSystemSceneNode::deserializeAttributes(io::IAttributes* in, io::SA ...@@ -607,9 +607,24 @@ void CParticleSystemSceneNode::deserializeAttributes(io::IAttributes* in, io::SA
case EPET_POINT: case EPET_POINT:
Emitter = createPointEmitter(); Emitter = createPointEmitter();
break; break;
case EPET_ANIMATED_MESH:
Emitter = createAnimatedMeshSceneNodeEmitter(NULL); // we can't set the node - the user will have to do this
break;
case EPET_BOX: case EPET_BOX:
Emitter = createBoxEmitter(); Emitter = createBoxEmitter();
break; break;
case EPET_CYLINDER:
Emitter = createCylinderEmitter(core::vector3df(0,0,0), 10.f, core::vector3df(0,1,0), 10.f); // (values here don't matter)
break;
case EPET_MESH:
Emitter = createMeshEmitter(NULL); // we can't set the mesh - the user will have to do this
break;
case EPET_RING:
Emitter = createRingEmitter(core::vector3df(0,0,0), 10.f, 10.f); // (values here don't matter)
break;
case EPET_SPHERE:
Emitter = createSphereEmitter(core::vector3df(0,0,0), 10.f); // (values here don't matter)
break;
default: default:
break; break;
} }
...@@ -645,12 +660,18 @@ void CParticleSystemSceneNode::deserializeAttributes(io::IAttributes* in, io::SA ...@@ -645,12 +660,18 @@ void CParticleSystemSceneNode::deserializeAttributes(io::IAttributes* in, io::SA
switch(atype) switch(atype)
{ {
case EPAT_ATTRACT:
aff = createAttractionAffector(core::vector3df(0,0,0));
break;
case EPAT_FADE_OUT: case EPAT_FADE_OUT:
aff = createFadeOutParticleAffector(); aff = createFadeOutParticleAffector();
break; break;
case EPAT_GRAVITY: case EPAT_GRAVITY:
aff = createGravityAffector(); aff = createGravityAffector();
break; break;
case EPAT_ROTATE:
aff = createRotationAffector();
break;
case EPAT_SCALE: case EPAT_SCALE:
aff = createScaleParticleAffector(); aff = createScaleParticleAffector();
break; break;
......
...@@ -25,7 +25,7 @@ public: ...@@ -25,7 +25,7 @@ public:
//! constructor //! constructor
CParticleSystemSceneNode(bool createDefaultEmitter, CParticleSystemSceneNode(bool createDefaultEmitter,
ISceneNode* parent, ISceneManager* mgr, s32 id, ISceneNode* parent, ISceneManager* mgr, s32 id,
const core::vector3df& position, const core::vector3df& position,
const core::vector3df& rotation, const core::vector3df& rotation,
const core::vector3df& scale); const core::vector3df& scale);
...@@ -77,7 +77,7 @@ public: ...@@ -77,7 +77,7 @@ public:
//! Creates a box particle emitter. //! Creates a box particle emitter.
virtual IParticleBoxEmitter* createBoxEmitter( virtual IParticleBoxEmitter* createBoxEmitter(
const core::aabbox3df& box = core::aabbox3d<f32>(-10,0,-10,5,30,10), const core::aabbox3df& box = core::aabbox3d<f32>(-10,0,-10,5,30,10),
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
u32 minParticlesPerSecond = 5, u32 minParticlesPerSecond = 5,
u32 maxParticlesPerSecond = 10, u32 maxParticlesPerSecond = 10,
const video::SColor& minStartColor = video::SColor(255,0,0,0), const video::SColor& minStartColor = video::SColor(255,0,0,0),
...@@ -117,7 +117,7 @@ public: ...@@ -117,7 +117,7 @@ public:
//! Creates a point particle emitter. //! Creates a point particle emitter.
virtual IParticlePointEmitter* createPointEmitter( virtual IParticlePointEmitter* createPointEmitter(
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
u32 minParticlesPerSecond = 5, u32 minParticlesPerSecond = 5,
u32 maxParticlesPerSecond = 10, u32 maxParticlesPerSecond = 10,
const video::SColor& minStartColor = video::SColor(255,0,0,0), const video::SColor& minStartColor = video::SColor(255,0,0,0),
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "ISceneNodeAnimatorCameraFPS.h" #include "ISceneNodeAnimatorCameraFPS.h"
#include "vector2d.h" #include "vector2d.h"
#include "position2d.h"
#include "SKeyMap.h" #include "SKeyMap.h"
#include "irrArray.h" #include "irrArray.h"
...@@ -21,16 +22,16 @@ namespace scene ...@@ -21,16 +22,16 @@ namespace scene
{ {
//! Special scene node animator for FPS cameras //! Special scene node animator for FPS cameras
class CSceneNodeAnimatorCameraFPS : public ISceneNodeAnimatorCameraFPS class CSceneNodeAnimatorCameraFPS : public ISceneNodeAnimatorCameraFPS
{ {
public: public:
//! Constructor //! Constructor
CSceneNodeAnimatorCameraFPS(gui::ICursorControl* cursorControl, CSceneNodeAnimatorCameraFPS(gui::ICursorControl* cursorControl,
f32 rotateSpeed = 100.0f, f32 moveSpeed = .5f, f32 jumpSpeed=0.f, f32 rotateSpeed = 100.0f, f32 moveSpeed = .5f, f32 jumpSpeed=0.f,
SKeyMap* keyMapArray=0, u32 keyMapSize=0, bool noVerticalMovement=false, SKeyMap* keyMapArray=0, u32 keyMapSize=0, bool noVerticalMovement=false,
bool invertY=false); bool invertY=false);
//! Destructor //! Destructor
virtual ~CSceneNodeAnimatorCameraFPS(); virtual ~CSceneNodeAnimatorCameraFPS();
......
...@@ -154,6 +154,9 @@ CBillboardTextSceneNode::~CBillboardTextSceneNode() ...@@ -154,6 +154,9 @@ CBillboardTextSceneNode::~CBillboardTextSceneNode()
//! sets the text string //! sets the text string
void CBillboardTextSceneNode::setText(const wchar_t* text) void CBillboardTextSceneNode::setText(const wchar_t* text)
{ {
if ( !Mesh )
return;
Text = text; Text = text;
Symbol.clear(); Symbol.clear();
...@@ -325,6 +328,9 @@ void CBillboardTextSceneNode::OnRegisterSceneNode() ...@@ -325,6 +328,9 @@ void CBillboardTextSceneNode::OnRegisterSceneNode()
//! render //! render
void CBillboardTextSceneNode::render() void CBillboardTextSceneNode::render()
{ {
if ( !Mesh )
return;
video::IVideoDriver* driver = SceneManager->getVideoDriver(); video::IVideoDriver* driver = SceneManager->getVideoDriver();
// draw // draw
...@@ -408,6 +414,9 @@ void CBillboardTextSceneNode::setTextColor(video::SColor color) ...@@ -408,6 +414,9 @@ void CBillboardTextSceneNode::setTextColor(video::SColor color)
//! \param overallColor: the color to set //! \param overallColor: the color to set
void CBillboardTextSceneNode::setColor(const video::SColor & overallColor) void CBillboardTextSceneNode::setColor(const video::SColor & overallColor)
{ {
if ( !Mesh )
return;
for ( u32 i = 0; i != Text.size (); ++i ) for ( u32 i = 0; i != Text.size (); ++i )
{ {
const SSymbolInfo &info = Symbol[i]; const SSymbolInfo &info = Symbol[i];
...@@ -425,6 +434,9 @@ void CBillboardTextSceneNode::setColor(const video::SColor & overallColor) ...@@ -425,6 +434,9 @@ void CBillboardTextSceneNode::setColor(const video::SColor & overallColor)
//! \param bottomColor: the color to set the bottom vertices //! \param bottomColor: the color to set the bottom vertices
void CBillboardTextSceneNode::setColor(const video::SColor & topColor, const video::SColor & bottomColor) void CBillboardTextSceneNode::setColor(const video::SColor & topColor, const video::SColor & bottomColor)
{ {
if ( !Mesh )
return;
ColorBottom = bottomColor; ColorBottom = bottomColor;
ColorTop = topColor; ColorTop = topColor;
for ( u32 i = 0; i != Text.size (); ++i ) for ( u32 i = 0; i != Text.size (); ++i )
......
...@@ -139,14 +139,24 @@ public: ...@@ -139,14 +139,24 @@ public:
//! Returns the value of an attribute as integer. //! Returns the value of an attribute as integer.
int getAttributeValueAsInt(const char_type* name) const int getAttributeValueAsInt(const char_type* name) const
{ {
return (int)getAttributeValueAsFloat(name); const SAttribute* attr = getAttributeByName(name);
if (!attr)
return 0;
core::stringc c(attr->Value.c_str());
return core::strtol10(c.c_str());
} }
//! Returns the value of an attribute as integer. //! Returns the value of an attribute as integer.
int getAttributeValueAsInt(int idx) const int getAttributeValueAsInt(int idx) const
{ {
return (int)getAttributeValueAsFloat(idx); const char_type* attrvalue = getAttributeValue(idx);
if (!attrvalue)
return 0;
core::stringc c(attrvalue);
return core::strtol10(c.c_str());
} }
......
...@@ -449,6 +449,7 @@ ...@@ -449,6 +449,7 @@
<Unit filename="../../include/IGPUProgrammingServices.h" /> <Unit filename="../../include/IGPUProgrammingServices.h" />
<Unit filename="../../include/IGUIButton.h" /> <Unit filename="../../include/IGUIButton.h" />
<Unit filename="../../include/IGUICheckBox.h" /> <Unit filename="../../include/IGUICheckBox.h" />
<Unit filename="../../include/IGUIColorSelectDialog.h" />
<Unit filename="../../include/IGUIComboBox.h" /> <Unit filename="../../include/IGUIComboBox.h" />
<Unit filename="../../include/IGUIContextMenu.h" /> <Unit filename="../../include/IGUIContextMenu.h" />
<Unit filename="../../include/IGUIEditBox.h" /> <Unit filename="../../include/IGUIEditBox.h" />
......
...@@ -28,6 +28,7 @@ OBJ = $(Sources:.cpp=.o) ...@@ -28,6 +28,7 @@ OBJ = $(Sources:.cpp=.o)
all_linux all_win32: $(OBJ) all_linux all_win32: $(OBJ)
$(warning Building...) $(warning Building...)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $(DESTPATH) $(LDFLAGS) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $(DESTPATH) $(LDFLAGS)
@$(RM) tests # otherwise it's easy to forget to copy it and run the old binary
clean: clean_linux clean_win32 clean: clean_linux clean_win32
$(warning Cleaning...) $(warning Cleaning...)
......
<?xml version="1.0"?>
<root>
<text><![CDATA[simple]]></text>
<text><![CDATA[]]></text>
<text><![CDATA[] ]> ]]></text>
<text><![CDATA[]
]> ]]></text>
<text><![CDATA[
Newlines
and tabs
gogogo]]></text>
<text><![CDATA[&&#@#$%*()@#$%*()#$%*(]]></text>
<text><![CDATA[& & && &&& &a &ü &ä &ö &&#]]></text>
</root>
...@@ -145,7 +145,7 @@ public: ...@@ -145,7 +145,7 @@ public:
void set() void set()
{ {
ValInt = 1; ValInt = 152722522;
ValFloat = 1.f; ValFloat = 1.f;
ValString = "one"; ValString = "one";
ValStringW = L"ONE"; ValStringW = L"ONE";
......
...@@ -6,12 +6,9 @@ ...@@ -6,12 +6,9 @@
using namespace irr; using namespace irr;
using namespace core; using namespace core;
/** Tests for XML handling */ bool simple_xml( irr::io::IFileSystem * fs )
bool testXML(void)
{ {
IrrlichtDevice *device = createDevice(video::EDT_NULL, dimension2du(400, 200)); io::IXMLReaderUTF8* reader = fs->createXMLReaderUTF8("media/test.xml");
io::IXMLReaderUTF8* reader = device->getFileSystem()->createXMLReaderUTF8("media/test.xml");
if (!reader) if (!reader)
{ {
logTestString("Could not create XML reader.\n"); logTestString("Could not create XML reader.\n");
...@@ -43,3 +40,128 @@ bool testXML(void) ...@@ -43,3 +40,128 @@ bool testXML(void)
return retVal; return retVal;
} }
// CDATA should return everything between "![CDATA[" and "]]>" as it's in the file
bool cdata( irr::io::IFileSystem * fs )
{
io::IXMLReaderUTF8* reader = fs->createXMLReaderUTF8("media/cdata.xml");
if (!reader)
{
logTestString("Could not create XML reader.\n");
return false;
}
const core::stringc textNode("text");
core::array< core::stringc > compareStrings;
compareStrings.push_back("simple");
compareStrings.push_back("");
compareStrings.push_back("] ]> ");
compareStrings.push_back("]\n]> ");
compareStrings.push_back("\nNewlines\n\tand tabs\n\t\tgogogo");
compareStrings.push_back("&&#@#$%*()@#$%*()#$%*(");
compareStrings.push_back("& & && &&& &a &ü &ä &ö &&#");
bool result = true;
size_t count = 0;
while(reader->read())
{
if (reader->getNodeType() == io::EXN_ELEMENT)
{
if ( core::stringc(reader->getNodeName()) == textNode )
{
while(reader->read())
{
if (reader->getNodeType() == io::EXN_CDATA)
{
core::stringc data = reader->getNodeData();
core::stringc name = reader->getNodeName();
if ( count == compareStrings.size() )
{
logTestString("too many cdata elements for reading in %s:%d\n", __FILE__, __LINE__);
}
else if ( count < compareStrings.size() )
{
core::stringc cmpString(compareStrings[count]);
// some (unused) variables to ease debugging
// const c8* dataRaw = data.c_str();
// const c8* cmpRaw = cmpString.c_str();
if ( cmpString != data )
{
result = false;
logTestString("cdata read failed for string %d in %s:%d\n", count, __FILE__, __LINE__);
}
}
++count;
}
if ( reader->getNodeType() == io::EXN_ELEMENT_END )
{
break;
}
}
}
}
}
reader->drop();
return result;
}
bool attributeValues(irr::io::IFileSystem * fs)
{
io::IXMLReaderUTF8* reader = fs->createXMLReaderUTF8("media/attributes.xml");
if (!reader)
{
logTestString("Could not create XML reader.\n");
return false;
}
bool result = true;
bool hasNode = false;
while (reader->read())
{
if (io::EXN_ELEMENT == reader->getNodeType() )
{
if ( core::stringc(reader->getNodeName()) == core::stringc("element_position") )
{
hasNode = true;
int id1 = reader->getAttributeValueAsInt("id1");
if ( id1 != 152722522 )
{
logTestString("id1 is %d in %s:%d\n", id1, __FILE__, __LINE__);
result = false;
}
int id2 = reader->getAttributeValueAsInt("id2");
result &= id2 == 3;
int x = reader->getAttributeValueAsInt("x");
result &= x == 301;
int y = reader->getAttributeValueAsInt("y");
result &= y == 118;
}
}
}
if ( !hasNode )
{
logTestString("missing node in xml in %s:%d\n", __FILE__, __LINE__);
return false;
}
reader->drop();
return result;
}
/** Tests for XML handling */
bool testXML(void)
{
IrrlichtDevice *device = createDevice(video::EDT_NULL, dimension2du(400, 200));
bool result = true;
result &= simple_xml(device->getFileSystem());
result &= cdata(device->getFileSystem());
result &= attributeValues(device->getFileSystem()); // TODO: this bug is still open!
device->drop();
return result;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment