2020-11-06 14:56:32 +01:00
|
|
|
#pragma once
|
2020-11-16 15:12:31 +01:00
|
|
|
#include "maths.h"
|
2020-11-06 14:56:32 +01:00
|
|
|
|
|
|
|
#define BYTEn(x, n) (*((unsigned char*)&(x)+n))
|
|
|
|
#define BYTE1(x) BYTEn(x, 1) // byte 1 (counting from 0)
|
|
|
|
#define BYTE2(x) BYTEn(x, 2)
|
|
|
|
|
2021-02-06 14:53:47 +01:00
|
|
|
|
|
|
|
struct resolution_info
|
|
|
|
{
|
|
|
|
__int16 ScreenWidth;
|
|
|
|
__int16 ScreenHeight;
|
|
|
|
__int16 TableWidth;
|
|
|
|
__int16 TableHeight;
|
|
|
|
__int16 ResolutionMenuId;
|
|
|
|
};
|
|
|
|
|
2020-11-06 14:56:32 +01:00
|
|
|
class fullscrn
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
static int screen_mode;
|
|
|
|
static HWND hWnd;
|
2020-11-16 15:12:31 +01:00
|
|
|
static tagRECT WindowRect1, WindowRect2;
|
|
|
|
static rectangle_type WHRect;
|
2020-11-06 14:56:32 +01:00
|
|
|
static int fullscrn_flag1;
|
|
|
|
static int display_changed;
|
|
|
|
static int ChangeDisplay, SmthFullScrnFlag2;
|
|
|
|
static int trick;
|
2021-02-06 14:53:47 +01:00
|
|
|
static const resolution_info resolution_array[3];
|
2020-11-06 14:56:32 +01:00
|
|
|
|
2020-11-16 15:12:31 +01:00
|
|
|
static void init(int width, int height, int isFullscreen, HWND winHandle, HMENU menuHandle, int changeDisplay);
|
|
|
|
static void shutdown();
|
2020-11-06 14:56:32 +01:00
|
|
|
static int set_screen_mode(int isFullscreen);
|
2020-11-07 16:41:14 +01:00
|
|
|
static void force_redraw();
|
2020-11-16 15:12:31 +01:00
|
|
|
static void center_in(HWND parent, HWND child);
|
|
|
|
static int displaychange();
|
|
|
|
static void activate(int flag);
|
2021-01-06 15:06:13 +01:00
|
|
|
static unsigned convert_mouse_pos(unsigned int mouseXY);
|
2020-11-16 15:12:31 +01:00
|
|
|
static void getminmaxinfo(MINMAXINFO* maxMin);
|
|
|
|
static void paint();
|
2020-12-02 18:12:34 +01:00
|
|
|
static bool set_menu_mode(int menuEnabled);
|
2021-02-06 14:53:47 +01:00
|
|
|
static int GetResolution();
|
|
|
|
static void SetResolution(int resolution);
|
|
|
|
static int GetMaxResolution();
|
|
|
|
static void SetMaxResolution(int resolution);
|
|
|
|
static int get_max_supported_resolution();
|
|
|
|
static int get_screen_resolution();
|
2020-11-06 14:56:32 +01:00
|
|
|
private :
|
|
|
|
static int MenuEnabled;
|
|
|
|
static HMENU MenuHandle;
|
2021-02-06 14:53:47 +01:00
|
|
|
static int resolution;
|
|
|
|
static int maxResolution;
|
2020-11-16 15:12:31 +01:00
|
|
|
|
|
|
|
static void GetWindowCenter();
|
2020-11-06 14:56:32 +01:00
|
|
|
static int disableWindowFlagsDisDlg();
|
|
|
|
static int setWindowFlagsDisDlg();
|
|
|
|
static int enableFullscreen();
|
2020-11-16 15:12:31 +01:00
|
|
|
static int disableFullscreen();
|
|
|
|
static void fillRect(int right, int bottom);
|
2020-11-06 14:56:32 +01:00
|
|
|
};
|