new timer class
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Mon, 28 Sep 2009 17:45:50 +0000 (11:45 -0600)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Mon, 28 Sep 2009 17:45:50 +0000 (11:45 -0600)
16 files changed:
Makefile.am
README
configure.ac
make-win32-installer.sh.in
src/Moof/Dispatcher.cc
src/Moof/Dispatcher.hh
src/Moof/Engine.cc
src/Moof/RK4.hh
src/Moof/Sound.cc
src/Moof/Sound.hh
src/Moof/Thread.hh
src/Moof/Timer.cc
src/Moof/Timer.hh
src/Moof/Video.cc
src/YoinkApp.cc
src/YoinkApp.hh

index b1ac384fa24020ff0a1c3febe370a562eeb8e031..b8f74200619110b574c312cd191ee1300a96fcc0 100644 (file)
@@ -12,17 +12,32 @@ debug: all
 
 
 if WIN32
-installer: all
+
+INSTALLER_NAME = yoinksetup-$(VERSION).exe
+
+.PHONY: package
+package: $(INSTALLER_NAME)
+
+$(INSTALLER_NAME): all
        @echo "Creating win32 installer..."
-       @(sh make-win32-installer.sh 2> installer.log 1>&2 && \
+       @(sh make-win32-installer.sh $(INSTALLER_NAME) 2> installer.log 1>&2 && \
          rm installer.log && echo "Done.") || \
        (echo "Installer compilation failed!"; \
         echo "Check installer.log for details."; exit 1)
-endif
 
+else
+if LINUX
 
-RPMBUILD = rpmbuild
+.PHONY: package
+package: rpm
 
 rpm: dist-bzip2
-       $(RPMBUILD) -ba --nodeps extra/yoink.spec 
+       @echo "Creating RPM package..."
+       @($(RPMBUILD) -ba --nodeps extra/yoink.spec 2> rpmbuild.log 1>&2 && \
+               rm rpmbuild.log && echo "Done.") || \
+               (echo "rpmbuild failed!"; \
+               echo "Check rpmbuild.log for details."; exit 1)
+
+endif
+endif
 
diff --git a/README b/README
index 39092e738866da52b9bcdede7322b63ee0e5ad6c..b645786aa9a59f10e8a0c50aa49c9f9e42a72fb7 100644 (file)
--- a/README
+++ b/README
@@ -1,24 +1,24 @@
 
-Yoink is a game originally developed by Neil Carter for Mac OS X.  You play
-the part of a flying alien heroine who must defend her home on Earth from
-other airborne alien invaders.
+Yoink is a game originally developed by Neil Carter for Mac OS.  You play the
+part of a flying alien heroine who must defend her home on Earth from other
+airborne alien invaders.
 
-This version of the game uses rewritten code and modern frameworks to bring
+This version of the game uses all new code and modern frameworks to bring
 this simple, fast-moving action game to a wider audience.
 
-The new code is released under the Simplified BSD License.  The old code and
-original resources are provided under the zlib/libpng License.  See COPYING
-for complete details.
+The new code is released under the BSD-2 license.  The old code and original
+resources are provided under the zlib/libpng License.  See COPYING for complete
+details.
 
 Dependencies:
 
 boost headers
 OpenGL (libGL, libGL or opengl32, glu32)
-libSDL
-libSDL_image (with libpng support)
-libSDL_sound (with libogg support)
-libopenal
-libalut
+SDL
+SDL_image (with libpng support)
+libvorbisfile
+OpenAL
+freealut
 
 
 Notes regarding the code:
index 561b39e3908a32eadf7b3fed3933035e70a336fd..a2db4cfda05fafd56e8bad35c71e07388144e272 100644 (file)
@@ -53,8 +53,14 @@ case "${host}" in
                MACOSX=yes
                LIBS="$LIBS -Wl,-framework"
        ;;
+       *-linux-gnu*)
+               LINUX=yes
+               AC_PATH_PROGS([RPMBUILD], [rpmbuild])
+               AC_SUBST(RPMBUILD)
+       ;;
 esac
 
+AM_CONDITIONAL([LINUX], test "$LINUX" = "yes")
 AM_CONDITIONAL([WIN32], test "$WIN32" = "yes")
 
 
