MatrixTranslation (&d3d->m_matView_out, tx, ty, 1.0f);
- MatrixScaling (&d3d->m_matWorld_out, sw + 0.5f / sw, sh + 0.5f / sh, 1.0f);
+ MatrixScaling (&d3d->m_matWorld_out, sw, sh, 1.0f);
struct amigadisplay *ad = &adisplays[monid];
int rota = currprefs.gf[ad->picasso_on ? GF_RTG : ad->interlace_on ? GF_INTERLACE : GF_NORMAL].gfx_filter_rotation;
return d3d->d3d_enabled ? 1 : 0;
}
-static uae_u8 *xD3D_setcursorsurface(int monid, int *pitch)
+static uae_u8 *xD3D_setcursorsurface(int monid, bool query, int *pitch)
{
struct d3dstruct *d3d = &d3ddata[monid];
+ if (query) {
+ return d3d->cursorsurfaced3dtexbuf;
+ }
if (pitch) {
*pitch = CURSORMAXWIDTH * 4;
return d3d->cursorsurfaced3dtexbuf;
extern int(*D3D_canshaders)(void);
extern int(*D3D_goodenough)(void);
extern bool(*D3D_setcursor)(int, int x, int y, int width, int height, float mx, float my, bool visible, bool noscale);
-extern uae_u8 *(*D3D_setcursorsurface)(int, int *pitch);
+extern uae_u8 *(*D3D_setcursorsurface)(int, bool, int *pitch);
extern float(*D3D_getrefreshrate)(int);
extern void(*D3D_restore)(int, bool);
extern void(*D3D_resize)(int, int);
int (*D3D_canshaders)(void);
int (*D3D_goodenough)(void);
bool (*D3D_setcursor)(int, int x, int y, int width, int height, float mx, float my, bool visible, bool noscale);
-uae_u8 *(*D3D_setcursorsurface)(int, int *pitch);
+uae_u8 *(*D3D_setcursorsurface)(int, bool, int *pitch);
float (*D3D_getrefreshrate)(int);
void(*D3D_restore)(int, bool);
void(*D3D_resize)(int, int);
bool screenlimit;
uae_u8 *texbuf;
bool updated;
+ bool empty;
};
struct d3doverlay
s->alpha = alpha;
s->rotation = rotation;
s->screenlimit = screenlimit;
+ s->empty = true;
if (screenlimit) {
s->texbuf = xcalloc(uae_u8, width * height * 4);
}
sp->updated = false;
+ sp->empty = false;
D3D11_MAPPED_SUBRESOURCE map;
HRESULT hr = d3d->m_deviceContext->Map(sp->texture, 0, D3D11_MAP_WRITE_DISCARD, 0, &map);
if (SUCCEEDED(hr)) {
return true;
}
-static uae_u8 *xD3D_setcursorsurface(int monid, int *pitch)
+static uae_u8 *xD3D_setcursorsurface(int monid, bool query, int *pitch)
{
struct d3d11struct *d3d = &d3d11data[monid];
- if (!d3d->hwsprite.texbuf)
+ d3d->hwsprite.updated = false;
+ if (query) {
+ return d3d->hwsprite.empty ? NULL : d3d->hwsprite.texbuf;
+ }
+ if (!d3d->hwsprite.texbuf) {
return NULL;
+ }
if (pitch) {
*pitch = d3d->hwsprite.width * 4;
return d3d->hwsprite.texbuf;
}
- d3d->hwsprite.updated = false;
return NULL;
}
return true;
}
-static uae_u8 *gdi_setcursorsurface(int monid, int *pitch)
+static uae_u8 *gdi_setcursorsurface(int monid, bool query, int *pitch)
{
struct gdistruct* gdi = &gdidata[monid];
+ if (query) {
+ return (uae_u8 *)gdi->cursor.bits;
+ }
+
if (gdi->depth < 32) {
return NULL;
}
return;
gfx_lock ();
setupcursor_needed = 1;
- dptr = D3D_setcursorsurface(rbc->monitor_id, &pitch);
+ dptr = D3D_setcursorsurface(rbc->monitor_id, false, &pitch);
if (dptr) {
for (int y = 0; y < CURSORMAXHEIGHT; y++) {
uae_u8 *p2 = dptr + pitch * y;
memcpy (p2, p1, cursorwidth * bpp);
}
}
- D3D_setcursorsurface(rbc->monitor_id, NULL);
+ D3D_setcursorsurface(rbc->monitor_id, false, NULL);
setupcursor_needed = 0;
P96TRACE_SPR((_T("cursorsurface3d updated\n")));
} else {
}
if (D3D_setcursor) {
+ if (!D3D_setcursorsurface(mon->monitor_id, true, NULL)) {
+ setupcursor_needed = 1;
+ }
if (currprefs.gf[GF_RTG].gfx_filter_autoscale == RTG_MODE_CENTER) {
D3D_setcursor(mon->monitor_id, x, y, WIN32GFX_GetWidth(mon), WIN32GFX_GetHeight(mon), mx, my, cursorvisible, mon->scalepicasso == 2);
} else {
vidinfo->orgbformat = state->RGBFormat;
}
vidinfo->full_refresh = 1;
+ setupcursor_needed = 1;
unlockrtg();
}
return 0;
if (idx >= 4)
return 0;
+ uae_u32 oc = cursorrgb[idx];
cursorrgb[idx] = (red << 16) | (green << 8) | (blue << 0);
+ if (oc != cursorrgb[idx]) {
+ setupcursor_needed = 1;
+ }
P96TRACE_SPR ((_T("SetSpriteColor(%08x,%d:%02X%02X%02X). %x\n"), bi, idx, red, green, blue, bi + PSSO_BoardInfo_MousePens));
return 1;
}