mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Fixed whitespace
This commit is contained in:
parent
3d1c3b19c3
commit
2348e426c7
@ -543,17 +543,17 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
|
|||||||
D3D_RenderData *data;
|
D3D_RenderData *data;
|
||||||
SDL_SysWMinfo windowinfo;
|
SDL_SysWMinfo windowinfo;
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
const char *hint;
|
const char *hint;
|
||||||
D3DPRESENT_PARAMETERS pparams;
|
D3DPRESENT_PARAMETERS pparams;
|
||||||
IDirect3DSwapChain9 *chain;
|
IDirect3DSwapChain9 *chain;
|
||||||
D3DCAPS9 caps;
|
D3DCAPS9 caps;
|
||||||
DWORD device_flags;
|
DWORD device_flags;
|
||||||
Uint32 window_flags;
|
Uint32 window_flags;
|
||||||
int w, h;
|
int w, h;
|
||||||
SDL_DisplayMode fullscreen_mode;
|
SDL_DisplayMode fullscreen_mode;
|
||||||
int d3dxVersion;
|
int d3dxVersion;
|
||||||
char d3dxDLLFile[50];
|
char d3dxDLLFile[50];
|
||||||
int displayIndex;
|
int displayIndex;
|
||||||
|
|
||||||
renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
|
renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
|
||||||
if (!renderer) {
|
if (!renderer) {
|
||||||
@ -568,7 +568,7 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( D3D_LoadDLL( &data->d3dDLL, &data->d3d ) ) {
|
if( D3D_LoadDLL( &data->d3dDLL, &data->d3d ) ) {
|
||||||
for (d3dxVersion=50;d3dxVersion>0;d3dxVersion--) {
|
for (d3dxVersion=50;d3dxVersion>0;d3dxVersion--) {
|
||||||
LPTSTR dllName;
|
LPTSTR dllName;
|
||||||
SDL_snprintf(d3dxDLLFile, sizeof(d3dxDLLFile), "D3DX9_%02d.dll", d3dxVersion);
|
SDL_snprintf(d3dxDLLFile, sizeof(d3dxDLLFile), "D3DX9_%02d.dll", d3dxVersion);
|
||||||
@ -600,7 +600,7 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
|
|||||||
renderer->WindowEvent = D3D_WindowEvent;
|
renderer->WindowEvent = D3D_WindowEvent;
|
||||||
renderer->CreateTexture = D3D_CreateTexture;
|
renderer->CreateTexture = D3D_CreateTexture;
|
||||||
renderer->UpdateTexture = D3D_UpdateTexture;
|
renderer->UpdateTexture = D3D_UpdateTexture;
|
||||||
renderer->UpdateTextureYUV = D3D_UpdateTextureYUV;
|
renderer->UpdateTextureYUV = D3D_UpdateTextureYUV;
|
||||||
renderer->LockTexture = D3D_LockTexture;
|
renderer->LockTexture = D3D_LockTexture;
|
||||||
renderer->UnlockTexture = D3D_UnlockTexture;
|
renderer->UnlockTexture = D3D_UnlockTexture;
|
||||||
renderer->SetRenderTarget = D3D_SetRenderTarget;
|
renderer->SetRenderTarget = D3D_SetRenderTarget;
|
||||||
@ -661,22 +661,22 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get the adapter for the display that the window is on */
|
/* Get the adapter for the display that the window is on */
|
||||||
displayIndex = SDL_GetWindowDisplayIndex( window );
|
displayIndex = SDL_GetWindowDisplayIndex( window );
|
||||||
data->adapter = SDL_Direct3D9GetAdapterIndex( displayIndex );
|
data->adapter = SDL_Direct3D9GetAdapterIndex( displayIndex );
|
||||||
|
|
||||||
IDirect3D9_GetDeviceCaps(data->d3d, data->adapter, D3DDEVTYPE_HAL, &caps);
|
IDirect3D9_GetDeviceCaps(data->d3d, data->adapter, D3DDEVTYPE_HAL, &caps);
|
||||||
|
|
||||||
device_flags = D3DCREATE_FPU_PRESERVE;
|
device_flags = D3DCREATE_FPU_PRESERVE;
|
||||||
if (caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) {
|
if (caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) {
|
||||||
device_flags |= D3DCREATE_HARDWARE_VERTEXPROCESSING;
|
device_flags |= D3DCREATE_HARDWARE_VERTEXPROCESSING;
|
||||||
} else {
|
} else {
|
||||||
device_flags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING;
|
device_flags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING;
|
||||||
}
|
}
|
||||||
|
|
||||||
hint = SDL_GetHint(SDL_HINT_RENDER_DIRECT3D_THREADSAFE);
|
hint = SDL_GetHint(SDL_HINT_RENDER_DIRECT3D_THREADSAFE);
|
||||||
if (hint && SDL_atoi(hint)) {
|
if (hint && SDL_atoi(hint)) {
|
||||||
device_flags |= D3DCREATE_MULTITHREADED;
|
device_flags |= D3DCREATE_MULTITHREADED;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = IDirect3D9_CreateDevice(data->d3d, data->adapter,
|
result = IDirect3D9_CreateDevice(data->d3d, data->adapter,
|
||||||
D3DDEVTYPE_HAL,
|
D3DDEVTYPE_HAL,
|
||||||
@ -1033,27 +1033,27 @@ D3D_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
|
|||||||
const Uint8 *Uplane, int Upitch,
|
const Uint8 *Uplane, int Upitch,
|
||||||
const Uint8 *Vplane, int Vpitch)
|
const Uint8 *Vplane, int Vpitch)
|
||||||
{
|
{
|
||||||
D3D_TextureData *data = (D3D_TextureData *) texture->driverdata;
|
D3D_TextureData *data = (D3D_TextureData *) texture->driverdata;
|
||||||
SDL_bool full_texture = SDL_FALSE;
|
SDL_bool full_texture = SDL_FALSE;
|
||||||
|
|
||||||
#ifdef USE_DYNAMIC_TEXTURE
|
#ifdef USE_DYNAMIC_TEXTURE
|
||||||
if (texture->access == SDL_TEXTUREACCESS_STREAMING &&
|
if (texture->access == SDL_TEXTUREACCESS_STREAMING &&
|
||||||
rect->x == 0 && rect->y == 0 &&
|
rect->x == 0 && rect->y == 0 &&
|
||||||
rect->w == texture->w && rect->h == texture->h) {
|
rect->w == texture->w && rect->h == texture->h) {
|
||||||
full_texture = SDL_TRUE;
|
full_texture = SDL_TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (D3D_UpdateTextureInternal(data->texture, texture->format, full_texture, rect->x, rect->y, rect->w, rect->h, Yplane, Ypitch) < 0) {
|
if (D3D_UpdateTextureInternal(data->texture, texture->format, full_texture, rect->x, rect->y, rect->w, rect->h, Yplane, Ypitch) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (D3D_UpdateTextureInternal(data->utexture, texture->format, full_texture, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Uplane, Upitch) < 0) {
|
if (D3D_UpdateTextureInternal(data->utexture, texture->format, full_texture, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Uplane, Upitch) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (D3D_UpdateTextureInternal(data->vtexture, texture->format, full_texture, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Vplane, Vpitch) < 0) {
|
if (D3D_UpdateTextureInternal(data->vtexture, texture->format, full_texture, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Vplane, Vpitch) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -1894,20 +1894,20 @@ D3D_DestroyRenderer(SDL_Renderer * renderer)
|
|||||||
IDirect3DDevice9 *
|
IDirect3DDevice9 *
|
||||||
SDL_RenderGetD3D9Device(SDL_Renderer * renderer)
|
SDL_RenderGetD3D9Device(SDL_Renderer * renderer)
|
||||||
{
|
{
|
||||||
D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
|
D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
|
||||||
IDirect3DDevice9 *device;
|
IDirect3DDevice9 *device;
|
||||||
|
|
||||||
// Make sure that this is a D3D renderer
|
// Make sure that this is a D3D renderer
|
||||||
if (renderer->DestroyRenderer != D3D_DestroyRenderer) {
|
if (renderer->DestroyRenderer != D3D_DestroyRenderer) {
|
||||||
SDL_SetError("Renderer is not a D3D renderer");
|
SDL_SetError("Renderer is not a D3D renderer");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
device = data->device;
|
device = data->device;
|
||||||
if (device) {
|
if (device) {
|
||||||
IDirect3DDevice9_AddRef( device );
|
IDirect3DDevice9_AddRef( device );
|
||||||
}
|
}
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
|
#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
|
||||||
|
Loading…
Reference in New Issue
Block a user