if (ap->gfx_backbuffers >= 2)
ap->gfx_vflip = -1;
}
- if (prefs->gf[i].gfx_filter == 0 && ((prefs->gf[i].gfx_filter_autoscale && !prefs->gfx_api) || (prefs->gfx_apmode[APMODE_NATIVE].gfx_vsyncmode))) {
+ if (prefs->gf[i].gfx_filter == 0) {
prefs->gf[i].gfx_filter = 1;
}
if (i == 0) {
#ifdef _WIN32
if (p->monitoremu && p->monitoremu_mon > 0) {
- if (!p->gfx_api) {
- p->monitoremu_mon = 0;
- error_log(_T("Multi virtual monitor support requires Direct3D mode."));
- }
if (isfullscreen() != 0) {
p->monitoremu_mon = 0;
error_log(_T("Multi virtual monitor support requires windowed mode."));
{
struct d3dstruct *d3d = &d3ddata[monid];
- if (width < 0 || height < 0)
- return true;
+ if (width < 0 || height < 0) {
+ return xD3D_goodenough() > 0;
+ }
if (width && height) {
d3d->cursor_offset2_x = d3d->cursor_offset_x * d3d->window_w / width;
D3D_led = xD3D_led;
D3D_getscanline = xD3D_getscanline;
D3D_extoverlay = xD3D_extoverlay;
+ D3D_paint = NULL;
}
#endif
extern void(*D3D_led)(int, int, int);
extern bool(*D3D_getscanline)(int*, bool*);
extern bool(*D3D_extoverlay)(struct extoverlay*);
+extern void(*D3D_paint)(void);
extern LPDIRECT3DSURFACE9 D3D_capture(int, int*,int*,int*,bool);
extern bool D3D11_capture(int, void**,int*, int*,int*,bool);
void(*D3D_led)(int, int, int);
bool(*D3D_getscanline)(int*, bool*);
bool(*D3D_extoverlay)(struct extoverlay*);
+void(*D3D_paint)(void);
static HMODULE hd3d11, hdxgi, hd3dcompiler, dwmapi;
D3D_led = xD3D11_led;
D3D_getscanline = NULL;
D3D_extoverlay = xD3D11_extoverlay;
+ D3D_paint = NULL;
}
void d3d_select(struct uae_prefs *p)
#include "statusline.h"
#include "uae.h"
#include "direct3d.h"
+#include "gfxfilter.h"
struct gdibm
{
{
int enabled;
int num;
- int width, height, depth;
int wwidth, wheight;
+ int depth;
HWND hwnd;
HDC hdc;
- HDC thdc;
- HBITMAP hbm;
HGDIOBJ oldbm;
- void *bits;
- int pitch;
int statusbar_hx, statusbar_vx;
int ledwidth, ledheight;
+ struct gdibm bm;
+ struct gdibm buf;
struct gdibm osd;
+ struct gdibm cursor;
+
+ float cursor_x, cursor_y;
+ float cursor_mx, cursor_my;
+ bool cursor_v, cursor_scale;
+
+ RECT sr2, dr2, zr2;
+ int dmult, dmultxh, dmultxv;
+ int xoffset, yoffset;
+ float xmult, ymult;
+ int cursor_offset_x, cursor_offset_y, cursor_offset2_x, cursor_offset2_y;
+
+ int bmxoffset, bmyoffset;
+ int bmwidth, bmheight;
+ bool refreshneeded;
+ bool eraseneeded;
};
static struct gdistruct gdidata[MAX_AMIGAMONITORS];
-static void gdi_refresh(int monid)
+static void gdi_restore(int monid, bool checkonly)
{
struct gdistruct *gdi = &gdidata[monid];
}
-static void gdi_restore(int monid, bool checkonly)
+static void setupscenecoords(struct gdistruct *gdi)
{
- struct gdistruct *gdi = &gdidata[monid];
+ RECT sr, dr, zr;
+
+ getfilterrect2(gdi->num, &dr, &sr, &zr, gdi->wwidth, gdi->wheight, gdi->bm.width / gdi->dmult, gdi->bm.height / gdi->dmult, gdi->dmult, gdi->bm.width, gdi->bm.height);
+
+ if (0 && !memcmp(&sr, &gdi->sr2, sizeof RECT) && !memcmp(&dr, &gdi->dr2, sizeof RECT) && !memcmp(&zr, &gdi->zr2, sizeof RECT)) {
+ return;
+ }
+ if (1) {
+ write_log(_T("POS (%d %d %d %d) - (%d %d %d %d)[%d,%d] (%d %d) S=%d*%d B=%d*%d\n"),
+ dr.left, dr.top, dr.right, dr.bottom,
+ sr.left, sr.top, sr.right, sr.bottom,
+ sr.right - sr.left, sr.bottom - sr.top,
+ zr.left, zr.top,
+ gdi->wwidth, gdi->wheight,
+ gdi->bm.width, gdi->bm.height);
+ }
+
+ gdi->sr2 = sr;
+ gdi->dr2 = dr;
+ gdi->zr2 = zr;
+
+ int w = sr.right - sr.left;
+ int h = sr.bottom - sr.top;
+
+ int dw = dr.right - dr.left;
+ int dh = dr.bottom - dr.top;
+
+ gdi->xmult = (float)gdi->wwidth / w;
+ gdi->ymult = (float)gdi->wheight / h;
+
+ gdi->bmwidth = gdi->bm.width * gdi->xmult;
+ gdi->bmheight = gdi->bm.height * gdi->ymult;
+
+ gdi->bmxoffset = (gdi->wwidth - gdi->bm.width) / 2;
+ gdi->bmyoffset = (gdi->wheight - gdi->bm.height) / 2;
+
+// gdi->bmxoffset -= zr.left / gdi->xmult;
+// gdi->bmxoffset = (gdi->wwidth - w * gdi->xmult) / 2;
+// gdi->bmyoffset = (gdi->wheight - h * gdi->ymult) / 2;
+
+ //gdi->bmxoffset += (dw - gdi->wwidth) / gdi->xmult / 2;
+
+// gdi->bmxoffset += zr.left * gdi->xmult - ((sr.right - sr.left) - gdi->wwidth);
+// gdi->bmyoffset = (gdi->wheight - gdi->bm.height) / 2;
+// gdi->bmyoffset += zr.top * gdi->ymult - ((sr.bottom - sr.top) - gdi->wheight);
+
+ gdi->eraseneeded = true;
}
-static void freetexture(int monid)
+static void gdi_clear(int monid)
{
struct gdistruct *gdi = &gdidata[monid];
+
if (gdi->hdc) {
- if (gdi->thdc) {
- if (gdi->hbm) {
- if (gdi->oldbm) {
- SelectObject(gdi->thdc, gdi->oldbm);
- }
- DeleteObject(gdi->hbm);
- }
- gdi->oldbm = NULL;
- gdi->hbm = NULL;
- gdi->bits = NULL;
- DeleteDC(gdi->thdc);
- gdi->thdc = NULL;
- }
- ReleaseDC(gdi->hwnd, gdi->hdc);
- gdi->hdc = NULL;
+ Rectangle(gdi->hdc, 0, 0, gdi->wwidth, gdi->wheight);
}
}
}
}
+static void freetexture(int monid)
+{
+ struct gdistruct *gdi = &gdidata[monid];
+ freesprite(gdi, &gdi->bm);
+}
+
static bool allocsprite(struct gdistruct *gdi, struct gdibm *bm, int w, int h)
{
bm->thdc = CreateCompatibleDC(gdi->hdc);
if (bm->thdc) {
BITMAPV4HEADER bmi = { 0 };
-
bmi.bV4Size = sizeof(BITMAPINFOHEADER);
bmi.bV4Width = w;
bmi.bV4Height = -h;
bm->height = h;
bm->depth = gdi->depth;
bm->pitch = ((w * bmi.bV4BitCount + 31) / 32) * 4;
- bmi.bV4SizeImage = gdi->pitch * h;
+ bmi.bV4SizeImage = bm->pitch * h;
bm->hbm = CreateDIBSection(gdi->hdc, (const BITMAPINFO*)&bmi, DIB_RGB_COLORS, &bm->bits, NULL, 0);
if (bm->hbm) {
bm->oldbm = SelectObject(bm->thdc, bm->hbm);
+ SelectObject(bm->thdc, GetStockObject(DC_PEN));
+ SelectObject(bm->thdc, GetStockObject(DC_BRUSH));
+ SetDCPenColor(bm->thdc, RGB(0, 0, 0));
+ SetDCBrushColor(bm->thdc, RGB(0, 0, 0));
return true;
}
}
gdi->hdc = GetDC(gdi->hwnd);
if (gdi->hdc) {
- gdi->thdc = CreateCompatibleDC(gdi->hdc);
- if (gdi->thdc) {
- BITMAPV4HEADER bmi = { 0 };
-
- bmi.bV4Size = sizeof(BITMAPINFOHEADER);
- bmi.bV4Width = w;
- bmi.bV4Height = -h;
- bmi.bV4Planes = 1;
- bmi.bV4V4Compression = BI_RGB;
- bmi.bV4BitCount = gdi->depth;
- gdi->width = w;
- gdi->height = h;
- gdi->pitch = ((w * bmi.bV4BitCount + 31) / 32) * 4;
- bmi.bV4SizeImage = gdi->pitch * h;
- gdi->hbm = CreateDIBSection(gdi->hdc, (const BITMAPINFO*)&bmi, DIB_RGB_COLORS, &gdi->bits, NULL, 0);
- if (gdi->hbm) {
- gdi->oldbm = SelectObject(gdi->thdc, gdi->hbm);
- return true;
- }
+ SelectObject(gdi->hdc, GetStockObject(DC_PEN));
+ SelectObject(gdi->hdc, GetStockObject(DC_BRUSH));
+ SetDCPenColor(gdi->hdc, RGB(0, 0, 0));
+ SetDCBrushColor(gdi->hdc, RGB(0, 0, 0));
+ if (allocsprite(gdi, &gdi->bm, w, h)) {
+ gdi->dmult = S2X_getmult(monid);
+ setupscenecoords(gdi);
+ return true;
}
}
freetexture(monid);
static uae_u8 *gdi_locktexture(int monid, int *pitch, int *height, int fullupdate)
{
struct gdistruct *gdi = &gdidata[monid];
- if (gdi->bits) {
- *pitch = gdi->pitch;
+ if (gdi->bm.bits) {
+ *pitch = gdi->bm.pitch;
if (height)
- *height = gdi->height;
- return (uae_u8*)gdi->bits;
+ *height = gdi->bm.height;
+ return (uae_u8*)gdi->bm.bits;
}
return NULL;
}
{
struct gdistruct *gdi = &gdidata[monid];
- return gdi->hbm != NULL;
+ return gdi->bm.hbm != NULL;
+}
+
+static void gdi_paint(void)
+{
+ for (int monid = 0; monid < MAX_AMIGAMONITORS; monid++) {
+ struct gdistruct *gdi = &gdidata[monid];
+ if (!gdi->refreshneeded) {
+ continue;
+ }
+ gdi->refreshneeded = false;
+
+ if (gdi->eraseneeded) {
+ Rectangle(gdi->buf.thdc, 0, 0, gdi->buf.width, gdi->buf.height);
+ gdi->eraseneeded = false;
+ }
+
+ if (gdi->bm.hbm) {
+ setupscenecoords(gdi);
+ StretchBlt(gdi->buf.thdc, gdi->bmxoffset, gdi->bmyoffset, gdi->bmwidth, gdi->bmheight, gdi->bm.thdc, 0, 0, gdi->bm.width, gdi->bm.height, SRCCOPY);
+ }
+ if (gdi->cursor.active && gdi->cursor.hbm) {
+ TransparentBlt(gdi->buf.thdc, gdi->cursor.x, gdi->cursor.y, CURSORMAXWIDTH, CURSORMAXHEIGHT, gdi->cursor.thdc, 0, 0, CURSORMAXWIDTH, CURSORMAXHEIGHT, 0x000000);
+ }
+ if (gdi->osd.active && gdi->osd.hbm) {
+ TransparentBlt(gdi->buf.thdc, gdi->osd.x, gdi->osd.y, gdi->ledwidth, gdi->ledheight, gdi->osd.thdc, 0, 0, gdi->ledwidth, gdi->ledheight, 0x000000);
+ }
+ BitBlt(gdi->hdc, 0, 0, gdi->wwidth, gdi->wheight, gdi->buf.thdc, 0, 0, SRCCOPY);
+ }
}
static void gdi_showframe(int monid)
{
struct gdistruct *gdi = &gdidata[monid];
+ gdi->refreshneeded = true;
+ RECT r;
+ r.left = 0;
+ r.top = 0;
+ r.right = gdi->wwidth;
+ r.bottom = gdi->wheight;
+ InvalidateRect(gdi->hwnd, &r, FALSE);
+}
- if (gdi->hbm) {
- StretchBlt(gdi->hdc, 0, 0, gdi->wwidth, gdi->wheight, gdi->thdc, 0, 0, gdi->width, gdi->height, SRCCOPY);
- }
- if (gdi->osd.active && gdi->osd.hbm) {
- TransparentBlt(gdi->hdc, gdi->osd.x, gdi->osd.y, gdi->ledwidth, gdi->ledheight, gdi->osd.thdc, 0, 0, gdi->ledwidth, gdi->ledheight, 0x000000);
- }
+static void gdi_refresh(int monid)
+{
+ gdi_clear(monid);
+ gdi_showframe(monid);
}
void gdi_free(int monid, bool immediate)
struct gdistruct *gdi = &gdidata[monid];
gdi->enabled = 0;
freetexture(monid);
+ freesprite(gdi, &gdi->osd);
+ freesprite(gdi, &gdi->cursor);
}
static const TCHAR *gdi_init(HWND ahwnd, int monid, int w_w, int w_h, int depth, int *freq, int mmulth, int mmultv)
gdi->depth = depth;
gdi->wwidth = w_w;
gdi->wheight = w_h;
+ if (allocsprite(gdi, &gdi->buf, gdi->wwidth, gdi->wheight)) {
+ gdi->statusbar_hx = gdi->statusbar_vx = statusline_set_multiplier(monid, gdi->wwidth, gdi->wheight) / 100;
+ gdi->ledwidth = gdi->wwidth;
+ gdi->ledheight = TD_TOTAL_HEIGHT * gdi->statusbar_vx;
+ allocsprite(gdi, &gdi->osd, gdi->ledwidth, gdi->ledheight);
+ allocsprite(gdi, &gdi->cursor, CURSORMAXWIDTH, CURSORMAXHEIGHT);
+ gdi->enabled = 1;
+ return NULL;
+ }
- gdi->statusbar_hx = gdi->statusbar_vx = statusline_set_multiplier(monid, gdi->wwidth, gdi->wheight) / 100;
- gdi->ledwidth = gdi->wwidth;
- gdi->ledheight = TD_TOTAL_HEIGHT * gdi->statusbar_vx;
- allocsprite(gdi, &gdi->osd, gdi->ledwidth, gdi->ledheight);
-
- gdi->enabled = 1;
-
- return NULL;
+ return _T("failed to allocate buffer");
}
static HDC gdi_getDC(int monid, HDC hdc)
return gdi->enabled ? -1 : 0;
}
-static void gdi_clear(int monid)
+static bool gdi_setcursor(int monid, int x, int y, int width, int height, float mx, float my, bool visible, bool noscale)
{
struct gdistruct *gdi = &gdidata[monid];
+
+ if (width < 0 || height < 0) {
+ return true;
+ }
+
+ if (width && height) {
+ gdi->cursor_offset2_x = gdi->cursor_offset_x * gdi->wwidth / width;
+ gdi->cursor_offset2_y = gdi->cursor_offset_y * gdi->wheight / height;
+ gdi->cursor_x = (float)x * gdi->wwidth / width;
+ gdi->cursor_y = (float)y * gdi->wheight / height;
+ gdi->cursor_mx = mx;
+ gdi->cursor_my = my;
+ } else {
+ gdi->cursor_x = gdi->cursor_y = 0;
+ gdi->cursor_offset2_x = gdi->cursor_offset2_y = 0;
+ }
+ gdi->cursor_scale = !noscale;
+ gdi->cursor.active = visible;
+ return true;
+
+ return false;
+}
+
+static uae_u8 *gdi_setcursorsurface(int monid, int *pitch)
+{
+ struct gdistruct* gdi = &gdidata[monid];
+
+ if (pitch) {
+ *pitch = gdi->cursor.pitch;
+ return (uae_u8*)gdi->cursor.bits;
+ }
+ return NULL;
}
void gdi_select(void)
D3D_clear = gdi_clear;
D3D_canshaders = NULL;
D3D_goodenough = NULL;
- D3D_setcursor = NULL;
- D3D_setcursorsurface = NULL;
+ D3D_setcursor = gdi_setcursor;
+ D3D_setcursorsurface = gdi_setcursorsurface;
D3D_getrefreshrate = NULL;
D3D_resize = NULL;
D3D_change = NULL;
D3D_led = NULL;
D3D_getscanline = NULL;
D3D_extoverlay = NULL;
+ D3D_paint = gdi_paint;
}
flags |= BIF_NOMEMORYMODEMIX;
flags |= BIF_GRANTDIRECTACCESS;
flags &= ~BIF_HARDWARESPRITE;
- if (currprefs.gfx_api && D3D_goodenough () > 0 && D3D_setcursor && D3D_setcursor(0, -1, -1, -1, -1, 0, 0, false, false) && USE_HARDWARESPRITE && currprefs.rtg_hardwaresprite) {
+ if (D3D_setcursor && D3D_setcursor(0, -1, -1, -1, -1, 0, 0, false, false) && USE_HARDWARESPRITE && currprefs.rtg_hardwaresprite) {
hwsprite = 1;
flags |= BIF_HARDWARESPRITE;
write_log (_T("P96: Hardware sprite support enabled\n"));
dst_width = vidinfo->width;
pitch = vidinfo->rowbytes;
statusline_getpos(monid, &slx, &sly, state->Width, dst_height);
- if (currprefs.gfx_api) {
- statusline_render(monid, dst + sly * pitch, vidinfo->pixbytes, pitch, dst_width, dst_height, p96rc, p96gc, p96bc, NULL);
- }
+ statusline_render(monid, dst + sly * pitch, vidinfo->pixbytes, pitch, dst_width, dst_height, p96rc, p96gc, p96bc, NULL);
int m = statusline_get_multiplier(monid) / 100;
for (y = 0; y < TD_TOTAL_HEIGHT * m; y++) {
uae_u8 *buf = dst + (y + sly) * pitch;
if (currprefs.gfx_api)
feat |= RP_FEATURE_SCREENOVERLAY;
if (WIN32GFX_IsPicassoScreen(mon)) {
- if (currprefs.gfx_api)
- feat |= RP_FEATURE_SCREEN2X | RP_FEATURE_SCREEN3X | RP_FEATURE_SCREEN4X;
+ feat |= RP_FEATURE_SCREEN2X | RP_FEATURE_SCREEN3X | RP_FEATURE_SCREEN4X;
} else {
feat |= RP_FEATURE_SCREEN2X | RP_FEATURE_SCREEN3X | RP_FEATURE_SCREEN4X;
feat |= RP_FEATURE_SCALING_SUBPIXEL | RP_FEATURE_SCALING_STRETCH | RP_FEATURE_SCANLINES;
rp_filter_default = rp_filter = currprefs.gf[0].gfx_filter;
if (rp_filter == 0) {
rp_filter = UAE_FILTER_NULL;
- if (currprefs.gfx_api)
- changed_prefs.gf[0].gfx_filter = currprefs.gf[0].gfx_filter = rp_filter;
+ changed_prefs.gf[0].gfx_filter = currprefs.gf[0].gfx_filter = rp_filter;
}
fixup_size (p);
bool softstatusline(void)
{
- if (currprefs.gfx_api > 0)
- return false;
- return (currprefs.leds_on_screen & STATUSLINE_TARGET) == 0;
+ return false;
}
void deletestatusline(int monid)
if (monid)
return;
- if (currprefs.gf[WIN32GFX_IsPicassoScreen(mon)].gfx_filter == 0 && !currprefs.gfx_api)
- return;
text = statusline_fetch();
//text = _T("Testing string 123!");
if (!text)
case WM_PAINT:
{
- static int recursive = 0;
- if (recursive == 0) {
- PAINTSTRUCT ps;
- recursive++;
- notice_screen_contents_lost(mon->monitor_id);
- hDC = BeginPaint(hWnd, &ps);
- /* Check to see if this WM_PAINT is coming while we've got the GUI visible */
- if (mon->manual_painting_needed)
- updatedisplayarea(mon->monitor_id);
- EndPaint(hWnd, &ps);
- recursive--;
+ PAINTSTRUCT ps;
+ hDC = BeginPaint(hWnd, &ps);
+ if (D3D_paint) {
+ D3D_paint();
}
+ /* Check to see if this WM_PAINT is coming while we've got the GUI visible */
+ if (mon->manual_painting_needed) {
+ updatedisplayarea(mon->monitor_id);
+ }
+ mon->manual_painting_needed = 0;
+ EndPaint(hWnd, &ps);
}
return 0;
nojoy = true;
}
- if (p->rtg_hardwaresprite && !p->gfx_api) {
- error_log(_T("GDI is not RTG hardware sprite compatible."));
- p->rtg_hardwaresprite = false;
- }
if (p->rtgboards[0].rtgmem_type >= GFXBOARD_HARDWARE) {
p->rtg_hardwareinterrupt = false;
p->rtg_hardwaresprite = false;
p->win32_rtgmatchdepth = false;
p->color_mode = 5;
- if (p->ppc_model && !p->gfx_api) {
- error_log(_T("Graphics board and PPC: Direct3D enabled."));
- p->gfx_api = os_win7 ? 2 : 1;
- }
}
struct MultiDisplay *md = getdisplay(p, 0);
p->gfx_api = os_win7 ? 2 : (os_vista ? 1 : 0);
if (p->gfx_api > 1)
p->color_mode = 5;
- if (p->gf[APMODE_NATIVE].gfx_filter == 0 && p->gfx_api)
+ if (p->gf[APMODE_NATIVE].gfx_filter == 0)
p->gf[APMODE_NATIVE].gfx_filter = 1;
- if (p->gf[APMODE_RTG].gfx_filter == 0 && p->gfx_api)
+ if (p->gf[APMODE_RTG].gfx_filter == 0)
p->gf[APMODE_RTG].gfx_filter = 1;
WIN32GUI_LoadUIString (IDS_INPUT_CUSTOM, buf, sizeof buf / sizeof (TCHAR));
for (int i = 0; i < GAMEPORT_INPUT_SETTINGS; i++)
store_custom_limits (-1, -1, -1, -1);
- if (!usedfilter && !currprefs.gfx_api) {
- filter_horiz_zoom = filter_vert_zoom = 0.0;
- filter_horiz_zoom_mult = filter_vert_zoom_mult = 1.0;
- filter_horiz_offset = filter_vert_offset = 0.0;
- }
-
if (mon->screen_is_picasso) {
getrtgfilterrect2(monid, sr, dr, zr, dst_width, dst_height);
if (D3D_getscalerect && D3D_getscalerect(monid, &mrmx, &mrmy, &mrsx, &mrsy, dst_width, dst_height)) {
doautoaspect = get_auto_aspect_ratio(monid, cw, ch, crealh, scalemode, &autoaspectratio);
}
- if (currprefs.gfx_api == 0) {
- if (cx < 0)
- cx = 0;
- if (cy < 0)
- cy = 0;
- }
-
if (cv) {
int diff;
#define SM_WINDOW 0
#define SM_FULLSCREEN_DX 2
-#define SM_OPENGL_WINDOW 3
-#define SM_OPENGL_FULLWINDOW 9
-#define SM_OPENGL_FULLSCREEN_DX 4
#define SM_D3D_WINDOW 5
#define SM_D3D_FULLWINDOW 10
#define SM_D3D_FULLSCREEN_DX 6
if (!mon->screen_is_picasso) {
- if (currprefs.gfx_api == 0 && currprefs.gf[0].gfx_filter == 0) {
- allocsoftbuffer(mon->monitor_id, _T("draw"), &avidinfo->drawbuffer, mon->currentmode.flags,
- mon->currentmode.native_width, mon->currentmode.native_height, mon->currentmode.current_depth);
- } else {
- allocsoftbuffer(mon->monitor_id, _T("draw"), &avidinfo->drawbuffer, mon->currentmode.flags,
- 1920, 1280, mon->currentmode.current_depth);
- }
+ allocsoftbuffer(mon->monitor_id, _T("draw"), &avidinfo->drawbuffer, mon->currentmode.flags,
+ 1920, 1280, mon->currentmode.current_depth);
if (currprefs.monitoremu || currprefs.cs_cd32fmv || (currprefs.genlock && currprefs.genlock_image) || currprefs.cs_color_burst || currprefs.gfx_grayscale) {
allocsoftbuffer(mon->monitor_id, _T("monemu"), &avidinfo->tempbuffer, mon->currentmode.flags,
mon->currentmode.amiga_width > 1024 ? mon->currentmode.amiga_width : 1024,
};
static struct GUIPAGE ppage[MAX_C_PAGES];
-static bool ischecked (HWND hDlg, DWORD id)
+static bool ischecked(HWND hDlg, DWORD id)
{
- return IsDlgButtonChecked (hDlg, id) == BST_CHECKED;
+ return IsDlgButtonChecked(hDlg, id) == BST_CHECKED;
}
-static void setchecked (HWND hDlg, DWORD id, bool checked)
+static void setchecked(HWND hDlg, DWORD id, bool checked)
{
- CheckDlgButton (hDlg, id, checked ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, id, checked ? BST_CHECKED : BST_UNCHECKED);
}
-static void setfocus (HWND hDlg, int id)
+static void setfocus(HWND hDlg, int id)
{
- SendMessage (hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem (hDlg, id), TRUE);
+ SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, id), TRUE);
}
-static void ew (HWND hDlg, DWORD id, int enable)
+static void ew(HWND hDlg, DWORD id, int enable)
{
if (id == -1)
return;
- HWND w = GetDlgItem (hDlg, id);
+ HWND w = GetDlgItem(hDlg, id);
if (!w)
return;
- if (!enable && w == GetFocus ())
- SendMessage (hDlg, WM_NEXTDLGCTL, 0, FALSE);
- EnableWindow (w, !!enable);
+ if (!enable && w == GetFocus())
+ SendMessage(hDlg, WM_NEXTDLGCTL, 0, FALSE);
+ EnableWindow(w, !!enable);
}
-static void hide (HWND hDlg, DWORD id, int hide)
+static void hide(HWND hDlg, DWORD id, int hide)
{
HWND w;
if (id == -1)
return;
- w = GetDlgItem (hDlg, id);
+ w = GetDlgItem(hDlg, id);
if (!w)
return;
- if (hide && w == GetFocus ())
- SendMessage (hDlg, WM_NEXTDLGCTL, 0, FALSE);
- ShowWindow (w, hide ? SW_HIDE : SW_SHOW);
+ if (hide && w == GetFocus())
+ SendMessage(hDlg, WM_NEXTDLGCTL, 0, FALSE);
+ ShowWindow(w, hide ? SW_HIDE : SW_SHOW);
}
static void parsefilepath(TCHAR *path, int maxlen)
ew(hDlg, IDC_RTG_DISPLAYSELECT, rtg2);
ew(hDlg, IDC_RTG_VBINTERRUPT, rtg3);
ew(hDlg, IDC_RTG_THREAD, rtg3 && en);
- if (!workprefs.gfx_api) {
- workprefs.rtg_hardwaresprite = false;
- CheckDlgButton(hDlg, IDC_RTG_HWSPRITE, FALSE);
- }
- ew(hDlg, IDC_RTG_HWSPRITE, rtg3 && workprefs.gfx_api);
+ ew(hDlg, IDC_RTG_HWSPRITE, rtg3);
}
static void values_to_expansiondlg(HWND hDlg)
ew (hDlg, IDC_ASSOCIATELIST, !rp_isactive ());
ew (hDlg, IDC_ASSOCIATE_ON, !rp_isactive ());
ew (hDlg, IDC_ASSOCIATE_OFF, !rp_isactive ());
- ew (hDlg, IDC_DXMODE_OPTIONS, workprefs.gfx_api == 2 || (full_property_sheet && workprefs.gfx_api == 0));
+ ew (hDlg, IDC_DXMODE_OPTIONS, workprefs.gfx_api == 2);
bool paused = false;
bool nosound = false;
if (v && uf->yuv) {
vv2 = TRUE;
}
- if (workprefs.gfx_api) {
- v = vv = vv2 = vv3 = vv4 = TRUE;
- }
+ v = vv = vv2 = vv3 = vv4 = TRUE;
if (filter_nativertg) {
vv4 = FALSE;
}
ew(hDlg, IDC_FILTERHZMULT, v && !as);
ew(hDlg, IDC_FILTERVZMULT, v && !as);
- ew(hDlg, IDC_FILTERHZ, v);
- ew(hDlg, IDC_FILTERVZ, v);
+ ew(hDlg, IDC_FILTERHZ, v && vv4);
+ ew(hDlg, IDC_FILTERVZ, v && vv4);
ew(hDlg, IDC_FILTERHO, v && vv4);
ew(hDlg, IDC_FILTERVO, v && vv4);
ew(hDlg, IDC_FILTERSLR, vv3);
ew(hDlg, IDC_FILTERXL, vv2);
ew(hDlg, IDC_FILTERXLV, vv2);
ew(hDlg, IDC_FILTERXTRA, vv2);
- ew(hDlg, IDC_FILTERFILTERH, workprefs.gfx_api);
- ew(hDlg, IDC_FILTERFILTERV, workprefs.gfx_api);
+ ew(hDlg, IDC_FILTERFILTERH, TRUE);
+ ew(hDlg, IDC_FILTERFILTERV, TRUE);
ew(hDlg, IDC_FILTERSTACK, workprefs.gfx_api);
ew(hDlg, IDC_FILTERKEEPASPECT, v && scalemode != AUTOSCALE_STATIC_AUTO);
ew(hDlg, IDC_FILTERASPECT, v && scalemode != AUTOSCALE_STATIC_AUTO);
workprefs.gf[filter_nativertg].gfx_filter = 0;
workprefs.gf[filter_nativertg].gfx_filter_filtermodeh = 0;
workprefs.gf[filter_nativertg].gfx_filter_filtermodev = 0;
- if (workprefs.gfx_api) {
- LRESULT item2 = xSendDlgItemMessage(hDlg, IDC_FILTERFILTERH, CB_GETCURSEL, 0, 0L);
- if (item2 != CB_ERR)
- workprefs.gf[filter_nativertg].gfx_filter_filtermodeh = (int)item2;
- item2 = xSendDlgItemMessage(hDlg, IDC_FILTERFILTERV, CB_GETCURSEL, 0, 0L);
- if (item2 != CB_ERR)
- workprefs.gf[filter_nativertg].gfx_filter_filtermodev = (int)item2;
- }
+ LRESULT item2 = xSendDlgItemMessage(hDlg, IDC_FILTERFILTERH, CB_GETCURSEL, 0, 0L);
+ if (item2 != CB_ERR)
+ workprefs.gf[filter_nativertg].gfx_filter_filtermodeh = (int)item2;
+ item2 = xSendDlgItemMessage(hDlg, IDC_FILTERFILTERV, CB_GETCURSEL, 0, 0L);
+ if (item2 != CB_ERR)
+ workprefs.gf[filter_nativertg].gfx_filter_filtermodev = (int)item2;
if (item > 0) {
if (item > UAE_FILTER_LAST) {
_stprintf (workprefs.gf[filter_nativertg].gfx_filtershader[filterstackpos], _T("%s.fx"), tmp + 5);
if (workprefs.gf[filter_nativertg].gfx_filtershader[i][0])
workprefs.gf[filter_nativertg].gfx_filter = UAE_FILTER_NULL;
}
- if (workprefs.gf[filter_nativertg].gfx_filter == 0 && !workprefs.gfx_api)
- workprefs.gf[filter_nativertg].gfx_filter_autoscale = 0;
}
int overlaytype = xSendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_GETCURSEL, 0, 0L);
if (item == AUTOSCALE_SEPARATOR)
item++;
workprefs.gf[filter_nativertg].gfx_filter_autoscale = item;
- if (workprefs.gf[filter_nativertg].gfx_filter_autoscale && workprefs.gf[filter_nativertg].gfx_filter == 0 && !workprefs.gfx_api)
- workprefs.gf[filter_nativertg].gfx_filter = 1; // NULL
values_to_hw3ddlg (hDlg, false);
enable_for_hw3ddlg (hDlg);
}
xSendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETPOS, TRUE, (int)fdwp->gfx_filter_horiz_zoom);
}
}
- if (fd->gfx_filter_horiz_zoom != fdwp->gfx_filter_horiz_zoom) {
- fdwp->gfx_filter_horiz_zoom = fd->gfx_filter_horiz_zoom;
- fdwp->changed = true;
- }
- if (fd->gfx_filter_vert_zoom != fdwp->gfx_filter_vert_zoom) {
- fdwp->gfx_filter_vert_zoom = fd->gfx_filter_vert_zoom;
- fdwp->changed = true;
- }
+ fdwp->gfx_filter_horiz_zoom = fd->gfx_filter_horiz_zoom;
+ fdwp->gfx_filter_vert_zoom = fd->gfx_filter_vert_zoom;
fdwp->gfx_filter_horiz_offset = (float)SendMessage (GetDlgItem (hDlg, IDC_FILTERHO), TBM_GETPOS, 0, 0);
fdwp->gfx_filter_vert_offset = (float)SendMessage(GetDlgItem(hDlg, IDC_FILTERVO), TBM_GETPOS, 0, 0);
fd->gfx_filter_horiz_offset = fdwp->gfx_filter_horiz_offset;
drv = pt.x - window_led_drives;
drv /= (window_led_drives_end - window_led_drives) / 4;
drvdrag = 1;
- if (drv < 0 || drv > 3)
+ if (drv < 0 || drv >= currprefs.nr_floppies)
drv = 0;
corner = -2;
}