Module: wine
Branch: stable
Commit: b114a134134db73f1ac5aa693d8ff09b85d4411e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b114a134134db73f1ac5aa693…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Fri Nov 22 10:45:00 2013 +0100
wined3d: Reimplement wined3d_ftoa().
The current implementation is not precise enough when the FPU is in REAL4
mode, which also happens to be the mode d3d9 sets by default. Doing the same
thing with integer math is a huge pain, so just replace the decimal separator
instead.
(cherry picked from commit 12f16f2127ffce9a05eedf008c3aa3732751a7e3)
---
dlls/wined3d/utils.c | 47 +++++++----------------------------------------
1 file changed, 7 insertions(+), 40 deletions(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 2ee4b95..a4b650d 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -3731,51 +3731,18 @@ void wined3d_get_draw_rect(const struct wined3d_state *state, RECT *rect)
IntersectRect(rect, rect, &state->scissor_rect);
}
-/* This should be equivalent to using the %.8e format specifier, but always
- * using '.' as decimal separator. This doesn't handle +/-INF or NAN, since
- * the GLSL and ARB parsers wouldn't be able to handle those anyway. */
+/* Print a floating point value with the %.8e format specifier, always using
+ * '.' as decimal separator. */
void wined3d_ftoa(float value, char *s)
{
- int x, frac, exponent;
- const char *sign = "";
- double d;
+ int idx = 1;
- d = value;
if (copysignf(1.0f, value) < 0.0f)
- {
- d = -d;
- sign = "-";
- }
-
- if (d == 0.0f)
- {
- x = 0;
- frac = 0;
- exponent = 0;
- }
- else
- {
- double t, diff;
-
- exponent = floorf(log10f(d));
- d /= pow(10.0, exponent);
-
- x = d;
- t = (d - x) * 100000000;
- frac = t;
- diff = t - frac;
-
- if ((diff > 0.5) || (diff == 0.5 && (frac & 1)))
- {
- if (++frac >= 100000000)
- {
- frac = 0;
- ++x;
- }
- }
- }
+ ++idx;
- sprintf(s, "%s%d.%08de%+03d", sign, x, frac, exponent);
+ sprintf(s, "%.8e", value);
+ if (isfinite(value))
+ s[idx] = '.';
}
void wined3d_release_dc(HWND window, HDC dc)
Module: wine
Branch: stable
Commit: deca08bc93d54a6f06462d80640fa75b1fc00ab1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=deca08bc93d54a6f06462d806…
Author: Andrew Eikum <aeikum(a)codeweavers.com>
Date: Thu Nov 21 12:42:35 2013 -0600
winecoreaudio.drv: Don't return 0 absolute position if AudioQueue call fails.
Some failures are temporary, for example if the user reconfigures their
audio setup while playing audio. Returning 0 could have bad "going
backward in time" effects which can break audio even after the call
starts to succeed again.
(cherry picked from commit f53dd40ad881cc7f887c0587d42f70bb07ddd2e0)
---
dlls/winecoreaudio.drv/mmdevdrv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c
index 92be329..7a0b3ff 100644
--- a/dlls/winecoreaudio.drv/mmdevdrv.c
+++ b/dlls/winecoreaudio.drv/mmdevdrv.c
@@ -681,6 +681,8 @@ static UINT64 get_current_aqbuffer_position(ACImpl *This, int mode)
if(sc != noErr){
if(sc != kAudioQueueErr_InvalidRunState)
WARN("Unable to get current time: %lx\n", sc);
+ if(mode == BUFPOS_ABSOLUTE)
+ return This->highest_sampletime;
return 0;
}