Add some missing global/static variable names

Also from the Mac port.
This commit is contained in:
Clownacy 2020-03-22 15:29:20 +00:00
parent f6606b7748
commit b374a8046c

View file

@ -55,16 +55,16 @@ static struct
} surface_metadata[SURFACE_ID_MAX]; } surface_metadata[SURFACE_ID_MAX];
// The original names for these variables are unknown // The original names for these variables are unknown
static int x_offset; static int client_x;
static int y_offset; static int client_y;
#define FRAMERATE 20 #define FRAMERATE 20
// The original name for this function is unknown // The original name for this function is unknown
void SetClientOffset(int width, int height) void SetClientOffset(int width, int height)
{ {
x_offset = width; client_x = width;
y_offset = height; client_y = height;
} }
BOOL Flip_SystemTask(HWND hWnd) BOOL Flip_SystemTask(HWND hWnd)
@ -93,8 +93,8 @@ BOOL Flip_SystemTask(HWND hWnd)
static RECT dst_rect; static RECT dst_rect;
GetWindowRect(hWnd, &dst_rect); GetWindowRect(hWnd, &dst_rect);
dst_rect.left += x_offset; dst_rect.left += client_x;
dst_rect.top += y_offset; dst_rect.top += client_y;
dst_rect.right = dst_rect.left + scaled_window_width; dst_rect.right = dst_rect.left + scaled_window_width;
dst_rect.bottom = dst_rect.top + scaled_window_height; dst_rect.bottom = dst_rect.top + scaled_window_height;
@ -555,111 +555,111 @@ void BackupSurface(SurfaceID surf_no, const RECT *rect)
void PutBitmap3(const RECT *rcView, int x, int y, const RECT *rect, SurfaceID surf_no) // Transparency void PutBitmap3(const RECT *rcView, int x, int y, const RECT *rect, SurfaceID surf_no) // Transparency
{ {
static RECT src_rect; static RECT rcWork;
static RECT dst_rect; static RECT dst_rect;
src_rect = *rect; rcWork = *rect;
if (x + rect->right - rect->left > rcView->right) if (x + rect->right - rect->left > rcView->right)
src_rect.right -= (x + rect->right - rect->left) - rcView->right; rcWork.right -= (x + rect->right - rect->left) - rcView->right;
if (x < rcView->left) if (x < rcView->left)
{ {
src_rect.left += rcView->left - x; rcWork.left += rcView->left - x;
x = rcView->left; x = rcView->left;
} }
if (y + rect->bottom - rect->top > rcView->bottom) if (y + rect->bottom - rect->top > rcView->bottom)
src_rect.bottom -= (y + rect->bottom - rect->top) - rcView->bottom; rcWork.bottom -= (y + rect->bottom - rect->top) - rcView->bottom;
if (y < rcView->top) if (y < rcView->top)
{ {
src_rect.top += rcView->top - y; rcWork.top += rcView->top - y;
y = rcView->top; y = rcView->top;
} }
dst_rect.left = x; rcSet.left = x;
dst_rect.top = y; rcSet.top = y;
dst_rect.right = x + src_rect.right - src_rect.left; rcSet.right = x + rcWork.right - rcWork.left;
dst_rect.bottom = y + src_rect.bottom - src_rect.top; rcSet.bottom = y + rcWork.bottom - rcWork.top;
src_rect.left *= magnification; rcWork.left *= magnification;
src_rect.top *= magnification; rcWork.top *= magnification;
src_rect.right *= magnification; rcWork.right *= magnification;
src_rect.bottom *= magnification; rcWork.bottom *= magnification;
dst_rect.left *= magnification; rcSet.left *= magnification;
dst_rect.top *= magnification; rcSet.top *= magnification;
dst_rect.right *= magnification; rcSet.right *= magnification;
dst_rect.bottom *= magnification; rcSet.bottom *= magnification;
backbuffer->Blt(&dst_rect, surf[surf_no], &src_rect, DDBLT_KEYSRC | DDBLT_WAIT, NULL); backbuffer->Blt(&rcSet, surf[surf_no], &rcWork, DDBLT_KEYSRC | DDBLT_WAIT, NULL);
} }
void PutBitmap4(const RECT *rcView, int x, int y, const RECT *rect, SurfaceID surf_no) // No Transparency void PutBitmap4(const RECT *rcView, int x, int y, const RECT *rect, SurfaceID surf_no) // No Transparency
{ {
static RECT src_rect; static RECT rcWork;
static RECT dst_rect; static RECT rcSet;
src_rect = *rect; rcWork = *rect;
if (x + rect->right - rect->left > rcView->right) if (x + rect->right - rect->left > rcView->right)
src_rect.right -= (x + rect->right - rect->left) - rcView->right; rcWork.right -= (x + rect->right - rect->left) - rcView->right;
if (x < rcView->left) if (x < rcView->left)
{ {
src_rect.left += rcView->left - x; rcWork.left += rcView->left - x;
x = rcView->left; x = rcView->left;
} }
if (y + rect->bottom - rect->top > rcView->bottom) if (y + rect->bottom - rect->top > rcView->bottom)
src_rect.bottom -= (y + rect->bottom - rect->top) - rcView->bottom; rcWork.bottom -= (y + rect->bottom - rect->top) - rcView->bottom;
if (y < rcView->top) if (y < rcView->top)
{ {
src_rect.top += rcView->top - y; rcWork.top += rcView->top - y;
y = rcView->top; y = rcView->top;
} }
dst_rect.left = x; rcSet.left = x;
dst_rect.top = y; rcSet.top = y;
dst_rect.right = x + src_rect.right - src_rect.left; rcSet.right = x + rcWork.right - rcWork.left;
dst_rect.bottom = y + src_rect.bottom - src_rect.top; rcSet.bottom = y + rcWork.bottom - rcWork.top;
src_rect.left *= magnification; rcWork.left *= magnification;
src_rect.top *= magnification; rcWork.top *= magnification;
src_rect.right *= magnification; rcWork.right *= magnification;
src_rect.bottom *= magnification; rcWork.bottom *= magnification;
dst_rect.left *= magnification; rcSet.left *= magnification;
dst_rect.top *= magnification; rcSet.top *= magnification;
dst_rect.right *= magnification; rcSet.right *= magnification;
dst_rect.bottom *= magnification; rcSet.bottom *= magnification;
backbuffer->Blt(&dst_rect, surf[surf_no], &src_rect, DDBLT_WAIT, NULL); backbuffer->Blt(&rcSet, surf[surf_no], &rcWork, DDBLT_WAIT, NULL);
} }
void Surface2Surface(int x, int y, const RECT *rect, int to, int from) void Surface2Surface(int x, int y, const RECT *rect, int to, int from)
{ {
static RECT src_rect; static RECT rcWork;
static RECT dst_rect; static RECT rcSet;
src_rect.left = rect->left * magnification; rcWork.left = rect->left * magnification;
src_rect.top = rect->top * magnification; rcWork.top = rect->top * magnification;
src_rect.right = rect->right * magnification; rcWork.right = rect->right * magnification;
src_rect.bottom = rect->bottom * magnification; rcWork.bottom = rect->bottom * magnification;
dst_rect.left = x; rcSet.left = x;
dst_rect.top = y; rcSet.top = y;
dst_rect.right = x + rect->right - rect->left; rcSet.right = x + rect->right - rect->left;
dst_rect.bottom = y + rect->bottom - rect->top; rcSet.bottom = y + rect->bottom - rect->top;
dst_rect.left *= magnification; rcSet.left *= magnification;
dst_rect.top *= magnification; rcSet.top *= magnification;
dst_rect.right *= magnification; rcSet.right *= magnification;
dst_rect.bottom *= magnification; rcSet.bottom *= magnification;
surf[to]->Blt(&dst_rect, surf[from], &src_rect, DDBLT_KEYSRC | DDBLT_WAIT, NULL); surf[to]->Blt(&rcSet, surf[from], &rcWork, DDBLT_KEYSRC | DDBLT_WAIT, NULL);
} }
// This converts a colour to the 'native' format by writing it // This converts a colour to the 'native' format by writing it