|
|
@@ -1,9 +1,9 @@
|
|
|
#include "stdafx.h"
|
|
|
#include "SDL_Extensions.h"
|
|
|
|
|
|
-void CSDL_Ext::SDL_PutPixel(SDL_Surface *ekran, int x, int y, Uint8 R, Uint8 G, Uint8 B)
|
|
|
+void CSDL_Ext::SDL_PutPixel(SDL_Surface *ekran, int x, int y, Uint8 R, Uint8 G, Uint8 B, int myC)
|
|
|
{
|
|
|
- Uint8 *p = (Uint8 *)ekran->pixels + y * ekran->pitch + x * ekran->format->BytesPerPixel;
|
|
|
+ Uint8 *p = (Uint8 *)ekran->pixels + y * ekran->pitch + x * ekran->format->BytesPerPixel-myC;
|
|
|
if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
|
|
|
{
|
|
|
p[0] = R;
|
|
|
@@ -34,11 +34,11 @@ SDL_Surface * CSDL_Ext::rotate01(SDL_Surface * toRot)
|
|
|
Uint8 *p = (Uint8 *)toRot->pixels + j * toRot->pitch + (ret->w - i - 1) * toRot->format->BytesPerPixel;
|
|
|
if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
|
|
|
{
|
|
|
- SDL_PutPixel(ret, i, j, p[0], p[1], p[2]);
|
|
|
+ CSDL_Ext::SDL_PutPixel(ret, i, j, p[0], p[1], p[2], 2);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- SDL_PutPixel(ret, i, j, p[2], p[1], p[0]);
|
|
|
+ CSDL_Ext::SDL_PutPixel(ret, i, j, p[2], p[1], p[0], 2);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -55,14 +55,15 @@ SDL_Surface * CSDL_Ext::hFlip(SDL_Surface * toRot)
|
|
|
for(int j=0; j<ret->h; ++j)
|
|
|
{
|
|
|
{
|
|
|
- Uint8 *p = (Uint8 *)toRot->pixels + (ret->h - j -1) * toRot->pitch + i * toRot->format->BytesPerPixel;
|
|
|
+ Uint8 *p = (Uint8 *)toRot->pixels + (ret->h - j -1) * toRot->pitch + i * toRot->format->BytesPerPixel-2;
|
|
|
+ int k=2;
|
|
|
if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
|
|
|
{
|
|
|
- SDL_PutPixel(ret, i, j, p[0], p[1], p[2]);
|
|
|
+ CSDL_Ext::SDL_PutPixel(ret, i, j, p[0], p[1], p[2], k);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- SDL_PutPixel(ret, i, j, p[2], p[1], p[0]);
|
|
|
+ CSDL_Ext::SDL_PutPixel(ret, i, j, p[2], p[1], p[0], k);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -114,11 +115,11 @@ SDL_Surface * CSDL_Ext::rotate03(SDL_Surface * toRot)
|
|
|
Uint8 *p = (Uint8 *)toRot->pixels + (ret->h - j - 1) * toRot->pitch + (ret->w - i - 1) * toRot->format->BytesPerPixel;
|
|
|
if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
|
|
|
{
|
|
|
- SDL_PutPixel(ret, i, j, p[0], p[1], p[2]);
|
|
|
+ SDL_PutPixel(ret, i, j, p[0], p[1], p[2], 2);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- SDL_PutPixel(ret, i, j, p[2], p[1], p[0]);
|
|
|
+ SDL_PutPixel(ret, i, j, p[2], p[1], p[0], 2);
|
|
|
}
|
|
|
}
|
|
|
}
|