mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Remove outdated comments from Graphics.cpp
This removes a bunch of commented-out code that was clearly kept from the Flash version, even though the Flash graphics API is much different than SDL's. Also removes a bunch of TODOs that either say nothing, or say something whose meaning has been totally lost to time due to being completely vague, or something that's already been done and someone forgot to remove the TODO.
This commit is contained in:
parent
b061051297
commit
b4937ff8d5
1 changed files with 0 additions and 87 deletions
|
@ -25,10 +25,6 @@ void Graphics::init()
|
||||||
|
|
||||||
|
|
||||||
//We initialise a few things
|
//We initialise a few things
|
||||||
//updatebackground = true;
|
|
||||||
|
|
||||||
|
|
||||||
//ct = new ColorTransform(0, 0, 0, 1, 255, 255, 255, 1); //Set to white
|
|
||||||
|
|
||||||
linestate = 0;
|
linestate = 0;
|
||||||
|
|
||||||
|
@ -41,10 +37,6 @@ void Graphics::init()
|
||||||
|
|
||||||
flipmode = false;
|
flipmode = false;
|
||||||
setflipmode = false;
|
setflipmode = false;
|
||||||
//flipmatrix.scale(1, -1);
|
|
||||||
//flipmatrix.translate(0, 240);
|
|
||||||
//flipfontmatrix.scale(1, -1); flipfontmatrix.translate(0, 8);
|
|
||||||
//flipfontmatrix2.scale(1, -1); flipfontmatrix2.translate(0, 9);
|
|
||||||
|
|
||||||
//Background inits
|
//Background inits
|
||||||
for (int i = 0; i < 50; i++)
|
for (int i = 0; i < 50; i++)
|
||||||
|
@ -77,7 +69,6 @@ void Graphics::init()
|
||||||
backboxvy.push_back(bvy);
|
backboxvy.push_back(bvy);
|
||||||
backboxint.push_back(bint);
|
backboxint.push_back(bint);
|
||||||
}
|
}
|
||||||
//backboxrect = new Rectangle();
|
|
||||||
backoffset = 0;
|
backoffset = 0;
|
||||||
backgrounddrawn = false;
|
backgrounddrawn = false;
|
||||||
|
|
||||||
|
@ -161,7 +152,6 @@ void Graphics::drawspritesetcol(int x, int y, int t, int c)
|
||||||
setcol(c);
|
setcol(c);
|
||||||
|
|
||||||
BlitSurfaceColoured(sprites[t],NULL,backBuffer, &rect, ct);
|
BlitSurfaceColoured(sprites[t],NULL,backBuffer, &rect, ct);
|
||||||
//.copyPixels(sprites[t], sprites_rect, backbuffer, tpoint);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::Makebfont()
|
void Graphics::Makebfont()
|
||||||
|
@ -392,13 +382,10 @@ void Graphics::PrintOffAlpha( int _x, int _y, std::string _s, int r, int g, int
|
||||||
|
|
||||||
if (flipmode)
|
if (flipmode)
|
||||||
{
|
{
|
||||||
//flipbfont[font_idx(cur)].colorTransform(bfont_rect, ct);
|
|
||||||
BlitSurfaceColoured( flipbfont[font_idx(curr)], NULL, backBuffer, &fontRect , ct);
|
BlitSurfaceColoured( flipbfont[font_idx(curr)], NULL, backBuffer, &fontRect , ct);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//bfont[font_idx(cur)].colorTransform(bfont_rect, ct);
|
|
||||||
//backBuffer.copyPixels(bfont[font_idx(cur)], bfont_rect, tpoint);
|
|
||||||
BlitSurfaceColoured( bfont[font_idx(curr)], NULL, backBuffer, &fontRect , ct);
|
BlitSurfaceColoured( bfont[font_idx(curr)], NULL, backBuffer, &fontRect , ct);
|
||||||
}
|
}
|
||||||
bfontpos+=bfontlen(curr) ;
|
bfontpos+=bfontlen(curr) ;
|
||||||
|
@ -411,14 +398,11 @@ void Graphics::bprint( int x, int y, std::string t, int r, int g, int b, bool ce
|
||||||
|
|
||||||
void Graphics::bprintalpha( int x, int y, std::string t, int r, int g, int b, int a, bool cen /*= false*/ )
|
void Graphics::bprintalpha( int x, int y, std::string t, int r, int g, int b, int a, bool cen /*= false*/ )
|
||||||
{
|
{
|
||||||
|
|
||||||
//printmask(x, y, t, cen);
|
|
||||||
if (!notextoutline)
|
if (!notextoutline)
|
||||||
{
|
{
|
||||||
PrintAlpha(x, y - 1, t, 0, 0, 0, a, cen);
|
PrintAlpha(x, y - 1, t, 0, 0, 0, a, cen);
|
||||||
if (cen)
|
if (cen)
|
||||||
{
|
{
|
||||||
//TODO find different
|
|
||||||
PrintOffAlpha(-1, y, t, 0, 0, 0, a, cen);
|
PrintOffAlpha(-1, y, t, 0, 0, 0, a, cen);
|
||||||
PrintOffAlpha(1, y, t, 0, 0, 0, a, cen);
|
PrintOffAlpha(1, y, t, 0, 0, 0, a, cen);
|
||||||
}
|
}
|
||||||
|
@ -457,13 +441,10 @@ void Graphics::RPrint( int _x, int _y, std::string _s, int r, int g, int b, bool
|
||||||
|
|
||||||
if (flipmode)
|
if (flipmode)
|
||||||
{
|
{
|
||||||
//flipbfont[font_idx(cur)].colorTransform(bfont_rect, ct);
|
|
||||||
BlitSurfaceColoured( flipbfont[font_idx(curr)], NULL, backBuffer, &fontRect , ct);
|
BlitSurfaceColoured( flipbfont[font_idx(curr)], NULL, backBuffer, &fontRect , ct);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//bfont[font_idx(cur)].colorTransform(bfont_rect, ct);
|
|
||||||
//backBuffer.copyPixels(bfont[font_idx(cur)], bfont_rect, tpoint);
|
|
||||||
BlitSurfaceColoured( bfont[font_idx(curr)], NULL, backBuffer, &fontRect , ct);
|
BlitSurfaceColoured( bfont[font_idx(curr)], NULL, backBuffer, &fontRect , ct);
|
||||||
}
|
}
|
||||||
bfontpos+=bfontlen(curr) ;
|
bfontpos+=bfontlen(curr) ;
|
||||||
|
@ -552,7 +533,6 @@ void Graphics::drawsprite( int x, int y, int t, int r, int g, int b )
|
||||||
{
|
{
|
||||||
SDL_Rect rect = { Sint16(x), Sint16(y), sprites_rect.w, sprites_rect.h };
|
SDL_Rect rect = { Sint16(x), Sint16(y), sprites_rect.w, sprites_rect.h };
|
||||||
setcolreal(getRGB(r,g,b));
|
setcolreal(getRGB(r,g,b));
|
||||||
//sprites[t].colorTransform(sprites_rect, ct);
|
|
||||||
BlitSurfaceColoured(sprites[t], NULL, backBuffer, &rect, ct);
|
BlitSurfaceColoured(sprites[t], NULL, backBuffer, &rect, ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -783,7 +763,6 @@ void Graphics::drawimage( int t, int xp, int yp, bool cent/*=false*/ )
|
||||||
trect.w = images[t]->w;
|
trect.w = images[t]->w;
|
||||||
trect.h = images[t]->h;
|
trect.h = images[t]->h;
|
||||||
BlitSurfaceStandard(images[t], NULL, backBuffer, &trect);
|
BlitSurfaceStandard(images[t], NULL, backBuffer, &trect);
|
||||||
//backbuffer.copyPixels(images[t], trect, tpoint);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -823,9 +802,7 @@ void Graphics::cutscenebars()
|
||||||
cutscenebarspos += 25;
|
cutscenebarspos += 25;
|
||||||
cutscenebarspos = std::min(cutscenebarspos, 361);
|
cutscenebarspos = std::min(cutscenebarspos, 361);
|
||||||
FillRect(backBuffer, 0, 0, cutscenebarspos, 16, 0x000000);
|
FillRect(backBuffer, 0, 0, cutscenebarspos, 16, 0x000000);
|
||||||
//backbuffer.fillRect(new Rectangle(0, 0, cutscenebarspos, 16), 0x000000);
|
|
||||||
FillRect(backBuffer, 360-cutscenebarspos, 224, cutscenebarspos, 16, 0x000000);
|
FillRect(backBuffer, 360-cutscenebarspos, 224, cutscenebarspos, 16, 0x000000);
|
||||||
//backbuffer.fillRect(new Rectangle(360-cutscenebarspos, 224, cutscenebarspos, 16), 0x000000);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -836,9 +813,7 @@ void Graphics::cutscenebars()
|
||||||
cutscenebarspos = std::max(cutscenebarspos, 0);
|
cutscenebarspos = std::max(cutscenebarspos, 0);
|
||||||
//draw
|
//draw
|
||||||
FillRect(backBuffer, 0, 0, cutscenebarspos, 16, 0x000000);
|
FillRect(backBuffer, 0, 0, cutscenebarspos, 16, 0x000000);
|
||||||
//backbuffer.fillRect(new Rectangle(0, 0, cutscenebarspos, 16), 0x000000);
|
|
||||||
FillRect(backBuffer, 360-cutscenebarspos, 224, cutscenebarspos, 16, 0x000000);
|
FillRect(backBuffer, 360-cutscenebarspos, 224, cutscenebarspos, 16, 0x000000);
|
||||||
//backbuffer.fillRect(new Rectangle(360-cutscenebarspos, 224, cutscenebarspos, 16), 0x000000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -905,7 +880,6 @@ void Graphics::drawpixeltextbox( int x, int y, int w, int h, int w2, int h2, int
|
||||||
//given these parameters, draw a textbox with a pixel width
|
//given these parameters, draw a textbox with a pixel width
|
||||||
|
|
||||||
//madrect.x = x; madrect.y = y; madrect.w = w; madrect.h = h;
|
//madrect.x = x; madrect.y = y; madrect.w = w; madrect.h = h;
|
||||||
//backbuffer.fillRect(madrect, RGB(r / 6, g / 6, b / 6));
|
|
||||||
FillRect(backBuffer,x,y,w,h, r/6, g/6, b/6 );
|
FillRect(backBuffer,x,y,w,h, r/6, g/6, b/6 );
|
||||||
|
|
||||||
for (k = 0; k < w2-2; k++)
|
for (k = 0; k < w2-2; k++)
|
||||||
|
@ -930,8 +904,6 @@ void Graphics::drawcustompixeltextbox( int x, int y, int w, int h, int w2, int h
|
||||||
{
|
{
|
||||||
//given these parameters, draw a textbox with a pixel width
|
//given these parameters, draw a textbox with a pixel width
|
||||||
|
|
||||||
//madrect.x = x; madrect.y = y; madrect.w = w; madrect.h = h;
|
|
||||||
//backbuffer.fillRect(madrect, RGB(r / 6, g / 6, b / 6));
|
|
||||||
FillRect(backBuffer,x,y,w,h, r/6, g/6, b/6 );
|
FillRect(backBuffer,x,y,w,h, r/6, g/6, b/6 );
|
||||||
|
|
||||||
for (k = 0; k < w2-2; k++)
|
for (k = 0; k < w2-2; k++)
|
||||||
|
@ -966,8 +938,6 @@ void Graphics::drawcustompixeltextbox( int x, int y, int w, int h, int w2, int h
|
||||||
void Graphics::drawtextbox( int x, int y, int w, int h, int r, int g, int b )
|
void Graphics::drawtextbox( int x, int y, int w, int h, int r, int g, int b )
|
||||||
{
|
{
|
||||||
//given these parameters, draw a textbox
|
//given these parameters, draw a textbox
|
||||||
//madrect.x = x; madrect.y = y; madrect.w = w*8; madrect.h = h*8;
|
|
||||||
//backbuffer.fillRect(madrect, RGB(r / 6, g / 6, b / 6));
|
|
||||||
FillRect(backBuffer,x,y,w*8,h*8, r/6, g/6, b/6 );
|
FillRect(backBuffer,x,y,w*8,h*8, r/6, g/6, b/6 );
|
||||||
|
|
||||||
drawcoloredtile(x, y, 40, r, g, b);
|
drawcoloredtile(x, y, 40, r, g, b);
|
||||||
|
@ -1071,14 +1041,12 @@ void Graphics::drawfade()
|
||||||
if ((fademode == 1)||(fademode == 4))
|
if ((fademode == 1)||(fademode == 4))
|
||||||
{
|
{
|
||||||
FillRect(backBuffer, 0, 0, backBuffer->w, backBuffer->h, 0x000000);
|
FillRect(backBuffer, 0, 0, backBuffer->w, backBuffer->h, 0x000000);
|
||||||
//backbuffer.fillRect(backbuffer.rect, 0x000000);
|
|
||||||
}
|
}
|
||||||
else if(fademode==3)
|
else if(fademode==3)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 15; i++)
|
for (int i = 0; i < 15; i++)
|
||||||
{
|
{
|
||||||
FillRect(backBuffer, fadebars[i], i * 16, fadeamount, 16, 0x000000 );
|
FillRect(backBuffer, fadebars[i], i * 16, fadeamount, 16, 0x000000 );
|
||||||
//backbuffer.fillRect(new Rectangle(, , , 16), 0x000000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(fademode==5 )
|
else if(fademode==5 )
|
||||||
|
@ -1086,7 +1054,6 @@ void Graphics::drawfade()
|
||||||
for (int i = 0; i < 15; i++)
|
for (int i = 0; i < 15; i++)
|
||||||
{
|
{
|
||||||
FillRect(backBuffer, fadebars[i]-fadeamount, i * 16, 500, 16, 0x000000 );
|
FillRect(backBuffer, fadebars[i]-fadeamount, i * 16, 500, 16, 0x000000 );
|
||||||
//backbuffer.fillRect(new Rectangle(fadebars[i]-fadeamount, i * 16, 500, 16), 0x000000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1461,14 +1428,11 @@ void Graphics::drawentities()
|
||||||
{
|
{
|
||||||
tpoint.x = obj.entities[i].xp;
|
tpoint.x = obj.entities[i].xp;
|
||||||
tpoint.y = obj.entities[i].yp;
|
tpoint.y = obj.entities[i].yp;
|
||||||
//
|
|
||||||
setcol(obj.entities[i].colour);
|
setcol(obj.entities[i].colour);
|
||||||
//flipsprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct);
|
|
||||||
drawRect = sprites_rect;
|
drawRect = sprites_rect;
|
||||||
drawRect.x += tpoint.x;
|
drawRect.x += tpoint.x;
|
||||||
drawRect.y += tpoint.y;
|
drawRect.y += tpoint.y;
|
||||||
BlitSurfaceColoured(flipsprites[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
BlitSurfaceColoured(flipsprites[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
||||||
//backbuffer.copyPixels(flipsprites[obj.entities[i].drawframe], sprites_rect, tpoint);
|
|
||||||
if (map.warpx)
|
if (map.warpx)
|
||||||
{
|
{
|
||||||
//screenwrapping!
|
//screenwrapping!
|
||||||
|
@ -1513,9 +1477,7 @@ void Graphics::drawentities()
|
||||||
{
|
{
|
||||||
tpoint.x = obj.entities[i].xp;
|
tpoint.x = obj.entities[i].xp;
|
||||||
tpoint.y = obj.entities[i].yp;
|
tpoint.y = obj.entities[i].yp;
|
||||||
//
|
|
||||||
setcol(obj.entities[i].colour);
|
setcol(obj.entities[i].colour);
|
||||||
//sprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct);
|
|
||||||
|
|
||||||
drawRect = sprites_rect;
|
drawRect = sprites_rect;
|
||||||
drawRect.x += tpoint.x;
|
drawRect.x += tpoint.x;
|
||||||
|
@ -1605,12 +1567,10 @@ void Graphics::drawentities()
|
||||||
//A seperate index of colours, for simplicity
|
//A seperate index of colours, for simplicity
|
||||||
if(obj.entities[i].colour==1)
|
if(obj.entities[i].colour==1)
|
||||||
{
|
{
|
||||||
//backbuffer.fillRect(prect, RGB(196 - (fRandom() * 64), 10, 10));
|
|
||||||
FillRect(backBuffer, prect, (fRandom() * 64), 10, 10);
|
FillRect(backBuffer, prect, (fRandom() * 64), 10, 10);
|
||||||
}
|
}
|
||||||
else if (obj.entities[i].colour == 2)
|
else if (obj.entities[i].colour == 2)
|
||||||
{
|
{
|
||||||
//backbuffer.fillRect(prect, RGB(160- help.glow/2 - (fRandom()*20), 200- help.glow/2, 220 - help.glow));
|
|
||||||
FillRect(backBuffer,prect, int(160- help.glow/2 - (fRandom()*20)), 200- help.glow/2, 220 - help.glow);
|
FillRect(backBuffer,prect, int(160- help.glow/2 - (fRandom()*20)), 200- help.glow/2, 220 - help.glow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1640,7 +1600,6 @@ void Graphics::drawentities()
|
||||||
}
|
}
|
||||||
else if (obj.entities[i].size == 8) // Special: Moving platform, 8 tiles
|
else if (obj.entities[i].size == 8) // Special: Moving platform, 8 tiles
|
||||||
{
|
{
|
||||||
//TODO check this is correct game breaking moving paltform
|
|
||||||
tpoint.x = obj.entities[i].xp;
|
tpoint.x = obj.entities[i].xp;
|
||||||
tpoint.y = obj.entities[i].yp;
|
tpoint.y = obj.entities[i].yp;
|
||||||
drawRect = sprites_rect;
|
drawRect = sprites_rect;
|
||||||
|
@ -1801,7 +1760,6 @@ void Graphics::drawentities()
|
||||||
}
|
}
|
||||||
else if (obj.entities[i].size == 11) //The fucking elephant
|
else if (obj.entities[i].size == 11) //The fucking elephant
|
||||||
{
|
{
|
||||||
//TODO elephant bug
|
|
||||||
setcol(obj.entities[i].colour);
|
setcol(obj.entities[i].colour);
|
||||||
drawimagecol(3, obj.entities[i].xp, obj.entities[i].yp);
|
drawimagecol(3, obj.entities[i].xp, obj.entities[i].yp);
|
||||||
}
|
}
|
||||||
|
@ -1813,7 +1771,6 @@ void Graphics::drawentities()
|
||||||
tpoint.x = obj.entities[i].xp;
|
tpoint.x = obj.entities[i].xp;
|
||||||
tpoint.y = obj.entities[i].yp;
|
tpoint.y = obj.entities[i].yp;
|
||||||
setcol(obj.entities[i].colour);
|
setcol(obj.entities[i].colour);
|
||||||
//
|
|
||||||
|
|
||||||
drawRect = sprites_rect;
|
drawRect = sprites_rect;
|
||||||
drawRect.x += tpoint.x;
|
drawRect.x += tpoint.x;
|
||||||
|
@ -1927,27 +1884,19 @@ void Graphics::drawentities()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//scaleMatrix.scale(6, 6);
|
|
||||||
//bigbuffer.fillRect(bigbuffer.rect, 0x000000);
|
|
||||||
FillRect(tempBuffer, 0x000000);
|
FillRect(tempBuffer, 0x000000);
|
||||||
|
|
||||||
tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp;
|
tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp;
|
||||||
setcol(obj.entities[i].colour);
|
setcol(obj.entities[i].colour);
|
||||||
//flipsprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct);
|
|
||||||
//bigbuffer.copyPixels(flipsprites[obj.entities[i].drawframe], sprites_rect, new Point(0, 0));
|
|
||||||
SDL_Rect drawRect = {Sint16(obj.entities[i].xp ), Sint16(obj.entities[i].yp), sprites_rect.x, sprites_rect.y };
|
SDL_Rect drawRect = {Sint16(obj.entities[i].xp ), Sint16(obj.entities[i].yp), sprites_rect.x, sprites_rect.y };
|
||||||
SDL_Surface* TempSurface = ScaleSurface( flipsprites[obj.entities[i].drawframe], 6* sprites_rect.w,6* sprites_rect.w );
|
SDL_Surface* TempSurface = ScaleSurface( flipsprites[obj.entities[i].drawframe], 6* sprites_rect.w,6* sprites_rect.w );
|
||||||
BlitSurfaceColoured(TempSurface, NULL , backBuffer, &drawRect, ct );
|
BlitSurfaceColoured(TempSurface, NULL , backBuffer, &drawRect, ct );
|
||||||
SDL_FreeSurface(TempSurface);
|
SDL_FreeSurface(TempSurface);
|
||||||
//scaleMatrix.translate(-obj.entities[i].xp, -obj.entities[i].yp);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//TODO checkthis
|
|
||||||
tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp;
|
tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp;
|
||||||
setcol(obj.entities[i].colour);
|
setcol(obj.entities[i].colour);
|
||||||
//flipsprites[obj.entities[i].drawframe].colorTransform(sprites_rect, ct);
|
|
||||||
//bigbuffer.copyPixels(flipsprites[obj.entities[i].drawframe], sprites_rect, new Point(0, 0));
|
|
||||||
SDL_Rect drawRect = {Sint16(obj.entities[i].xp ), Sint16(obj.entities[i].yp), Sint16(sprites_rect.x * 6), Sint16(sprites_rect.y * 6 ) };
|
SDL_Rect drawRect = {Sint16(obj.entities[i].xp ), Sint16(obj.entities[i].yp), Sint16(sprites_rect.x * 6), Sint16(sprites_rect.y * 6 ) };
|
||||||
SDL_Surface* TempSurface = ScaleSurface( flipsprites[obj.entities[i].drawframe], 6 * sprites_rect.w,6* sprites_rect.h );
|
SDL_Surface* TempSurface = ScaleSurface( flipsprites[obj.entities[i].drawframe], 6 * sprites_rect.w,6* sprites_rect.h );
|
||||||
BlitSurfaceColoured(TempSurface, NULL , backBuffer, &drawRect, ct );
|
BlitSurfaceColoured(TempSurface, NULL , backBuffer, &drawRect, ct );
|
||||||
|
@ -1977,7 +1926,6 @@ void Graphics::drawbackground( int t )
|
||||||
if (starsspeed[i] <= 6)
|
if (starsspeed[i] <= 6)
|
||||||
{
|
{
|
||||||
FillRect(backBuffer,stars[i], getRGB(0x22,0x22,0x22));
|
FillRect(backBuffer,stars[i], getRGB(0x22,0x22,0x22));
|
||||||
//backbuffer.fillRect(stars[i], 0x222222);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2171,8 +2119,6 @@ void Graphics::drawbackground( int t )
|
||||||
|
|
||||||
if (backgrounddrawn)
|
if (backgrounddrawn)
|
||||||
{
|
{
|
||||||
//TODO Scroll?
|
|
||||||
//towerbuffer.scroll( -3, 0);
|
|
||||||
ScrollSurface(towerbuffer, -3, 0 );
|
ScrollSurface(towerbuffer, -3, 0 );
|
||||||
for (int j = 0; j < 15; j++)
|
for (int j = 0; j < 15; j++)
|
||||||
{
|
{
|
||||||
|
@ -2201,9 +2147,6 @@ void Graphics::drawbackground( int t )
|
||||||
}
|
}
|
||||||
backgrounddrawn = true;
|
backgrounddrawn = true;
|
||||||
}
|
}
|
||||||
//TODO this is why map breaks
|
|
||||||
|
|
||||||
//backbuffer.copyPixels(towerbuffer, towerbuffer.rect, tl);
|
|
||||||
BlitSurfaceStandard(towerbuffer, NULL, backBuffer, NULL);
|
BlitSurfaceStandard(towerbuffer, NULL, backBuffer, NULL);
|
||||||
break;
|
break;
|
||||||
case 4: //Warp zone (vertical)
|
case 4: //Warp zone (vertical)
|
||||||
|
@ -2212,8 +2155,6 @@ void Graphics::drawbackground( int t )
|
||||||
|
|
||||||
if (backgrounddrawn)
|
if (backgrounddrawn)
|
||||||
{
|
{
|
||||||
//TODO scroll?!
|
|
||||||
//towerbuffer.scroll(0, -3);
|
|
||||||
ScrollSurface(towerbuffer,0,-3);
|
ScrollSurface(towerbuffer,0,-3);
|
||||||
for (int i = 0; i < 21; i++)
|
for (int i = 0; i < 21; i++)
|
||||||
{
|
{
|
||||||
|
@ -2358,8 +2299,6 @@ void Graphics::drawbackground( int t )
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
FillRect(backBuffer, 0x000000 );
|
FillRect(backBuffer, 0x000000 );
|
||||||
//TODO
|
|
||||||
//backbuffer.copyPixels(backgrounds[t], bg_rect, tl);
|
|
||||||
BlitSurfaceStandard(backgrounds[t], NULL, backBuffer, &bg_rect);
|
BlitSurfaceStandard(backgrounds[t], NULL, backBuffer, &bg_rect);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -2368,7 +2307,6 @@ void Graphics::drawbackground( int t )
|
||||||
|
|
||||||
void Graphics::drawmap()
|
void Graphics::drawmap()
|
||||||
{
|
{
|
||||||
///TODO forground once;
|
|
||||||
if (!foregrounddrawn)
|
if (!foregrounddrawn)
|
||||||
{
|
{
|
||||||
FillRect(foregroundBuffer, 0x00000000);
|
FillRect(foregroundBuffer, 0x00000000);
|
||||||
|
@ -2635,7 +2573,6 @@ void Graphics::drawtowerbackgroundsolo()
|
||||||
|
|
||||||
void Graphics::drawtowerbackground()
|
void Graphics::drawtowerbackground()
|
||||||
{
|
{
|
||||||
//TODO
|
|
||||||
int temp;
|
int temp;
|
||||||
|
|
||||||
if (map.bypos < 0) map.bypos += 120 * 8;
|
if (map.bypos < 0) map.bypos += 120 * 8;
|
||||||
|
@ -2654,7 +2591,6 @@ void Graphics::drawtowerbackground()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//backbuffer.copyPixels(towerbuffer, towerbuffer.rect, tl, null, null, false);
|
|
||||||
SDL_BlitSurface(towerbuffer,NULL, backBuffer,NULL);
|
SDL_BlitSurface(towerbuffer,NULL, backBuffer,NULL);
|
||||||
|
|
||||||
map.tdrawback = false;
|
map.tdrawback = false;
|
||||||
|
@ -2662,8 +2598,6 @@ void Graphics::drawtowerbackground()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//just update the bottom
|
//just update the bottom
|
||||||
//TODO SCOLL
|
|
||||||
//towerbuffer.scroll(0, -map.bscroll);
|
|
||||||
ScrollSurface(towerbuffer, 0, -map.bscroll);
|
ScrollSurface(towerbuffer, 0, -map.bscroll);
|
||||||
for (int i = 0; i < 40; i++)
|
for (int i = 0; i < 40; i++)
|
||||||
{
|
{
|
||||||
|
@ -2671,7 +2605,6 @@ void Graphics::drawtowerbackground()
|
||||||
drawtowertile3(i * 8, -(map.bypos % 8), temp, map.colstate);
|
drawtowertile3(i * 8, -(map.bypos % 8), temp, map.colstate);
|
||||||
}
|
}
|
||||||
|
|
||||||
//backbuffer.copyPixels(towerbuffer, towerbuffer.rect, tl, null, null, false);
|
|
||||||
SDL_BlitSurface(towerbuffer,NULL, backBuffer,NULL);
|
SDL_BlitSurface(towerbuffer,NULL, backBuffer,NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2875,15 +2808,10 @@ void Graphics::setcol( int t )
|
||||||
ct.colour = 0xFFFFFF;
|
ct.colour = 0xFFFFFF;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//ct.color = endian_swap(ct.color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::menuoffrender()
|
void Graphics::menuoffrender()
|
||||||
{
|
{
|
||||||
//TODO
|
|
||||||
//screenbuffer.lock();
|
|
||||||
//screenbuffer.copyPixels(menubuffer, menubuffer.rect, tl, null, null, false);
|
|
||||||
//screenbuffer->UpdateScreen(menubuffer,NULL);
|
|
||||||
SDL_Rect offsetRect1;
|
SDL_Rect offsetRect1;
|
||||||
setRect (offsetRect1, 0, 0, backBuffer->w ,backBuffer->h);
|
setRect (offsetRect1, 0, 0, backBuffer->w ,backBuffer->h);
|
||||||
|
|
||||||
|
@ -2913,20 +2841,15 @@ void Graphics::menuoffrender()
|
||||||
//put the stored backbuffer in the backbuffer.
|
//put the stored backbuffer in the backbuffer.
|
||||||
BlitSurfaceStandard(tempBuffer, NULL, backBuffer, NULL);
|
BlitSurfaceStandard(tempBuffer, NULL, backBuffer, NULL);
|
||||||
|
|
||||||
//screenbuffer.copyPixels(backbuffer, backbuffer.rect, new Point(0, menuoffset), null, null, false);
|
|
||||||
SDL_Rect offsetRect;
|
SDL_Rect offsetRect;
|
||||||
setRect (offsetRect, 0, menuoffset, backBuffer->w ,backBuffer->h);
|
setRect (offsetRect, 0, menuoffset, backBuffer->w ,backBuffer->h);
|
||||||
BlitSurfaceStandard(menubuffer,NULL,backBuffer,&offsetRect);
|
BlitSurfaceStandard(menubuffer,NULL,backBuffer,&offsetRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
//screenbuffer.unlock();
|
|
||||||
SDL_Rect rect;
|
SDL_Rect rect;
|
||||||
setRect(rect, 0, 0, backBuffer->w, backBuffer->h);
|
setRect(rect, 0, 0, backBuffer->w, backBuffer->h);
|
||||||
screenbuffer->UpdateScreen(backBuffer,&rect);
|
screenbuffer->UpdateScreen(backBuffer,&rect);
|
||||||
//backbuffer.lock();
|
|
||||||
//backbuffer.fillRect(backbuffer.rect, 0x000000);
|
|
||||||
FillRect(backBuffer, 0x000000);
|
FillRect(backBuffer, 0x000000);
|
||||||
//backbuffer.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::drawhuetile( int x, int y, int t, int c )
|
void Graphics::drawhuetile( int x, int y, int t, int c )
|
||||||
|
@ -3023,7 +2946,6 @@ void Graphics::flashlight()
|
||||||
void Graphics::screenshake()
|
void Graphics::screenshake()
|
||||||
{
|
{
|
||||||
point tpoint;
|
point tpoint;
|
||||||
//screenbuffer.lock();
|
|
||||||
if(flipmode)
|
if(flipmode)
|
||||||
{
|
{
|
||||||
// tpoint.x = int((Math.random() * 7) - 4); tpoint.y = int((Math.random() * 7) - 4);
|
// tpoint.x = int((Math.random() * 7) - 4); tpoint.y = int((Math.random() * 7) - 4);
|
||||||
|
@ -3050,14 +2972,9 @@ void Graphics::screenshake()
|
||||||
SDL_Rect shakeRect;
|
SDL_Rect shakeRect;
|
||||||
setRect(shakeRect,tpoint.x, tpoint.y, backBuffer->w, backBuffer->h);
|
setRect(shakeRect,tpoint.x, tpoint.y, backBuffer->w, backBuffer->h);
|
||||||
screenbuffer->UpdateScreen( backBuffer, &shakeRect);
|
screenbuffer->UpdateScreen( backBuffer, &shakeRect);
|
||||||
// screenbuffer.copyPixels(backbuffer, backbuffer.rect, tpoint, null, null, false);
|
|
||||||
}
|
}
|
||||||
//screenbuffer.unlock();
|
|
||||||
|
|
||||||
//backbuffer.lock();
|
|
||||||
FillRect(backBuffer, 0x000000 );
|
FillRect(backBuffer, 0x000000 );
|
||||||
//backbuffer.fillRect(backbuffer.rect, 0x000000);
|
|
||||||
//backbuffer.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::render()
|
void Graphics::render()
|
||||||
|
@ -3198,7 +3115,6 @@ void Graphics::setcolreal(Uint32 t)
|
||||||
|
|
||||||
void Graphics::drawforetile(int x, int y, int t)
|
void Graphics::drawforetile(int x, int y, int t)
|
||||||
{
|
{
|
||||||
//frontbuffer.copyPixels(tiles[t], tiles_rect, tpoint);
|
|
||||||
SDL_Rect rect;
|
SDL_Rect rect;
|
||||||
setRect(rect, x,y,tiles_rect.w, tiles_rect.h);
|
setRect(rect, x,y,tiles_rect.w, tiles_rect.h);
|
||||||
BlitSurfaceStandard(tiles[t],NULL, foregroundBuffer, &rect );
|
BlitSurfaceStandard(tiles[t],NULL, foregroundBuffer, &rect );
|
||||||
|
@ -3206,7 +3122,6 @@ void Graphics::drawforetile(int x, int y, int t)
|
||||||
|
|
||||||
void Graphics::drawforetile2(int x, int y, int t)
|
void Graphics::drawforetile2(int x, int y, int t)
|
||||||
{
|
{
|
||||||
//frontbuffer.copyPixels(tiles2[t], tiles_rect, tpoint);
|
|
||||||
SDL_Rect rect;
|
SDL_Rect rect;
|
||||||
setRect(rect, x,y,tiles_rect.w, tiles_rect.h);
|
setRect(rect, x,y,tiles_rect.w, tiles_rect.h);
|
||||||
BlitSurfaceStandard(tiles2[t],NULL, foregroundBuffer, &rect );
|
BlitSurfaceStandard(tiles2[t],NULL, foregroundBuffer, &rect );
|
||||||
|
@ -3217,7 +3132,6 @@ void Graphics::drawforetile3(int x, int y, int t, int off)
|
||||||
SDL_Rect rect;
|
SDL_Rect rect;
|
||||||
setRect(rect, x,y,tiles_rect.w, tiles_rect.h);
|
setRect(rect, x,y,tiles_rect.w, tiles_rect.h);
|
||||||
BlitSurfaceStandard(tiles3[t+(off*30)],NULL, foregroundBuffer, &rect );
|
BlitSurfaceStandard(tiles3[t+(off*30)],NULL, foregroundBuffer, &rect );
|
||||||
//frontbuffer.copyPixels(tiles3[t+(off*30)], tiles_rect, tpoint);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::drawrect(int x, int y, int w, int h, int r, int g, int b)
|
void Graphics::drawrect(int x, int y, int w, int h, int r, int g, int b)
|
||||||
|
@ -3228,7 +3142,6 @@ void Graphics::drawrect(int x, int y, int w, int h, int r, int g, int b)
|
||||||
madrect.y = y;
|
madrect.y = y;
|
||||||
madrect.w = w;
|
madrect.w = w;
|
||||||
madrect.h = 1;
|
madrect.h = 1;
|
||||||
//backbuffer.fillRect(madrect, RGB(r,g,b));
|
|
||||||
FillRect(backBuffer, madrect, getRGB(b,g,r));
|
FillRect(backBuffer, madrect, getRGB(b,g,r));
|
||||||
|
|
||||||
madrect.w = 1;
|
madrect.w = 1;
|
||||||
|
|
Loading…
Reference in a new issue