forked from mirror/openmw-tes3mp
Merge branch 'master' of https://github.com/zinnschlag/openmw into graphics
This commit is contained in:
commit
a3afb91485
7 changed files with 109 additions and 70 deletions
|
@ -140,25 +140,42 @@ namespace MWScript
|
||||||
|
|
||||||
Compiler::Locals& ScriptManager::getLocals (const std::string& name)
|
Compiler::Locals& ScriptManager::getLocals (const std::string& name)
|
||||||
{
|
{
|
||||||
ScriptCollection::iterator iter = mScripts.find (name);
|
|
||||||
|
|
||||||
if (iter==mScripts.end())
|
|
||||||
{
|
{
|
||||||
if (!compile (name))
|
ScriptCollection::iterator iter = mScripts.find (name);
|
||||||
{
|
|
||||||
/// \todo Handle case of cyclic member variable access. Currently this could look up
|
|
||||||
/// the whole application in an endless recursion.
|
|
||||||
|
|
||||||
// failed -> ignore script from now on.
|
if (iter!=mScripts.end())
|
||||||
std::vector<Interpreter::Type_Code> empty;
|
return iter->second.second;
|
||||||
mScripts.insert (std::make_pair (name, std::make_pair (empty, Compiler::Locals())));
|
|
||||||
throw std::runtime_error ("failed to compile script " + name);
|
|
||||||
}
|
|
||||||
|
|
||||||
iter = mScripts.find (name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return iter->second.second;
|
{
|
||||||
|
std::map<std::string, Compiler::Locals>::iterator iter = mOtherLocals.find (name);
|
||||||
|
|
||||||
|
if (iter!=mOtherLocals.end())
|
||||||
|
return iter->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
Compiler::Locals locals;
|
||||||
|
|
||||||
|
if (const ESM::Script *script = mStore.get<ESM::Script>().find (name))
|
||||||
|
{
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
for (int i=0; i<script->mData.mNumShorts; ++i)
|
||||||
|
locals.declare ('s', script->mVarNames[index++]);
|
||||||
|
|
||||||
|
for (int i=0; i<script->mData.mNumLongs; ++i)
|
||||||
|
locals.declare ('l', script->mVarNames[index++]);
|
||||||
|
|
||||||
|
for (int i=0; i<script->mData.mNumFloats; ++i)
|
||||||
|
locals.declare ('f', script->mVarNames[index++]);
|
||||||
|
|
||||||
|
std::map<std::string, Compiler::Locals>::iterator iter =
|
||||||
|
mOtherLocals.insert (std::make_pair (name, locals)).first;
|
||||||
|
|
||||||
|
return iter->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw std::logic_error ("script " + name + " does not exist");
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalScripts& ScriptManager::getGlobalScripts()
|
GlobalScripts& ScriptManager::getGlobalScripts()
|
||||||
|
|
|
@ -47,6 +47,7 @@ namespace MWScript
|
||||||
|
|
||||||
ScriptCollection mScripts;
|
ScriptCollection mScripts;
|
||||||
GlobalScripts mGlobalScripts;
|
GlobalScripts mGlobalScripts;
|
||||||
|
std::map<std::string, Compiler::Locals> mOtherLocals;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace MWWorld
|
||||||
|
|
||||||
virtual size_t getSize() const = 0;
|
virtual size_t getSize() const = 0;
|
||||||
virtual void load(ESM::ESMReader &esm, const std::string &id) = 0;
|
virtual void load(ESM::ESMReader &esm, const std::string &id) = 0;
|
||||||
|
|
||||||
virtual bool eraseStatic(const std::string &id) {return false;}
|
virtual bool eraseStatic(const std::string &id) {return false;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ namespace MWWorld
|
||||||
item.mId = Misc::StringUtils::lowerCase(id);
|
item.mId = Misc::StringUtils::lowerCase(id);
|
||||||
|
|
||||||
typename std::map<std::string, T>::const_iterator it = mStatic.find(item.mId);
|
typename std::map<std::string, T>::const_iterator it = mStatic.find(item.mId);
|
||||||
|
|
||||||
if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) {
|
if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) {
|
||||||
return &(it->second);
|
return &(it->second);
|
||||||
}
|
}
|
||||||
|
@ -188,14 +188,14 @@ namespace MWWorld
|
||||||
item.mId = Misc::StringUtils::lowerCase(id);
|
item.mId = Misc::StringUtils::lowerCase(id);
|
||||||
|
|
||||||
typename std::map<std::string, T>::iterator it = mStatic.find(item.mId);
|
typename std::map<std::string, T>::iterator it = mStatic.find(item.mId);
|
||||||
|
|
||||||
if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) {
|
if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) {
|
||||||
mStatic.erase(it);
|
mStatic.erase(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool erase(const std::string &id) {
|
bool erase(const std::string &id) {
|
||||||
std::string key = Misc::StringUtils::lowerCase(id);
|
std::string key = Misc::StringUtils::lowerCase(id);
|
||||||
typename Dynamic::iterator it = mDynamic.find(key);
|
typename Dynamic::iterator it = mDynamic.find(key);
|
||||||
|
@ -220,9 +220,15 @@ namespace MWWorld
|
||||||
template <>
|
template <>
|
||||||
inline void Store<ESM::Dialogue>::load(ESM::ESMReader &esm, const std::string &id) {
|
inline void Store<ESM::Dialogue>::load(ESM::ESMReader &esm, const std::string &id) {
|
||||||
std::string idLower = Misc::StringUtils::lowerCase(id);
|
std::string idLower = Misc::StringUtils::lowerCase(id);
|
||||||
mStatic[idLower] = ESM::Dialogue();
|
|
||||||
mStatic[idLower].mId = id; // don't smash case here, as this line is printed... I think
|
std::map<std::string, ESM::Dialogue>::iterator it = mStatic.find(idLower);
|
||||||
mStatic[idLower].load(esm);
|
if (it == mStatic.end()) {
|
||||||
|
it = mStatic.insert( std::make_pair( idLower, ESM::Dialogue() ) ).first;
|
||||||
|
it->second.mId = id; // don't smash case here, as this line is printed... I think
|
||||||
|
}
|
||||||
|
|
||||||
|
//I am not sure is it need to load the dialog from a plugin if it was already loaded from prevois plugins
|
||||||
|
it->second.load(esm);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -409,7 +415,7 @@ namespace MWWorld
|
||||||
|
|
||||||
DynamicInt mDynamicInt;
|
DynamicInt mDynamicInt;
|
||||||
DynamicExt mDynamicExt;
|
DynamicExt mDynamicExt;
|
||||||
|
|
||||||
const ESM::Cell *search(const ESM::Cell &cell) const {
|
const ESM::Cell *search(const ESM::Cell &cell) const {
|
||||||
if (cell.isExterior()) {
|
if (cell.isExterior()) {
|
||||||
return search(cell.getGridX(), cell.getGridY());
|
return search(cell.getGridX(), cell.getGridY());
|
||||||
|
@ -481,7 +487,7 @@ namespace MWWorld
|
||||||
newCell->mData.mY = y;
|
newCell->mData.mY = y;
|
||||||
mExt[std::make_pair(x, y)] = *newCell;
|
mExt[std::make_pair(x, y)] = *newCell;
|
||||||
delete newCell;
|
delete newCell;
|
||||||
|
|
||||||
return &mExt[std::make_pair(x, y)];
|
return &mExt[std::make_pair(x, y)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,7 +534,7 @@ namespace MWWorld
|
||||||
// There some nasty three-way cyclic header dependency involved, which I could only fix by moving
|
// There some nasty three-way cyclic header dependency involved, which I could only fix by moving
|
||||||
// this method.
|
// this method.
|
||||||
void load(ESM::ESMReader &esm, const std::string &id);
|
void load(ESM::ESMReader &esm, const std::string &id);
|
||||||
|
|
||||||
iterator intBegin() const {
|
iterator intBegin() const {
|
||||||
return iterator(mSharedInt.begin());
|
return iterator(mSharedInt.begin());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,76 +2,78 @@
|
||||||
|
|
||||||
<MyGUI type="Skin">
|
<MyGUI type="Skin">
|
||||||
<!-- The 'box' frame that surrounds various HUD items and other elements -->
|
<!-- The 'box' frame that surrounds various HUD items and other elements -->
|
||||||
<Skin name="HUD_Box" size="40 40" texture="textures\menu_icon_equip.dds">
|
<Skin name="HUD_Box" size="40 40" texture="mwgui.png">
|
||||||
<BasisSkin type="TileRect" offset="0 0 40 2" align="ALIGN_TOP ALIGN_HSTRETCH">
|
|
||||||
<State name="normal" offset="2 2 40 2">
|
<BasisSkin type="TileRect" offset="0 0 39 2" align="ALIGN_TOP ALIGN_HSTRETCH">
|
||||||
|
<State name="normal" offset="4 2 38 2">
|
||||||
<Property key="TileSize" value="40 2"/>
|
<Property key="TileSize" value="40 2"/>
|
||||||
<Property key="TileH" value="true"/>
|
<Property key="TileH" value="true"/>
|
||||||
<Property key="TileV" value="true"/>
|
<Property key="TileV" value="true"/>
|
||||||
</State>
|
</State>
|
||||||
</BasisSkin>
|
</BasisSkin>
|
||||||
|
|
||||||
<BasisSkin type="TileRect" offset="0 38 40 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH">
|
<BasisSkin type="TileRect" offset="0 1 2 37" align="ALIGN_LEFT ALIGN_VSTRETCH">
|
||||||
<State name="normal" offset="2 40 40 2">
|
<State name="normal" offset="2 26 2 36">
|
||||||
|
<Property key="TileSize" value="2 40"/>
|
||||||
|
<Property key="TileH" value="true"/>
|
||||||
|
<Property key="TileV" value="true"/>
|
||||||
|
</State>
|
||||||
|
</BasisSkin>
|
||||||
|
|
||||||
|
<BasisSkin type="TileRect" offset="38 0 2 40" align="ALIGN_RIGHT ALIGN_VSTRETCH">
|
||||||
|
<State name="normal" offset="16 26 2 38">
|
||||||
|
<Property key="TileSize" value="2 40"/>
|
||||||
|
<Property key="TileH" value="true"/>
|
||||||
|
<Property key="TileV" value="true"/>
|
||||||
|
</State>
|
||||||
|
</BasisSkin>
|
||||||
|
|
||||||
|
<BasisSkin type="TileRect" offset="0 38 39 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH">
|
||||||
|
<State name="normal" offset="4 20 40 2">
|
||||||
<Property key="TileSize" value="40 2"/>
|
<Property key="TileSize" value="40 2"/>
|
||||||
<Property key="TileH" value="true"/>
|
<Property key="TileH" value="true"/>
|
||||||
<Property key="TileV" value="true"/>
|
<Property key="TileV" value="true"/>
|
||||||
</State>
|
</State>
|
||||||
</BasisSkin>
|
</BasisSkin>
|
||||||
|
|
||||||
<BasisSkin type="TileRect" offset="0 2 2 36" align="ALIGN_LEFT ALIGN_VSTRETCH">
|
|
||||||
<State name="normal" offset="2 4 2 36">
|
|
||||||
<Property key="TileSize" value="2 36"/>
|
|
||||||
<Property key="TileH" value="true"/>
|
|
||||||
<Property key="TileV" value="true"/>
|
|
||||||
</State>
|
|
||||||
</BasisSkin>
|
|
||||||
|
|
||||||
<BasisSkin type="TileRect" offset="38 2 2 36" align="ALIGN_RIGHT ALIGN_VSTRETCH">
|
|
||||||
<State name="normal" offset="40 4 2 36">
|
|
||||||
<Property key="TileSize" value="2 36"/>
|
|
||||||
<Property key="TileH" value="true"/>
|
|
||||||
<Property key="TileV" value="true"/>
|
|
||||||
</State>
|
|
||||||
</BasisSkin>
|
|
||||||
|
|
||||||
<!-- The interior of the box -->
|
<!-- The interior of the box -->
|
||||||
<Child type="Widget" skin="BlackBG" offset="2 2 36 36" align="ALIGN_STRETCH" name="Client"/>
|
<Child type="Widget" skin="BlackBG" offset="2 2 36 36" align="ALIGN_STRETCH" name="Client"/>
|
||||||
</Skin>
|
</Skin>
|
||||||
|
|
||||||
<Skin name="HUD_Box_NoTransp" size="40 40" texture="textures\menu_icon_equip.dds">
|
<Skin name="HUD_Box_NoTransp" size="40 40" texture="mwgui.png">
|
||||||
<BasisSkin type="TileRect" offset="0 0 40 2" align="ALIGN_TOP ALIGN_HSTRETCH">
|
|
||||||
<State name="normal" offset="2 2 40 2">
|
<BasisSkin type="TileRect" offset="0 0 39 2" align="ALIGN_TOP ALIGN_HSTRETCH">
|
||||||
|
<State name="normal" offset="4 2 38 2">
|
||||||
<Property key="TileSize" value="40 2"/>
|
<Property key="TileSize" value="40 2"/>
|
||||||
<Property key="TileH" value="true"/>
|
<Property key="TileH" value="true"/>
|
||||||
<Property key="TileV" value="true"/>
|
<Property key="TileV" value="true"/>
|
||||||
</State>
|
</State>
|
||||||
</BasisSkin>
|
</BasisSkin>
|
||||||
|
|
||||||
<BasisSkin type="TileRect" offset="0 38 40 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH">
|
<BasisSkin type="TileRect" offset="0 1 2 37" align="ALIGN_LEFT ALIGN_VSTRETCH">
|
||||||
<State name="normal" offset="2 40 40 2">
|
<State name="normal" offset="2 26 2 36">
|
||||||
|
<Property key="TileSize" value="2 40"/>
|
||||||
|
<Property key="TileH" value="true"/>
|
||||||
|
<Property key="TileV" value="true"/>
|
||||||
|
</State>
|
||||||
|
</BasisSkin>
|
||||||
|
|
||||||
|
<BasisSkin type="TileRect" offset="38 0 2 40" align="ALIGN_RIGHT ALIGN_VSTRETCH">
|
||||||
|
<State name="normal" offset="16 26 2 38">
|
||||||
|
<Property key="TileSize" value="2 40"/>
|
||||||
|
<Property key="TileH" value="true"/>
|
||||||
|
<Property key="TileV" value="true"/>
|
||||||
|
</State>
|
||||||
|
</BasisSkin>
|
||||||
|
|
||||||
|
<BasisSkin type="TileRect" offset="0 38 39 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH">
|
||||||
|
<State name="normal" offset="4 20 40 2">
|
||||||
<Property key="TileSize" value="40 2"/>
|
<Property key="TileSize" value="40 2"/>
|
||||||
<Property key="TileH" value="true"/>
|
<Property key="TileH" value="true"/>
|
||||||
<Property key="TileV" value="true"/>
|
<Property key="TileV" value="true"/>
|
||||||
</State>
|
</State>
|
||||||
</BasisSkin>
|
</BasisSkin>
|
||||||
|
|
||||||
<BasisSkin type="TileRect" offset="0 2 2 36" align="ALIGN_LEFT ALIGN_VSTRETCH">
|
|
||||||
<State name="normal" offset="2 4 2 36">
|
|
||||||
<Property key="TileSize" value="2 36"/>
|
|
||||||
<Property key="TileH" value="true"/>
|
|
||||||
<Property key="TileV" value="true"/>
|
|
||||||
</State>
|
|
||||||
</BasisSkin>
|
|
||||||
|
|
||||||
<BasisSkin type="TileRect" offset="38 2 2 36" align="ALIGN_RIGHT ALIGN_VSTRETCH">
|
|
||||||
<State name="normal" offset="40 4 2 36">
|
|
||||||
<Property key="TileSize" value="2 36"/>
|
|
||||||
<Property key="TileH" value="true"/>
|
|
||||||
<Property key="TileV" value="true"/>
|
|
||||||
</State>
|
|
||||||
</BasisSkin>
|
|
||||||
|
|
||||||
<!-- The interior of the box -->
|
<!-- The interior of the box -->
|
||||||
<Child type="Widget" skin="DialogBG" offset="2 2 36 36" align="ALIGN_STRETCH" name="Client"/>
|
<Child type="Widget" skin="DialogBG" offset="2 2 36 36" align="ALIGN_STRETCH" name="Client"/>
|
||||||
</Skin>
|
</Skin>
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
|
|
||||||
<Widget type="ImageBox" skin="ImageBox" position="0 0 300 300" align="Stretch" name="BackgroundImage">
|
<Widget type="ImageBox" skin="ImageBox" position="0 0 300 300" align="Stretch" name="BackgroundImage">
|
||||||
|
|
||||||
<Widget type="Widget" skin="HUD_Box" position="0 200 300 70" align="Bottom HCenter">
|
<Widget type="Widget" skin="HUD_Box" position="0 200 300 60" align="Bottom HCenter">
|
||||||
|
|
||||||
<Widget type="AutoSizedTextBox" skin="SandText" position="20 12 260 24" name="LoadingText">
|
<Widget type="AutoSizedTextBox" skin="SandText" position="20 12 260 24" name="LoadingText">
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
<Widget type="ProgressBar" skin="MW_Progress_Blue" position="20 38 260 24" name="ProgressBar">
|
<Widget type="ProgressBar" skin="MW_Progress_Loading" position="20 36 260 8" name="ProgressBar">
|
||||||
<Property key="Range" value="1000"/>
|
<Property key="Range" value="1000"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,11 @@
|
||||||
<State name="normal" offset = "0 28 2 14"/>
|
<State name="normal" offset = "0 28 2 14"/>
|
||||||
</BasisSkin>
|
</BasisSkin>
|
||||||
</Skin>
|
</Skin>
|
||||||
|
<Skin name = "MW_BigTrack_Progress_Blue_Small" size = "2 6" texture = "smallbars.png" >
|
||||||
|
<BasisSkin type="MainSkin" offset = "0 0 2 6" align = "ALIGN_STRETCH">
|
||||||
|
<State name="normal" offset = "0 26 2 6"/>
|
||||||
|
</BasisSkin>
|
||||||
|
</Skin>
|
||||||
|
|
||||||
<Skin name = "ProgressText" size = "16 16">
|
<Skin name = "ProgressText" size = "16 16">
|
||||||
<Property key="FontName" value = "Default"/>
|
<Property key="FontName" value = "Default"/>
|
||||||
|
@ -51,4 +56,12 @@
|
||||||
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="ALIGN_STRETCH"/>
|
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="ALIGN_STRETCH"/>
|
||||||
<Child type="Widget" skin="BlackBG" offset = "2 2 60 8" align = "ALIGN_STRETCH" name="Client"/>
|
<Child type="Widget" skin="BlackBG" offset = "2 2 60 8" align = "ALIGN_STRETCH" name="Client"/>
|
||||||
</Skin>
|
</Skin>
|
||||||
|
|
||||||
|
<Skin name="MW_Progress_Loading" size="64 6">
|
||||||
|
<Property key="TrackSkin" value = "MW_BigTrack_Progress_Blue_Small" />
|
||||||
|
<Property key="TrackWidth" value = "1" />
|
||||||
|
|
||||||
|
<Child type="Widget" skin="MW_Box" offset="0 0 64 6" align="ALIGN_STRETCH"/>
|
||||||
|
<Child type="Widget" skin="BlackBG" offset = "2 2 60 2" align = "ALIGN_STRETCH" name="Client"/>
|
||||||
|
</Skin>
|
||||||
</MyGUI>
|
</MyGUI>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 3.1 KiB |
Loading…
Reference in a new issue