Rebase against 9ef8fa2a0bfb559475e17d2562892085f0e2a90f

This commit is contained in:
Alistair Leslie-Hughes
2018-06-22 10:17:35 +10:00
parent c3a5e9290e
commit 7c9f9bc0c1
6 changed files with 57 additions and 157 deletions

View File

@@ -1,7 +1,7 @@
From e8e425059101d8c719a8aea674f1c1da3d9a1085 Mon Sep 17 00:00:00 2001
From b1655e88c9c7b4b87ae87d06261ce3db4fac1432 Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Sun, 26 May 2013 19:42:08 +0200
Subject: d3dx9_36: Implement ID3DXFontImpl_DrawText.
Subject: [PATCH] d3dx9_36: Implement ID3DXFontImpl_DrawText.
Changes by Sebastian Lackner <sebastian@fds-team.de>:
* Use pitch value for locked buffer instead of assuming that pitch = width * bytesperpixel
@@ -21,10 +21,10 @@ Changes by Sebastian Lackner <sebastian@fds-team.de>:
1 file changed, 210 insertions(+), 19 deletions(-)
diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
index dd1243e..7152dab 100644
index 5522dea..916ce4c 100644
--- a/dlls/d3dx9_36/font.c
+++ b/dlls/d3dx9_36/font.c
@@ -36,8 +36,29 @@ struct d3dx_font
@@ -35,8 +35,29 @@ struct d3dx_font
HDC hdc;
HFONT hfont;
@@ -54,7 +54,7 @@ index dd1243e..7152dab 100644
static inline struct d3dx_font *impl_from_ID3DXFont(ID3DXFont *iface)
{
return CONTAINING_RECORD(iface, struct d3dx_font, ID3DXFont_iface);
@@ -64,19 +85,27 @@ static HRESULT WINAPI ID3DXFontImpl_QueryInterface(ID3DXFont *iface, REFIID riid
@@ -63,19 +84,27 @@ static HRESULT WINAPI ID3DXFontImpl_QueryInterface(ID3DXFont *iface, REFIID riid
static ULONG WINAPI ID3DXFontImpl_AddRef(ID3DXFont *iface)
{
struct d3dx_font *This = impl_from_ID3DXFont(iface);
@@ -85,7 +85,7 @@ index dd1243e..7152dab 100644
DeleteObject(This->hfont);
DeleteDC(This->hdc);
IDirect3DDevice9_Release(This->device);
@@ -179,17 +208,170 @@ static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, const WCHAR *
@@ -178,17 +207,170 @@ static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, const WCHAR *
static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
const char *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
{
@@ -260,7 +260,7 @@ index dd1243e..7152dab 100644
}
static HRESULT WINAPI ID3DXFontImpl_OnLostDevice(ID3DXFont *iface)
@@ -303,46 +485,55 @@ HRESULT WINAPI D3DXCreateFontIndirectW(IDirect3DDevice9 *device, const D3DXFONT_
@@ -302,46 +484,55 @@ HRESULT WINAPI D3DXCreateFontIndirectW(IDirect3DDevice9 *device, const D3DXFONT_
TRACE("(%p, %p, %p)\n", device, desc, font);
@@ -329,5 +329,5 @@ index dd1243e..7152dab 100644
return D3D_OK;
}
--
2.4.5
1.9.1

View File

@@ -1,19 +1,20 @@
From f28e6a98185ce7dd1137f2f04861c097e75e72a9 Mon Sep 17 00:00:00 2001
From 657fcdbe239c1c1b37414acb82df75a27f643f38 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 4 Dec 2015 09:22:35 +1100
Subject: d3dx9_36: Support NULL terminated strings in ID3DXFont_DrawText
Subject: [PATCH] d3dx9_36: Support NULL terminated strings in
ID3DXFont_DrawText
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/d3dx9_36/font.c | 10 ++++++++--
dlls/d3dx9_36/tests/core.c | 46 +++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 53 insertions(+), 3 deletions(-)
dlls/d3dx9_36/tests/core.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
index d6dcd6c..63aa828 100644
index 921dada..518a9dc 100644
--- a/dlls/d3dx9_36/font.c
+++ b/dlls/d3dx9_36/font.c
@@ -214,9 +214,12 @@ static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
@@ -213,9 +213,12 @@ static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
@@ -27,7 +28,7 @@ index d6dcd6c..63aa828 100644
countW = MultiByteToWideChar(CP_ACP, 0, string, count, NULL, 0);
stringW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR));
if (stringW)
@@ -239,9 +242,12 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
@@ -238,9 +241,12 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
@@ -42,28 +43,19 @@ index d6dcd6c..63aa828 100644
while (count > 0 && !string[count-1])
count--;
diff --git a/dlls/d3dx9_36/tests/core.c b/dlls/d3dx9_36/tests/core.c
index 1c379fb..c931260 100644
index 91e458b..b95c23f 100644
--- a/dlls/d3dx9_36/tests/core.c
+++ b/dlls/d3dx9_36/tests/core.c
@@ -321,6 +321,8 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
{ 12, 256, 5 },
{ 72, 256, 8 }
};
+ static const WCHAR testW[] = {'t','e','s','t',0};
@@ -306,6 +306,7 @@ static void test_ID3DXSprite(IDirect3DDevice9 *device)
static void test_ID3DXFont(IDirect3DDevice9 *device)
{
static const WCHAR testW[] = {'t','e','s','t',0};
+ static const char testA[] = "test";
static const struct
{
int font_height;
@@ -637,6 +638,49 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
/* D3DXCreateFont */
@@ -463,7 +465,6 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
/* ID3DXFont_PreloadText */
hr = D3DXCreateFontA(device, 12, 0, FW_DONTCARE, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Arial", &font);
if(SUCCEEDED(hr)) {
- const WCHAR testW[] = {'t','e','s','t',0};
todo_wine {
hr = ID3DXFont_PreloadTextA(font, NULL, -1);
@@ -591,6 +592,49 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
}
ID3DXFont_Release(font);
}
+
@@ -113,5 +105,5 @@ index 1c379fb..c931260 100644
static void test_D3DXCreateRenderToSurface(IDirect3DDevice9 *device)
--
2.6.2
1.9.1