dst -= dpitch;
}
}
- if (WIN32GFX_IsPicassoScreen () && !vb)
- freertgbuffer (mem);
+ if (!vb) {
+ if (WIN32GFX_IsPicassoScreen ())
+ freertgbuffer (mem);
+ else
+ freefilterbuffer(mem);
+ }
} else {
donormal:
}
+void freefilterbuffer(uae_u8 *buf)
+{
+ struct vidbuffer *vb = gfxvidinfo.outbuffer;
+
+ if (usedfilter == NULL) {
+ unlockscr3d(vb);
+ }
+}
+
uae_u8 *getfilterbuffer (int *widthp, int *heightp, int *pitch, int *depth)
{
struct vidbuffer *vb = gfxvidinfo.outbuffer;
*widthp = 0;
*heightp = 0;
*depth = amiga_depth;
- if (usedfilter == NULL)
- return NULL;
+ if (usedfilter == NULL) {
+ if (!lockscr3d(vb)) {
+ return NULL;
+ }
+ }
*widthp = vb->outwidth;
*heightp = vb->outheight;
if (pitch)
return gfxvidinfo.outbuffer->bufmem;
}
+bool lockscr3d(struct vidbuffer *vb)
+{
+ if (currentmode->flags & DM_D3D) {
+ if (!(currentmode->flags & DM_SWSCALE)) {
+ vb->bufmem = D3D_locktexture(&vb->rowbytes, NULL, false);
+ if (vb->bufmem)
+ return true;
+ }
+ }
+ return false;
+}
+
+void unlockscr3d(struct vidbuffer *vb)
+{
+ if (currentmode->flags & DM_D3D) {
+ if (!(currentmode->flags & DM_SWSCALE)) {
+ D3D_unlocktexture();
+ }
+ }
+}
+
int lockscr (struct vidbuffer *vb, bool fullupdate)
{
int ret = 0;
extern void gfx_lock (void);
extern void gfx_unlock (void);
+extern bool lockscr3d(struct vidbuffer *vb);
+extern void unlockscr3d(struct vidbuffer *vb);
+
void DX_Fill (int dstx, int dsty, int width, int height, uae_u32 color);
void DX_Blit (int x, int y, int w, int h);
void centerdstrect (RECT *);