From c9e20ac06383b20ceb5404c9237e319c2e90d157 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Tue, 1 Dec 2009 19:27:17 -0700 Subject: [PATCH] port to NetBSD --- Makefile.am | 6 +++--- src/Moof/Sound.cc | 4 ++-- src/Moof/Timer.cc | 14 +++++++------- src/Moof/Timer.hh | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile.am b/Makefile.am index 26ea705..009c2dc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,10 +6,10 @@ SUBDIRS = data doc src EXTRA_DIST = extra run: all - $(MAKE) -C src run + @cd src && $(MAKE) run debug: all - $(MAKE) -C src debug + @cd src && $(MAKE) debug .PHONY: docs package @@ -19,7 +19,7 @@ docs: if WIN32 package: all - $(MAKE) -C win32 installer + @cd win32 && $(MAKE) installer else package: dist-bzip2 endif diff --git a/src/Moof/Sound.cc b/src/Moof/Sound.cc index a615624..4c60e32 100644 --- a/src/Moof/Sound.cc +++ b/src/Moof/Sound.cc @@ -273,12 +273,12 @@ public: void beginStream() { ALuint buffer; - for (int i = mBufferObjects.size(); i < 4; ++i) + for (int i = mBufferObjects.size(); i < 8; ++i) { alGenBuffers(1, &buffer); mBufferObjects.push_back(buffer); } - for (int i = 0; i < 4; ++i) + for (int i = 0; i < 8; ++i) { buffer = mBufferObjects[i]; mQueue.front()->stream(buffer); diff --git a/src/Moof/Timer.cc b/src/Moof/Timer.cc index a4dcf40..7f51510 100644 --- a/src/Moof/Timer.cc +++ b/src/Moof/Timer.cc @@ -44,7 +44,7 @@ namespace Mf { Scalar Timer::gNextFire = std::numeric_limits::max(); -std::map Timer::gTimers; +std::map Timer::gTimers; unsigned Timer::getNewID() @@ -75,7 +75,7 @@ void Timer::init(const Function& function, Scalar seconds, Mode mode) } mId = getNewID(); - gTimers.insert(std::pair(mId, *this)); + gTimers.insert(std::pair(mId, this)); if (mAbsolute < gNextFire) gNextFire = mAbsolute; } @@ -123,12 +123,12 @@ void Timer::fire() Scalar Timer::findNextFire() { - std::map::iterator it; + std::map::iterator it; Scalar nextFire = std::numeric_limits::max(); for (it = gTimers.begin(); it != gTimers.end(); ++it) { - Scalar absolute = (*it).second.mAbsolute; + Scalar absolute = (*it).second->mAbsolute; if (absolute < nextFire) nextFire = absolute; } @@ -154,14 +154,14 @@ bool Timer::isRepeating() const void Timer::fireIfExpired(Scalar t) { - std::map::iterator it; + std::map::iterator it; if (gNextFire > t) return; for (it = gTimers.begin(); it != gTimers.end(); ++it) { - Timer& timer = (*it).second; - if (timer.isExpired()) timer.fire(); + Timer* timer = (*it).second; + if (timer->isExpired()) timer->fire(); } } diff --git a/src/Moof/Timer.hh b/src/Moof/Timer.hh index bb0b483..a0bc676 100644 --- a/src/Moof/Timer.hh +++ b/src/Moof/Timer.hh @@ -124,7 +124,7 @@ private: unsigned mId; static Scalar gNextFire; - static std::map gTimers; + static std::map gTimers; }; -- 2.43.0