index f88dd5ea51423072ef8ea9713f982832bad1b4cd..b5c4d9a13e676476f2652400eed53b4dd0f5d68a 100644 (file)
@@ -17,6 +17,7 @@ ROOT_DIR="$PWD"
 COMPRESSION="/solid lzma"
 DEST="tmp-yoink-win32"
 SCRIPT="$DEST/yoink.nsi"
+OUT_FILE=${1:-yoinksetup-@VERSION@.exe}
 
 # DLL dependencies
 DLLS="SDL SDL_image zlib1 libpng12-0 OpenAL32 libalut-0 libvorbis-0 libogg-0"
@@ -75,7 +76,7 @@ VIAddVersionKey               "ProductVersion"        "@VERSION@"
 VIAddVersionKey                "LegalCopyright"        "Copyright 2009 Charles McGarvey et al."
 
 ;General
-OutFile                                        "$ROOT_DIR/yoinksetup-@VERSION@.exe"
+OutFile                                        "$ROOT_DIR/$OUT_FILE"
 SetCompressor                  $COMPRESSION
 ShowInstDetails                        show
 ShowUninstDetails              show
index fd93ccfb3948c249e543882b47fde522c8330ca6..2d9d3377011a5d6eef4f9984633f17da738b1c0c 100644 (file)
@@ -76,7 +76,7 @@ struct Dispatcher::Impl
 
                        for (CallbackIter jt = first; jt != last; ++jt)
                        {
-                               if (((*jt).second).first == id)
+                               if ((*jt).second.first == id)
                                {
                                        callbacks.erase(jt);
                                        break;
@@ -135,7 +135,7 @@ void Dispatcher::dispatch(const std::string& message, const Notification* param)
 
        for (Impl::CallbackIter it = callbacks.first; it != callbacks.second; ++it)
        {
-               Function callback = ((*it).second).second;
+               Function callback = (*it).second.second;
                callback(param);
        }
 }
index 0d75390d7f7adaa4902ef62ee761564519a9f057..14d8998bccd10392b3dc4cb4dd46fb678cb32eb0 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <string>
 
+#include <boost/bind.hpp>
 #include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
 
@@ -105,6 +106,7 @@ inline void dispatch(const std::string& message, const Notification* param = 0)
 
 } // namespace dispatch
 
+
 } // namespace Mf
 
 #endif // _MOOF_DISPATCHER_HH_
index 80a203e6989b368a86cb12c0790568fef0bc7b6c..e97c8b5d1b7edbae52a5b48ebc1072574e697ebe 100644 (file)
@@ -54,9 +54,9 @@ public:
                interface(outer)
        {
 #if defined(_WIN32) || defined (_WIN64) || defined(__WIN32__)
-               if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
+               if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0)
 #else
-               if (SDL_Init(SDL_INIT_EVERYTHING | SDL_INIT_EVENTTHREAD) != 0)
+               if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTTHREAD) != 0)
 #endif
                {
                        logError("sdl is complaining: %s", SDL_GetError());
@@ -112,7 +112,7 @@ public:
 
        int run()
        {
-               Scalar ticksNow = getTicks();
+               Scalar ticksNow = Timer::getTicks();
 
                Scalar nextStep = ticksNow;
                Scalar nextDraw = ticksNow;
@@ -128,13 +128,15 @@ public:
                running = true;
                do
                {
-                       Scalar newTicks = getTicks();
+                       Scalar newTicks = Timer::getTicks();
                        deltaTime = newTicks - ticksNow;
                        ticksNow = newTicks;
 
                        if (deltaTime >= 0.25) deltaTime = 0.25;
                        accumulator += deltaTime;
 
+                       Timer::fireIfExpired(ticksNow);
+
                        while (accumulator >= timestep)
                        {
                                dispatchEvents();
@@ -183,7 +185,8 @@ public:
                        }
 
                        // be a good citizen and give back what you don't need
-                       sleep(std::min(nextStep, nextDraw), true);
+                       Timer::sleep(std::min(std::min(nextStep, nextDraw),
+                                               Timer::getNextFire()), true);
                }
                while (running);
 
index 00c0b649c9406414dd7a56593322b59bb1f8b780..a2e0f1cbe713c62e0eb9b6267c2b2febaecd065a 100644 (file)
@@ -75,15 +75,6 @@ inline void integrate(S& state, Scalar t, Scalar dt)
 }
 
 
-//template<typename T>
-//inline T spring(Scalar k, Scalar b)
-//{
-       //current.force = -15 * (current.position - Mf::Vector2(200.0, 200.0))
-               //- 15.0 * current.velocity;
-       //return 
-//}
-
-
 } // namespace Mf
 
 #endif // _MOOF_RK4_HH_
