Codechange: [Blitter] Change DrawLine to be templated

This is remove per-pixel overheads due to use of the SetPixel virtual
method.
These overheads included:
* expensive virtual method call which prevents inlining
* palette lookup for every pixel
* branch on whether palette animation is enabled on every pixel

Regenerate project files.
This commit is contained in:
Jonathan G Rennison
2018-01-16 23:23:52 +00:00
committed by PeterN
parent ed325ada88
commit db924a4681
13 changed files with 62 additions and 18 deletions

View File

@@ -122,7 +122,7 @@ public:
* @param width Line width.
* @param dash Length of dashes for dashed lines. 0 means solid line.
*/
virtual void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash = 0);
virtual void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash = 0) = 0;
/**
* Copy from a buffer to the screen.
@@ -203,6 +203,8 @@ public:
virtual void PostResize() { };
virtual ~Blitter() { }
template <typename SetPixelT> void DrawLineGeneric(int x, int y, int x2, int y2, int screen_width, int screen_height, int width, int dash, SetPixelT set_pixel);
};
#endif /* BLITTER_BASE_HPP */