|
@@ -9,21 +9,21 @@
|
|
|
#include "spritecache.h"
|
|
|
#include "strings.h"
|
|
|
#include "string.h"
|
|
|
#include "gfx.h"
|
|
|
#include "table/palettes.h"
|
|
|
#include "table/sprites.h"
|
|
|
#include "hal.h"
|
|
|
#include "variables.h"
|
|
|
#include "table/control_codes.h"
|
|
|
#include "fontcache.h"
|
|
|
#include "genworld.h"
|
|
|
#include "debug.h"
|
|
|
#include "zoom.hpp"
|
|
|
#include "texteff.hpp"
|
|
|
#include "blitter/factory.hpp"
|
|
|
#include "video/video_driver.hpp"
|
|
|
|
|
|
byte _dirkeys; ///< 1 = left, 2 = up, 4 = right, 8 = down
|
|
|
bool _fullscreen;
|
|
|
CursorVars _cursor;
|
|
|
bool _ctrl_pressed; ///< Is Ctrl pressed?
|
|
|
bool _shift_pressed; ///< Is Shift pressed?
|
|
@@ -63,13 +63,13 @@ void GfxScroll(int left, int top, int wi
|
|
|
|
|
|
if (_cursor.visible) UndrawMouseCursor();
|
|
|
UndrawTextMessage();
|
|
|
|
|
|
blitter->ScrollBuffer(_screen.dst_ptr, left, top, width, height, xo, yo);
|
|
|
/* This part of the screen is now dirty. */
|
|
|
_video_driver->make_dirty(left, top, width, height);
|
|
|
_video_driver->MakeDirty(left, top, width, height);
|
|
|
}
|
|
|
|
|
|
|
|
|
void GfxFillRect(int left, int top, int right, int bottom, int color)
|
|
|
{
|
|
|
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
|
|
@@ -831,13 +831,13 @@ void ScreenSizeChanged()
|
|
|
void UndrawMouseCursor()
|
|
|
{
|
|
|
if (_cursor.visible) {
|
|
|
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
|
|
|
_cursor.visible = false;
|
|
|
blitter->CopyFromBuffer(blitter->MoveTo(_screen.dst_ptr, _cursor.draw_pos.x, _cursor.draw_pos.y), _cursor_backup, _cursor.draw_size.x, _cursor.draw_size.y);
|
|
|
_video_driver->make_dirty(_cursor.draw_pos.x, _cursor.draw_pos.y, _cursor.draw_size.x, _cursor.draw_size.y);
|
|
|
_video_driver->MakeDirty(_cursor.draw_pos.x, _cursor.draw_pos.y, _cursor.draw_size.x, _cursor.draw_size.y);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void DrawMouseCursor()
|
|
|
{
|
|
|
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
|
|
@@ -883,13 +883,13 @@ void DrawMouseCursor()
|
|
|
blitter->CopyToBuffer(blitter->MoveTo(_screen.dst_ptr, _cursor.draw_pos.x, _cursor.draw_pos.y), _cursor_backup, _cursor.draw_size.x, _cursor.draw_size.y);
|
|
|
|
|
|
/* Draw cursor on screen */
|
|
|
_cur_dpi = &_screen;
|
|
|
DrawSprite(_cursor.sprite, _cursor.pal, _cursor.pos.x, _cursor.pos.y);
|
|
|
|
|
|
_video_driver->make_dirty(_cursor.draw_pos.x, _cursor.draw_pos.y, _cursor.draw_size.x, _cursor.draw_size.y);
|
|
|
_video_driver->MakeDirty(_cursor.draw_pos.x, _cursor.draw_pos.y, _cursor.draw_size.x, _cursor.draw_size.y);
|
|
|
|
|
|
_cursor.visible = true;
|
|
|
_cursor.dirty = false;
|
|
|
}
|
|
|
|
|
|
void RedrawScreenRect(int left, int top, int right, int bottom)
|
|
@@ -904,13 +904,13 @@ void RedrawScreenRect(int left, int top,
|
|
|
}
|
|
|
}
|
|
|
UndrawTextMessage();
|
|
|
|
|
|
DrawOverlappedWindowForAll(left, top, right, bottom);
|
|
|
|
|
|
_video_driver->make_dirty(left, top, right - left, bottom - top);
|
|
|
_video_driver->MakeDirty(left, top, right - left, bottom - top);
|
|
|
}
|
|
|
|
|
|
void DrawDirtyBlocks()
|
|
|
{
|
|
|
byte *b = _dirty_blocks;
|
|
|
const int w = ALIGN(_screen.width, 64);
|
|
@@ -1148,18 +1148,18 @@ void SetAnimatedMouseCursor(const AnimCu
|
|
|
}
|
|
|
|
|
|
bool ChangeResInGame(int w, int h)
|
|
|
{
|
|
|
return
|
|
|
(_screen.width == w && _screen.height == h) ||
|
|
|
_video_driver->change_resolution(w, h);
|
|
|
_video_driver->ChangeResolution(w, h);
|
|
|
}
|
|
|
|
|
|
void ToggleFullScreen(bool fs)
|
|
|
{
|
|
|
_video_driver->toggle_fullscreen(fs);
|
|
|
_video_driver->ToggleFullscreen(fs);
|
|
|
if (_fullscreen != fs && _num_resolutions == 0) {
|
|
|
DEBUG(driver, 0, "Could not find a suitable fullscreen resolution");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static int CDECL compare_res(const void *pa, const void *pb)
|