index f912b318d153c2dfa13ecf1b991169f4e87751ee..460f7bb24a1054d2a18e0e579f08e8386320e06c 100644 (file)
@@ -38,6 +38,7 @@
 #include "Log.hh"
 #include "Mippleton.hh"
 #include "Sound.hh"
+#include "Timer.hh"
 
 #define BUFFER_SIZE (64 * 1024)
 //#define BUFFER_SIZE (5*2048)
@@ -161,7 +162,7 @@ struct Sound::Impl
                }
 
 
-               void beginStream(ALuint source, int nBuffers = 4)
+               void beginStream(ALuint source, int nBuffers = 8)
                {
                        if (!oggStream.datasource) openFile();
                        if (!oggStream.datasource) return;
@@ -299,6 +300,9 @@ struct Sound::Impl
                alSourcei(source_, AL_LOOPING, AL_FALSE);
                alSourcePlay(source_);
                playing_ = true;
+
+               streamTimer.init(boost::bind(&Impl::streamUpdate, this, _1, _2), 1.0,
+                               Timer::REPEAT);
        }
 
        inline void update()
@@ -446,6 +450,14 @@ struct Sound::Impl
 
        std::queue<BufferP>             queue_;
        std::vector<BufferP>    expired_;
+
+       Timer                                   streamTimer;
+
+       void streamUpdate(Timer& timer, Scalar t)
+       {
+               // don't let the music die!
+               update();
+       }
 };
 
 Sound::Sound(const std::string& name) :
@@ -459,19 +471,12 @@ void Sound::play()
        impl_->play();
 }
 
-
 void Sound::stream()
 {
        // pass through
        impl_->stream();
 }
 
