From 5c60b8df5f5a00d8323c98c9c0103cfad8712783 Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 1 Apr 2020 15:42:22 -0700 Subject: [PATCH] Remove unused arguments from Graphics::drawtile() The 'r', 'g', and 'b' arguments do absolutely nothing, even though they're used in the version of Graphics::drawtile() that's more used. So delete the other version without those extra arguments, and then remove the extra arguments from the remaining version. And then update callers. --- desktop_version/src/Graphics.cpp | 9 +------ desktop_version/src/Graphics.h | 4 +-- desktop_version/src/editor.cpp | 46 ++++++++++++++++---------------- 3 files changed, 25 insertions(+), 34 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 018e99d5..4ef5009e 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -556,7 +556,7 @@ void Graphics::drawsprite( int x, int y, int t, int r, int g, int b ) BlitSurfaceColoured(sprites[t], NULL, backBuffer, &rect, ct); } -void Graphics::drawtile( int x, int y, int t, int r, int g, int b ) +void Graphics::drawtile( int x, int y, int t ) { SDL_Rect rect = { Sint16(x), Sint16(y), tiles_rect.w, tiles_rect.h }; BlitSurfaceStandard(tiles[t], NULL, backBuffer, &rect); @@ -3198,13 +3198,6 @@ void Graphics::setcolreal(Uint32 t) ct.colour = t; } -void Graphics::drawtile(int x, int y, int t) -{ - SDL_Rect drawRect; - setRect(drawRect,x,y, tiles_rect.w, tiles_rect.h ); - BlitSurfaceStandard(tiles[t] ,NULL, backBuffer,&drawRect); -} - void Graphics::drawforetile(int x, int y, int t) { //frontbuffer.copyPixels(tiles[t], tiles_rect, tpoint); diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index 0ed0c8a7..decb3670 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -162,12 +162,10 @@ public: void drawtile3( int x, int y, int t, int off ); void drawentcolours( int x, int y, int t); void drawtile2( int x, int y, int t, int r, int g, int b ); - void drawtile( int x, int y, int t, int r, int g, int b ); + void drawtile( int x, int y, int t ); void drawtowertile( int x, int y, int t ); void drawtowertile3( int x, int y, int t, int off ); - void drawtile(int x, int y, int t); - void drawmap(); void drawforetile(int x, int y, int t); diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 1f2e27e9..0a616f14 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -2301,7 +2301,7 @@ void editorrender() for (int i = 0; i < 40; i++) { temp=ed.contents[i + (ed.levx*40) + ed.vmult[j+(ed.levy*30)]]; - if(temp>0) graphics.drawtile(i*8,j*8,temp,0,0,0); + if(temp>0) graphics.drawtile(i*8,j*8,temp); } } } @@ -2740,11 +2740,11 @@ void editorrender() { for(int i=0; i<40; i++) { - graphics.drawtile(i*8,0-t2,(temp+1200+i)%1200,0,0,0); - graphics.drawtile(i*8,8-t2,(temp+1200+40+i)%1200,0,0,0); - graphics.drawtile(i*8,16-t2,(temp+1200+80+i)%1200,0,0,0); - graphics.drawtile(i*8,24-t2,(temp+1200+120+i)%1200,0,0,0); - graphics.drawtile(i*8,32-t2,(temp+1200+160+i)%1200,0,0,0); + graphics.drawtile(i*8,0-t2,(temp+1200+i)%1200); + graphics.drawtile(i*8,8-t2,(temp+1200+40+i)%1200); + graphics.drawtile(i*8,16-t2,(temp+1200+80+i)%1200); + graphics.drawtile(i*8,24-t2,(temp+1200+120+i)%1200); + graphics.drawtile(i*8,32-t2,(temp+1200+160+i)%1200); } } else @@ -2772,7 +2772,7 @@ void editorrender() if(ed.level[ed.levx+(ed.levy*ed.maxwidth)].tileset==0) { - graphics.drawtile(45,45-t2,ed.dmtile,0,0,0); + graphics.drawtile(45,45-t2,ed.dmtile); } else { @@ -2788,7 +2788,7 @@ void editorrender() if(ed.level[ed.levx+(ed.levy*ed.maxwidth)].tileset==0) { - graphics.drawtile(45,12,ed.dmtile,0,0,0); + graphics.drawtile(45,12,ed.dmtile); } else { @@ -3179,19 +3179,19 @@ void editorrender() } FillRect(graphics.backBuffer, 4+(ed.drawmode*tg), 209,20,20,graphics.getRGB(64,64,64)); //0: - graphics.drawtile(tx,ty,83,0,0,0); - graphics.drawtile(tx+8,ty,83,0,0,0); - graphics.drawtile(tx,ty+8,83,0,0,0); - graphics.drawtile(tx+8,ty+8,83,0,0,0); + graphics.drawtile(tx,ty,83); + graphics.drawtile(tx+8,ty,83); + graphics.drawtile(tx,ty+8,83); + graphics.drawtile(tx+8,ty+8,83); //1: tx+=tg; - graphics.drawtile(tx,ty,680,0,0,0); - graphics.drawtile(tx+8,ty,680,0,0,0); - graphics.drawtile(tx,ty+8,680,0,0,0); - graphics.drawtile(tx+8,ty+8,680,0,0,0); + graphics.drawtile(tx,ty,680); + graphics.drawtile(tx+8,ty,680); + graphics.drawtile(tx,ty+8,680); + graphics.drawtile(tx+8,ty+8,680); //2: tx+=tg; - graphics.drawtile(tx+4,ty+4,8,0,0,0); + graphics.drawtile(tx+4,ty+4,8); //3: tx+=tg; graphics.drawsprite(tx,ty,22,196,196,196); @@ -3200,16 +3200,16 @@ void editorrender() graphics.drawsprite(tx,ty,21,196,196,196); //5: tx+=tg; - graphics.drawtile(tx,ty+4,3,0,0,0); - graphics.drawtile(tx+8,ty+4,4,0,0,0); + graphics.drawtile(tx,ty+4,3); + graphics.drawtile(tx+8,ty+4,4); //6: tx+=tg; - graphics.drawtile(tx,ty+4,24,0,0,0); - graphics.drawtile(tx+8,ty+4,24,0,0,0); + graphics.drawtile(tx,ty+4,24); + graphics.drawtile(tx+8,ty+4,24); //7: tx+=tg; - graphics.drawtile(tx,ty+4,1,0,0,0); - graphics.drawtile(tx+8,ty+4,1,0,0,0); + graphics.drawtile(tx,ty+4,1); + graphics.drawtile(tx+8,ty+4,1); //8: tx+=tg; graphics.drawsprite(tx,ty,78+ed.entframe,196,196,196);