Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if(NOT MSVC)
endif()

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Set the data path depending on the platform
if(WIN32)
Expand Down Expand Up @@ -138,20 +139,9 @@ set(OD_OPT_FLAGS CACHE STRING "Optimization and optional compilation flags")
set(OD_CXX11_FLAGS CACHE STRING "Compilation flags to enable C++11 support")

if(MSVC)
# C++11 compilation flag is activated by default
# The language standard is driven by CMAKE_CXX_STANDARD above.
# Optimisation flags can be added if deemed useful
else()
include(CheckCXXCompilerFlag)
if(NOT OD_CXX11_FLAGS)
CHECK_CXX_COMPILER_FLAG("-std=c++11" OD_CXX11_FLAG_SUPPORTED)
CHECK_CXX_COMPILER_FLAG("-std=gnu++11" OD_CXXGNU11_FLAG_SUPPORTED)
# MinGW supports CXX11 flag but do not compile with it. However, it works with gnu++11
if(OD_CXX11_FLAG_SUPPORTED AND NOT MINGW)
set(OD_CXX11_FLAGS "-std=c++11" CACHE STRING "Compilation flags to enable C++11 support" FORCE)
elseif(OD_CXX11_FLAG_SUPPORTED)
set(OD_CXX11_FLAGS "-std=gnu++11" CACHE STRING "Compilation flags to enable C++11 support" FORCE)
endif()
endif()
if(OD_ENABLE_WARNINGS)
# Help getting compilation warnings
set(OD_OPT_FLAGS "${OD_OPT_FLAGS} -Wall -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wold-style-cast")
Expand Down Expand Up @@ -210,7 +200,7 @@ if(OD_USE_SFML_WINDOW)
add_definitions(-DOD_USE_SFML_WINDOW)
endif()

set(CMAKE_CXX_FLAGS "${OD_CXX11_FLAGS} ${OD_OPT_FLAGS} ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${OD_OPT_FLAGS} ${CMAKE_CXX_FLAGS}")
message(STATUS "CMake CXX Flags: " ${CMAKE_CXX_FLAGS})

set(EXTRA_LIBRARIES "")
Expand Down
14 changes: 7 additions & 7 deletions cmake/config/resources.cfg.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[Graphics]
FileSystem=@CMAKE_INSTALL_PREFIX@/share/OGRE/Media/RTShaderLib
FileSystem=@CMAKE_INSTALL_PREFIX@/share/OGRE/Media/RTShaderLib/GLSL
FileSystem=@CMAKE_INSTALL_PREFIX@/share/OGRE/Media/RTShaderLib/HLSL
FileSystem=@CMAKE_INSTALL_PREFIX@/share/OGRE/Media/RTShaderLib/HLSL_Cg
FileSystem=@CMAKE_INSTALL_PREFIX@/share/OGRE/Media/RTShaderLib/materials
FileSystem=@CMAKE_INSTALL_PREFIX@/share/OGRE/Media/RTShaderLib/../Main
[OgreInternal]
FileSystem=@OGRE_MEDIA_DIR@/Main

[Graphics]
# Our hand-written .vert/.frag live in the Graphics group and #include
# OgreUnifiedShader.h plus the RTShaderLib FFPLib_*/SGXLib_* sources. Ogre resolves
# those includes within the *same* resource group, so Main has to be repeated here
# even though [OgreInternal] already lists it.
# RTShaderLib is deliberately listed ONLY here: adding it to [OgreInternal] as well
# makes RTSSamplers.material parse twice and Ogre then throws
# "Sampler 'Ogre/ShadowSampler' already exists" during startup.
FileSystem=@RTSHADER_DIR@
FileSystem=@OGRE_MEDIA_DIR@/Main
FileSystem=materials/scripts
Expand Down
2 changes: 0 additions & 2 deletions gui/WindowSettings.layout
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
<Property name="Area" value="{{0,32},{0,67},{0,327},{0,80}}" />
<Property name="Text" value="" />
<Property name="VerticalSlider" value="False" />
<Property name="AutoRenderingSurface" value="True" />
<Property name="MaximumValue" value="100" />
<Property name="ClickStepSize" value="5" />
</Window>
Expand Down Expand Up @@ -168,7 +167,6 @@
<Property name="Area" value="{{0,32},{0,150},{0,327},{0,163}}" />
<Property name="Text" value="" />
<Property name="VerticalSlider" value="False" />
<Property name="AutoRenderingSurface" value="True" />
<Property name="MaximumValue" value="250" />
<Property name="ClickStepSize" value="5" />
</Window>
Expand Down
2 changes: 1 addition & 1 deletion materials/RTShaderLib/GLSL/RTSLib_Colour.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
#define COLOUR_TRANSFER(colour) colour.rgb = pow(colour.rgb, vec3_splat(1.0/2.2))
#else
#define COLOUR_TRANSFER(colour)
#endif
#endif
2 changes: 1 addition & 1 deletion materials/RTShaderLib/GLSL/SGXLib_NormalMap.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ void SGX_Generate_Parallax_Texcoord(in sampler2D normalHeightMap,
float weight = afterDepth / (afterDepth - beforeDepth);
newTexCoord = mix(newTexCoord, prevTexCoords, weight);
#endif
}
}
5 changes: 3 additions & 2 deletions materials/scripts/T2HammerGood.material
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ material T2HammerGood : RTSS/NormalMapping_MultiPass
texture T2HammerGoodNormal.png
rtshader_system
{
normal_map }
normal_map tangent_space
}
}
}