-void Sound::update(Scalar t, Scalar dt)
-{
-       // pass through
-       impl_->update();
-}
-
 
 void Sound::stop()
 {
index 4953774f2cc7b8f02ddce060676620e112ac1225..26c2b424f94321e7e007bde9ecf854a45ef4d614 100644 (file)
@@ -64,9 +64,7 @@ public:
 
 
        void play();
-
        void stream();
-       void update(Scalar t, Scalar dt);
 
        void stop();
        void pause();
index a5e02254fe4a43b0de769e5b14a4c2eca125beba..274f717b057895c79cd10bacdcd46babcb199d67 100644 (file)
@@ -31,7 +31,7 @@
 
 /**
  * @file Thread.hh
- * Light C++ wrapper around SDL threads.
+ * Light C++ wrapper around the SDL threads API.
  */
 
 #include <boost/function.hpp>
@@ -51,34 +51,33 @@ typedef SDL_Thread* Thread;
 typedef boost::function<int(void)> Function;
 
 
-int detach_(void* arg)
+inline int detach_(void* arg)
 {
-       Function function = *(Function*)arg;
-       int ret = function();
+       //Function function = *(Function*)arg;
+       int code = (*(Function*)arg)();
 
        delete (Function*)arg;
-       return ret;
+       return code;
 }
 
-Thread detachFunction(const Function& function)
+inline Thread detachFunction(const Function& function)
 {
-       Thread thread;
        Function* fcopy = new Function(function);
+       Thread thread = SDL_CreateThread(detach_, (void*)fcopy);
 
-       thread = SDL_CreateThread(detach_, (void*)fcopy);
     if (thread == 0) delete fcopy;
        return thread;
 }
 
 
-int waitOnThread(Thread thread)
+inline int waitOnThread(Thread thread)
 {
        int i;
        SDL_WaitThread(thread, &i);
        return i;
 }
 
-void killThread(Thread thread)
+inline void killThread(Thread thread)
 {
        SDL_KillThread(thread);
 }
@@ -88,12 +87,12 @@ void killThread(Thread thread)
 // The identifier function returns a unique integer for the calling thread.
 //
 
-unsigned int getThreadIdentifier()
+inline unsigned getThreadIdentifier()
 {
     return SDL_ThreadID();
 }
 
-unsigned int getThreadIdentifier(Thread thread)
+inline unsigned getThreadIdentifier(Thread thread)
 {
     return SDL_GetThreadID(thread);
 }
index bc7aae220416687747de6f29bf07c39fc39a3f67..d28d5e89fd9d8ef39b379459a0b3a51b6009de3f 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <cerrno>
 #include <ctime>
+#include <limits>
 #include <stdexcept>
 
 #include "Log.hh"
 namespace Mf {
 
 
+Scalar Timer::nextFire_ = std::numeric_limits<Scalar>::max();
+std::map<unsigned,Timer&> Timer::timers_;
+
+
+unsigned Timer::getNewID()
+{
+       static unsigned id = 1;
+       return id++;
+}
+
+
+void Timer::init(const Function& function, Scalar seconds, Mode mode)
+{
+       invalidate();
+
+       mode_ = mode;
+
+       if (mode_ != INVALID)
+       {
+               function_ = function;
+
+               if (mode == ABSOLUTEE)
+               {
+                       absolute_ = seconds;
+               }
+               else
+               {
+                       absolute_ = seconds - getTicks();
+                       interval_ = seconds;
+               }
+
+               id_ = getNewID();
+               timers_.insert(std::pair<unsigned,Timer&>(id_, *this));
+
+               if (absolute_ < nextFire_) nextFire_ = absolute_;
+       }
+}
+
+
+bool Timer::isValid() const
+{
+       return mode_ != INVALID;
+}
+
+void Timer::invalidate()
+{
+       if (mode_ != INVALID)
+       {
+               timers_.erase(id_);
+               mode_ = INVALID;
+
+               if (isEqual(absolute_, nextFire_)) nextFire_ = findNextFire();
+       }
+}
+
+
+void Timer::fire()
+{
+       Scalar t = getTicks();
+
+       if (function_) function_(*this, t);
+
+       if (isRepeating())
+       {
+               Scalar absolute = absolute_;
+
+               if (isEqual(absolute_, t, 1.0)) absolute_ += interval_;
+               else absolute_ = interval_ + t;
+
+               if (isEqual(absolute, nextFire_)) nextFire_ = findNextFire();
+       }
+       else
+       {
+               invalidate();
+       }
+}
+
+
+Scalar Timer::findNextFire()
+{
+       std::map<unsigned,Timer&>::iterator it;
+       Scalar nextFire = std::numeric_limits<Scalar>::max();
+
+       for (it = timers_.begin(); it != timers_.end(); ++it)
+       {
+               Scalar absolute = (*it).second.absolute_;
+               if (absolute < nextFire) nextFire = absolute;
+       }
+
+       return nextFire;
+}
+
+
+Scalar Timer::getSecondsRemaining() const
+{
+       return absolute_ - getTicks();
+}
+
+bool Timer::isExpired() const
+{
+       return getSecondsRemaining() < 0.0;
+}
+
+bool Timer::isRepeating() const
+{
+       return mode_ == REPEAT;
+}
+
+
+void Timer::fireIfExpired(Scalar t)
+{
+       std::map<unsigned,Timer&>::iterator it;
+
+       if (nextFire_ > t) return;
+
+       for (it = timers_.begin(); it != timers_.end(); ++it)
+       {
+               Timer& timer = (*it).second;
+               if (timer.isExpired()) timer.fire();
+       }
+}
+
+
 #if HAVE_CLOCK_GETTIME
 
 // Since the monotonic clock will provide us with the timer since the computer
@@ -67,7 +191,7 @@ static time_t setReference_()
 static const time_t reference = setReference_();
 
 
-Scalar getTicks()
+Scalar Timer::getTicks()
 {
        struct timespec ts;
 
@@ -79,7 +203,7 @@ Scalar getTicks()
        return Scalar(ts.tv_sec - reference) + Scalar(ts.tv_nsec) / 1000000000.0;
 }
 
-void sleep(Scalar seconds, bool absolute)
+void Timer::sleep(Scalar seconds, bool absolute)
 {
        struct timespec ts;
        int ret;
@@ -103,13 +227,13 @@ void sleep(Scalar seconds, bool absolute)
 // SDL only promises centisecond accuracy, but that's better than a kick in the
 // butt.
 
-Scalar getTicks()
+Scalar Timer::getTicks()
 {
        Uint32 ms = SDL_GetTicks();
        return Scalar(ms / 1000) + Scalar(ms % 1000) / 1000.0;
 }
 
-void sleep(Scalar seconds, bool absolute)
+void Timer::sleep(Scalar seconds, bool absolute)
 {
        if (absolute) seconds -= getTicks();
        SDL_Delay(Uint32(cml::clamp(int(seconds * 1000.0), 0, 1000)));
index 340f79fa15b53b8d762ae730687eaca147315817..6c1af5615a6426913eac86788a46b9e02116bbd4 100644 (file)
  * Functions for measuring time in a friendly unit.
  */
 
+#include <map>
+
+#include <boost/bind.hpp>
+#include <boost/function.hpp>
+
 #include <Moof/Math.hh>
 
 
 namespace Mf {
 
 
-/**
- * Get the number of seconds since a fixed, arbitrary point in the past.
- * @return Seconds.
- */
+struct Timer
+{
+       enum Mode
+       {
+               INVALID         = -1,
+               NORMAL          =  0,
+               ABSOLUTEE       =  1,   // the ABSOLUTE keyword isn't available on win32...
+               REPEAT          =  2
+       };
 
-Scalar getTicks();
+       typedef boost::function<void(Timer&,Scalar)> Function;
 
 
-/**
- * Put the thread to sleep for a certain period of time.  If absolute is true,
- * then it will sleep until seconds after the fixed time in the past.  If
- * absolute is false, it will sleep for seconds starting now.  Unlike system
- * sleep functions, this one automatically resumes sleep if sleep was
- * interrupted by a signal.  Therefore, calling this function is guaranteed to
- * sleep for the requested amount of time.
- */
+       Timer() :
+               mode_(INVALID) {}
+
+       Timer(const Function& function, Scalar seconds, Mode mode = NORMAL)
+       {
+               init(function, seconds, mode);
+       }
+
+       ~Timer()
+       {
+               invalidate();
+       }
+
+       void init(const Function& function, Scalar seconds, Mode mode = NORMAL);
+
+       bool isValid() const;
+       void invalidate();
+
+       void fire();
+
+       Scalar getSecondsRemaining() const;
+       bool isExpired() const;
+       bool isRepeating() const;
+
+
+       /**
+        * Get the number of seconds since a fixed, arbitrary point in the past.
+        * @return Seconds.
+        */
+
+       static Scalar getTicks();
+
+
+       /**
+        * Put the thread to sleep for a certain period of time.  If absolute is true,
+        * then it will sleep until seconds after the fixed time in the past.  If
+        * absolute is false, it will sleep for seconds starting now.  Unlike system
+        * sleep functions, this one automatically resumes sleep if sleep was
+        * interrupted by a signal.  Therefore, calling this function is guaranteed to
+        * sleep for the requested amount of time (and maybe longer).
+        */
+
+       static void sleep(Scalar seconds, bool absolute = false);
+
+
+       static Scalar getNextFire()
+       {
+               return nextFire_;
+       }
+
+       static void fireIfExpired(Scalar t);
+
+private:
+
+       static unsigned getNewID();
+       static Scalar findNextFire();
+
+       Function        function_;
+       Mode            mode_;
+       Scalar          absolute_;
+       Scalar          interval_;
+       unsigned        id_;
 
-void sleep(Scalar seconds, bool absolute = false);
+       static Scalar                                           nextFire_;
+       static std::map<unsigned,Timer&>        timers_;
+};
 
 
 } // namespace Mf
index 63970e44389f5b5944eb00092e6e78c07e3e072d..1ed24c75fee3e3e877cea604eab0261c9028b0cf 100644 (file)
@@ -31,6 +31,7 @@
 #include <SDL/SDL_image.h>
 
 #include "Dispatcher.hh"
+#include "Log.hh"
 #include "Serializable.hh"
 #include "Settings.hh"
 #include "Video.hh"
@@ -84,7 +85,6 @@ void Video::recreateContext()
        SDL_FreeSurface(context_);
        context_ = 0;
        setVideoMode(attribs_.mode);
-       Mf::Dispatcher::getInstance().dispatch("video.context_recreated");
 }
 
 void Video::setOpenGLAttributes()
@@ -129,6 +129,14 @@ void Video::setVideoMode(const long mode[3])
                        attribs_.mode[0] = mode[0];
                        attribs_.mode[1] = mode[1];
                        attribs_.mode[2] = mode[2];
+
+#if defined(_WIN32) || defined (_WIN64) || defined(__WIN32__)
+                       // on win32, creating a new context via SDL_SetVideoMode will wipe
+                       // out the GL state, so we gotta notify everyone to reload their
+                       // state after the change
+                       Mf::dispatcher::dispatch("video.context_recreated");
+                       logInfo("video context recreated");
+#endif
                }
                else throw Exception(SDL_GetError());
        }
index 77f5c7318d0a9b8f7676e305f020c4d492ae2b7a..a9b8f1328068029f42442cfa16630234db76f3a3 100644 (file)
 #include <iostream>
 #include <string>
 
-#include <boost/bind.hpp>
-
 #include <Moof/Exception.hh>
 #include <Moof/Log.hh>
 #include <Moof/Math.hh>
 #include <Moof/OpenGL.hh>
 #include <Moof/Settings.hh>
+#include <Moof/Thread.hh>
 #include <Moof/Timer.hh>
 #include <Moof/Video.hh>
 
@@ -100,6 +99,28 @@ static std::string iconFile()
 }
 
 
