From 994f47e7d816f13214df88b96c93a122a7549d95 Mon Sep 17 00:00:00 2001 From: Misa Date: Thu, 25 Feb 2021 15:24:53 -0800 Subject: [PATCH] Remove commented-out code from Graphics.cpp and GraphicsUtil.cpp This is pretty old commented-out code from earlier versions of the game; they are no longer useful, and are just distracting. If we need them, we can always refer back to this commit (but I sincerely doubt that we'll need them). --- desktop_version/src/Graphics.cpp | 26 -------------------------- desktop_version/src/GraphicsUtil.cpp | 25 ------------------------- 2 files changed, 51 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index dca18eb7..c5c73e36 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -524,16 +524,6 @@ void Graphics::bigprint( int _x, int _y, std::string _s, int r, int g, int b, b while (iter != _s.end()) { curr = utf8::unchecked::next(iter); - /* - point tpoint; - tpoint.x = _x + bfontpos; - tpoint.y = _y; - - SDL_Rect fontRect = bfont_rect; - fontRect.x = tpoint.x ; - fontRect.y = tpoint.y ; - */ - idx = font_idx(curr); if (INBOUNDS_VEC(idx, font)) { @@ -2833,9 +2823,6 @@ void Graphics::menuoffrender(void) int usethisoffset = lerp(oldmenuoffset, menuoffset); if(flipmode) { - // flipmatrix.translate(0, menuoffset); - // screenbuffer.draw(backbuffer, flipmatrix); - // flipmatrix.translate(0, -menuoffset); SDL_Surface* tempbufferFlipped = FlipSurfaceVerticle(tempBuffer); //put the stored backbuffer in the backbuffer. SDL_FillRect(backBuffer, NULL, 0x00000000); @@ -2981,11 +2968,6 @@ void Graphics::screenshake(void) { if(flipmode) { - // tpoint.x = int((Math.random() * 7) - 4); tpoint.y = int((Math.random() * 7) - 4); - // flipmatrix.translate(tpoint.x, tpoint.y); - // screenbuffer.draw(backbuffer, flipmatrix); - // flipmatrix.translate(-tpoint.x, -tpoint.y); - SDL_Rect shakeRect; setRect(shakeRect,screenshake_x, screenshake_y, backBuffer->w, backBuffer->h); SDL_Surface* flipBackBuffer = FlipSurfaceVerticle(backBuffer); @@ -2994,10 +2976,6 @@ void Graphics::screenshake(void) } else { - //FillRect(screenbuffer, 0x000); - //SDL_Rect rect; - //setRect(rect, blackBars/2, 0, screenbuffer->w, screenbuffer->h); - //SDL_BlitSurface(backBuffer, NULL, screenbuffer, &rect); SDL_Rect shakeRect; setRect(shakeRect,screenshake_x, screenshake_y, backBuffer->w, backBuffer->h); screenbuffer->UpdateScreen( backBuffer, &shakeRect); @@ -3022,8 +3000,6 @@ void Graphics::render(void) { SDL_Rect rect; setRect(rect, 0, 0, backBuffer->w, backBuffer->h); - //setRect(rect, 0, 0, backBuffer->w, backBuffer->h); - //SDL_BlitSurface(backBuffer, NULL, screenbuffer, &rect); SDL_Surface* tempsurface = FlipSurfaceVerticle(backBuffer); if(tempsurface != NULL) { @@ -3035,8 +3011,6 @@ void Graphics::render(void) { SDL_Rect rect; setRect(rect, 0, 0, backBuffer->w, backBuffer->h); - //setRect(rect, 0, 0, backBuffer->w, backBuffer->h); - //SDL_BlitSurface(backBuffer, NULL, screenbuffer, &rect); screenbuffer->UpdateScreen( backBuffer, &rect); } } diff --git a/desktop_version/src/GraphicsUtil.cpp b/desktop_version/src/GraphicsUtil.cpp index cd3b1194..3fbcf8d3 100644 --- a/desktop_version/src/GraphicsUtil.cpp +++ b/desktop_version/src/GraphicsUtil.cpp @@ -31,9 +31,6 @@ SDL_Surface* GetSubSurface( SDL_Surface* metaSurface, int x, int y, int width, i metaSurface->format->Bmask, metaSurface->format->Amask ); - //SDL_Surface* subSurface = SDL_DisplayFormatAlpha(preSurface); - - //SDL_FreeSurface(preSurface); // Lastly, apply the area from the meta _surface onto the whole of the sub _surface. SDL_BlitSurface(metaSurface, &area, preSurface, 0); @@ -130,9 +127,6 @@ SDL_Surface * ScaleSurface( SDL_Surface *_surface, int Width, int Height, SDL_Su SDL_FillRect(_ret, &gigantoPixel, ReadPixel(_surface, x, y)); } - // DrawPixel(_ret, static_cast(_stretch_factor_x * x) + o_x, - //static_cast(_stretch_factor_y * y) + o_y, ReadPixel(_surface, x, y)); - return _ret; } @@ -160,25 +154,7 @@ SDL_Surface * FlipSurfaceVerticle(SDL_Surface* _src) void BlitSurfaceStandard( SDL_Surface* _src, SDL_Rect* _srcRect, SDL_Surface* _dest, SDL_Rect* _destRect ) { - //SDL_Rect tempRect = *_destRect; - //tempRect.w ; - //tempRect.h ; - //tempRect.x *=globalScale; - //tempRect.y *=globalScale; - - - //if(globalScale != 1) - //{ - // SDL_Surface* tempScaled = ScaleSurface(_src, tempRect.w, tempRect.h); - - // SDL_BlitSurface( tempScaled, _srcRect, _dest, &tempRect ); - - // SDL_FreeSurface(tempScaled); - //} - //else - //{ SDL_BlitSurface( _src, _srcRect, _dest, _destRect ); - //} } void BlitSurfaceColoured( @@ -191,7 +167,6 @@ void BlitSurfaceColoured( SDL_Rect *tempRect = _destRect; const SDL_PixelFormat& fmt = *(_src->format); - // const SDL_PixelFormat& destfmt = *(_dest->format); SDL_Surface* tempsurface = SDL_CreateRGBSurface( SDL_SWSURFACE,