pass decal
{
Expand All @@ -35,4 +36,4 @@ material T2HammerGood : RTSS/NormalMapping_MultiPass
}
}
}
}
}
5 changes: 3 additions & 2 deletions materials/scripts/T2ShieldEvil.material
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ material T2ShieldEvil : RTSS/NormalMapping_MultiPass
texture T2ShieldEvilNormal.png
rtshader_system
{
normal_map }
normal_map tangent_space
}
}
}

pass decal
{
Expand All @@ -35,4 +36,4 @@ material T2ShieldEvil : RTSS/NormalMapping_MultiPass
}
}
}
}
}
5 changes: 3 additions & 2 deletions materials/scripts/T2ShieldGood.material
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ material T2ShieldGood : RTSS/NormalMapping_MultiPass
texture T2ShieldGoodNormal.png
rtshader_system
{
normal_map }
normal_map tangent_space
}
}
}

pass decal
{
Expand All @@ -35,4 +36,4 @@ material T2ShieldGood : RTSS/NormalMapping_MultiPass
}
}
}
}
}
5 changes: 3 additions & 2 deletions materials/scripts/T2SwordGood.material
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ material T2SwordGood : RTSS/NormalMapping_MultiPass
texture T2SwordGoodNormal.png
rtshader_system
{
normal_map }
normal_map tangent_space
}
}
}

pass decal
{
Expand All @@ -35,4 +36,4 @@ material T2SwordGood : RTSS/NormalMapping_MultiPass
}
}
}
}
}
5 changes: 3 additions & 2 deletions materials/scripts/T3HammerGood.material
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ material T3HammerGood : RTSS/NormalMapping_MultiPass
texture T3HammerGoodNormal.png
rtshader_system
{
normal_map }
normal_map tangent_space
}
}
}

pass decal
{
Expand All @@ -35,4 +36,4 @@ material T3HammerGood : RTSS/NormalMapping_MultiPass
}
}
}
}
}
5 changes: 3 additions & 2 deletions materials/scripts/T3ShieldEvil.material
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ material T3ShieldEvil : RTSS/NormalMapping_MultiPass
texture T3ShieldEvilNormal.png
rtshader_system
{
normal_map }
normal_map tangent_space
}
}
}

pass decal
{
Expand All @@ -35,4 +36,4 @@ material T3ShieldEvil : RTSS/NormalMapping_MultiPass
}
}
}
}
}
5 changes: 3 additions & 2 deletions materials/scripts/T3ShieldGood.material
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ material T3ShieldGood : RTSS/NormalMapping_MultiPass
texture T3ShieldGoodNormal.png
rtshader_system
{
normal_map }
normal_map tangent_space
}
}
}

pass decal
{
Expand All @@ -35,4 +36,4 @@ material T3ShieldGood : RTSS/NormalMapping_MultiPass
}
}
}
}
}
3 changes: 2 additions & 1 deletion source/creaturemood/CreatureMoodHunger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <iostream>
#include "creaturemood/CreatureMoodHunger.h"

#include <iostream>

#include "creaturemood/CreatureMoodManager.h"
#include "entities/Creature.h"

Expand Down
3 changes: 2 additions & 1 deletion source/creaturemood/CreatureMoodWakefulness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <iostream>
#include "creaturemood/CreatureMoodWakefulness.h"