+void YoinkApp::myFunc(Mf::Timer& timer, Mf::Scalar t)
+{
+       std::cout << "timer: " << t << std::endl;
+       
+       //timer.invalidate();
+}
+
+int YoinkApp::myThread()
+{
+       Mf::Scalar timer = Mf::Timer::getTicks();
+
+       for (;;)
+       {
+               std::cout << "thread awake: " << Mf::Timer::getTicks() << std::endl;
+
+               timer += 3.0;
+               Mf::Timer::sleep(timer, true);
+       }
+       return 0;
+}
+
+
 YoinkApp::YoinkApp(int argc, char* argv[]) :
        Mf::Engine(argc, argv, configFiles(), PACKAGE_STRING, iconFile()),
        music("NightFusionIntro"),
@@ -124,6 +145,11 @@ YoinkApp::YoinkApp(int argc, char* argv[]) :
 
        octree = Mf::loadScene("Test");
        heroine->treeNode = octree->insert(heroine);
+
+       //myTimer.init(boost::bind(&YoinkApp::myFunc, this, _1, _2),
+                       //0.0, Mf::Timer::REPEAT);
+       //Mf::Thread thread = Mf::detachFunction(boost::bind(&YoinkApp::myThread, this));
+       //std::cout << "thread " << thread << " detached." << std::endl;
 }
 
 YoinkApp::~YoinkApp()
