Am Donnerstag, den 24.07.2008, 00:55 +0800 schrieb Huang, Zhangrong:
Hi, I tried run World of Warcraft on Mac OS X with X11 and NVIDIA card, got the following error messages:
err:d3d_caps:IWineD3DImpl_FillGLCaps Invalid nVidia version string: "1.5 NVIDIA-1.5.24" err:d3d_caps:IWineD3DImpl_FillGLCaps Invalid nVidia version string: "1.5 NVIDIA-1.5.24"
This patch fixed this problem.
gl_string_cursor = gl_string;
major = atoi(gl_string_cursor);
while (*gl_string_cursor <= '9' && *gl_string_cursor >= '0') {
++gl_string_cursor;
}
What is the advantage of that compared to major = strtol(gl_string, &gl_string_cursor,10); ?
Or even replace the whole scanning code by
if(sscanf(gl_string, "%d.%d", &major, &minor) != 2) ERR_(d3d_caps)(...)
Regards, Michael Karcher
Hi,
2008/7/24 Michael Karcher wine@mkarcher.dialup.fu-berlin.de:
What is the advantage of that compared to major = strtol(gl_string, &gl_string_cursor,10); ?
Or even replace the whole scanning code by
if(sscanf(gl_string, "%d.%d", &major, &minor) != 2) ERR_(d3d_caps)(...)
It looks much better.
This patch was copied & modified from existing code:
/* Apple and Mesa version strings look differently, but both provide intel drivers */ if(strstr(gl_string, "APPLE")) { /* [0-9]+.[0-9]+ APPLE-[0-9]+.[0.9]+.[0.9]+ * We only need the first part, and use the APPLE as identification * "1.2 APPLE-1.4.56" */ gl_string_cursor = gl_string; major = atoi(gl_string_cursor); while (*gl_string_cursor <= '9' && *gl_string_cursor >= '0') { ++gl_string_cursor; }