mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:23:52 +00:00
Feature #37 (In Progress) Render Path Grid
added "togglepathgrid" script command
This commit is contained in:
parent
de5b692f9f
commit
5328853445
4 changed files with 47 additions and 19 deletions
|
@ -255,8 +255,14 @@ if (APPLE)
|
||||||
"${APP_BUNDLE_DIR}/Contents/Resources/OpenMW.icns" COPYONLY)
|
"${APP_BUNDLE_DIR}/Contents/Resources/OpenMW.icns" COPYONLY)
|
||||||
|
|
||||||
# prepare plugins
|
# prepare plugins
|
||||||
if (${CMAKE_BUILD_TYPE} MATCHES "Release" OR
|
if (${CMAKE_BUILD_TYPE} MATCHES "Release")
|
||||||
${CMAKE_BUILD_TYPE} MATCHES "RelWithDebugInfo")
|
set(OPENMW_RELEASE_BUILD 1)
|
||||||
|
endif()
|
||||||
|
if (${CMAKE_BUILD_TYPE} MATCHES "Release")
|
||||||
|
set(OPENMW_RELEASE_BUILD 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (${OPENMW_RELEASE_BUILD})
|
||||||
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_REL})
|
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_REL})
|
||||||
else()
|
else()
|
||||||
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_DBG})
|
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_DBG})
|
||||||
|
|
|
@ -115,10 +115,11 @@ op 0x2000136: GetPCCell
|
||||||
op 0x2000137: GetButtonPressed
|
op 0x2000137: GetButtonPressed
|
||||||
op 0x2000138: SkipAnim
|
op 0x2000138: SkipAnim
|
||||||
op 0x2000139: SkipAnim, expplicit reference
|
op 0x2000139: SkipAnim, expplicit reference
|
||||||
op 0x200013b: twf
|
op 0x200013b: ToggleWireframe
|
||||||
op 0x200013c: FadeIn
|
op 0x200013c: FadeIn
|
||||||
op 0x200013d: FadeOut
|
op 0x200013d: FadeOut
|
||||||
op 0x200013e: FadeTo
|
op 0x200013e: FadeTo
|
||||||
op 0x200013f: GetCurrentWeather
|
op 0x200013f: GetCurrentWeather
|
||||||
op 0x2000140: ChangeWeather
|
op 0x2000140: ChangeWeather
|
||||||
opcodes 0x2000141-0x3ffffff unused
|
op 0x2000141: TogglePathgrid
|
||||||
|
opcodes 0x2000142-0x3ffffff unused
|
||||||
|
|
|
@ -124,6 +124,22 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class OpTogglePathgrind : public Interpreter::Opcode0
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
|
{
|
||||||
|
InterpreterContext& context =
|
||||||
|
static_cast<InterpreterContext&> (runtime.getContext());
|
||||||
|
|
||||||
|
bool enabled =
|
||||||
|
context.getWorld().toggleRenderMode (MWWorld::World::Render_Wireframe);
|
||||||
|
|
||||||
|
context.report (enabled ?
|
||||||
|
"Path Grid rendering -> On" : "Path Grid Rendering -> Off");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class OpFadeIn : public Interpreter::Opcode0
|
class OpFadeIn : public Interpreter::Opcode0
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -187,6 +203,7 @@ namespace MWScript
|
||||||
const int opcodeFadeIn = 0x200013c;
|
const int opcodeFadeIn = 0x200013c;
|
||||||
const int opcodeFadeOut = 0x200013d;
|
const int opcodeFadeOut = 0x200013d;
|
||||||
const int opcodeFadeTo = 0x200013e;
|
const int opcodeFadeTo = 0x200013e;
|
||||||
|
const int opcodeTogglePathgrid = 0x2000141;
|
||||||
|
|
||||||
void registerExtensions (Compiler::Extensions& extensions)
|
void registerExtensions (Compiler::Extensions& extensions)
|
||||||
{
|
{
|
||||||
|
@ -204,6 +221,8 @@ namespace MWScript
|
||||||
extensions.registerInstruction ("fadein", "f", opcodeFadeIn);
|
extensions.registerInstruction ("fadein", "f", opcodeFadeIn);
|
||||||
extensions.registerInstruction ("fadeout", "f", opcodeFadeOut);
|
extensions.registerInstruction ("fadeout", "f", opcodeFadeOut);
|
||||||
extensions.registerInstruction ("fadeto", "ff", opcodeFadeTo);
|
extensions.registerInstruction ("fadeto", "ff", opcodeFadeTo);
|
||||||
|
extensions.registerInstruction ("togglepathgrid", "", opcodeTogglePathgrid);
|
||||||
|
extensions.registerInstruction ("tpg", "", opcodeTogglePathgrid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||||
|
@ -220,6 +239,7 @@ namespace MWScript
|
||||||
interpreter.installSegment5 (opcodeFadeIn, new OpFadeIn);
|
interpreter.installSegment5 (opcodeFadeIn, new OpFadeIn);
|
||||||
interpreter.installSegment5 (opcodeFadeOut, new OpFadeOut);
|
interpreter.installSegment5 (opcodeFadeOut, new OpFadeOut);
|
||||||
interpreter.installSegment5 (opcodeFadeTo, new OpFadeTo);
|
interpreter.installSegment5 (opcodeFadeTo, new OpFadeTo);
|
||||||
|
interpreter.installSegment5 (opcodeTogglePathgrid, new OpTogglePathgrind);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,8 @@ namespace MWWorld
|
||||||
enum RenderMode
|
enum RenderMode
|
||||||
{
|
{
|
||||||
Render_CollisionDebug,
|
Render_CollisionDebug,
|
||||||
Render_Wireframe
|
Render_Wireframe,
|
||||||
|
Render_Pathgrid
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue