|
@@ -4,50 +4,48 @@
|
|
|
|
|
|
#ifdef WITH_SDL
|
|
|
|
|
|
#include "../openttd.h"
|
|
|
#include "../debug.h"
|
|
|
#include "../functions.h"
|
|
|
#include "../gfx.h"
|
|
|
#include "../macros.h"
|
|
|
#include "../sdl.h"
|
|
|
#include "../window.h"
|
|
|
#include "../network.h"
|
|
|
#include "../variables.h"
|
|
|
#include "sdl_v.h"
|
|
|
#include <SDL.h>
|
|
|
|
|
|
static SDL_Surface *_sdl_screen;
|
|
|
static bool _all_modes;
|
|
|
|
|
|
#define MAX_DIRTY_RECTS 100
|
|
|
static SDL_Rect _dirty_rects[MAX_DIRTY_RECTS];
|
|
|
static int _num_dirty_rects;
|
|
|
|
|
|
static void SdlVideoMakeDirty(int left, int top, int width, int height)
|
|
|
{
|
|
|
// printf("(%d,%d)-(%d,%d)\n", left, top, width, height);
|
|
|
// _pixels_redrawn += width*height;
|
|
|
if (_num_dirty_rects < MAX_DIRTY_RECTS) {
|
|
|
_dirty_rects[_num_dirty_rects].x = left;
|
|
|
_dirty_rects[_num_dirty_rects].y = top;
|
|
|
_dirty_rects[_num_dirty_rects].w = width;
|
|
|
_dirty_rects[_num_dirty_rects].h = height;
|
|
|
}
|
|
|
_num_dirty_rects++;
|
|
|
}
|
|
|
|
|
|
static SDL_Color pal[256];
|
|
|
|
|
|
static void UpdatePalette(uint start, uint end)
|
|
|
{
|
|
|
uint i;
|
|
|
|
|
|
for (i = start; i != end; i++) {
|
|
|
pal[i].r = _cur_palette[i].r;
|
|
|
pal[i].g = _cur_palette[i].g;
|
|
|
pal[i].b = _cur_palette[i].b;
|
|
|
pal[i].unused = 0;
|
|
|
}
|
|
|
|
|
|
SDL_CALL SDL_SetColors(_sdl_screen, pal, start, end);
|
|
|
}
|