1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Merge branch 'master' into openal

This commit is contained in:
Nikolay Kasyanov 2012-03-29 13:09:54 +04:00
commit 0897a2a4cb
7 changed files with 58 additions and 13 deletions

View File

@ -160,7 +160,7 @@ endif (APPLE)
# Dependencies # Dependencies
# Fix for not visible pthreads functions for linker with glibc 2.15 # Fix for not visible pthreads functions for linker with glibc 2.15
if (UNIX AND NOT APPLE) if (UNIX AND NOT APPLE)
find_package (Threads) find_package (Threads)
endif() endif()
@ -257,6 +257,9 @@ endif (APPLE)
if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCC)
add_definitions (-Wall -Wextra -Wno-unused-parameter -Wno-reorder) add_definitions (-Wall -Wextra -Wno-unused-parameter -Wno-reorder)
# Silence warnings in OGRE headers. Remove once OGRE got fixed!
add_definitions (-Wno-ignored-qualifiers)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION) OUTPUT_VARIABLE GCC_VERSION)
if ("${GCC_VERSION}" VERSION_GREATER 4.6 OR "${GCC_VERSION}" VERSION_EQUAL 4.6) if ("${GCC_VERSION}" VERSION_GREATER 4.6 OR "${GCC_VERSION}" VERSION_EQUAL 4.6)
@ -332,7 +335,7 @@ if(WIN32)
SET(CPACK_PACKAGE_VERSION_MINOR ${OPENMW_VERSION_MINO}) SET(CPACK_PACKAGE_VERSION_MINOR ${OPENMW_VERSION_MINO})
SET(CPACK_PACKAGE_VERSION_PATCH ${OPENMW_VERSION_RELEASE}) SET(CPACK_PACKAGE_VERSION_PATCH ${OPENMW_VERSION_RELEASE})
SET(CPACK_PACKAGE_EXECUTABLES "openmw;OpenMW;esmtool;Esmtool;omwlauncher;OpenMW Launcher") SET(CPACK_PACKAGE_EXECUTABLES "openmw;OpenMW;esmtool;Esmtool;omwlauncher;OpenMW Launcher")
set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Readme.lnk' '\$INSTDIR\\\\readme.txt'") set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Readme.lnk' '\$INSTDIR\\\\readme.txt'")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenMW_SOURCE_DIR}/readme.txt") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenMW_SOURCE_DIR}/readme.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${OpenMW_SOURCE_DIR}/GPL3.txt") SET(CPACK_RESOURCE_FILE_LICENSE "${OpenMW_SOURCE_DIR}/GPL3.txt")
SET(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") SET(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")

View File

