From: <hik...@us...> - 2009-04-04 03:12:14
|
Revision: 3346 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=3346&view=rev Author: hikerstk Date: 2009-04-04 03:12:12 +0000 (Sat, 04 Apr 2009) Log Message: ----------- Added support for alpha blending. Modified Paths: -------------- main/branches/irrlicht/data/tracks/beach/materials.xml main/branches/irrlicht/src/material.cpp main/branches/irrlicht/src/material.hpp Modified: main/branches/irrlicht/data/tracks/beach/materials.xml =================================================================== --- main/branches/irrlicht/data/tracks/beach/materials.xml 2009-04-02 00:30:09 UTC (rev 3345) +++ main/branches/irrlicht/data/tracks/beach/materials.xml 2009-04-04 03:12:12 UTC (rev 3346) @@ -1,11 +1,12 @@ <?xml version="1.0"?> <materials> - <material name="chess.jpg" alpha="0.0" collide="N"/> - <material name="grass.jpg" alpha="0.0" collide="N" maxSpeed="0.6" slowdownTime="4"/> - <material name="sand.jpg" alpha="0.0" collide="N" maxSpeed="0.4" slowdownTime="4"/> - <material name="sandgrass.jpg" alpha="0.0" collide="N" maxSpeed="0.4" slowdownTime="4"/> - <material name="stonetex.jpg" alpha="0.0" collide="N"/> - <material name="track.jpg" alpha="0.0" collide="N"/> - <material name="trackborder.jpg" alpha="0.0" light="N" collide="N"/> + <material name="chess.jpg" collide="N"/> + <material name="grass.jpg" collide="N" maxSpeed="0.6" slowdownTime="4"/> + <material name="sand.jpg" collide="N" maxSpeed="0.4" slowdownTime="4"/> + <material name="sandgrass.jpg" collide="N" maxSpeed="0.4" slowdownTime="4"/> + <material name="stonetex.jpg" collide="N"/> + <material name="track.jpg" collide="N"/> + <material name="trackborder.jpg" light="N" collide="N"/> <material name="water_light.jpg" light="N" reset="Y" collide="N"/> + <material name="waterfall.png" alpha="Y"/> </materials> Modified: main/branches/irrlicht/src/material.cpp =================================================================== --- main/branches/irrlicht/src/material.cpp 2009-04-02 00:30:09 UTC (rev 3345) +++ main/branches/irrlicht/src/material.cpp 2009-04-04 03:12:12 UTC (rev 3346) @@ -49,7 +49,7 @@ b=false; node->get("clampV", &b); if(b) m_clamp_tex +=VCLAMP; node->get("transparency", &m_transparency ); - node->get("alpha", &m_alpha_ref ); + node->get("alpha", &m_alpha_blending ); node->get("light", &m_lighting ); node->get("sphere", &m_sphere_map ); node->get("friction", &m_friction ); @@ -90,7 +90,7 @@ m_index = index ; m_clamp_tex = 0 ; m_transparency = false ; - m_alpha_ref = 0.1f ; + m_alpha_blending = false ; m_lighting = true ; m_sphere_map = false ; m_friction = 1.0f ; @@ -127,7 +127,9 @@ // updates of the Z buffer of the material. Since the _REF // approach is faster (and looks better imho), this is used for now. mb->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; - if(m_sphere_map) + else if(m_sphere_map) mb->getMaterial().MaterialType = video::EMT_SPHERE_MAP; + else if(m_alpha_blending) + mb->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; // FIXME: more parameters need to be set! } // setMaterialProperties Modified: main/branches/irrlicht/src/material.hpp =================================================================== --- main/branches/irrlicht/src/material.hpp 2009-04-02 00:30:09 UTC (rev 3345) +++ main/branches/irrlicht/src/material.hpp 2009-04-04 03:12:12 UTC (rev 3346) @@ -41,7 +41,7 @@ bool m_lighting; bool m_sphere_map; bool m_transparency; - float m_alpha_ref; + bool m_alpha_blending; float m_friction; /** How much the top speed is reduced per second. */ float m_slowdown; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |