Fixed some code style warnings
parent
6b7e6cbc75
commit
55412842df
|
@ -55,6 +55,5 @@ public:
|
|||
void StartGame(LevelCategory cat, int chap, int lvl);
|
||||
|
||||
private:
|
||||
CApplication* m_app;
|
||||
std::unique_ptr<CRobotMain> m_main;
|
||||
};
|
||||
|
|
|
@ -51,4 +51,4 @@ bool LanguageToString(const Language& language, std::string& str)
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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.";
|
||||
|
|
|
@ -50,8 +50,8 @@ namespace Gfx
|
|||
*/
|
||||
struct DynamicBuffer
|
||||
{
|
||||
GLuint vbo;
|
||||
unsigned int size;
|
||||
GLuint vbo = 0;
|
||||
unsigned int size = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -3242,4 +3242,4 @@ void CEdit::UpdateFocus()
|
|||
CApplication::GetInstancePointer()->SetTextInput(m_bFocus);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue