Author: christoph-guest Date: 2009-08-07 16:21:50 +0000 (Fri, 07 Aug 2009) New Revision: 10118
Added: packages/trunk/supertuxkart/debian/clean packages/trunk/supertuxkart/debian/patches/rubber.patch Modified: packages/trunk/supertuxkart/debian/control packages/trunk/supertuxkart/debian/patches/series packages/trunk/supertuxkart/debian/rules Log: Update package, include fix for #539964 Added: packages/trunk/supertuxkart/debian/clean =================================================================== --- packages/trunk/supertuxkart/debian/clean (rev 0) +++ packages/trunk/supertuxkart/debian/clean 2009-08-07 16:21:50 UTC (rev 10118) @@ -0,0 +1,3 @@ +config.sub +config.guess +debian/supertuxkart.6 Modified: packages/trunk/supertuxkart/debian/control =================================================================== --- packages/trunk/supertuxkart/debian/control 2009-08-07 04:54:08 UTC (rev 10117) +++ packages/trunk/supertuxkart/debian/control 2009-08-07 16:21:50 UTC (rev 10118) @@ -5,7 +5,7 @@ Uploaders: Gonéri Le Bouder <[email protected]>, Sam Hocevar (Debian packages) <[email protected]>, Alexander Reichle-Schmehl <[email protected]>, Cyril Brulebois <[email protected]>, Christoph Egger <[email protected]> -Build-Depends: debhelper (>= 6.0.7~), autotools-dev, libplib-dev, +Build-Depends: debhelper (>= 7.0.0~), autotools-dev, libplib-dev, libsdl-ttf2.0-dev, libsdl-image1.2-dev, docbook-to-man, libopenal-dev, libalut-dev, libmikmod2-dev, libvorbis-dev, quilt Standards-Version: 3.8.2 Added: packages/trunk/supertuxkart/debian/patches/rubber.patch =================================================================== --- packages/trunk/supertuxkart/debian/patches/rubber.patch (rev 0) +++ packages/trunk/supertuxkart/debian/patches/rubber.patch 2009-08-07 16:21:50 UTC (rev 10118) @@ -0,0 +1,124 @@ +Index: a/src/items/rubber_band.cpp +=================================================================== +--- a/src/items/rubber_band.cpp (revision 3741) ++++ b/src/items/rubber_band.cpp (working copy) +@@ -51,7 +51,7 @@ + vertices->add(0, 0, 0); vertices->add(0, 0, 0); + vertices->add(0, 0, 0); vertices->add(0, 0, 0); + m_attached_state = RB_TO_PLUNGER; +- update(0); ++ updatePosition(); + + sgVec3 norm; + sgSetVec3(norm, 1/sqrt(2.0f), 0, 1/sqrt(2.0f)); +@@ -80,6 +80,42 @@ + } // removeFromScene + + // ---------------------------------------------------------------------------- ++/** Updates the position of the rubber band. It especially sets the ++ * end position of the rubber band, i.e. the side attached to the plunger, ++ * track, or kart hit. ++ */ ++void RubberBand::updatePosition() ++{ ++ const Vec3 &k = m_owner.getXYZ(); ++ ++ // Get the position to which the band is attached ++ // ---------------------------------------------- ++ switch(m_attached_state) ++ { ++ case RB_TO_KART: m_end_position = m_hit_kart->getXYZ(); break; ++ case RB_TO_TRACK: m_end_position = m_hit_position; break; ++ case RB_TO_PLUNGER: m_end_position = m_plunger->getXYZ(); ++ checkForHit(k, m_end_position); break; ++ } // switch(m_attached_state); ++ ++ // Update the rubber band positions ++ // -------------------------------- ++ // Todo: make height dependent on length (i.e. rubber band gets ++ // thinner). And call explosion if the band is too long. ++ const float hh=.1f; // half height of the band ++ const Vec3 &p=m_end_position; // for shorter typing ++ float *f = vertices->get(0); ++ f[0] = p.getX()-hh; f[1] = p.getY(); f[2] = p.getZ()-hh; ++ f = vertices->get(1); ++ f[0] = p.getX()+hh; f[1] = p.getY(); f[2] = p.getZ()+hh; ++ f = vertices->get(2); ++ f[0] = k.getX()+hh; f[1] = k.getY(); f[2] = k.getZ()+hh; ++ f = vertices->get(3); ++ f[0] = k.getX()-hh; f[1] = k.getY(); f[2] = k.getZ()-hh; ++ dirtyBSphere(); ++} // updatePosition ++ ++// ---------------------------------------------------------------------------- + /** Updates the rubber band. It takes the new position of the kart and the + * plunger, and sets the quad representing the rubber band appropriately. + * It then casts a ray along the rubber band to detect if anything is hit. If +@@ -97,38 +133,12 @@ + return; + } + +- Vec3 p; ++ updatePosition(); + const Vec3 &k = m_owner.getXYZ(); +- +- // Get the position to which the band is attached +- // ---------------------------------------------- +- switch(m_attached_state) +- { +- case RB_TO_KART: p = m_hit_kart->getXYZ(); break; +- case RB_TO_TRACK: p = m_hit_position; break; +- case RB_TO_PLUNGER: p = m_plunger->getXYZ(); +- checkForHit(k, p); break; +- } // switch(m_attached_state); +- +- // Draw the rubber band +- // -------------------- +- // Todo: make height dependent on length (i.e. rubber band gets +- // thinner). And call explosion if the band is too long. +- const float hh=.1f; // half height of the band +- +- float *f = vertices->get(0); +- f[0] = p.getX()-hh; f[1] = p.getY(); f[2] = p.getZ()-hh; +- f = vertices->get(1); +- f[0] = p.getX()+hh; f[1] = p.getY(); f[2] = p.getZ()+hh; +- f = vertices->get(2); +- f[0] = k.getX()+hh; f[1] = k.getY(); f[2] = k.getZ()+hh; +- f = vertices->get(3); +- f[0] = k.getX()-hh; f[1] = k.getY(); f[2] = k.getZ()-hh; +- dirtyBSphere(); +- ++ + // Check for rubber band snapping + // ------------------------------ +- float l = (p-k).length2(); ++ float l = (m_end_position-k).length2(); + float max_len = m_owner.getKartProperties()->getRubberBandMaxLength(); + if(l>max_len*max_len) + { +@@ -143,7 +153,7 @@ + if(m_attached_state!=RB_TO_PLUNGER) + { + float force = m_owner.getKartProperties()->getRubberBandForce(); +- Vec3 diff = p-k; ++ Vec3 diff = m_end_position-k; + + // detach rubber band if kart gets very close to hit point + if(m_attached_state==RB_TO_TRACK && diff.length2() < 10*10) +Index: a/src/items/rubber_band.hpp +=================================================================== +--- a/src/items/rubber_band.hpp (revision 3741) ++++ b/src/items/rubber_band.hpp (working copy) +@@ -50,7 +50,12 @@ + /** State for rubber band. */ + ssgSimpleState *m_state; + ++ /** Stores the end of the rubber band (i.e. the side attached to the ++ * plunger. */ ++ Vec3 m_end_position; ++ + void checkForHit(const Vec3 &k, const Vec3 &p); ++ void updatePosition(); + + public: + RubberBand(Plunger *plunger, const Kart &kart); Modified: packages/trunk/supertuxkart/debian/patches/series =================================================================== --- packages/trunk/supertuxkart/debian/patches/series 2009-08-07 04:54:08 UTC (rev 10117) +++ packages/trunk/supertuxkart/debian/patches/series 2009-08-07 16:21:50 UTC (rev 10118) @@ -1 +1,2 @@ # Nothing to do right now +rubber.patch Modified: packages/trunk/supertuxkart/debian/rules =================================================================== --- packages/trunk/supertuxkart/debian/rules 2009-08-07 04:54:08 UTC (rev 10117) +++ packages/trunk/supertuxkart/debian/rules 2009-08-07 16:21:50 UTC (rev 10118) @@ -58,17 +58,12 @@ # Add here commands to clean up after the build process. [ ! -f Makefile ] || $(MAKE) distclean - rm config.sub - rm config.guess - - rm -f debian/supertuxkart.6 - dh_clean install: build dh_testdir dh_testroot - dh_clean -k + dh_prep dh_installdirs -psupertuxkart -Pdebian/tmp usr/share/pixmaps usr/share/icons/hicolor/32x32/apps usr/share/icons/hicolor/64x64/apps usr/share/applications # Add here commands to install the package into debian/supertuxkart. _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

