From e354c4b4f28ec5e67817fe3161ce163bd60e4748 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 30 Jan 2009 16:18:58 +0000 Subject: Got rid of VectorRenderer::surfacePitch() & VectorRenderer::bytesPerPixel(): the latter was not used, for the former it is silly to go through a virtual method to compute that value; all in all, this code performs too many unnecessary divisions ;) svn-id: r36151 --- graphics/VectorRenderer.h | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'graphics/VectorRenderer.h') diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h index 9d5453aa57..7905c43940 100644 --- a/graphics/VectorRenderer.h +++ b/graphics/VectorRenderer.h @@ -217,28 +217,6 @@ public: drawLine(x + w, y, x, y + h); } - /** - * Gets the pixel pitch for the current drawing surface. - * Note: This is a real pixel-pitch, not a byte-pitch. - * That means it can be safely used in pointer arithmetics and - * in pixel manipulation. - * - * @return integer with the active bytes per pixel - */ - virtual uint16 surfacePitch() { - return _activeSurface->pitch / _activeSurface->bytesPerPixel; - } - - /** - * Gets the BYTES (not bits) per Pixel we are working on, - * based on the active drawing surface. - * - * @return integer byte with the active bytes per pixel value - */ - virtual uint8 bytesPerPixel() { - return _activeSurface->bytesPerPixel; - } - /** * Set the active foreground painting color for the renderer. * All the foreground drawing from then on will be done with that color, unless @@ -303,7 +281,7 @@ public: */ virtual void clearSurface() { byte *src = (byte *)_activeSurface->pixels; - memset(src, 0, _activeSurface->w * _activeSurface->h * _activeSurface->bytesPerPixel); + memset(src, 0, _activeSurface->pitch * _activeSurface->h); } /** -- cgit v1.2.3