diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-05-30 11:32:58 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-05-30 11:32:58 (GMT) |
| commit | 86746f38b0c0f382f06eb11c59b3dc49641490aa (patch) | |
| tree | e6b6b239f9097c06faa235e2773903f811458519 /src/RasterGraphics.cpp | |
| parent | 7074036b898083cdab1316cedbbade009ce6422d (diff) | |
| download | powder-86746f38b0c0f382f06eb11c59b3dc49641490aa.zip powder-86746f38b0c0f382f06eb11c59b3dc49641490aa.tar.gz | |
Separate SDL from graphics code
Also remove OS X specific project files and update Makefile to ensure
the Element class generator only runs when necessary
Diffstat (limited to 'src/RasterGraphics.cpp')
| -rw-r--r-- | src/RasterGraphics.cpp | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/src/RasterGraphics.cpp b/src/RasterGraphics.cpp index 563aef2..b807238 100644 --- a/src/RasterGraphics.cpp +++ b/src/RasterGraphics.cpp @@ -20,32 +20,9 @@ void Graphics::Clear() memset(vid, 0, PIXELSIZE * ((XRES+BARSIZE) * (YRES+MENUSIZE))); } -void Graphics::AttachSDLSurface(SDL_Surface * surface) +void Graphics::Finalise() { - sdl_scrn = surface; -} -void Graphics::Blit() -{ - if(sdl_scrn) - { - pixel * dst; - pixel * src = vid; - int j, x = 0, y = 0, w = XRES+BARSIZE, h = YRES+MENUSIZE, pitch = XRES+BARSIZE; - if (SDL_MUSTLOCK(sdl_scrn)) - if (SDL_LockSurface(sdl_scrn)<0) - return; - dst=(pixel *)sdl_scrn->pixels+y*sdl_scrn->pitch/PIXELSIZE+x; - for (j=0; j<h; j++) - { - memcpy(dst, src, w*PIXELSIZE); - dst+=sdl_scrn->pitch/PIXELSIZE; - src+=pitch; - } - if (SDL_MUSTLOCK(sdl_scrn)) - SDL_UnlockSurface(sdl_scrn); - SDL_UpdateRect(sdl_scrn,0,0,0,0); - } } int Graphics::drawtext(int x, int y, const char *s, int r, int g, int b, int a) |
