Fixed some code style warnings

dev-time-step
krzys-h 2016-02-13 13:46:56 +01:00
parent 6b7e6cbc75
commit 55412842df
8 changed files with 12 additions and 13 deletions

View File

@ -55,6 +55,5 @@ public:
void StartGame(LevelCategory cat, int chap, int lvl);
private:
CApplication* m_app;
std::unique_ptr<CRobotMain> m_main;
};

View File

@ -51,4 +51,4 @@ bool LanguageToString(const Language& language, std::string& str)
return true;
}
return false;
}
}

View File

@ -36,4 +36,4 @@ enum Language
};
bool ParseLanguage(const std::string& str, Language& language);
bool LanguageToString(const Language& language, std::string& str);
bool LanguageToString(const Language& language, std::string& str);

View File

@ -21,6 +21,7 @@
#include "common/resources/sdl_memory_wrapper.h"
#include "common/logger.h"
#include "common/make_unique.h"
#include <physfs.h>
@ -42,15 +43,15 @@ CSDLMemoryWrapper::CSDLMemoryWrapper(const std::string& filename)
}
PHYSFS_sint64 length = PHYSFS_fileLength(file);
m_buffer = new char[length];
if (PHYSFS_read(file, m_buffer, 1, length) != length)
m_buffer = MakeUniqueArray<char>(length);
if (PHYSFS_read(file, m_buffer.get(), 1, length) != length)
{
GetLogger()->Error("Unable to read data for \"%s\"\n", filename.c_str());
PHYSFS_close(file);
return;
}
PHYSFS_close(file);
m_rwops = SDL_RWFromMem(m_buffer, length);
m_rwops = SDL_RWFromMem(m_buffer.get(), length);
if (m_rwops == nullptr)
{
@ -62,7 +63,7 @@ CSDLMemoryWrapper::CSDLMemoryWrapper(const std::string& filename)
CSDLMemoryWrapper::~CSDLMemoryWrapper()
{
SDL_FreeRW(m_rwops);
delete []m_buffer;
m_buffer.reset();
}
SDL_RWops* CSDLMemoryWrapper::GetHandler()

View File

@ -21,6 +21,7 @@
#pragma once
#include <string>
#include <memory>
#include <SDL.h>
@ -38,5 +39,5 @@ public:
private:
SDL_RWops* m_rwops;
char *m_buffer;
std::unique_ptr<char[]> m_buffer;
};

View File

@ -166,8 +166,6 @@ bool CGL33Device::Create()
{
GetLogger()->Info("Creating CDevice - OpenGL 3.3\n");
static bool glewInited = false;
if (!InitializeGLEW())
{
m_errorMessage = "An error occured while initializing GLEW.";

View File

@ -50,8 +50,8 @@ namespace Gfx
*/
struct DynamicBuffer
{
GLuint vbo;
unsigned int size;
GLuint vbo = 0;
unsigned int size = 0;
};
/**

View File

@ -3242,4 +3242,4 @@ void CEdit::UpdateFocus()
CApplication::GetInstancePointer()->SetTextInput(m_bFocus);
}
}
}