mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 16:20:21 +00:00
Feature #37 (In Progress) Render Path Grid
added "togglepathgrid" script command
This commit is contained in:
parent
de5b692f9f
commit
5328853445
@ -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
|
||||||
|
@ -106,7 +106,7 @@ namespace MWScript
|
|||||||
"Collision Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
|
"Collision Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class OpToggleWireframe : public Interpreter::Opcode0
|
class OpToggleWireframe : public Interpreter::Opcode0
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -123,7 +123,23 @@ namespace MWScript
|
|||||||
"Wireframe Rendering -> On" : "Wireframe Rendering -> Off");
|
"Wireframe Rendering -> On" : "Wireframe Rendering -> Off");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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:
|
||||||
@ -135,11 +151,11 @@ namespace MWScript
|
|||||||
|
|
||||||
Interpreter::Type_Float time = runtime[0].mFloat;
|
Interpreter::Type_Float time = runtime[0].mFloat;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
context.getWorld().getFader()->fadeIn(time);
|
context.getWorld().getFader()->fadeIn(time);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class OpFadeOut : public Interpreter::Opcode0
|
class OpFadeOut : public Interpreter::Opcode0
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -151,11 +167,11 @@ namespace MWScript
|
|||||||
|
|
||||||
Interpreter::Type_Float time = runtime[0].mFloat;
|
Interpreter::Type_Float time = runtime[0].mFloat;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
context.getWorld().getFader()->fadeOut(time);
|
context.getWorld().getFader()->fadeOut(time);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class OpFadeTo : public Interpreter::Opcode0
|
class OpFadeTo : public Interpreter::Opcode0
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -167,10 +183,10 @@ namespace MWScript
|
|||||||
|
|
||||||
Interpreter::Type_Float alpha = runtime[0].mFloat;
|
Interpreter::Type_Float alpha = runtime[0].mFloat;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
Interpreter::Type_Float time = runtime[0].mFloat;
|
Interpreter::Type_Float time = runtime[0].mFloat;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
context.getWorld().getFader()->fadeTo(alpha, time);
|
context.getWorld().getFader()->fadeTo(alpha, time);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -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,13 +63,14 @@ namespace MWWorld
|
|||||||
enum RenderMode
|
enum RenderMode
|
||||||
{
|
{
|
||||||
Render_CollisionDebug,
|
Render_CollisionDebug,
|
||||||
Render_Wireframe
|
Render_Wireframe,
|
||||||
|
Render_Pathgrid
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
MWRender::RenderingManager* mRendering;
|
MWRender::RenderingManager* mRendering;
|
||||||
|
|
||||||
MWWorld::WeatherManager* mWeatherManager;
|
MWWorld::WeatherManager* mWeatherManager;
|
||||||
|
|
||||||
MWWorld::Scene *mWorldScene;
|
MWWorld::Scene *mWorldScene;
|
||||||
@ -106,13 +107,13 @@ namespace MWWorld
|
|||||||
Environment& environment, const std::string& encoding);
|
Environment& environment, const std::string& encoding);
|
||||||
|
|
||||||
~World();
|
~World();
|
||||||
|
|
||||||
OEngine::Render::Fader* getFader();
|
OEngine::Render::Fader* getFader();
|
||||||
|
|
||||||
Ptr::CellStore *getExterior (int x, int y);
|
Ptr::CellStore *getExterior (int x, int y);
|
||||||
|
|
||||||
Ptr::CellStore *getInterior (const std::string& name);
|
Ptr::CellStore *getInterior (const std::string& name);
|
||||||
|
|
||||||
void adjustSky();
|
void adjustSky();
|
||||||
|
|
||||||
MWWorld::Player& getPlayer();
|
MWWorld::Player& getPlayer();
|
||||||
@ -125,7 +126,7 @@ namespace MWWorld
|
|||||||
|
|
||||||
bool hasCellChanged() const;
|
bool hasCellChanged() const;
|
||||||
///< Has the player moved to a different cell, since the last frame?
|
///< Has the player moved to a different cell, since the last frame?
|
||||||
|
|
||||||
bool isCellExterior() const;
|
bool isCellExterior() const;
|
||||||
bool isCellQuasiExterior() const;
|
bool isCellQuasiExterior() const;
|
||||||
|
|
||||||
@ -163,9 +164,9 @@ namespace MWWorld
|
|||||||
|
|
||||||
bool toggleSky();
|
bool toggleSky();
|
||||||
///< \return Resulting mode
|
///< \return Resulting mode
|
||||||
|
|
||||||
void changeWeather(const std::string& region, const unsigned int id);
|
void changeWeather(const std::string& region, const unsigned int id);
|
||||||
|
|
||||||
int getCurrentWeather() const;
|
int getCurrentWeather() const;
|
||||||
|
|
||||||
int getMasserPhase() const;
|
int getMasserPhase() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user