Added support for irrlicht 1.7.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4400 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-01-05 03:38:35 +00:00
parent d39b76f433
commit dcec9bafcf
9 changed files with 256 additions and 1 deletions

View File

@ -344,7 +344,11 @@ scene::ISceneNode* IrrDriver::addWaterNode(scene::IMesh *mesh,
*/
scene::ISceneNode *IrrDriver::addOctTree(scene::IMesh *mesh)
{
#if (IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR == 7)
return m_scene_manager->addOctreeSceneNode(mesh);
#else
return m_scene_manager->addOctTreeSceneNode(mesh);
#endif
} // addOctTree
// ----------------------------------------------------------------------------

View File

@ -50,7 +50,11 @@ MaterialManager::MaterialManager()
void MaterialManager::setAllMaterialFlags(video::ITexture* t,
scene::IMeshBuffer *mb) const
{
#if (IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR == 7)
const std::string image = StringUtils::getBasename(core::stringc(t->getName()).c_str());
#else
const std::string image = StringUtils::getBasename(t->getName().c_str());
#endif
// Search backward so that temporary (track) textures are found first
for(int i = (int)m_materials.size()-1; i>=0; i-- )
{

View File

@ -1326,7 +1326,18 @@ void Skin::drawBGFadeColor()
GUIEngine::getDriver()->getCurrentRenderTargetSize()) );
}
core::rect< s32 > Skin::draw3DWindowBackground (IGUIElement *element, bool drawTitleBar, video::SColor titleBarColor, const core::rect< s32 > &rect, const core::rect< s32 > *clip)
#if (IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR==7)
core::rect< s32 > Skin::draw3DWindowBackground(IGUIElement *element, bool drawTitleBar,
video::SColor titleBarColor,
const core::rect< s32 > &rect,
const core::rect< s32 > *clip,
core::rect<s32>* checkClientArea)
#else
core::rect< s32 > Skin::draw3DWindowBackground(IGUIElement *element, bool drawTitleBar,
video::SColor titleBarColor,
const core::rect< s32 > &rect,
const core::rect< s32 > *clip)
#endif
{
drawBGFadeColor();

View File

@ -254,7 +254,12 @@ namespace GUIEngine
virtual void draw3DTabBody (irr::gui::IGUIElement *element, bool border, bool background, const irr::core::rect< irr::s32 > &rect, const irr::core::rect< irr::s32 > *clip, irr::s32 tabHeight=-1, irr::gui::EGUI_ALIGNMENT alignment=irr::gui::EGUIA_UPPERLEFT);
virtual void draw3DTabButton (irr::gui::IGUIElement *element, bool active, const irr::core::rect< irr::s32 > &rect, const irr::core::rect< irr::s32 > *clip, irr::gui::EGUI_ALIGNMENT alignment=irr::gui::EGUIA_UPPERLEFT);
virtual void draw3DToolBar (irr::gui::IGUIElement *element, const irr::core::rect< irr::s32 > &rect, const irr::core::rect< irr::s32 > *clip);
#if (IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR==7)
virtual irr::core::rect< irr::s32 > draw3DWindowBackground (irr::gui::IGUIElement *element, bool drawTitleBar, irr::video::SColor titleBarColor, const irr::core::rect< irr::s32 > &rect, const irr::core::rect< irr::s32 > *clip,
irr::core::rect<irr::s32>* checkClientArea=0);
#else
virtual irr::core::rect< irr::s32 > draw3DWindowBackground (irr::gui::IGUIElement *element, bool drawTitleBar, irr::video::SColor titleBarColor, const irr::core::rect< irr::s32 > &rect, const irr::core::rect< irr::s32 > *clip);
#endif
virtual void drawIcon (irr::gui::IGUIElement *element, irr::gui::EGUI_DEFAULT_ICON icon, const irr::core::position2di position, irr::u32 starttime, irr::u32 currenttime, bool loop=false, const irr::core::rect< irr::s32 > *clip=NULL);
virtual irr::video::SColor getColor (irr::gui::EGUI_DEFAULT_COLOR color) const;
virtual const wchar_t* getDefaultText (irr::gui::EGUI_DEFAULT_TEXT text) const;

View File

@ -209,6 +209,70 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="irr1.7|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
ManagedExtensions="0"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\bullet\src;&quot;$(STK_INCLUDE)&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;BT_NO_PROFILE;HAVE_GLUT"
MinimalRebuild="true"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
<AssemblyReference

View File

@ -206,6 +206,70 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="irr1.7|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="../../enet/include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>

View File

@ -15,6 +15,7 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
debug|Win32 = debug|Win32
irr1.6|Win32 = irr1.6|Win32
irr1.7|Win32 = irr1.7|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
@ -22,18 +23,24 @@ Global
{B1BC2764-1A43-4800-A654-788B0D05EDA2}.debug|Win32.Build.0 = Debug|Win32
{B1BC2764-1A43-4800-A654-788B0D05EDA2}.irr1.6|Win32.ActiveCfg = irr1.6|Win32
{B1BC2764-1A43-4800-A654-788B0D05EDA2}.irr1.6|Win32.Build.0 = irr1.6|Win32
{B1BC2764-1A43-4800-A654-788B0D05EDA2}.irr1.7|Win32.ActiveCfg = irr1.7|Win32
{B1BC2764-1A43-4800-A654-788B0D05EDA2}.irr1.7|Win32.Build.0 = irr1.7|Win32
{B1BC2764-1A43-4800-A654-788B0D05EDA2}.Release|Win32.ActiveCfg = Release|Win32
{B1BC2764-1A43-4800-A654-788B0D05EDA2}.Release|Win32.Build.0 = Release|Win32
{54AA44B9-B07B-49DA-8B1A-05BBFE8AD5D4}.debug|Win32.ActiveCfg = Release|Win32
{54AA44B9-B07B-49DA-8B1A-05BBFE8AD5D4}.debug|Win32.Build.0 = Release|Win32
{54AA44B9-B07B-49DA-8B1A-05BBFE8AD5D4}.irr1.6|Win32.ActiveCfg = irr1.6|Win32
{54AA44B9-B07B-49DA-8B1A-05BBFE8AD5D4}.irr1.6|Win32.Build.0 = irr1.6|Win32
{54AA44B9-B07B-49DA-8B1A-05BBFE8AD5D4}.irr1.7|Win32.ActiveCfg = irr1.7|Win32
{54AA44B9-B07B-49DA-8B1A-05BBFE8AD5D4}.irr1.7|Win32.Build.0 = irr1.7|Win32
{54AA44B9-B07B-49DA-8B1A-05BBFE8AD5D4}.Release|Win32.ActiveCfg = Release|Win32
{54AA44B9-B07B-49DA-8B1A-05BBFE8AD5D4}.Release|Win32.Build.0 = Release|Win32
{B0E92B97-089A-4D5B-BF17-77F1BC5DAEEF}.debug|Win32.ActiveCfg = Release|Win32
{B0E92B97-089A-4D5B-BF17-77F1BC5DAEEF}.debug|Win32.Build.0 = Release|Win32
{B0E92B97-089A-4D5B-BF17-77F1BC5DAEEF}.irr1.6|Win32.ActiveCfg = irr1.6|Win32
{B0E92B97-089A-4D5B-BF17-77F1BC5DAEEF}.irr1.6|Win32.Build.0 = irr1.6|Win32
{B0E92B97-089A-4D5B-BF17-77F1BC5DAEEF}.irr1.7|Win32.ActiveCfg = irr1.7|Win32
{B0E92B97-089A-4D5B-BF17-77F1BC5DAEEF}.irr1.7|Win32.Build.0 = irr1.7|Win32
{B0E92B97-089A-4D5B-BF17-77F1BC5DAEEF}.Release|Win32.ActiveCfg = Release|Win32
{B0E92B97-089A-4D5B-BF17-77F1BC5DAEEF}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection

View File

@ -272,6 +272,94 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="irr1.7|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="../../../src;../../../src/bullet/src;&quot;$(STK_INCLUDE)&quot;;../../../src/enet/include;&quot;C:\cygwin\home\jh235117\local\irrlicht-1.7\include&quot;"
PreprocessorDefinitions="BT_NO_PROFILE;HAVE_OPENAL;HAVE_OGGVORBIS;_DEBUG;_CONSOLE;WIN32;NOMINMAX;VERSION=\&quot;SVN\&quot;;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;DEBUG;PACKAGE=\&quot;supertuxkart\&quot;;HAVE_GETTEXT;ENABLE_NLS;HAVE_GLUT;HAVE_IRRLICHT;_CRTDBG_MAP_ALLOC;IRR_SVN"
GeneratePreprocessedFile="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
FloatingPointExceptions="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="opengl32.lib user32.lib gdi32.lib winmm.lib advapi32.lib OpenAL32.lib libogg.lib libvorbis.lib libvorbisfile.lib intl.lib Irrlicht.lib ws2_32.lib"
OutputFile="./../../../$(ProjectName)_d16.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(STK_LIB)&quot;;&quot;C:\cygwin\home\jh235117\local\irrlicht-1.7\lib\Win32-visualstudio&quot;"
IgnoreAllDefaultLibraries="false"
IgnoreDefaultLibraryNames="libcmt.lib"
GenerateDebugInformation="true"
GenerateMapFile="false"
MapFileName=""
MapExports="false"
SubSystem="1"
LinkTimeCodeGeneration="0"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
Profile="false"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>

View File

@ -371,7 +371,11 @@ void Track::convertTrackToBullet(const scene::IMesh *mesh,
const Material* material=0;
TriangleMesh *tmesh = m_track_mesh;
if(t) {
#if (IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR == 7)
std::string image = std::string(core::stringc(t->getName()).c_str());
#else
std::string image = std::string(t->getName().c_str());
#endif
material=material_manager->getMaterial(StringUtils::getBasename(image));
// Zipper are converted to non-collision mesh, since otherwise
// the road becomes 'bumpy' if the meshes are not 100% correctly
@ -515,7 +519,11 @@ void Track::handleAnimatedTextures(scene::ISceneNode *node, const XMLNode &xml)
video::ITexture* t=irrMaterial.getTexture(j);
if(!t) continue;
const std::string texture_name =
#if (IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR == 7)
StringUtils::getBasename(core::stringc(t->getName()).c_str());
#else
StringUtils::getBasename(t->getName().c_str());
#endif
if(texture_name!=name) continue;
core::matrix4 *m = &irrMaterial.getTextureMatrix(j);
m_animated_textures.push_back(new MovingTexture(m, *texture_node));