From 49c218b3a7a35b1ad3504217018c3035582e6f48 Mon Sep 17 00:00:00 2001 From: aap Date: Sat, 18 Apr 2020 09:47:19 +0200 Subject: [PATCH] removed alpha channel from d3d cam textures --- src/d3d/d3d.cpp | 7 +++++++ src/d3d/d3ddevice.cpp | 9 +++++---- src/d3d/rwd3dimpl.h | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/d3d/d3d.cpp b/src/d3d/d3d.cpp index 6451dd1..d5188b5 100644 --- a/src/d3d/d3d.cpp +++ b/src/d3d/d3d.cpp @@ -469,6 +469,13 @@ rasterSetFormat(Raster *raster) break; case Raster::CAMERATEXTURE: +// let's not use this because we apparently don't want alpha +// raster->format = findFormatInfoD3D(d3d9Globals.present.BackBufferFormat)->rwFormat; + raster->format = findFormatInfoD3D(d3d9Globals.startMode.mode.Format)->rwFormat; + // can this even happen? just do something... + if(raster->format == 0) + raster->format = Raster::C888; + break; case Raster::CAMERA: raster->format = findFormatInfoD3D(d3d9Globals.present.BackBufferFormat)->rwFormat; // can this even happen? just do something... diff --git a/src/d3d/d3ddevice.cpp b/src/d3d/d3ddevice.cpp index e4bf4b0..816bc16 100644 --- a/src/d3d/d3ddevice.cpp +++ b/src/d3d/d3ddevice.cpp @@ -1077,9 +1077,10 @@ startD3D(void) uint32 width, height, depth; D3DFORMAT format, zformat; - format = d3d9Globals.modes[d3d9Globals.currentMode].mode.Format; + d3d9Globals.startMode = d3d9Globals.modes[d3d9Globals.currentMode]; + format = d3d9Globals.startMode.mode.Format; - bool windowed = !(d3d9Globals.modes[d3d9Globals.currentMode].flags & VIDEOMODEEXCLUSIVE); + bool windowed = !(d3d9Globals.startMode.flags & VIDEOMODEEXCLUSIVE); // Use window size in windowed mode, otherwise get size from video mode if(windowed){ @@ -1090,8 +1091,8 @@ startD3D(void) }else{ // this will be much better for restoring after iconification SetWindowLong(d3d9Globals.window, GWL_STYLE, WS_POPUP); - width = d3d9Globals.modes[d3d9Globals.currentMode].mode.Width; - height = d3d9Globals.modes[d3d9Globals.currentMode].mode.Height; + width = d3d9Globals.startMode.mode.Width; + height = d3d9Globals.startMode.mode.Height; } // See if we can get an alpha channel diff --git a/src/d3d/rwd3dimpl.h b/src/d3d/rwd3dimpl.h index 890506c..e6da827 100644 --- a/src/d3d/rwd3dimpl.h +++ b/src/d3d/rwd3dimpl.h @@ -37,6 +37,7 @@ struct D3d9Globals DisplayMode *modes; int numModes; int currentMode; + DisplayMode startMode; D3DPRESENT_PARAMETERS present;