@@ -176,7 +202,6 @@ void YoinkApp::update(Mf::Scalar t, Mf::Scalar dt)
 {
        //dt *= 0.7;
 
-       music.update(t, dt);
        fadeIn.update(dt);
        camera.update(t, dt);
        heroine->update(t, dt);
@@ -186,7 +211,8 @@ void YoinkApp::update(Mf::Scalar t, Mf::Scalar dt)
        octree->print(heroine->treeNode);
        
        //camera.lookAt(heroine->getSphere().point);
-       camera.setPosition(Mf::Vector3(-heroine->current.position[0], -heroine->current.position[1], -256));
+       camera.setPosition(Mf::Vector3(-heroine->current.position[0],
+                               -heroine->current.position[1], -256));
 
        interp.update(dt);
        hud.setBar1Progress(interp.getState(dt));
@@ -294,7 +320,8 @@ void YoinkApp::handleEvent(const Mf::Event& event)
                case SDL_VIDEORESIZE:
                        glViewport(0, 0, event.resize.w, event.resize.h);
                        hud.resize(event.resize.w, event.resize.h);
-                       camera.setProjection(cml::rad(60.0), double(event.resize.w / event.resize.h), 32.0, 2500.0);
+                       camera.setProjection(cml::rad(60.0),
+                               double(event.resize.w) / double(event.resize.h), 32.0, 2500.0);
                        camera.uploadProjectionToGL();
                        break;
        }
index 950d31983002443dd83abe9c3c70d4a57321f1b8..24865c93fa741089fdd4b5fefdae6b097f7dfe77 100644 (file)
@@ -77,6 +77,10 @@ private:
        Mf::Camera camera;
        Mf::OctreeP octree;
 
+       void myFunc(Mf::Timer& timer, Mf::Scalar t);
+       Mf::Timer myTimer;
+       int myThread();
+
        Hud hud;
 };
 
This page took 0.043067 seconds and 4 git commands to generate.