#include <iostream>

#include "creaturemood/CreatureMoodManager.h"
#include "entities/Creature.h"

Expand Down
6 changes: 0 additions & 6 deletions source/modes/MenuModeMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ void MenuModeMain::activate()
CEGUI::Window* window = getModeManager().getGui().getGuiSheet(Gui::mainMenu);
OD_ASSERT_TRUE(window != nullptr);

CEGUI::Sizef rootSize = window->getPixelSize();
OD_LOG_INF("MenuModeMain root window size: " + std::to_string(rootSize.d_width) + "x" + std::to_string(rootSize.d_height));
OD_LOG_INF("MenuModeMain root window area: '" + std::string(window->getProperty("Area").c_str()) + "'");

window->getChild(WINDOW_SKIRMISH)->hide();
window->getChild(WINDOW_MULTIPLAYER)->hide();
window->getChild(WINDOW_EDITOR)->hide();
Expand All @@ -162,8 +158,6 @@ void MenuModeMain::activate()

ODFrameListener::getSingleton().stopGameRenderer();
ODFrameListener::getSingleton().createMainMenuScene();

// Settings window is hidden by default; user opens it via Settings button.
}

void MenuModeMain::connectModeChangeEvent(const std::string& buttonName, AbstractModeManager::ModeType mode)
Expand Down
28 changes: 0 additions & 28 deletions source/modes/SettingsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,8 @@

#include <SFML/Audio/Listener.hpp>

#include <iostream>

namespace
{
void dumpWindowTree(CEGUI::Window* window, int depth = 0)
{
if(window == nullptr)
return;

CEGUI::Vector2f pos = window->getPixelPosition();
CEGUI::Sizef size = window->getPixelSize();
std::string indent(depth * 2, ' ');
CEGUI::Rectf inner = window->getUnclippedInnerRect().get();
std::string msg = indent + "CEGUI window: " + std::string(window->getName().c_str()) +
" type: " + std::string(window->getType().c_str()) +
" visible: " + std::string(window->isVisible() ? "yes" : "no") +
" pos: [" + std::to_string(pos.d_x) + "," + std::to_string(pos.d_y) +
"] size: [" + std::to_string(size.d_width) + "," + std::to_string(size.d_height) + "]" +
" inner: [" + std::to_string(inner.left()) + "," + std::to_string(inner.top()) +
"," + std::to_string(inner.right()) + "," + std::to_string(inner.bottom()) + "]" +
" area: '" + std::string(window->getProperty("Area").c_str()) + "'" +
" text: '" + std::string(window->getText().c_str()) + "'";
std::cerr << msg << std::endl;

for(size_t i = 0; i < window->getChildCount(); ++i)
dumpWindowTree(window->getChildAtIdx(i), depth + 1);
}

float computeUiScale()
{
CEGUI::Sizef displaySize = CEGUI::System::getSingleton().getRenderer()->getDisplaySize();
Expand Down Expand Up @@ -657,8 +631,6 @@ void SettingsWindow::show()
// Input only allowed on this window when visible.
mSettingsWindow->setModalState(true);
mSettingsWindow->show();
OD_LOG_INF("SettingsWindow tree dump:");
dumpWindowTree(mSettingsWindow);
}
}

Expand Down
1 change: 0 additions & 1 deletion source/network/ODPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <fstream>
#include "network/ODPacket.h"

#include <fstream>
Expand Down
1 change: 1 addition & 0 deletions source/network/ODSocketServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

ODSocketServer::ODSocketServer():
mThread(nullptr),
mActualPort(0),
mIsConnected(false)
{
}
Expand Down
4 changes: 3 additions & 1 deletion source/render/ODFrameListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ bool ODFrameListener::frameStarted(const Ogre::FrameEvent& evt)
void ODFrameListener::renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String& cameraName,
bool&)
{
if(queueGroupId == RenderManager::OD_RENDER_QUEUE_ID_GUI && cameraName == mCameraManager.getActiveCamera()->getName())
const Ogre::Camera* activeCamera = mCameraManager.getActiveCamera();
if(queueGroupId == RenderManager::OD_RENDER_QUEUE_ID_GUI &&
activeCamera != nullptr && cameraName == activeCamera->getName())
{
Ogre::Root::getSingleton().getRenderSystem()->clearFrameBuffer(Ogre::FBT_DEPTH);
CEGUI::System::getSingleton().renderAllGUIContexts();
Expand Down
Loading