From 5a674a9c4d6cbd66d9ab700b11c3d7f8082dd84a Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Fri, 13 Nov 2009 12:34:32 +0100 Subject: Make tiles and non-tiles use the "same" screen_buffer_t buffy. This change also gets rid of the ugly intermediate macroing. --- crawl-ref/source/viewgeom.h | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) (limited to 'crawl-ref/source/viewgeom.h') diff --git a/crawl-ref/source/viewgeom.h b/crawl-ref/source/viewgeom.h index 72e68ce3ec..6913849679 100644 --- a/crawl-ref/source/viewgeom.h +++ b/crawl-ref/source/viewgeom.h @@ -1,29 +1,19 @@ #ifndef VIEWGEOM_H #define VIEWGEOM_H -template class crawl_view_buffer { public: - crawl_view_buffer() : buffer(NULL) {} - ~crawl_view_buffer() { delete [] buffer; } - - void size(const coord_def &sz) - { - delete [] buffer; - buffer = new T[sz.x * sz.y * 2]; - } - - operator T * () { return (buffer); } + crawl_view_buffer(); + ~crawl_view_buffer(); + void size(const coord_def &size); + operator screen_buffer_t * () { return (buffer); } + void draw(); private: - T *buffer; + screen_buffer_t *buffer; }; -#ifdef USE_TILE -typedef unsigned int tile_buffer_t; -#endif - struct crawl_view_geometry { public: @@ -38,12 +28,7 @@ public: coord_def mlistp; // Left-top pos of the monster list. coord_def mlistsz; // Size of the monster list. - crawl_view_buffer vbuf; - // Buffer for drawing the main game map. -#ifdef USE_TILE - crawl_view_buffer tbuf; - // Tiles buffer. -#endif + crawl_view_buffer vbuf; // Buffer for drawing the main game map. coord_def vgrdc; // What grid pos is at the centre of the view // usually you.pos(). -- cgit v1.2.3-54-g00ecf