More style fixes
parent
3b585d9f51
commit
7d8b56d9ab
|
@ -403,12 +403,16 @@ bool CApplication::Create()
|
|||
defaultValues = true;
|
||||
}
|
||||
|
||||
if (GetConfigFile().GetStringProperty("Language", "Lang", path)) {
|
||||
if (GetConfigFile().GetStringProperty("Language", "Lang", path))
|
||||
{
|
||||
Language language;
|
||||
if (ParseLanguage(path, language)) {
|
||||
if (ParseLanguage(path, language))
|
||||
{
|
||||
m_language = language;
|
||||
GetLogger()->Info("Setting language '%s' from ini file\n", path.c_str());
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
GetLogger()->Error("Invalid language '%s' in ini file\n", path.c_str());
|
||||
}
|
||||
}
|
||||
|
@ -487,14 +491,17 @@ bool CApplication::Create()
|
|||
std::getline(resolution, ws, 'x');
|
||||
std::getline(resolution, hs, 'x');
|
||||
int w = 800, h = 600;
|
||||
if (!ws.empty() && !hs.empty()) {
|
||||
if (!ws.empty() && !hs.empty())
|
||||
{
|
||||
w = atoi(ws.c_str());
|
||||
h = atoi(hs.c_str());
|
||||
}
|
||||
|
||||
// Why not just set m_deviceConfig.size to w,h? Because this way if the resolution is no longer supported (e.g. changimg monitor) defaults will be used instead
|
||||
for(auto it = modes.begin(); it != modes.end(); ++it) {
|
||||
if (it->x == w && it->y == h) {
|
||||
for (auto it = modes.begin(); it != modes.end(); ++it)
|
||||
{
|
||||
if (it->x == w && it->y == h)
|
||||
{
|
||||
m_deviceConfig.size = *it;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,8 @@ class CInput;
|
|||
class CObjectManager;
|
||||
class CPathManager;
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
class CModelManager;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
class CApplication;
|
||||
class CRobotMain;
|
||||
struct Event;
|
||||
namespace Ui {
|
||||
namespace Ui
|
||||
{
|
||||
class CMainDialog;
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,8 @@ int SDL_MAIN_FUNC(int argc, char *argv[])
|
|||
logger.Info("%s starting\n", COLOBOT_FULLNAME);
|
||||
|
||||
int code = 0;
|
||||
while(true) {
|
||||
while (true)
|
||||
{
|
||||
CSystemUtils* systemUtils = CSystemUtils::Create(); // platform-specific utils
|
||||
systemUtils->Init();
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
#include <string>
|
||||
|
||||
|
||||
enum PauseType {
|
||||
enum PauseType
|
||||
{
|
||||
PAUSE_NONE = 0,
|
||||
PAUSE_USER,
|
||||
PAUSE_SATCOM,
|
||||
|
|
|
@ -435,14 +435,15 @@ bool CImage::SavePNG(const std::string& fileName)
|
|||
return true;
|
||||
}
|
||||
|
||||
void CImage::SetDataPixels(void *pixels){
|
||||
|
||||
void CImage::SetDataPixels(void *pixels)
|
||||
{
|
||||
Uint8* srcPixels = static_cast<Uint8*> (pixels);
|
||||
Uint8* resultPixels = static_cast<Uint8*> (m_data->surface->pixels);
|
||||
|
||||
Uint32 pitch = m_data->surface->pitch;
|
||||
|
||||
for(int line = 0; line < m_data->surface->h; ++line) {
|
||||
for (int line = 0; line < m_data->surface->h; ++line)
|
||||
{
|
||||
Uint32 pos = line * pitch;
|
||||
memcpy(&resultPixels[pos], &srcPixels[pos], pitch);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
|
||||
#include <cstring>
|
||||
|
||||
namespace IOUtils {
|
||||
namespace IOUtils
|
||||
{
|
||||
|
||||
//! Writes a binary number to output stream
|
||||
/**
|
||||
|
@ -148,5 +149,5 @@ std::string ReadBinaryString(std::istream &istr)
|
|||
return str;
|
||||
}
|
||||
|
||||
}; // namespace IOUtils
|
||||
} // namespace IOUtils
|
||||
|
||||
|
|
|
@ -148,7 +148,8 @@ void CPathManager::InitPaths()
|
|||
|
||||
void CPathManager::LoadModsFromDir(const std::string &dir)
|
||||
{
|
||||
try {
|
||||
try
|
||||
{
|
||||
#if PLATFORM_WINDOWS
|
||||
boost::filesystem::directory_iterator iterator(CSystemUtilsWindows::UTF8_Decode(dir));
|
||||
#else
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
namespace RegexUtils {
|
||||
namespace RegexUtils
|
||||
{
|
||||
|
||||
class AssertRegexMatchError : public std::runtime_error
|
||||
{
|
||||
|
|
|
@ -81,7 +81,8 @@ std::streambuf::int_type COutputStreamBuffer::overflow(std::streambuf::int_type
|
|||
|
||||
pbump(-bytes_written);
|
||||
// write final char
|
||||
if (ch != traits_type::eof()) {
|
||||
if (ch != traits_type::eof())
|
||||
{
|
||||
bytes_written = PHYSFS_write(m_file, &ch, 1, 1);
|
||||
if (bytes_written <= 0)
|
||||
return traits_type::eof();
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
namespace StrUtils {
|
||||
namespace StrUtils
|
||||
{
|
||||
|
||||
//! Converts a value to string
|
||||
/** If given, \a ok is set to true/false on success/failure.
|
||||
|
@ -83,5 +84,5 @@ int Utf8CharSizeAt(const std::string &str, unsigned int pos);
|
|||
//! Returns the length in characters of UTF-8 string \a str
|
||||
size_t Utf8StringLength(const std::string &str);
|
||||
|
||||
}; // namespace StrUtil
|
||||
} // namespace StrUtil
|
||||
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
ColorHSV RGB2HSV(Color color)
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \struct Color
|
||||
|
|
|
@ -43,7 +43,8 @@ struct ImageData;
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \struct DeviceConfig
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
|
||||
#include "graphics/core/framebuffer.h"
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
CDefaultFramebuffer::CDefaultFramebuffer(const FramebufferParams& params)
|
||||
: m_width(params.width), m_height(params.height), m_depth(params.depth)
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \struct FramebufferParams
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \enum LightType
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \struct Material
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
CNullDevice::CNullDevice()
|
||||
{
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
#include "graphics/core/device.h"
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \class CNullDevice
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
|
@ -252,11 +253,12 @@ enum TexGenMode
|
|||
*/
|
||||
struct TextureGenerationParams
|
||||
{
|
||||
struct
|
||||
struct Coord
|
||||
{
|
||||
TexGenMode mode;
|
||||
float plane[4];
|
||||
} coords[4];
|
||||
};
|
||||
Coord coords[4];
|
||||
|
||||
TextureGenerationParams()
|
||||
{
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,7 +41,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
//! Changes the level of transparency of an object and objects transported (battery & cargo)
|
||||
|
@ -170,7 +171,8 @@ void CCamera::SetBlood(bool enable)
|
|||
m_blood = enable;
|
||||
}
|
||||
|
||||
bool CCamera::GetBlood() {
|
||||
bool CCamera::GetBlood()
|
||||
{
|
||||
return m_blood;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@ class CInput;
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
|
@ -130,7 +131,8 @@ enum CameraOverEffect
|
|||
\brief Camera moving in 3D scene
|
||||
|
||||
... */
|
||||
class CCamera {
|
||||
class CCamera
|
||||
{
|
||||
public:
|
||||
CCamera();
|
||||
~CCamera();
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
const int CLOUD_LINE_PREALLOCATE_COUNT = 100;
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
class CEngine;
|
||||
class CTerrain;
|
||||
|
|
|
@ -55,7 +55,8 @@
|
|||
template<> Gfx::CEngine* CSingleton<Gfx::CEngine>::m_instance = nullptr;
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
CEngine::CEngine(CApplication *app)
|
||||
{
|
||||
|
@ -4514,7 +4515,8 @@ void CEngine::DrawBackgroundImage()
|
|||
Math::Point scale;
|
||||
scale.x = static_cast<float>(m_size.x) / static_cast<float>(m_backgroundTex.originalSize.x);
|
||||
scale.y = static_cast<float>(m_size.y) / static_cast<float>(m_backgroundTex.originalSize.y);
|
||||
if (scale.x > scale.y) {
|
||||
if (scale.x > scale.y)
|
||||
{
|
||||
scale.y /= scale.x;
|
||||
scale.x = 1;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,8 @@ struct Event;
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
class CDevice;
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
void LightProgression::Init(float value)
|
||||
|
|
|
@ -33,7 +33,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \struct LightProgression
|
||||
|
@ -236,5 +237,5 @@ protected:
|
|||
std::vector<int> m_lightMap;
|
||||
};
|
||||
|
||||
}; // namespace Gfx
|
||||
} // namespace Gfx
|
||||
|
||||
|
|
|
@ -39,7 +39,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
CLightning::CLightning(CEngine* engine)
|
||||
|
|
|
@ -35,7 +35,8 @@ class CSoundInterface;
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
class CEngine;
|
||||
class CTerrain;
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
|
||||
#include <cstdio>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
COldModelManager::COldModelManager(CEngine* engine)
|
||||
{
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
class CEngine;
|
||||
class CModelFile;
|
||||
|
|
|
@ -39,7 +39,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
const float FOG_HSUP = 10.0f;
|
||||
|
|
|
@ -36,7 +36,8 @@ class CSoundInterface;
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
const short MAXPARTICULE = 500;
|
||||
const short MAXPARTITYPE = 5;
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
const int PLANET_PREALLOCATE_COUNT = 10;
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
class CEngine;
|
||||
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
CPyro::CPyro()
|
||||
|
|
|
@ -43,7 +43,8 @@ class CSoundInterface;
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
class CEngine;
|
||||
class CTerrain;
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
|
||||
#include "graphics/engine/pyro.h"
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
Gfx::CPyroManager::CPyroManager()
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
struct Event;
|
||||
class CObject;
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
class CPyro;
|
||||
using CPyroUPtr = std::unique_ptr<CPyro>;
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \enum PyroType
|
||||
|
|
|
@ -36,7 +36,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
CTerrain::CTerrain()
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
class CEngine;
|
||||
class CWater;
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
class CEngine;
|
||||
class CDevice;
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
const int WATERLINE_PREALLOCATE_COUNT = 500;
|
||||
|
|
|
@ -34,7 +34,8 @@ class CSoundInterface;
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
|
||||
class CEngine;
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
#include "common/logger.h"
|
||||
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
int CModel::GetMeshCount() const
|
||||
{
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
#include <vector>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \class CModel
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
|
||||
#include "math/vector.h"
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \struct ModelCrashSphere
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \enum ModelFormat
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
// Private functions
|
||||
namespace ModelInput
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
|
||||
#include <istream>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \namespace ModelInput
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
|
||||
#include <stdexcept>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
class CModelIOException : public std::runtime_error
|
||||
{
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
|
||||
#include <cstring>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/*******************************************************
|
||||
Deprecated enums/magic values
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
#include "graphics/model/model_input.h"
|
||||
#include "graphics/model/model_io_exception.h"
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
CModel& CModelManager::GetModel(const std::string& modelName)
|
||||
{
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \class CModelManager
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
|
||||
#include "graphics/model/model_mesh.h"
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
void CModelMesh::AddTriangle(const ModelTriangle& triangle)
|
||||
{
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
struct ModelTriangle;
|
||||
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
|
||||
#include <fstream>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
// Private functions
|
||||
namespace ModelOutput
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
#include <ostream>
|
||||
#include <string>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
class CModel;
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \struct ModelShadowSpot
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
#include "graphics/core/color.h"
|
||||
#include "graphics/core/vertex.h"
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \enum ModelSpecialMark
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
CGL21Device::CGL21Device(const DeviceConfig &config)
|
||||
{
|
||||
|
@ -710,7 +711,8 @@ Texture CGL21Device::CreateTexture(ImageData *data, const TextureCreateParams &p
|
|||
convert = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
GetLogger()->Error("Unknown data surface format");
|
||||
assert(false);
|
||||
}
|
||||
|
@ -1710,8 +1712,8 @@ void CGL21Device::CopyFramebufferToTexture(Texture& texture, int xOffset, int yO
|
|||
glBindTexture(GL_TEXTURE_2D, m_currentTextures[0].id);
|
||||
}
|
||||
|
||||
void* CGL21Device::GetFrameBufferPixels()const{
|
||||
|
||||
void* CGL21Device::GetFrameBufferPixels()const
|
||||
{
|
||||
GLubyte* pixels = new GLubyte[4 * m_config.size.x * m_config.size.y];
|
||||
|
||||
glReadPixels(0, 0, m_config.size.x, m_config.size.y, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
struct GLDevicePrivate;
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
CGL33Device::CGL33Device(const DeviceConfig &config)
|
||||
{
|
||||
|
@ -736,7 +737,8 @@ Texture CGL33Device::CreateTexture(ImageData *data, const TextureCreateParams &p
|
|||
convert = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
GetLogger()->Error("Unknown data surface format");
|
||||
assert(false);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
\class CGL33Device
|
||||
|
@ -304,7 +305,7 @@ private:
|
|||
//! Specular color
|
||||
GLint uni_SpecularColor;
|
||||
|
||||
struct
|
||||
struct LightUniforms
|
||||
{
|
||||
//! true enables light
|
||||
GLint Enabled;
|
||||
|
@ -320,7 +321,9 @@ private:
|
|||
GLint Specular;
|
||||
//! Attenuation
|
||||
GLint Attenuation;
|
||||
} uni_Light[8];
|
||||
};
|
||||
|
||||
LightUniforms uni_Light[8];
|
||||
};
|
||||
|
||||
} // namespace Gfx
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
CGLDevice::CGLDevice(const DeviceConfig &config)
|
||||
{
|
||||
|
@ -683,7 +684,8 @@ Texture CGLDevice::CreateTexture(ImageData *data, const TextureCreateParams &par
|
|||
convert = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
GetLogger()->Error("Unknown data surface format");
|
||||
assert(false);
|
||||
}
|
||||
|
@ -1842,8 +1844,8 @@ void CGLDevice::CopyFramebufferToTexture(Texture& texture, int xOffset, int yOff
|
|||
glBindTexture(GL_TEXTURE_2D, m_currentTextures[0].id);
|
||||
}
|
||||
|
||||
void* CGLDevice::GetFrameBufferPixels()const{
|
||||
|
||||
void* CGLDevice::GetFrameBufferPixels()const
|
||||
{
|
||||
GLubyte* pixels = new GLubyte[4 * m_config.size.x * m_config.size.y];
|
||||
|
||||
glReadPixels(0, 0, m_config.size.x, m_config.size.y, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
\enum VertexBufferType
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
|
||||
#include "common/logger.h"
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
// CGLFramebuffer
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
#include "graphics/core/framebuffer.h"
|
||||
#include "graphics/opengl/glutil.h"
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
/**
|
||||
* \class CGLFramebuffer
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
#include <cstring>
|
||||
|
||||
// Graphics module namespace
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
GLuint textureCoordinates[] = { GL_S, GL_T, GL_R, GL_Q };
|
||||
GLuint textureCoordGen[] = { GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R, GL_TEXTURE_GEN_Q };
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
|
||||
|
||||
// Math module namespace
|
||||
namespace Math {
|
||||
namespace Math
|
||||
{
|
||||
|
||||
|
||||
//! Tolerance level -- minimum accepted float value
|
||||
|
|
|
@ -33,7 +33,8 @@
|
|||
|
||||
|
||||
// Math module namespace
|
||||
namespace Math {
|
||||
namespace Math
|
||||
{
|
||||
|
||||
|
||||
//! Compares \a a and \a b within \a tolerance
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
|
||||
|
||||
// Math module namespace
|
||||
namespace Math {
|
||||
namespace Math
|
||||
{
|
||||
|
||||
|
||||
//! Returns py up on the line \a a - \a b
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
#include <cmath>
|
||||
|
||||
// Math module namespace
|
||||
namespace Math {
|
||||
namespace Math
|
||||
{
|
||||
|
||||
/**
|
||||
* \struct IntPoint
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
|
||||
|
||||
// Math module namespace
|
||||
namespace Math {
|
||||
namespace Math
|
||||
{
|
||||
|
||||
/**
|
||||
* \struct Matrix math/matrix.h
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
|
||||
|
||||
// Math module namespace
|
||||
namespace Math {
|
||||
namespace Math
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
#include "math/vector.h"
|
||||
|
||||
namespace Math {
|
||||
namespace Math
|
||||
{
|
||||
|
||||
struct Sphere
|
||||
{
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
|
||||
|
||||
// Math module namespace
|
||||
namespace Math {
|
||||
namespace Math
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -33,12 +33,14 @@ class CSoundInterface;
|
|||
class CLevelParserLine;
|
||||
class COldObject;
|
||||
|
||||
namespace Ui {
|
||||
namespace Ui
|
||||
{
|
||||
class CInterface;
|
||||
class CWindow;
|
||||
} /* Ui */
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
|
||||
class CEngine;
|
||||
class CParticle;
|
||||
|
|
|
@ -159,7 +159,8 @@ bool CAutoDestroyer::EventProcess(const Event &event)
|
|||
if ( pw != 0 ) EnableInterface(pw, EVENT_OBJECT_BDESTROY, (scrap != 0));
|
||||
}
|
||||
}
|
||||
} else if ( pw != 0 ) EnableInterface(pw, EVENT_OBJECT_BDESTROY, false);
|
||||
}
|
||||
else if ( pw != 0 ) EnableInterface(pw, EVENT_OBJECT_BDESTROY, false);
|
||||
|
||||
if ( m_phase == ADEP_DOWN )
|
||||
{
|
||||
|
|
|
@ -46,13 +46,15 @@ class CRobotMain;
|
|||
class CSoundInterface;
|
||||
class CLevelParserLine;
|
||||
|
||||
namespace Ui {
|
||||
namespace Ui
|
||||
{
|
||||
class CStudio;
|
||||
class CInterface;
|
||||
class CWindow;
|
||||
}
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
class CEngine;
|
||||
class CTerrain;
|
||||
class CWater;
|
||||
|
|
|
@ -33,7 +33,8 @@
|
|||
class CRobotMain;
|
||||
class CSoundInterface;
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
class CCamera;
|
||||
class CEngine;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
|
||||
#include "object/object_type.h"
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
class CEngine;
|
||||
class CParticle;
|
||||
class CTerrain;
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
struct ModelCrashSphere;
|
||||
} // namespace Gfx
|
||||
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
class CEngine;
|
||||
class COldModelManager;
|
||||
class CModelManager;
|
||||
|
|
|
@ -36,7 +36,8 @@
|
|||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
class CEngine;
|
||||
class CModelManager;
|
||||
class COldModelManager;
|
||||
|
@ -75,7 +76,8 @@ public:
|
|||
do
|
||||
{
|
||||
++m_currentIt;
|
||||
} while (m_currentIt != m_endIt && m_currentIt->second == nullptr);
|
||||
}
|
||||
while (m_currentIt != m_endIt && m_currentIt->second == nullptr);
|
||||
}
|
||||
|
||||
inline bool operator!=(const CObjectIteratorProxy& other)
|
||||
|
|
|
@ -3127,7 +3127,8 @@ int COldObject::GetDefRank()
|
|||
bool COldObject::GetTooltipName(std::string& name)
|
||||
{
|
||||
GetResource(RES_OBJECT, m_type, name);
|
||||
if(GetTeam() != 0) {
|
||||
if (GetTeam() != 0)
|
||||
{
|
||||
name += " ["+CRobotMain::GetInstancePointer()->GetTeamName(GetTeam())+" ("+boost::lexical_cast<std::string>(GetTeam())+")]";
|
||||
}
|
||||
return !name.empty();
|
||||
|
|
|
@ -2556,7 +2556,8 @@ void CRobotMain::InitEye()
|
|||
bool CRobotMain::EventFrame(const Event &event)
|
||||
{
|
||||
m_time += event.rTime;
|
||||
if (!m_movieLock && m_pause->GetPause() == PAUSE_NONE) {
|
||||
if (!m_movieLock && m_pause->GetPause() == PAUSE_NONE)
|
||||
{
|
||||
m_gameTime += event.rTime;
|
||||
m_gameTimeAbsolute += m_app->GetRealRelTime() / 1e9f;
|
||||
}
|
||||
|
@ -5499,7 +5500,8 @@ Error CRobotMain::CheckEndMission(bool frame)
|
|||
// Special handling for teams
|
||||
m_missionResult = ERR_MISSION_NOTERM;
|
||||
|
||||
if (teamCount == 0) {
|
||||
if (teamCount == 0)
|
||||
{
|
||||
GetLogger()->Info("All teams died, mission ended with failure\n");
|
||||
m_missionResult = INFO_LOST;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,8 @@ class CSceneEndCondition;
|
|||
class CAudioChangeCondition;
|
||||
class CPlayerProfile;
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
class CEngine;
|
||||
class CLightManager;
|
||||
class CWater;
|
||||
|
@ -93,7 +94,8 @@ class CTerrain;
|
|||
class CModelManager;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
namespace Ui
|
||||
{
|
||||
class CMainDialog;
|
||||
class CMainShort;
|
||||
class CMainMap;
|
||||
|
|
|
@ -36,7 +36,8 @@ struct ExchangePostInfo
|
|||
|
||||
struct ObjectCreateParams;
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
class COldModelManager;
|
||||
class CEngine;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
class CModelManager;
|
||||
class CEngine;
|
||||
class CModel;
|
||||
|
|
|
@ -36,7 +36,8 @@ class CRobotMain;
|
|||
class CSoundInterface;
|
||||
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
class CEngine;
|
||||
class CLightManager;
|
||||
class CParticle;
|
||||
|
|
|
@ -141,7 +141,9 @@ CObject* CTaskFlag::SearchNearest(Math::Vector pos, ObjectType type)
|
|||
if(type == OBJECT_NULL)
|
||||
{
|
||||
types = {OBJECT_FLAGb, OBJECT_FLAGr, OBJECT_FLAGg, OBJECT_FLAGy, OBJECT_FLAGv};
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
types = {type};
|
||||
}
|
||||
return CObjectManager::GetInstancePointer()->FindNearest(nullptr, pos, types);
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
|
||||
std::string TraceColorName(TraceColor color)
|
||||
{
|
||||
switch(color) {
|
||||
switch(color)
|
||||
{
|
||||
case TraceColor::White: return "White"; break;
|
||||
case TraceColor::Black: return "Black"; break;
|
||||
case TraceColor::Gray: return "Gray"; break;
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
enum class TraceColor : int {
|
||||
enum class TraceColor : int
|
||||
{
|
||||
Default = -1,
|
||||
|
||||
White = 0,
|
||||
|
|
|
@ -42,7 +42,8 @@ class CLevelParserLine;
|
|||
class CJostleableObject;
|
||||
struct Event;
|
||||
|
||||
namespace Gfx {
|
||||
namespace Gfx
|
||||
{
|
||||
class CCamera;
|
||||
class CEngine;
|
||||
class CLight;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue