forked from mirror/openmw-tes3mp
Merge branch 'master' into tooltips
This commit is contained in:
commit
ab4e03f05f
10 changed files with 130 additions and 57 deletions
|
@ -27,6 +27,11 @@ configure_file ("${OpenMW_SOURCE_DIR}/Docs/mainpage.hpp.cmake" "${OpenMW_SOURCE_
|
||||||
option(MYGUI_STATIC "Link static build of Mygui into the binaries" FALSE)
|
option(MYGUI_STATIC "Link static build of Mygui into the binaries" FALSE)
|
||||||
option(OGRE_STATIC "Link static build of Ogre and Ogre Plugins into the binaries" FALSE)
|
option(OGRE_STATIC "Link static build of Ogre and Ogre Plugins into the binaries" FALSE)
|
||||||
|
|
||||||
|
# Apps and tools
|
||||||
|
option(BUILD_ESMTOOL "build ESM inspector" ON)
|
||||||
|
option(BUILD_LAUNCHER "build Launcher" ON)
|
||||||
|
option(BUILD_MWINIIMPORTER "build MWiniImporter" ON)
|
||||||
|
|
||||||
# Sound source selection
|
# Sound source selection
|
||||||
option(USE_FFMPEG "use ffmpeg for sound" OFF)
|
option(USE_FFMPEG "use ffmpeg for sound" OFF)
|
||||||
option(USE_AUDIERE "use audiere for sound" OFF)
|
option(USE_AUDIERE "use audiere for sound" OFF)
|
||||||
|
@ -244,6 +249,9 @@ endif (WIN32)
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
configure_file(${OpenMW_SOURCE_DIR}/files/plugins.cfg.linux
|
configure_file(${OpenMW_SOURCE_DIR}/files/plugins.cfg.linux
|
||||||
"${OpenMW_BINARY_DIR}/plugins.cfg")
|
"${OpenMW_BINARY_DIR}/plugins.cfg")
|
||||||
|
|
||||||
|
configure_file(${OpenMW_SOURCE_DIR}/files/openmw.desktop
|
||||||
|
"${OpenMW_BINARY_DIR}/openmw.desktop")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
@ -307,7 +315,7 @@ if(DPKG_PROGRAM)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#Install icon and desktop file
|
#Install icon and desktop file
|
||||||
INSTALL(FILES "${OpenMW_SOURCE_DIR}/files/openmw.desktop" DESTINATION "share/applications/" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw")
|
INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw.desktop" DESTINATION "share/applications/" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw")
|
||||||
INSTALL(FILES "${OpenMW_SOURCE_DIR}/apps/launcher/resources/images/openmw.png" DESTINATION "share/pixmaps/" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw")
|
INSTALL(FILES "${OpenMW_SOURCE_DIR}/apps/launcher/resources/images/openmw.png" DESTINATION "share/pixmaps/" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw")
|
||||||
|
|
||||||
#Install global configuration files
|
#Install global configuration files
|
||||||
|
@ -413,17 +421,14 @@ add_subdirectory (components)
|
||||||
# Apps and tools
|
# Apps and tools
|
||||||
add_subdirectory( apps/openmw )
|
add_subdirectory( apps/openmw )
|
||||||
|
|
||||||
option(BUILD_ESMTOOL "build ESM inspector" ON)
|
|
||||||
if (BUILD_ESMTOOL)
|
if (BUILD_ESMTOOL)
|
||||||
add_subdirectory( apps/esmtool )
|
add_subdirectory( apps/esmtool )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(BUILD_LAUNCHER "build Launcher inspector" ON)
|
|
||||||
if (BUILD_LAUNCHER)
|
if (BUILD_LAUNCHER)
|
||||||
add_subdirectory( apps/launcher )
|
add_subdirectory( apps/launcher )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(BUILD_MWINIIMPORTER "build MWiniImporter inspector" ON)
|
|
||||||
if (BUILD_MWINIIMPORTER)
|
if (BUILD_MWINIIMPORTER)
|
||||||
add_subdirectory( apps/mwiniimporter )
|
add_subdirectory( apps/mwiniimporter )
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -240,6 +240,7 @@ Ogre::Entity* NpcAnimation::insertBoundedPart(const std::string &mesh, std::stri
|
||||||
|
|
||||||
NIFLoader::load(mesh);
|
NIFLoader::load(mesh);
|
||||||
Entity* ent = mRend.getScene()->createEntity(mesh);
|
Entity* ent = mRend.getScene()->createEntity(mesh);
|
||||||
|
ent->setVisibilityFlags(RV_Actors);
|
||||||
|
|
||||||
base->attachObjectToBone(bonename, ent);
|
base->attachObjectToBone(bonename, ent);
|
||||||
return ent;
|
return ent;
|
||||||
|
@ -249,9 +250,7 @@ void NpcAnimation::insertFreePart(const std::string &mesh, const std::string suf
|
||||||
NIFLoader::load(meshNumbered);
|
NIFLoader::load(meshNumbered);
|
||||||
|
|
||||||
Ogre::Entity* ent = mRend.getScene()->createEntity(meshNumbered);
|
Ogre::Entity* ent = mRend.getScene()->createEntity(meshNumbered);
|
||||||
|
ent->setVisibilityFlags(RV_Actors);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
insert->attachObject(ent);
|
insert->attachObject(ent);
|
||||||
entityparts.push_back(ent);
|
entityparts.push_back(ent);
|
||||||
|
|
|
@ -56,6 +56,8 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
|
||||||
const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities();
|
const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities();
|
||||||
if (caps->getNumMultiRenderTargets() < 2)
|
if (caps->getNumMultiRenderTargets() < 2)
|
||||||
Settings::Manager::setBool("shader", "Water", false);
|
Settings::Manager::setBool("shader", "Water", false);
|
||||||
|
if (!caps->isShaderProfileSupported("fp40") && !caps->isShaderProfileSupported("ps_4_0"))
|
||||||
|
Settings::Manager::setBool("enabled", "Shadows", false);
|
||||||
|
|
||||||
// note that the order is important here
|
// note that the order is important here
|
||||||
if (useMRT())
|
if (useMRT())
|
||||||
|
@ -108,7 +110,6 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
|
||||||
|
|
||||||
RenderingManager::~RenderingManager ()
|
RenderingManager::~RenderingManager ()
|
||||||
{
|
{
|
||||||
//TODO: destroy mSun?
|
|
||||||
delete mPlayer;
|
delete mPlayer;
|
||||||
delete mSkyManager;
|
delete mSkyManager;
|
||||||
delete mDebugging;
|
delete mDebugging;
|
||||||
|
@ -481,11 +482,13 @@ void RenderingManager::preCellChange(MWWorld::Ptr::CellStore* cell)
|
||||||
void RenderingManager::disableLights()
|
void RenderingManager::disableLights()
|
||||||
{
|
{
|
||||||
mObjects.disableLights();
|
mObjects.disableLights();
|
||||||
|
sunDisable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderingManager::enableLights()
|
void RenderingManager::enableLights()
|
||||||
{
|
{
|
||||||
mObjects.enableLights();
|
mObjects.enableLights();
|
||||||
|
sunEnable();
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool RenderingManager::useMRT()
|
const bool RenderingManager::useMRT()
|
||||||
|
|
|
@ -540,7 +540,6 @@ namespace Ogre
|
||||||
params->setNamedAutoConstant("viewProjMatrix", GpuProgramParameters::ACT_VIEWPROJ_MATRIX);
|
params->setNamedAutoConstant("viewProjMatrix", GpuProgramParameters::ACT_VIEWPROJ_MATRIX);
|
||||||
params->setNamedAutoConstant("lodMorph", GpuProgramParameters::ACT_CUSTOM,
|
params->setNamedAutoConstant("lodMorph", GpuProgramParameters::ACT_CUSTOM,
|
||||||
Terrain::LOD_MORPH_CUSTOM_PARAM);
|
Terrain::LOD_MORPH_CUSTOM_PARAM);
|
||||||
params->setNamedAutoConstant("fogParams", GpuProgramParameters::ACT_FOG_PARAMS);
|
|
||||||
|
|
||||||
if (prof->isShadowingEnabled(tt, terrain))
|
if (prof->isShadowingEnabled(tt, terrain))
|
||||||
{
|
{
|
||||||
|
@ -576,7 +575,7 @@ namespace Ogre
|
||||||
{
|
{
|
||||||
params->setNamedAutoConstant("lightPosObjSpace"+StringConverter::toString(i), GpuProgramParameters::ACT_LIGHT_POSITION_OBJECT_SPACE, i);
|
params->setNamedAutoConstant("lightPosObjSpace"+StringConverter::toString(i), GpuProgramParameters::ACT_LIGHT_POSITION_OBJECT_SPACE, i);
|
||||||
params->setNamedAutoConstant("lightDiffuseColour"+StringConverter::toString(i), GpuProgramParameters::ACT_LIGHT_DIFFUSE_COLOUR, i);
|
params->setNamedAutoConstant("lightDiffuseColour"+StringConverter::toString(i), GpuProgramParameters::ACT_LIGHT_DIFFUSE_COLOUR, i);
|
||||||
if (prof->getNumberOfLightsSupported() > 1)
|
if (i > 0)
|
||||||
params->setNamedAutoConstant("lightAttenuation"+StringConverter::toString(i), GpuProgramParameters::ACT_LIGHT_ATTENUATION, i);
|
params->setNamedAutoConstant("lightAttenuation"+StringConverter::toString(i), GpuProgramParameters::ACT_LIGHT_ATTENUATION, i);
|
||||||
//params->setNamedAutoConstant("lightSpecularColour"+StringConverter::toString(i), GpuProgramParameters::ACT_LIGHT_SPECULAR_COLOUR, i);
|
//params->setNamedAutoConstant("lightSpecularColour"+StringConverter::toString(i), GpuProgramParameters::ACT_LIGHT_SPECULAR_COLOUR, i);
|
||||||
}
|
}
|
||||||
|
@ -586,6 +585,7 @@ namespace Ogre
|
||||||
|
|
||||||
params->setNamedAutoConstant("eyePosObjSpace", GpuProgramParameters::ACT_CAMERA_POSITION_OBJECT_SPACE);
|
params->setNamedAutoConstant("eyePosObjSpace", GpuProgramParameters::ACT_CAMERA_POSITION_OBJECT_SPACE);
|
||||||
params->setNamedAutoConstant("fogColour", GpuProgramParameters::ACT_FOG_COLOUR);
|
params->setNamedAutoConstant("fogColour", GpuProgramParameters::ACT_FOG_COLOUR);
|
||||||
|
params->setNamedAutoConstant("fogParams", GpuProgramParameters::ACT_FOG_PARAMS);
|
||||||
|
|
||||||
if (prof->isShadowingEnabled(tt, terrain))
|
if (prof->isShadowingEnabled(tt, terrain))
|
||||||
{
|
{
|
||||||
|
@ -813,11 +813,11 @@ namespace Ogre
|
||||||
|
|
||||||
outStream <<
|
outStream <<
|
||||||
"out float4 oPos : POSITION,\n"
|
"out float4 oPos : POSITION,\n"
|
||||||
"out float4 oPosObj : COLOR \n";
|
"out float4 oPosObj : TEXCOORD0 \n";
|
||||||
|
|
||||||
uint texCoordSet = 0;
|
uint texCoordSet = 1;
|
||||||
outStream <<
|
outStream <<
|
||||||
", out float4 oUVMisc : TEXCOORD" << texCoordSet++ <<" // xy = uv, z = camDepth\n";
|
", out float4 oUVMisc : COLOR0 // xy = uv, z = camDepth\n";
|
||||||
|
|
||||||
// layer UV's premultiplied, packed as xy/zw
|
// layer UV's premultiplied, packed as xy/zw
|
||||||
uint numUVSets = numLayers / 2;
|
uint numUVSets = numLayers / 2;
|
||||||
|
@ -837,14 +837,6 @@ namespace Ogre
|
||||||
outStream << ", out float2 lodInfo : TEXCOORD" << texCoordSet++ << "\n";
|
outStream << ", out float2 lodInfo : TEXCOORD" << texCoordSet++ << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fog = terrain->getSceneManager()->getFogMode() != FOG_NONE && tt != RENDER_COMPOSITE_MAP;
|
|
||||||
if (fog)
|
|
||||||
{
|
|
||||||
outStream <<
|
|
||||||
", uniform float4 fogParams\n";
|
|
||||||
//", out float fogVal : COLOR\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (prof->isShadowingEnabled(tt, terrain))
|
if (prof->isShadowingEnabled(tt, terrain))
|
||||||
{
|
{
|
||||||
texCoordSet = generateVpDynamicShadowsParams(texCoordSet, prof, terrain, tt, outStream);
|
texCoordSet = generateVpDynamicShadowsParams(texCoordSet, prof, terrain, tt, outStream);
|
||||||
|
@ -940,11 +932,11 @@ namespace Ogre
|
||||||
|
|
||||||
outStream <<
|
outStream <<
|
||||||
"void main_fp(\n"
|
"void main_fp(\n"
|
||||||
"float4 position : COLOR,\n";
|
"float4 position : TEXCOORD0,\n";
|
||||||
|
|
||||||
uint texCoordSet = 0;
|
uint texCoordSet = 1;
|
||||||
outStream <<
|
outStream <<
|
||||||
"float4 uvMisc : TEXCOORD" << texCoordSet++ << ",\n";
|
"float4 uvMisc : COLOR0,\n";
|
||||||
|
|
||||||
// UV's premultiplied, packed as xy/zw
|
// UV's premultiplied, packed as xy/zw
|
||||||
uint maxLayers = prof->getMaxLayers(terrain);
|
uint maxLayers = prof->getMaxLayers(terrain);
|
||||||
|
@ -971,8 +963,8 @@ namespace Ogre
|
||||||
if (fog)
|
if (fog)
|
||||||
{
|
{
|
||||||
outStream <<
|
outStream <<
|
||||||
|
"uniform float4 fogParams, \n"
|
||||||
"uniform float3 fogColour, \n";
|
"uniform float3 fogColour, \n";
|
||||||
//"float fogVal : COLOR,\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint currentSamplerIdx = 0;
|
uint currentSamplerIdx = 0;
|
||||||
|
@ -991,7 +983,7 @@ namespace Ogre
|
||||||
//"uniform float3 lightSpecularColour"<<i<<",\n"
|
//"uniform float3 lightSpecularColour"<<i<<",\n"
|
||||||
;
|
;
|
||||||
|
|
||||||
if (prof->getNumberOfLightsSupported() > 1)
|
if (i > 0)
|
||||||
outStream <<
|
outStream <<
|
||||||
"uniform float4 lightAttenuation"<<i<<",\n";
|
"uniform float4 lightAttenuation"<<i<<",\n";
|
||||||
|
|
||||||
|
@ -1069,7 +1061,6 @@ namespace Ogre
|
||||||
" float4 outputCol;\n"
|
" float4 outputCol;\n"
|
||||||
" float shadow = 1.0;\n"
|
" float shadow = 1.0;\n"
|
||||||
" float2 uv = uvMisc.xy;\n"
|
" float2 uv = uvMisc.xy;\n"
|
||||||
" float fogVal = position.w; \n"
|
|
||||||
// base colour
|
// base colour
|
||||||
" outputCol = float4(0,0,0,1);\n";
|
" outputCol = float4(0,0,0,1);\n";
|
||||||
|
|
||||||
|
@ -1161,7 +1152,7 @@ namespace Ogre
|
||||||
outStream << " float3 halfAngle"<<i<<" = normalize(lightDir"<<i<<" + eyeDir);\n"
|
outStream << " float3 halfAngle"<<i<<" = normalize(lightDir"<<i<<" + eyeDir);\n"
|
||||||
" float4 litRes"<<i<<" = lit(dot(normalize(lightDir"<<i<<"), normal), dot(halfAngle"<<i<<", normal), scaleBiasSpecular.z);\n";
|
" float4 litRes"<<i<<" = lit(dot(normalize(lightDir"<<i<<"), normal), dot(halfAngle"<<i<<", normal), scaleBiasSpecular.z);\n";
|
||||||
|
|
||||||
if (prof->getNumberOfLightsSupported() > 1)
|
if (i > 0)
|
||||||
outStream <<
|
outStream <<
|
||||||
// pre-multiply light color with attenuation factor
|
// pre-multiply light color with attenuation factor
|
||||||
"d = length( lightDir"<<i<<" ); \n"
|
"d = length( lightDir"<<i<<" ); \n"
|
||||||
|
@ -1273,24 +1264,7 @@ namespace Ogre
|
||||||
|
|
||||||
outStream <<
|
outStream <<
|
||||||
" // pass cam depth\n"
|
" // pass cam depth\n"
|
||||||
" oUVMisc.z = oPos.z;\n";
|
" oPosObj.w = oPos.z;\n";
|
||||||
|
|
||||||
bool fog = terrain->getSceneManager()->getFogMode() != FOG_NONE && tt != RENDER_COMPOSITE_MAP;
|
|
||||||
if (fog)
|
|
||||||
{
|
|
||||||
if (terrain->getSceneManager()->getFogMode() == FOG_LINEAR)
|
|
||||||
{
|
|
||||||
outStream <<
|
|
||||||
" float fogVal = saturate((oPos.z - fogParams.y) * fogParams.w);\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
outStream <<
|
|
||||||
" float fogVal = saturate(1 / (exp(oPos.z * fogParams.x)));\n";
|
|
||||||
}
|
|
||||||
outStream <<
|
|
||||||
" oPosObj.w = fogVal; \n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (prof->isShadowingEnabled(tt, terrain))
|
if (prof->isShadowingEnabled(tt, terrain))
|
||||||
generateVpDynamicShadows(prof, terrain, tt, outStream);
|
generateVpDynamicShadows(prof, terrain, tt, outStream);
|
||||||
|
@ -1341,7 +1315,13 @@ namespace Ogre
|
||||||
|
|
||||||
// diffuse lighting
|
// diffuse lighting
|
||||||
for (int i=0; i<prof->getNumberOfLightsSupported(); ++i)
|
for (int i=0; i<prof->getNumberOfLightsSupported(); ++i)
|
||||||
|
{
|
||||||
|
// shadows only for first light (directional)
|
||||||
|
if (i==0)
|
||||||
outStream << " outputCol.rgb += litRes"<<i<<".y * lightDiffuseColour"<<i<<" * diffuse * shadow;\n";
|
outStream << " outputCol.rgb += litRes"<<i<<".y * lightDiffuseColour"<<i<<" * diffuse * shadow;\n";
|
||||||
|
else
|
||||||
|
outStream << " outputCol.rgb += litRes"<<i<<".y * lightDiffuseColour"<<i<<" * diffuse;\n";
|
||||||
|
}
|
||||||
|
|
||||||
// specular default
|
// specular default
|
||||||
if (!prof->isLayerSpecularMappingEnabled())
|
if (!prof->isLayerSpecularMappingEnabled())
|
||||||
|
@ -1369,6 +1349,16 @@ namespace Ogre
|
||||||
bool fog = terrain->getSceneManager()->getFogMode() != FOG_NONE && tt != RENDER_COMPOSITE_MAP;
|
bool fog = terrain->getSceneManager()->getFogMode() != FOG_NONE && tt != RENDER_COMPOSITE_MAP;
|
||||||
if (fog)
|
if (fog)
|
||||||
{
|
{
|
||||||
|
if (terrain->getSceneManager()->getFogMode() == FOG_LINEAR)
|
||||||
|
{
|
||||||
|
outStream <<
|
||||||
|
" float fogVal = saturate((position.w - fogParams.y) * fogParams.w);\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outStream <<
|
||||||
|
" float fogVal = saturate(1 / (exp(position.w * fogParams.x)));\n";
|
||||||
|
}
|
||||||
outStream << " outputCol.rgb = lerp(outputCol.rgb, fogColour, fogVal);\n";
|
outStream << " outputCol.rgb = lerp(outputCol.rgb, fogColour, fogVal);\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1376,7 +1366,7 @@ namespace Ogre
|
||||||
outStream << " oColor = outputCol;\n";
|
outStream << " oColor = outputCol;\n";
|
||||||
|
|
||||||
if (MWRender::RenderingManager::useMRT()) outStream <<
|
if (MWRender::RenderingManager::useMRT()) outStream <<
|
||||||
" oColor1 = float4(uvMisc.z / far, 0, 0, 1); \n";
|
" oColor1 = float4(position.w / far, 0, 0, 1); \n";
|
||||||
|
|
||||||
outStream
|
outStream
|
||||||
<< "}\n";
|
<< "}\n";
|
||||||
|
@ -1585,7 +1575,7 @@ namespace Ogre
|
||||||
{
|
{
|
||||||
uint numTextures = prof->getReceiveDynamicShadowsPSSM()->getSplitCount();
|
uint numTextures = prof->getReceiveDynamicShadowsPSSM()->getSplitCount();
|
||||||
outStream <<
|
outStream <<
|
||||||
" float camDepth = uvMisc.z;\n";
|
" float camDepth = position.w;\n";
|
||||||
|
|
||||||
if (prof->getReceiveDynamicShadowsDepth())
|
if (prof->getReceiveDynamicShadowsDepth())
|
||||||
{
|
{
|
||||||
|
@ -1629,8 +1619,8 @@ namespace Ogre
|
||||||
|
|
||||||
outStream <<
|
outStream <<
|
||||||
" float fadeRange = shadowFar_fadeStart.x - shadowFar_fadeStart.y; \n"
|
" float fadeRange = shadowFar_fadeStart.x - shadowFar_fadeStart.y; \n"
|
||||||
" float fade = 1-((uvMisc.z - shadowFar_fadeStart.y) / fadeRange); \n"
|
" float fade = 1-((position.w - shadowFar_fadeStart.y) / fadeRange); \n"
|
||||||
" rtshadow = (uvMisc.z > shadowFar_fadeStart.x) ? 1 : ((uvMisc.z > shadowFar_fadeStart.y) ? 1-((1-rtshadow)*fade) : rtshadow); \n"
|
" rtshadow = (position.w > shadowFar_fadeStart.x) ? 1 : ((position.w > shadowFar_fadeStart.y) ? 1-((1-rtshadow)*fade) : rtshadow); \n"
|
||||||
" rtshadow = (1-(1-rtshadow)*0.6); \n" // make the shadow a little less intensive
|
" rtshadow = (1-(1-rtshadow)*0.6); \n" // make the shadow a little less intensive
|
||||||
" shadow = min(shadow, rtshadow);\n";
|
" shadow = min(shadow, rtshadow);\n";
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "../mwdialogue/dialoguemanager.hpp"
|
#include "../mwdialogue/dialoguemanager.hpp"
|
||||||
|
|
||||||
#include "interpretercontext.hpp"
|
#include "interpretercontext.hpp"
|
||||||
|
#include "ref.hpp"
|
||||||
|
|
||||||
namespace MWScript
|
namespace MWScript
|
||||||
{
|
{
|
||||||
|
@ -115,12 +116,27 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<class R>
|
||||||
|
class OpForceGreeting : public Interpreter::Opcode0
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
|
{
|
||||||
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
MWScript::InterpreterContext& context
|
||||||
|
= static_cast<MWScript::InterpreterContext&> (runtime.getContext());
|
||||||
|
context.getEnvironment().mDialogueManager->startDialogue (ptr);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const int opcodeJournal = 0x2000133;
|
const int opcodeJournal = 0x2000133;
|
||||||
const int opcodeSetJournalIndex = 0x2000134;
|
const int opcodeSetJournalIndex = 0x2000134;
|
||||||
const int opcodeGetJournalIndex = 0x2000135;
|
const int opcodeGetJournalIndex = 0x2000135;
|
||||||
const int opcodeAddTopic = 0x200013a;
|
const int opcodeAddTopic = 0x200013a;
|
||||||
const int opcodeChoice = 0x2000a;
|
const int opcodeChoice = 0x2000a;
|
||||||
|
const int opcodeForceGreeting = 0x200014f;
|
||||||
|
const int opcodeForceGreetingExplicit = 0x2000150;
|
||||||
|
|
||||||
void registerExtensions (Compiler::Extensions& extensions)
|
void registerExtensions (Compiler::Extensions& extensions)
|
||||||
{
|
{
|
||||||
|
@ -129,6 +145,9 @@ namespace MWScript
|
||||||
extensions.registerFunction ("getjournalindex", 'l', "c", opcodeGetJournalIndex);
|
extensions.registerFunction ("getjournalindex", 'l', "c", opcodeGetJournalIndex);
|
||||||
extensions.registerInstruction ("addtopic", "S" , opcodeAddTopic);
|
extensions.registerInstruction ("addtopic", "S" , opcodeAddTopic);
|
||||||
extensions.registerInstruction ("choice", "/SlSlSlSlSlSlSlSlSlSlSlSlSlSlSlSl", opcodeChoice);
|
extensions.registerInstruction ("choice", "/SlSlSlSlSlSlSlSlSlSlSlSlSlSlSlSl", opcodeChoice);
|
||||||
|
extensions.registerInstruction("forcegreeting","",opcodeForceGreeting);
|
||||||
|
extensions.registerInstruction("forcegreeting","",opcodeForceGreeting,
|
||||||
|
opcodeForceGreetingExplicit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||||
|
@ -138,6 +157,8 @@ namespace MWScript
|
||||||
interpreter.installSegment5 (opcodeGetJournalIndex, new OpGetJournalIndex);
|
interpreter.installSegment5 (opcodeGetJournalIndex, new OpGetJournalIndex);
|
||||||
interpreter.installSegment5 (opcodeAddTopic, new OpAddTopic);
|
interpreter.installSegment5 (opcodeAddTopic, new OpAddTopic);
|
||||||
interpreter.installSegment3 (opcodeChoice,new OpChoice);
|
interpreter.installSegment3 (opcodeChoice,new OpChoice);
|
||||||
|
interpreter.installSegment5 (opcodeForceGreeting, new OpForceGreeting<ImplicitRef>);
|
||||||
|
interpreter.installSegment5 (opcodeForceGreetingExplicit, new OpForceGreeting<ExplicitRef>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,10 @@ op 0x20009: LoopAnim, explicit reference
|
||||||
op 0x2000a: Choice
|
op 0x2000a: Choice
|
||||||
op 0x2000b: PCRaiseRank
|
op 0x2000b: PCRaiseRank
|
||||||
op 0x2000c: PCLowerRank
|
op 0x2000c: PCLowerRank
|
||||||
op x20000d: PCJoinFaction
|
op 0x2000d: PCJoinFaction
|
||||||
opcodes 0x2000e-0x3ffff unused
|
op 0x2000e: PCGetRank implicit
|
||||||
|
op 0x2000f: PCGetRank explicit
|
||||||
|
opcodes 0x20010-0x3ffff unused
|
||||||
|
|
||||||
Segment 4:
|
Segment 4:
|
||||||
(not implemented yet)
|
(not implemented yet)
|
||||||
|
@ -140,4 +142,6 @@ op 0x200014b: GetSpell
|
||||||
op 0x200014c: GetSpell, explicit reference
|
op 0x200014c: GetSpell, explicit reference
|
||||||
op 0x200014d: ModDisposition
|
op 0x200014d: ModDisposition
|
||||||
op 0x200014e: ModDisposition, explicit reference
|
op 0x200014e: ModDisposition, explicit reference
|
||||||
opcodes 0x200014f-0x3ffffff unused
|
op 0x200014f: ForceGreeting
|
||||||
|
op 0x2000150: ForceGreeting, explicit reference
|
||||||
|
opcodes 0x2000151-0x3ffffff unused
|
||||||
|
|
|
@ -435,6 +435,53 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<class R>
|
||||||
|
class OpGetPCRank : public Interpreter::Opcode1
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
||||||
|
{
|
||||||
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
|
std::string factionID = "";
|
||||||
|
if(arg0 >0)
|
||||||
|
{
|
||||||
|
factionID = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
|
runtime.pop();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(MWWorld::Class::get(ptr).getNpcStats(ptr).mFactionRank.empty())
|
||||||
|
{
|
||||||
|
//throw exception?
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).mFactionRank.begin()->first;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MWScript::InterpreterContext& context
|
||||||
|
= static_cast<MWScript::InterpreterContext&> (runtime.getContext());
|
||||||
|
MWWorld::Ptr player = context.getEnvironment().mWorld->getPlayer().getPlayer();
|
||||||
|
if(factionID!="")
|
||||||
|
{
|
||||||
|
if(MWWorld::Class::get(player).getNpcStats(player).mFactionRank.find(factionID) != MWWorld::Class::get(player).getNpcStats(player).mFactionRank.end())
|
||||||
|
{
|
||||||
|
runtime.push(MWWorld::Class::get(player).getNpcStats(player).mFactionRank[factionID]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
runtime.push(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
runtime.push(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template<class R>
|
template<class R>
|
||||||
class OpModDisposition : public Interpreter::Opcode0
|
class OpModDisposition : public Interpreter::Opcode0
|
||||||
{
|
{
|
||||||
|
@ -492,6 +539,8 @@ namespace MWScript
|
||||||
const int opcodePCRaiseRank = 0x2000b;
|
const int opcodePCRaiseRank = 0x2000b;
|
||||||
const int opcodePCLowerRank = 0x2000c;
|
const int opcodePCLowerRank = 0x2000c;
|
||||||
const int opcodePCJoinFaction = 0x2000d;
|
const int opcodePCJoinFaction = 0x2000d;
|
||||||
|
const int opcodeGetPCRank = 0x2000e;
|
||||||
|
const int opcodeGetPCRankExplicit = 0x2000f;
|
||||||
const int opcodeModDisposition = 0x200014d;
|
const int opcodeModDisposition = 0x200014d;
|
||||||
const int opcodeModDispositionExplicit = 0x200014e;
|
const int opcodeModDispositionExplicit = 0x200014e;
|
||||||
|
|
||||||
|
@ -576,6 +625,7 @@ namespace MWScript
|
||||||
extensions.registerInstruction("pcjoinfaction","/S",opcodePCJoinFaction);
|
extensions.registerInstruction("pcjoinfaction","/S",opcodePCJoinFaction);
|
||||||
extensions.registerInstruction("moddisposition","l",opcodeModDisposition,
|
extensions.registerInstruction("moddisposition","l",opcodeModDisposition,
|
||||||
opcodeModDispositionExplicit);
|
opcodeModDispositionExplicit);
|
||||||
|
extensions.registerFunction("getpcrank",'l',"/S",opcodeGetPCRank,opcodeGetPCRankExplicit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||||
|
@ -645,6 +695,8 @@ namespace MWScript
|
||||||
interpreter.installSegment3(opcodePCJoinFaction,new OpPCJoinFaction);
|
interpreter.installSegment3(opcodePCJoinFaction,new OpPCJoinFaction);
|
||||||
interpreter.installSegment5(opcodeModDisposition,new OpModDisposition<ImplicitRef>);
|
interpreter.installSegment5(opcodeModDisposition,new OpModDisposition<ImplicitRef>);
|
||||||
interpreter.installSegment5(opcodeModDispositionExplicit,new OpModDisposition<ExplicitRef>);
|
interpreter.installSegment5(opcodeModDispositionExplicit,new OpModDisposition<ExplicitRef>);
|
||||||
|
interpreter.installSegment3(opcodeGetPCRank,new OpGetPCRank<ImplicitRef>);
|
||||||
|
interpreter.installSegment3(opcodeGetPCRankExplicit,new OpGetPCRank<ExplicitRef>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Version=0.11
|
Version=${OPENMW_VERSION}
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=OpenMW Launcher
|
Name=OpenMW Launcher
|
||||||
GenericName=Role Playing Game
|
GenericName=Role Playing Game
|
||||||
|
|
|
@ -93,7 +93,7 @@ rtt size = 512
|
||||||
reflect terrain = true
|
reflect terrain = true
|
||||||
reflect statics = false
|
reflect statics = false
|
||||||
reflect small statics = false
|
reflect small statics = false
|
||||||
reflect actors = true
|
reflect actors = false
|
||||||
reflect misc = false
|
reflect misc = false
|
||||||
|
|
||||||
# Enable underwater effect. It is not resource intensive, so only disable it if you have problems.
|
# Enable underwater effect. It is not resource intensive, so only disable it if you have problems.
|
||||||
|
|
|
@ -18,7 +18,6 @@ void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool
|
||||||
// manager before the main gui system itself, otherwise the main
|
// manager before the main gui system itself, otherwise the main
|
||||||
// object will get the chance to spit out a few messages before we
|
// object will get the chance to spit out a few messages before we
|
||||||
// can able to disable it.
|
// can able to disable it.
|
||||||
/// \todo - can't avoid this with MyGUI 3.2?
|
|
||||||
|
|
||||||
std::string theLogFile = std::string(MYGUI_PLATFORM_LOG_FILENAME);
|
std::string theLogFile = std::string(MYGUI_PLATFORM_LOG_FILENAME);
|
||||||
if(!logDir.empty())
|
if(!logDir.empty())
|
||||||
|
@ -26,9 +25,9 @@ void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool
|
||||||
|
|
||||||
// Set up OGRE platform. We might make this more generic later.
|
// Set up OGRE platform. We might make this more generic later.
|
||||||
mPlatform = new OgrePlatform();
|
mPlatform = new OgrePlatform();
|
||||||
|
LogManager::getInstance().setSTDOutputEnabled(logging);
|
||||||
mPlatform->initialise(wnd, mgr, "General", theLogFile);
|
mPlatform->initialise(wnd, mgr, "General", theLogFile);
|
||||||
|
|
||||||
LogManager::getInstance().setSTDOutputEnabled(logging);
|
|
||||||
|
|
||||||
// Create GUI
|
// Create GUI
|
||||||
mGui = new Gui();
|
mGui = new Gui();
|
||||||
|
|
Loading…
Reference in a new issue