@ -182,7 +182,9 @@ void HUD::setPlayerPos(const float x, const float y)
} }
MapWindow::MapWindow() MapWindow::MapWindow()
: Layout("openmw_map_window_layout.xml"), mGlobal(false) : Layout("openmw_map_window_layout.xml")
, mGlobal(false)
, mVisible(false)
{ {
setCoord(500,0,320,300); setCoord(500,0,320,300);
setText("WorldButton", "World"); setText("WorldButton", "World");
@ -272,6 +274,17 @@ void MapWindow::onWorldButtonClicked(MyGUI::Widget* _sender)
mButton->setCaption( mGlobal ? "Local" : "World" ); mButton->setCaption( mGlobal ? "Local" : "World" );
} }
LocalMapBase::LocalMapBase()
: mCurX(0)
, mCurY(0)
, mInterior(false)
, mLocalMap(NULL)
, mPrefix()
, mChanged(true)
, mLayout(NULL)
{
}
void LocalMapBase::init(MyGUI::ScrollView* widget, OEngine::GUI::Layout* layout) void LocalMapBase::init(MyGUI::ScrollView* widget, OEngine::GUI::Layout* layout)
{ {
mLocalMap = widget; mLocalMap = widget;

View File

@ -34,6 +34,7 @@ namespace MWGui
class LocalMapBase class LocalMapBase
{ {
public: public:
LocalMapBase();
void init(MyGUI::ScrollView* widget, OEngine::GUI::Layout* layout); void init(MyGUI::ScrollView* widget, OEngine::GUI::Layout* layout);
void setCellPrefix(const std::string& prefix); void setCellPrefix(const std::string& prefix);
@ -85,6 +86,7 @@ namespace MWGui
{ {
public: public:
MapWindow(); MapWindow();
virtual ~MapWindow(){}
void setVisible(bool b); void setVisible(bool b);
void setPlayerPos(const float x, const float y); void setPlayerPos(const float x, const float y);

View File

@ -256,8 +256,12 @@ public:
return DataStreamPtr(new Mangle2OgreStream(strm)); return DataStreamPtr(new Mangle2OgreStream(strm));
} }
bool exists(const String& filename) {
return cexists(filename);
}
// Check if the file exists. // Check if the file exists.
bool exists(const String& filename) { bool cexists(const String& filename) const {
String passed = filename; String passed = filename;
if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<' if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<'
|| filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' || filename.at(filename.length() - 1) == ':' || filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' || filename.at(filename.length() - 1) == ':'
@ -308,6 +312,29 @@ return arc.exists(passed.c_str());
located in BSAs. So instead we channel it through exists() and located in BSAs. So instead we channel it through exists() and
set up a single-element result list if the file is found. set up a single-element result list if the file is found.
*/ */
FileInfoListPtr findFileInfo(const String& pattern, bool recursive = true,
bool dirs = false) const
{
FileInfoListPtr ptr = FileInfoListPtr(new FileInfoList());
// Check if the file exists (only works for single files - wild
// cards and recursive search isn't implemented.)
if(cexists(pattern))
{
FileInfo fi;
fi.archive = this;
fi.filename = pattern;
// It apparently doesn't matter that we return bogus
// information
fi.path = "";
fi.compressedSize = fi.uncompressedSize = 0;
ptr->push_back(fi);
}
return ptr;
}
FileInfoListPtr findFileInfo(const String& pattern, bool recursive = true, FileInfoListPtr findFileInfo(const String& pattern, bool recursive = true,
bool dirs = false) bool dirs = false)
{ {
@ -315,7 +342,7 @@ return arc.exists(passed.c_str());
// Check if the file exists (only works for single files - wild // Check if the file exists (only works for single files - wild
// cards and recursive search isn't implemented.) // cards and recursive search isn't implemented.)
if(exists(pattern)) if(cexists(pattern))
{ {
FileInfo fi; FileInfo fi;
fi.archive = this; fi.archive = this;

View File

@ -148,9 +148,9 @@ void BSAFile::readHeader()
} }
/// Get the index of a given file name, or -1 if not found /// Get the index of a given file name, or -1 if not found
int BSAFile::getIndex(const char *str) int BSAFile::getIndex(const char *str) const
{ {
Lookup::iterator it; Lookup::const_iterator it;
it = lookup.find(str); it = lookup.find(str);
if(it == lookup.end()) return -1; if(it == lookup.end()) return -1;

View File

@ -93,7 +93,7 @@ class BSAFile
void readHeader(); void readHeader();
/// Get the index of a given file name, or -1 if not found /// Get the index of a given file name, or -1 if not found
int getIndex(const char *str); int getIndex(const char *str) const;
public: public:
@ -119,7 +119,7 @@ class BSAFile
*/ */
/// Check if a file exists /// Check if a file exists
bool exists(const char *file) { return getIndex(file) != -1; } bool exists(const char *file) const { return getIndex(file) != -1; }
/** Open a file contained in the archive. Throws an exception if the /** Open a file contained in the archive. Throws an exception if the
file doesn't exist. file doesn't exist.

View File

@ -63,17 +63,17 @@ size_t BulletShape::calculateSize() const
//============================================================================================================= //=============================================================================================================
template<> BulletShapeManager *Ogre::Singleton<BulletShapeManager>::ms_Singleton = 0; template<> BulletShapeManager *Ogre::Singleton<BulletShapeManager>::msSingleton = 0;
BulletShapeManager *BulletShapeManager::getSingletonPtr() BulletShapeManager *BulletShapeManager::getSingletonPtr()
{ {
return ms_Singleton; return msSingleton;
} }
BulletShapeManager &BulletShapeManager::getSingleton() BulletShapeManager &BulletShapeManager::getSingleton()
{ {
assert(ms_Singleton); assert(msSingleton);
return(*ms_Singleton); return(*msSingleton);
} }
BulletShapeManager::BulletShapeManager() BulletShapeManager::BulletShapeManager()