|
4 | 4 | #include "miniwin/com_macro.h"
|
5 | 5 | #include <SDL.h>
|
6 | 6 |
|
| 7 | +#include "utils.h" |
| 8 | + |
7 | 9 | namespace dvl {
|
8 | 10 |
|
9 | 11 | int sgdwLockCount;
|
@@ -182,17 +184,33 @@ void BltFast(DWORD dwX, DWORD dwY, LPRECT lpSrcRect)
|
182 | 184 | static_cast<decltype(SDL_Rect().y)>(lpSrcRect->top),
|
183 | 185 | w, h
|
184 | 186 | };
|
185 |
| - SDL_Rect dst_rect = { |
186 |
| - static_cast<decltype(SDL_Rect().x)>(dwX), |
187 |
| - static_cast<decltype(SDL_Rect().y)>(dwY), |
188 |
| - w, h |
189 |
| - }; |
190 |
| - |
191 |
| - // Convert from 8-bit to 32-bit |
192 |
| - if (SDL_BlitSurface(pal_surface, &src_rect, GetOutputSurface(), &dst_rect) <= -1) { |
193 |
| - ErrSdl(); |
| 187 | + |
| 188 | + if (GFX_IsRetroFW20()) { |
| 189 | + SDL_Rect dst_rect = { |
| 190 | + static_cast<decltype(SDL_Rect().x)>(dwX), |
| 191 | + static_cast<decltype(SDL_Rect().y)>(dwY), |
| 192 | + w, h |
| 193 | + }; |
| 194 | + |
| 195 | + // Convert from 8-bit to 32-bit |
| 196 | + if (SDL_BlitSurface(pal_surface, &src_rect, GetOutputSurface(), &dst_rect) <= -1) { |
| 197 | + ErrSdl(); |
| 198 | + } |
| 199 | + |
| 200 | + } else { |
| 201 | + SDL_Rect dst_rect = { |
| 202 | + static_cast<decltype(SDL_Rect().x)>(dwX) / 2, |
| 203 | + static_cast<decltype(SDL_Rect().y)>(dwY), |
| 204 | + w / 2, h |
| 205 | + }; |
| 206 | + // Convert from 8-bit to 32-bit |
| 207 | + SDL_Surface *tmp = SDL_ConvertSurface(pal_surface, GetOutputSurface()->format, 0); |
| 208 | + if (SDL_BlitScaled(tmp, &src_rect, GetOutputSurface(), &dst_rect) <= -1) { |
| 209 | + SDL_FreeSurface(tmp); |
| 210 | + ErrSdl(); |
| 211 | + } |
| 212 | + SDL_FreeSurface(tmp); |
194 | 213 | }
|
195 |
| - |
196 | 214 | bufferUpdated = true;
|
197 | 215 | }
|
198 | 216 |
|
|
0 commit comments