Some style and whitespace fixes

master
Piotr Dziwinski 2015-08-02 08:45:02 +02:00
parent 60ae9b1959
commit 3b585d9f51
28 changed files with 135 additions and 136 deletions

View File

@ -448,8 +448,8 @@ void CImage::SetDataPixels(void *pixels){
} }
} }
void CImage::flipVertically(){ void CImage::FlipVertically()
{
SDL_Surface* result = SDL_CreateRGBSurface( m_data->surface->flags, SDL_Surface* result = SDL_CreateRGBSurface( m_data->surface->flags,
m_data->surface->w, m_data->surface->w,
m_data->surface->h, m_data->surface->h,
@ -467,7 +467,8 @@ void CImage::flipVertically(){
Uint32 pitch = m_data->surface->pitch; Uint32 pitch = m_data->surface->pitch;
Uint32 pxLength = pitch*m_data->surface->h; Uint32 pxLength = pitch*m_data->surface->h;
for(int line = 0; line < m_data->surface->h; ++line) { for (int line = 0; line < m_data->surface->h; ++line)
{
Uint32 pos = line * pitch; Uint32 pos = line * pitch;
memcpy(&resultPixels[pos], &srcPixels[(pxLength-pos)-pitch], pitch); memcpy(&resultPixels[pos], &srcPixels[(pxLength-pos)-pitch], pitch);
} }

View File

@ -113,7 +113,7 @@ public:
std::string GetError(); std::string GetError();
//! Flips the image vertically //! Flips the image vertically
void flipVertically(); void FlipVertically();
//! sets/replaces the pixels from the surface //! sets/replaces the pixels from the surface
void SetDataPixels(void *pixels); void SetDataPixels(void *pixels);

View File

@ -41,6 +41,3 @@ boost::smatch RegexUtils::AssertRegexMatch(const std::string& text, const std::s
return matches; return matches;
} }
/*
boost::cmatch matches;*/

View File

@ -487,7 +487,7 @@ bool CEngine::WriteScreenShot(const std::string& fileName, int width, int height
CImage img({width, height}); CImage img({width, height});
img.SetDataPixels(pixels); img.SetDataPixels(pixels);
img.flipVertically(); img.FlipVertically();
if ( img.SavePNG(fileName.c_str()) ) if ( img.SavePNG(fileName.c_str()) )
{ {

View File

@ -19,7 +19,8 @@
#pragma once #pragma once
enum MissionType { enum MissionType
{
MISSION_NORMAL = 0, MISSION_NORMAL = 0,
MISSION_RETRO, MISSION_RETRO,
MISSION_CODE_BATTLE MISSION_CODE_BATTLE