]> Dogcows Code - chaz/yoink/commitdiff
random changes
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Sun, 1 Nov 2009 20:51:49 +0000 (13:51 -0700)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Sun, 1 Nov 2009 20:51:49 +0000 (13:51 -0700)
COPYING
extra/yoink.ebuild
make-win32-installer.sh.in
src/Character.cc
src/Character.hh
src/Moof/RK4.hh
src/Typesetter.cc

diff --git a/COPYING b/COPYING
index 8138ee39d33f4a97a8713a2308b4f562ad85a45d..293eda0e7df20708a61b78a183b103b2c55b8979 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -53,7 +53,7 @@ Copyright: © 2000-2004, Unicode, Inc.
 
   Portion: original image and sound resources
    Source: http://www.nether.org.uk/bad_mac_code.html
-Copyright: Neil Carter
+Copyright: © 2003, Neil Carter
   License: zlib-libpng
 
   Portion: cml
index 1b3b1ba59f3d22a2dc75c3890bb97bfb74a88d00..bad914967638d3f6abc4997bc3381b7ffc81f65c 100644 (file)
@@ -7,11 +7,11 @@ EAPI=2
 inherit autotools eutils games
 
 DESCRIPTION="Alien-smashing action game"
-HOMEPAGE="http://www.dogcows.com/"
+HOMEPAGE="http://www.dogcows.com/yoink/"
 SRC_URI="http://www.dogcows.com/yoink/${P}.tar.bz2
        http://eng.utah.edu/~mcgarvey/yoink/${P}.tar.bz2"
 
-LICENSE="BSD-2"
+LICENSE="BSD-2 BSD LGPL-2.1 ZLIB"
 SLOT="0"
 KEYWORDS="amd64 ~ppc x86"
 IUSE="debug profile"
index 6cf54b138cc77381ac2e8c1982376ea0e9e3386d..4bfc6b3f9fab339d2b9ba64cd591f0184b2b30c1 100644 (file)
@@ -88,8 +88,8 @@ RequestExecutionLevel highest
 ;; Modern UI Configuration ;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-!define MUI_ICON                                               "$ROOT_DIR/src/yoink.ico"
-!define MUI_UNICON                                             "$ROOT_DIR/src/yoink.ico"
+!define MUI_ICON                                               "$ROOT_DIR/src/yoink_setup.ico"
+!define MUI_UNICON                                             "$ROOT_DIR/src/yoink_uninstall.ico"
 ; Language
 !define MUI_LANGDLL_ALWAYSSHOW
 !define MUI_LANGDLL_REGISTRY_ROOT              "HKCU"
index 8e5a4c65e7437ca4f80a8614a8b17c5f1c087454..accad6512ecc4e0ffc185a528bbc495b13a423f6 100644 (file)
@@ -48,8 +48,6 @@ Character::Character(const std::string& name) :
        current.recalculate();
 
        previous = current;
-
-       //updateContainers();
 }
 
 
@@ -61,28 +59,21 @@ void Character::update(Mf::Scalar t, Mf::Scalar dt)
        Mf::Scalar mag = x.length();
        Mf::Scalar d = 50.0;
 
+       // gravity:
        current.force = Mf::Vector2(0.0, -2000.0);
+       // spring:
        //current.force += -15.0 * x - 1.5 * current.velocity;
        current.force += -20.0 * (mag - d) * (x / mag) - 2.0 * current.velocity;
+       // internal:
        current.force += userForce;
        current.recalculate();
        //std::cout << "force: " << current.momentum << std::endl;
 
-       Mf::integrate<State,Derivative>(current, t, dt);
+       Mf::euler<State,Derivative>(current, t, dt);
 
        animation_.update(t, dt);
-
-       //updateContainers();
 }
 
-//void Character::updateContainers()
-//{
-       //aabb_.init(Mf::Vector3(current.position[0]-16.0, current.position[1]-16.0, z),
-                       //Mf::Vector3(current.position[0]+16.0, current.position[1]+16.0, z));
-       //sphere_.point = Mf::Vector3(current.position[0], current.position[1], z);
-       //sphere_.radius = (aabb_.min - sphere_.point).length();
-//}
-
 
 void Character::draw(Mf::Scalar alpha) const
 {
index c19206c416a022e1bcabce36c0a591facc35fc22..087bf494c819743eafc099fcca9f7c9635fc300a 100644 (file)
@@ -101,6 +101,9 @@ struct Character : public Mf::Entity
                        //derivative.force = Mf::Vector2(0.0, 0.0);
                        derivative.velocity = velocity;
                        derivative.force = force;
+
+                       //Mf::Vector2 x = position - Mf::Vector2(500.0, 200.0);
+                       //derivative.force += -15.0 * x - 1.5 * velocity;
                }
 
                void applyDerivative(const Derivative& derivative, Mf::Scalar dt)
@@ -143,8 +146,6 @@ private:
        Mf::Tilemap             tilemap_;
        Mf::Animation   animation_;
 
-       //void updateContainers();
-
 protected:
 
        Mf::Vector2 userForce;
@@ -162,17 +163,6 @@ public:
 };
 
 
-//inline Character::State operator*(Mf::Scalar scalar,
-               //const Character::State& state)
-//{
-       //Character::State newState = state;
-       //newState.position *= scalar;
-       //newState.momentum *= scalar;
-       //newState.recalculate();
-       //return newState;
-//}
-
-
 #endif // _CHARACTER_HH_
 
 /** vim: set ts=4 sw=4 tw=80: *************************************************/
index a2e0f1cbe713c62e0eb9b6267c2b2febaecd065a..806127ecc977c1388b2dcef37f838f2658f86f77 100644 (file)
@@ -34,9 +34,9 @@
 
 namespace Mf {
 
-// Generic implementation of the RK4 integrator.  To use, you need one type
-// representing the state and another containing the derivatives of the primary
-// state variables.  The state class must implement these methods:
+// Generic implementations of a few simple integrators.  To use, you need one
+// type representing the state and another containing the derivatives of the
+// primary state variables.  The state class must implement these methods:
 //
 // void getDerivative(Derivative_Type& derivative, Scalar absoluteTime);
 // void applyDerivative(const Derivative_Type& derivative, Scalar deltaTime);
@@ -64,7 +64,24 @@ inline D evaluate(const S& state,  Scalar t, Scalar dt, const D& derivative)
 
 
 template<typename S, typename D>
-inline void integrate(S& state, Scalar t, Scalar dt)
+inline void euler(S& state, Scalar t, Scalar dt)
+{
+       D a = evaluate<S,D>(state, t);
+
+       state.applyDerivative(a, dt);
+}
+
+template<typename S, typename D>
+inline void rk2(S& state, Scalar t, Scalar dt)
+{
+       D a = evaluate<S,D>(state, t);
+       D b = evaluate<S,D>(state, t, dt * 0.5, a);
+
+       state.applyDerivative(b, dt);
+}
+
+template<typename S, typename D>
+inline void rk4(S& state, Scalar t, Scalar dt)
 {
        D a = evaluate<S,D>(state, t);
        D b = evaluate<S,D>(state, t, dt * 0.5, a);
index bd8d4ea29310686f47a751d5a4f324fe03e1ea69..26929194d613d45b730337fdac6adeb786e914a7 100644 (file)
@@ -47,5 +47,6 @@ void Typesetter::print(const std::string& format, ...)
        nPrinted = std::min(nPrinted, (int)sizeof(buffer) - 1);
 }
 
+
 /** vim: set ts=4 sw=4 tw=80: *************************************************/
 
This page took 0.025733 seconds and 4 git commands to generate.