int ledwidth, ledheight;
int max_texture_w, max_texture_h;
int tin_w, tin_h, tout_w, tout_h, window_h, window_w;
+ int tino_w, tino_h;
int t_depth, dmult, dmultxh, dmultxv, dmode;
int required_sl_texture_w, required_sl_texture_h;
int vsync2, guimode, maxscanline, variablerefresh;
struct d3dstruct *d3d = &d3ddata[monid];
if (w < 0 || h < 0) {
- return d3d->texture1 != NULL;
+ if (d3d->tino_w == -w && d3d->tino_h == -h && d3d->texture1) {
+ return true;
+ }
+ return false;
}
+ d3d->tino_w = w;
+ d3d->tino_h = h;
d3d->tin_w = w * d3d->dmult;
d3d->tin_h = h * d3d->dmult;
if (d3d->m_screenWidth != w_w || d3d->m_screenHeight != w_h) {
changed = true;
}
- if (doalloc && !changed && (d3d->m_bitmapWidth != t_w || d3d->m_bitmapHeight != t_h || d3d->dmultxh != mmulth || d3d->dmultxv != mmultv)) {
- d3d->m_bitmapWidth = t_w;
- d3d->m_bitmapHeight = t_h;
- d3d->dmultxh = mmulth;
- d3d->dmultxv = mmultv;
- D3D_alloctexture(monid, t_w, t_h);
- }
- d3d->m_bitmapWidth = t_w;
- d3d->m_bitmapHeight = t_h;
d3d->m_screenWidth = w_w;
d3d->m_screenHeight = w_h;
d3d->dmultxh = mmulth;
d3d->dmultxv = mmultv;
+ if (d3d->m_device) {
+ target_graphics_buffer_update(monid);
+ }
return changed;
}
struct d3d11struct *d3d = &d3d11data[monid];
bool v;
+ if (w == 0 || h == 0) {
+ return false;
+ }
if (w < 0 || h < 0) {
- return d3d->texture2d != NULL;
+ if (d3d->m_bitmapWidth == -w && d3d->m_bitmapHeight == -h && d3d->texture2d) {
+ return true;
+ }
+ return false;
}
recheck(d3d, monid);
int cy = (int)d3d->cursor_y;
int width = sp->width;
int height = sp->height;
+ int bw = d3d->m_bitmapWidth;
+ int bh = d3d->m_bitmapHeight;
if (sp->texture == NULL) {
return;
}
- if (sp->updated && cx >= 0 && cy >= 0 && cx + width <= d3d->m_bitmapWidth && cy + height <= d3d->m_bitmapHeight) {
+ if (sp->updated && cx >= 0 && cy >= 0 && cx + width <= bw && cy + height <= bh) {
return;
}
for (int h = 0; h < sp->height; h++) {
int w = width;
int x = 0;
- if (cx + w > d3d->m_bitmapWidth) {
- w -= (cx + w) - d3d->m_bitmapWidth;
+ if (cx + w > bw) {
+ w -= (cx + w) - bw;
}
if (cx < 0) {
x = -cx;
w -= -cx;
}
- if (w <= 0 || cy + h > d3d->m_bitmapHeight) {
+ if (w <= 0 || cy + h > bh) {
memset(b, 0, width * 4);
} else {
if (x > 0) {
}
d3d->m_deviceContext->Unmap(d3d->hwsprite.texture, 0);
- if (cx >= 0 && cy >= 0 && cx + width <= d3d->m_bitmapWidth && cy + height <= d3d->m_bitmapHeight) {
+ if (cx >= 0 && cy >= 0 && cx + width <= bw && cy + height <= bh) {
sp->updated = true;
}
}