From bffc879fc8ee8167bb123310d39fad4e2f426ffd Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Mon, 23 Nov 2009 22:18:44 -0700 Subject: [PATCH] renamed mippleton to library --- Doxyfile | 2 +- doc/yoink.6.in | 10 ++++---- src/Animation.cc | 8 +++---- src/Makefile.am | 2 +- src/Moof/{Mippleton.hh => Library.hh} | 33 +++++++++++++++------------ src/Moof/Sound.cc | 6 ++--- src/Moof/Texture.cc | 8 ++++--- src/Tilemap.cc | 6 ++--- win32/build-installer.sh.in | 3 ++- 9 files changed, 42 insertions(+), 36 deletions(-) rename src/Moof/{Mippleton.hh => Library.hh} (78%) diff --git a/Doxyfile b/Doxyfile index c2c8319..5242966 100644 --- a/Doxyfile +++ b/Doxyfile @@ -763,7 +763,7 @@ GENERATE_HTML = YES # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. -HTML_OUTPUT = doc/doxygen +HTML_OUTPUT = doxygen # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank diff --git a/doc/yoink.6.in b/doc/yoink.6.in index 809faab..ece0fa5 100644 --- a/doc/yoink.6.in +++ b/doc/yoink.6.in @@ -127,13 +127,13 @@ as the numbers 1024 and 768. The video size will be 1024x768. Here is a list of some of the options available: .TP .B detail -The level of detail. Possible values are 1, 2, or 3, 1 meaning the least amount -of detail and 3 meaning the most. This effects the number of objects drawn to -the screen. A high level of detail will draw everything but could cause poor +The level of detail. Possible values are 1, 2, or 3 where 1 means the least +amount of detail and 3 means the most. This effects the number of objects drawn +to the screen. A high level of detail will draw everything but could cause poor frame rates if the graphics driver can't keep up with the load. Lower levels will omit certain details which aren't crucial for playing the game with the -benefit of higher frame rates. See the Notes for more ways to increase the -game's performance. The default value is 3. +possible benefit of higher frame rates. See the Notes for more ways to increase +the game's performance. The default value is 3. .TP .B doublebuffer If true, double-buffering will be used to help minimize distortion and artifacts diff --git a/src/Animation.cc b/src/Animation.cc index aa754ce..c694aec 100644 --- a/src/Animation.cc +++ b/src/Animation.cc @@ -29,8 +29,8 @@ #include #include +#include #include -#include #include #include "Animation.hh" @@ -55,10 +55,10 @@ class Animation::Impl * which wants to use these loaded sequences. */ - class Data : public Mf::Mippleton + class Data : public Mf::Library { friend class Impl; - friend class Mf::Mippleton; + friend class Mf::Library; /** * A frame of an animation sequence. A frame is merely an index which @@ -214,7 +214,7 @@ class Animation::Impl */ explicit Data(const std::string& name) : - Mf::Mippleton(name) + Mf::Library(name) { loadFromFile(); } diff --git a/src/Makefile.am b/src/Makefile.am index cecdac1..c10b586 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,10 +33,10 @@ libmoof_a_SOURCES = \ Moof/Hash.hh \ Moof/Interpolator.hh \ Moof/Layer.hh \ + Moof/Library.hh \ Moof/Log.cc \ Moof/Log.hh \ Moof/Math.hh \ - Moof/Mippleton.hh \ Moof/Octree.hh \ Moof/OpenGL.hh \ Moof/Plane.cc \ diff --git a/src/Moof/Mippleton.hh b/src/Moof/Library.hh similarity index 78% rename from src/Moof/Mippleton.hh rename to src/Moof/Library.hh index a27a6c5..1d5af36 100644 --- a/src/Moof/Mippleton.hh +++ b/src/Moof/Library.hh @@ -26,18 +26,17 @@ *******************************************************************************/ -#ifndef _MOOF_MIPPLETON_HH_ -#define _MOOF_MIPPLETON_HH_ +#ifndef _MOOF_LIBRARY_HH_ +#define _MOOF_LIBRARY_HH_ /** - * @file Mippleton.hh - * Related to singletons, a mippleton is an object which can be obtained - * globally using a unique name. Unlike singletons, there can be multiple - * mippletons per class, each with a different name or identifier. Mippletons - * are create automatically when they are first requested (retained) and deleted - * after the last interested code releases its hold on the object. + * @file Library.hh + * A library is a collection of named objects of the same type. Libraries use + * reference counting to automagically delete objects which no longer have any + * interested code. */ +#include #include #include @@ -49,7 +48,7 @@ namespace Mf { template -class Mippleton +class Library { typedef std::pair PtrValue; typedef stlplus::hash PtrMap; @@ -68,8 +67,11 @@ class Mippleton } else { - T* newObj = new T(name); - mPtrMap.insert(std::make_pair(name, std::make_pair(1, newObj))); + T* newObj(new T(name)); + if (newObj) + { + mPtrMap.insert(std::make_pair(name, std::make_pair(1, newObj))); + } return newObj; } } @@ -83,7 +85,8 @@ class Mippleton { typename PtrMap::iterator it; - if ((it = mPtrMap.find(name)) != mPtrMap.end() && --(*it).second.first == 0) + if ((it = mPtrMap.find(name)) != mPtrMap.end() && + --(*it).second.first == 0) { delete (*it).second.second; mPtrMap.erase((*it).first); @@ -92,7 +95,7 @@ class Mippleton public: - explicit Mippleton(const std::string& name) : + explicit Library(const std::string& name) : mName(name) {} const std::string& getName() const @@ -108,12 +111,12 @@ public: template stlplus::hash< std::string,std::pair,getHash > - Mippleton::mPtrMap; + Library::mPtrMap; } // namespace Mf -#endif // _MOOF_MIPPLETON_HH_ +#endif // _MOOF_LIBRARY_HH_ /** vim: set ts=4 sw=4 tw=80: *************************************************/ diff --git a/src/Moof/Sound.cc b/src/Moof/Sound.cc index 27905ba..a04d29b 100644 --- a/src/Moof/Sound.cc +++ b/src/Moof/Sound.cc @@ -35,8 +35,8 @@ #include #include +#include "Library.hh" #include "Log.hh" -#include "Mippleton.hh" #include "Sound.hh" #include "Timer.hh" @@ -60,7 +60,7 @@ public: class Buffer; typedef boost::shared_ptr BufferP; - class Buffer : public Mippleton + class Buffer : public Library { OggVorbis_File mOggStream; ALenum mFormat; @@ -70,7 +70,7 @@ public: public: Buffer(const std::string& name) : - Mippleton(name) + Library(name) { mOggStream.datasource = 0; openFile(); diff --git a/src/Moof/Texture.cc b/src/Moof/Texture.cc index fc50cfa..78dc0c8 100644 --- a/src/Moof/Texture.cc +++ b/src/Moof/Texture.cc @@ -34,8 +34,8 @@ #include #include "Dispatcher.hh" +#include "Library.hh" #include "Log.hh" -#include "Mippleton.hh" #include "OpenGL.hh" #include "Texture.hh" @@ -52,7 +52,7 @@ namespace Mf { * objects and avoid having duplicate textures loaded to GL. */ -class Texture::Impl : public Mippleton +class Texture::Impl : public Library { /** @@ -131,7 +131,7 @@ public: */ explicit Impl(const std::string& name) : - Mippleton(name), + Library(name), mContext(0), mWidth(0), mHeight(0), @@ -296,10 +296,12 @@ public: glBindTexture(GL_TEXTURE_2D, mObject); glTexImage2D + //gluBuild2DMipmaps ( GL_TEXTURE_2D, 0, mMode, + //3, mContext->w, mContext->h, 0, diff --git a/src/Tilemap.cc b/src/Tilemap.cc index 232d003..b15d07f 100644 --- a/src/Tilemap.cc +++ b/src/Tilemap.cc @@ -26,17 +26,17 @@ *******************************************************************************/ -#include +#include #include #include #include "Tilemap.hh" -struct Tilemap::Impl : public Mf::Mippleton +struct Tilemap::Impl : public Mf::Library { Impl(const std::string& name) : - Mf::Mippleton(name), + Mf::Library(name), mMagFilter(GL_NEAREST), mMinFilter(GL_NEAREST), mTilesS(1), diff --git a/win32/build-installer.sh.in b/win32/build-installer.sh.in index 5c3b5d9..115599d 100644 --- a/win32/build-installer.sh.in +++ b/win32/build-installer.sh.in @@ -265,7 +265,8 @@ Section "$SEC_INSTALL" SecInstallYoink File /r /x Makefile* /x *.desktop "$ROOT_DIR/data" ; documentation File "$ROOT_DIR/AUTHORS" "$ROOT_DIR/ChangeLog" "$ROOT_DIR/COPYING" - File "$ROOT_DIR/README" "$ROOT_DIR/TODO" + File "$ROOT_DIR/README" "$ROOT_DIR/TODO" "$ROOT_DIR/doc/screenshot.png" + File /r "$ROOT_DIR/doc/licenses" ; uninstall WriteUninstaller "uninstall.exe" EOF -- 2.45.2