forked from teamnwah/openmw-tes3coop
Merge branch 'master' of https://github.com/zinnschlag/openmw.git into journal
commit
28bd9ce362
@ -1,30 +0,0 @@
|
||||
######################################################################
|
||||
# Automatically generated by qmake (2.01a) Fri Jun 24 21:14:15 2011
|
||||
######################################################################
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET =
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += .
|
||||
|
||||
# Input
|
||||
HEADERS += combobox.hpp \
|
||||
datafilespage.hpp \
|
||||
graphicspage.hpp \
|
||||
lineedit.hpp \
|
||||
maindialog.hpp \
|
||||
naturalsort.hpp \
|
||||
playpage.hpp \
|
||||
pluginsmodel.hpp \
|
||||
pluginsview.hpp
|
||||
SOURCES += datafilespage.cpp \
|
||||
graphicspage.cpp \
|
||||
lineedit.cpp \
|
||||
main.cpp \
|
||||
maindialog.cpp \
|
||||
naturalsort.cpp \
|
||||
playpage.cpp \
|
||||
pluginsmodel.cpp \
|
||||
pluginsview.cpp
|
||||
RESOURCES += resources.qrc
|
||||
win32:RC_FILE = launcher.rc
|
Binary file not shown.
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 82 KiB |
@ -0,0 +1,126 @@
|
||||
|
||||
#include "localscripts.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
template<typename T>
|
||||
void listCellScripts (MWWorld::LocalScripts& localScripts,
|
||||
ESMS::CellRefList<T, MWWorld::RefData>& cellRefList, MWWorld::Ptr::CellStore *cell)
|
||||
{
|
||||
for (typename ESMS::CellRefList<T, MWWorld::RefData>::List::iterator iter (
|
||||
cellRefList.list.begin());
|
||||
iter!=cellRefList.list.end(); ++iter)
|
||||
{
|
||||
if (!iter->base->script.empty() && iter->mData.getCount())
|
||||
{
|
||||
localScripts.add (iter->base->script, MWWorld::Ptr (&*iter, cell));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MWWorld::LocalScripts::LocalScripts (const ESMS::ESMStore& store) : mStore (store) {}
|
||||
|
||||
void MWWorld::LocalScripts::setIgnore (const Ptr& ptr)
|
||||
{
|
||||
mIgnore = ptr;
|
||||
}
|
||||
|
||||
void MWWorld::LocalScripts::startIteration()
|
||||
{
|
||||
mIter = mScripts.begin();
|
||||
}
|
||||
|
||||
bool MWWorld::LocalScripts::isFinished() const
|
||||
{
|
||||
if (mIter==mScripts.end())
|
||||
return true;
|
||||
|
||||
if (!mIgnore.isEmpty() && mIter->second==mIgnore)
|
||||
{
|
||||
std::list<std::pair<std::string, Ptr> >::iterator iter = mIter;
|
||||
return ++iter==mScripts.end();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::pair<std::string, MWWorld::Ptr> MWWorld::LocalScripts::getNext()
|
||||
{
|
||||
assert (!isFinished());
|
||||
|
||||
std::list<std::pair<std::string, Ptr> >::iterator iter = mIter++;
|
||||
|
||||
if (mIgnore.isEmpty() || iter->second!=mIgnore)
|
||||
return *iter;
|
||||
|
||||
return getNext();
|
||||
}
|
||||
|
||||
void MWWorld::LocalScripts::add (const std::string& scriptName, const Ptr& ptr)
|
||||
{
|
||||
if (const ESM::Script *script = mStore.scripts.find (scriptName))
|
||||
{
|
||||
ptr.getRefData().setLocals (*script);
|
||||
|
||||
mScripts.push_back (std::make_pair (scriptName, ptr));
|
||||
}
|
||||
}
|
||||
|
||||
void MWWorld::LocalScripts::addCell (Ptr::CellStore *cell)
|
||||
{
|
||||
listCellScripts (*this, cell->activators, cell);
|
||||
listCellScripts (*this, cell->potions, cell);
|
||||
listCellScripts (*this, cell->appas, cell);
|
||||
listCellScripts (*this, cell->armors, cell);
|
||||
listCellScripts (*this, cell->books, cell);
|
||||
listCellScripts (*this, cell->clothes, cell);
|
||||
listCellScripts (*this, cell->containers, cell);
|
||||
listCellScripts (*this, cell->creatures, cell);
|
||||
listCellScripts (*this, cell->doors, cell);
|
||||
listCellScripts (*this, cell->ingreds, cell);
|
||||
listCellScripts (*this, cell->lights, cell);
|
||||
listCellScripts (*this, cell->lockpicks, cell);
|
||||
listCellScripts (*this, cell->miscItems, cell);
|
||||
listCellScripts (*this, cell->npcs, cell);
|
||||
listCellScripts (*this, cell->probes, cell);
|
||||
listCellScripts (*this, cell->repairs, cell);
|
||||
listCellScripts (*this, cell->weapons, cell);
|
||||
}
|
||||
|
||||
void MWWorld::LocalScripts::clear()
|
||||
{
|
||||
mScripts.clear();
|
||||
}
|
||||
|
||||
void MWWorld::LocalScripts::clearCell (Ptr::CellStore *cell)
|
||||
{
|
||||
std::list<std::pair<std::string, Ptr> >::iterator iter = mScripts.begin();
|
||||
|
||||
while (iter!=mScripts.end())
|
||||
{
|
||||
if (iter->second.getCell()==cell)
|
||||
{
|
||||
if (iter==mIter)
|
||||
++mIter;
|
||||
|
||||
mScripts.erase (iter++);
|
||||
}
|
||||
else
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
void MWWorld::LocalScripts::remove (const Ptr& ptr)
|
||||
{
|
||||
for (std::list<std::pair<std::string, Ptr> >::iterator iter = mScripts.begin();
|
||||
iter!=mScripts.end(); ++iter)
|
||||
if (iter->second==ptr)
|
||||
{
|
||||
if (iter==mIter)
|
||||
++mIter;
|
||||
|
||||
mScripts.erase (iter);
|
||||
break;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
#ifndef GAME_MWWORLD_LOCALSCRIPTS_H
|
||||
#define GAME_MWWORLD_LOCALSCRIPTS_H
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
|
||||
#include "ptr.hpp"
|
||||
|
||||
namespace ESMS
|
||||
{
|
||||
struct ESMStore;
|
||||
}
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
/// \brief List of active local scripts
|
||||
class LocalScripts
|
||||
{
|
||||
std::list<std::pair<std::string, Ptr> > mScripts;
|
||||
std::list<std::pair<std::string, Ptr> >::iterator mIter;
|
||||
MWWorld::Ptr mIgnore;
|
||||
const ESMS::ESMStore& mStore;
|
||||
|
||||
public:
|
||||
|
||||
LocalScripts (const ESMS::ESMStore& store);
|
||||
|
||||
void setIgnore (const Ptr& ptr);
|
||||
///< Mark a single reference for ignoring during iteration over local scripts (will revoke
|
||||
/// previous ignores).
|
||||
|
||||
void startIteration();
|
||||
///< Set the iterator to the begin of the script list.
|
||||
|
||||
bool isFinished() const;
|
||||
///< Is iteration finished?
|
||||
|
||||
std::pair<std::string, Ptr> getNext();
|
||||
///< Get next local script (must not be called if isFinished())
|
||||
|
||||
void add (const std::string& scriptName, const Ptr& ptr);
|
||||
///< Add script to collection of active local scripts.
|
||||
|
||||
void addCell (Ptr::CellStore *cell);
|
||||
///< Add all local scripts in a cell.
|
||||
|
||||
void clear();
|
||||
///< Clear active local scripts collection.
|
||||
|
||||
void clearCell (Ptr::CellStore *cell);
|
||||
///< Remove all scripts belonging to \a cell.
|
||||
|
||||
void remove (const Ptr& ptr);
|
||||
///< Remove script for given reference (ignored if reference does not have a scirpt listed).
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,24 @@
|
||||
|
||||
macro (add_openmw_dir dir)
|
||||
set (files)
|
||||
foreach (u ${ARGN})
|
||||
file (GLOB ALL RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.*")
|
||||
foreach (f ${ALL})
|
||||
list (APPEND files "${f}")
|
||||
list (APPEND OPENMW_FILES "${f}")
|
||||
endforeach (f)
|
||||
endforeach (u)
|
||||
source_group ("apps\\openmw\\${dir}" FILES ${files})
|
||||
endmacro (add_openmw_dir)
|
||||
|
||||
macro (add_component_dir dir)
|
||||
set (files)
|
||||
foreach (u ${ARGN})
|
||||
file (GLOB ALL RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.*")
|
||||
foreach (f ${ALL})
|
||||
list (APPEND files "${f}")
|
||||
list (APPEND COMPONENT_FILES "${f}")
|
||||
endforeach (f)
|
||||
endforeach (u)
|
||||
source_group ("components\\${dir}" FILES ${files})
|
||||
endmacro (add_component_dir)
|
@ -0,0 +1,66 @@
|
||||
project (Components)
|
||||
|
||||
# source files
|
||||
|
||||
add_component_dir (bsa
|
||||
bsa_archive bsa_file
|
||||
)
|
||||
|
||||
add_component_dir (cfg
|
||||
configurationmanager
|
||||
)
|
||||
|
||||
add_component_dir (nif
|
||||
controlled effect nif_types record controller extra node record_ptr data nif_file property
|
||||
)
|
||||
|
||||
add_component_dir (nifogre
|
||||
ogre_nif_loader
|
||||
)
|
||||
|
||||
add_component_dir (nifbullet
|
||||
bullet_nif_loader
|
||||
)
|
||||
|
||||
add_component_dir (to_utf8
|
||||
to_utf8
|
||||
)
|
||||
|
||||
add_component_dir (file_finder
|
||||
file_finder filename_less search
|
||||
)
|
||||
|
||||
add_component_dir (esm_store
|
||||
cell_store reclists store
|
||||
)
|
||||
|
||||
add_component_dir (esm
|
||||
attr defs esm_reader loadacti loadalch loadappa loadarmo loadbody loadbook loadbsgn loadcell
|
||||
loadclas loadclot loadcont loadcrea loadcrec loaddial loaddoor loadench loadfact loadglob loadgmst
|
||||
loadinfo loadingr loadland loadlevlist loadligh loadlocks loadltex loadmgef loadmisc loadnpcc
|
||||
loadnpc loadpgrd loadrace loadregn loadscpt loadskil loadsndg loadsoun loadspel loadsscr loadstat
|
||||
loadweap records
|
||||
)
|
||||
|
||||
add_component_dir (misc
|
||||
slice_array stringops
|
||||
)
|
||||
|
||||
add_component_dir (files
|
||||
linuxpath windowspath macospath path multidircollection collections fileops
|
||||
)
|
||||
|
||||
add_component_dir (compiler
|
||||
context controlparser errorhandler exception exprparser extensions fileparser generator
|
||||
lineparser literals locals output parser scanner scriptparser skipparser streamerrorhandler
|
||||
stringparser tokenloc
|
||||
)
|
||||
|
||||
add_component_dir (interpreter
|
||||
context controlopcodes genericopcodes installopcodes interpreter localopcodes mathopcodes
|
||||
miscopcodes opcodes runtime scriptopcodes spatialopcodes types
|
||||
)
|
||||
|
||||
include_directories(${BULLET_INCLUDE_DIRS})
|
||||
|
||||
add_library (components STATIC ${COMPONENT_FILES})
|
@ -1 +1 @@
|
||||
Subproject commit 0b1d6d4330818ee3e491e1ec78928ff714e9bbaa
|
||||
Subproject commit 2f5eca9d878526bdd9dce93ece7f42093b481545
|
Loading…
Reference in New Issue