mirror of
https://github.com/love2d/megasource.git
synced 2026-08-19 04:05:09 +02:00
Update SDL2 to the latest hg revision of 2.0.4.
This commit is contained in:
@@ -760,8 +760,8 @@ SDL_RenderDriver D3D11_RenderDriver = {
|
||||
};
|
||||
|
||||
|
||||
static Uint32
|
||||
DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat) {
|
||||
Uint32
|
||||
D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat) {
|
||||
switch (dxgiFormat) {
|
||||
case DXGI_FORMAT_B8G8R8A8_UNORM:
|
||||
return SDL_PIXELFORMAT_ARGB8888;
|
||||
@@ -2367,7 +2367,7 @@ D3D11_UpdateVertexBuffer(SDL_Renderer *renderer,
|
||||
} else {
|
||||
SAFE_RELEASE(rendererData->vertexBuffer);
|
||||
|
||||
vertexBufferDesc.ByteWidth = dataSizeInBytes;
|
||||
vertexBufferDesc.ByteWidth = (UINT) dataSizeInBytes;
|
||||
vertexBufferDesc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
|
||||
vertexBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
@@ -2504,7 +2504,7 @@ D3D11_RenderDrawPoints(SDL_Renderer * renderer,
|
||||
a = (float)(renderer->a / 255.0f);
|
||||
|
||||
vertices = SDL_stack_alloc(VertexPositionColor, count);
|
||||
for (i = 0; i < min(count, 128); ++i) {
|
||||
for (i = 0; i < count; ++i) {
|
||||
const VertexPositionColor v = { { points[i].x, points[i].y, 0.0f }, { 0.0f, 0.0f }, { r, g, b, a } };
|
||||
vertices[i] = v;
|
||||
}
|
||||
@@ -2911,7 +2911,7 @@ D3D11_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
||||
*/
|
||||
if (SDL_ConvertPixels(
|
||||
rect->w, rect->h,
|
||||
DXGIFormatToSDLPixelFormat(stagingTextureDesc.Format),
|
||||
D3D11_DXGIFormatToSDLPixelFormat(stagingTextureDesc.Format),
|
||||
textureMemory.pData,
|
||||
textureMemory.RowPitch,
|
||||
format,
|
||||
|
||||
Reference in New Issue
Block a user