From 51177f96ba7c7148ab250839fbfde9dde3c934e4 Mon Sep 17 00:00:00 2001 From: Lionel Ulmer Date: Mon, 1 May 2000 14:25:49 +0000 Subject: [PATCH] Added DGA2 driver to DirectDraw. --- configure | 404 ++++++++++++++++++----------------- configure.in | 3 + dlls/ddraw/Makefile.in | 6 + dlls/ddraw/ddraw/dga.c | 355 ++++++++---------------------- dlls/ddraw/ddraw/dga2.c | 427 +++++++++++++++++++++++++++++++++++++ dlls/ddraw/dga.c | 142 ++++-------- dlls/ddraw/dga2.c | 194 +++++++++++++++++ dlls/ddraw/dga2_private.h | 28 +++ dlls/ddraw/dga_private.h | 29 ++- dlls/ddraw/dpalette/dga.c | 7 +- dlls/ddraw/dsurface/dga.c | 99 +-------- dlls/ddraw/dsurface/dga2.c | 110 ++++++++++ 12 files changed, 1112 insertions(+), 692 deletions(-) create mode 100644 dlls/ddraw/ddraw/dga2.c create mode 100644 dlls/ddraw/dga2.c create mode 100644 dlls/ddraw/dga2_private.h create mode 100644 dlls/ddraw/dsurface/dga2.c diff --git a/configure b/configure index b75f28be2a1..132e10b3ab1 100755 --- a/configure +++ b/configure @@ -2918,6 +2918,8 @@ XFILES="" DGA_SRCS="" +DGA2_SRCS="" + MESA_SRCS="" if test "$have_x" = "yes" then @@ -2929,17 +2931,17 @@ then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2933: checking for $ac_hdr" >&5 +echo "configure:2935: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2968,7 +2970,7 @@ done if test "$ac_cv_header_X11_xpm_h" = "yes" then echo $ac_n "checking for XpmCreatePixmapFromData in -lXpm""... $ac_c" 1>&6 -echo "configure:2972: checking for XpmCreatePixmapFromData in -lXpm" >&5 +echo "configure:2974: checking for XpmCreatePixmapFromData in -lXpm" >&5 ac_lib_var=`echo Xpm'_'XpmCreatePixmapFromData | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2976,7 +2978,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXpm $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3030,17 +3032,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3034: checking for $ac_hdr" >&5 +echo "configure:3036: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3069,7 +3071,7 @@ done if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_XShm_h" = "yes" then echo $ac_n "checking for XShmQueryExtension in -lXext""... $ac_c" 1>&6 -echo "configure:3073: checking for XShmQueryExtension in -lXext" >&5 +echo "configure:3075: checking for XShmQueryExtension in -lXext" >&5 ac_lib_var=`echo Xext'_'XShmQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3077,7 +3079,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXext $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3116,17 +3118,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3120: checking for $ac_hdr" >&5 +echo "configure:3122: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3155,7 +3157,7 @@ done if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86dga_h" = "yes" then echo $ac_n "checking for XDGAQueryExtension in -lXxf86dga""... $ac_c" 1>&6 -echo "configure:3159: checking for XDGAQueryExtension in -lXxf86dga" >&5 +echo "configure:3161: checking for XDGAQueryExtension in -lXxf86dga" >&5 ac_lib_var=`echo Xxf86dga'_'XDGAQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3164,7 +3166,7 @@ else LIBS="-lXxf86dga $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3200,6 +3202,7 @@ EOF X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga" DGA_SRCS='$(DGA_SRCS)' + DGA2_SRCS='$(DGA2_SRCS)' else echo "$ac_t""no" 1>&6 @@ -3208,7 +3211,7 @@ fi if test "$ac_cv_lib_Xxf86dga_XDGAQueryExtension" = "no" then echo $ac_n "checking for XF86DGAQueryExtension in -lXxf86dga""... $ac_c" 1>&6 -echo "configure:3212: checking for XF86DGAQueryExtension in -lXxf86dga" >&5 +echo "configure:3215: checking for XF86DGAQueryExtension in -lXxf86dga" >&5 ac_lib_var=`echo Xxf86dga'_'XF86DGAQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3216,7 +3219,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXxf86dga $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3260,17 +3263,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3264: checking for $ac_hdr" >&5 +echo "configure:3267: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3299,7 +3302,7 @@ done if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes" then echo $ac_n "checking for XF86VidModeQueryExtension in -lXxf86vm""... $ac_c" 1>&6 -echo "configure:3303: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5 +echo "configure:3306: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5 ac_lib_var=`echo Xxf86vm'_'XF86VidModeQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3307,7 +3310,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXxf86vm $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3349,17 +3352,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3353: checking for $ac_hdr" >&5 +echo "configure:3356: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3388,19 +3391,19 @@ done if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes" then echo $ac_n "checking "for up-to-date OpenGL version"""... $ac_c" 1>&6 -echo "configure:3392: checking "for up-to-date OpenGL version"" >&5 +echo "configure:3395: checking "for up-to-date OpenGL version"" >&5 if eval "test \"`echo '$''{'wine_cv_mesa_version_OK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { GLenum test = GL_UNSIGNED_SHORT_5_6_5; ; return 0; } EOF -if { (eval echo configure:3404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_mesa_version_OK="yes" else @@ -3417,21 +3420,21 @@ fi echo "$ac_t""$wine_cv_mesa_version_OK" 1>&6 echo $ac_n "checking "for thread-safe OpenGL version"""... $ac_c" 1>&6 -echo "configure:3421: checking "for thread-safe OpenGL version"" >&5 +echo "configure:3424: checking "for thread-safe OpenGL version"" >&5 if eval "test \"`echo '$''{'wine_cv_mesa_version_threadsafe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else saved_libs=$LIBS LIBS="$X_LIBS -lGL" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wine_cv_mesa_version_threadsafe="yes" else @@ -3450,7 +3453,7 @@ echo "$ac_t""$wine_cv_mesa_version_threadsafe" 1>&6 if test "$wine_cv_mesa_version_OK" = "yes" -a \( "$wine_cv_mesa_version_threadsafe" = "no" -o $OPENGL = "yes" \) then echo $ac_n "checking for glXCreateContext in -lGL""... $ac_c" 1>&6 -echo "configure:3454: checking for glXCreateContext in -lGL" >&5 +echo "configure:3457: checking for glXCreateContext in -lGL" >&5 ac_lib_var=`echo GL'_'glXCreateContext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3458,7 +3461,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lGL $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3499,7 +3502,7 @@ fi if test "$ac_cv_lib_GL_glXCreateContext" = "no" then echo $ac_n "checking for glXCreateContext in -lMesaGL""... $ac_c" 1>&6 -echo "configure:3503: checking for glXCreateContext in -lMesaGL" >&5 +echo "configure:3506: checking for glXCreateContext in -lMesaGL" >&5 ac_lib_var=`echo MesaGL'_'glXCreateContext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3507,7 +3510,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lMesaGL $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3547,19 +3550,19 @@ fi fi echo $ac_n "checking "for the OpenGL Color Index extension"""... $ac_c" 1>&6 -echo "configure:3551: checking "for the OpenGL Color Index extension"" >&5 +echo "configure:3554: checking "for the OpenGL Color Index extension"" >&5 if eval "test \"`echo '$''{'dummy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { GLenum test = GL_COLOR_INDEX8_EXT; ; return 0; } EOF -if { (eval echo configure:3563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_GL_COLOR_TABLE 1 @@ -3577,7 +3580,7 @@ echo "$ac_t""$dummy" 1>&6 if test "$ac_cv_lib_GL_glXCreateContext" = "no" then echo $ac_n "checking for glColorTableEXT in -lMesaGL""... $ac_c" 1>&6 -echo "configure:3581: checking for glColorTableEXT in -lMesaGL" >&5 +echo "configure:3584: checking for glColorTableEXT in -lMesaGL" >&5 ac_lib_var=`echo MesaGL'_'glColorTableEXT | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3585,7 +3588,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lMesaGL $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3621,7 +3624,7 @@ fi else echo $ac_n "checking for glColorTableEXT in -lGL""... $ac_c" 1>&6 -echo "configure:3625: checking for glColorTableEXT in -lGL" >&5 +echo "configure:3628: checking for glColorTableEXT in -lGL" >&5 ac_lib_var=`echo GL'_'glColorTableEXT | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3629,7 +3632,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lGL $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3683,17 +3686,17 @@ then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3687: checking for $ac_hdr" >&5 +echo "configure:3690: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3722,7 +3725,7 @@ done if test "$ac_cv_header_ncurses_h" = "yes" then echo $ac_n "checking for waddch in -lncurses""... $ac_c" 1>&6 -echo "configure:3726: checking for waddch in -lncurses" >&5 +echo "configure:3729: checking for waddch in -lncurses" >&5 ac_lib_var=`echo ncurses'_'waddch | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3730,7 +3733,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3772,7 +3775,7 @@ fi if test "$ac_cv_lib_ncurses_waddch" = "yes" then echo $ac_n "checking for resizeterm in -lncurses""... $ac_c" 1>&6 -echo "configure:3776: checking for resizeterm in -lncurses" >&5 +echo "configure:3779: checking for resizeterm in -lncurses" >&5 ac_lib_var=`echo ncurses'_'resizeterm | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3780,7 +3783,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3815,7 +3818,7 @@ else fi echo $ac_n "checking for getbkgd in -lncurses""... $ac_c" 1>&6 -echo "configure:3819: checking for getbkgd in -lncurses" >&5 +echo "configure:3822: checking for getbkgd in -lncurses" >&5 ac_lib_var=`echo ncurses'_'getbkgd | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3823,7 +3826,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3862,17 +3865,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3866: checking for $ac_hdr" >&5 +echo "configure:3869: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3901,7 +3904,7 @@ done if test "$ac_cv_header_curses_h" = "yes" then echo $ac_n "checking for waddch in -lcurses""... $ac_c" 1>&6 -echo "configure:3905: checking for waddch in -lcurses" >&5 +echo "configure:3908: checking for waddch in -lcurses" >&5 ac_lib_var=`echo curses'_'waddch | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3909,7 +3912,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3950,7 +3953,7 @@ fi if test "$ac_cv_lib_curses_waddch" = "yes" then echo $ac_n "checking for resizeterm in -lcurses""... $ac_c" 1>&6 -echo "configure:3954: checking for resizeterm in -lcurses" >&5 +echo "configure:3957: checking for resizeterm in -lcurses" >&5 ac_lib_var=`echo curses'_'resizeterm | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3958,7 +3961,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3993,7 +3996,7 @@ else fi echo $ac_n "checking for getbkgd in -lcurses""... $ac_c" 1>&6 -echo "configure:3997: checking for getbkgd in -lcurses" >&5 +echo "configure:4000: checking for getbkgd in -lcurses" >&5 ac_lib_var=`echo curses'_'getbkgd | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4001,7 +4004,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4041,12 +4044,12 @@ fi fi echo $ac_n "checking "for GNU style IPX support"""... $ac_c" 1>&6 -echo "configure:4045: checking "for GNU style IPX support"" >&5 +echo "configure:4048: checking "for GNU style IPX support"" >&5 if eval "test \"`echo '$''{'ac_cv_c_ipx_gnu'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4054,7 +4057,7 @@ int main() { ((struct sockaddr_ipx *)0)->sipx_family == AF_IPX ; return 0; } EOF -if { (eval echo configure:4058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_ipx_gnu="yes" else @@ -4079,12 +4082,12 @@ fi if test "$ac_cv_c_ipx_gnu" = "no" then echo $ac_n "checking "for linux style IPX support"""... $ac_c" 1>&6 -echo "configure:4083: checking "for linux style IPX support"" >&5 +echo "configure:4086: checking "for linux style IPX support"" >&5 if eval "test \"`echo '$''{'ac_cv_c_ipx_linux'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4093,7 +4096,7 @@ int main() { ((struct sockaddr_ipx *)0)->sipx_family == AF_IPX ; return 0; } EOF -if { (eval echo configure:4097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_ipx_linux="yes" else @@ -4120,17 +4123,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h soundcard.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4124: checking for $ac_hdr" >&5 +echo "configure:4127: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4158,12 +4161,12 @@ done echo $ac_n "checking "for Open Sound System"""... $ac_c" 1>&6 -echo "configure:4162: checking "for Open Sound System"" >&5 +echo "configure:4165: checking "for Open Sound System"" >&5 if eval "test \"`echo '$''{'ac_cv_c_opensoundsystem'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4191: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_opensoundsystem="yes" else @@ -4207,12 +4210,12 @@ EOF fi echo $ac_n "checking "for Open Sound System/MIDI interface"""... $ac_c" 1>&6 -echo "configure:4211: checking "for Open Sound System/MIDI interface"" >&5 +echo "configure:4214: checking "for Open Sound System/MIDI interface"" >&5 if eval "test \"`echo '$''{'ac_cv_c_opensoundsystem_midi'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_opensoundsystem_midi="yes" else @@ -4262,7 +4265,7 @@ if test "x${GCC}" = "xyes" then CFLAGS="$CFLAGS -Wall" echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6 -echo "configure:4266: checking "for gcc strength-reduce bug"" >&5 +echo "configure:4269: checking "for gcc strength-reduce bug"" >&5 if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4270,7 +4273,7 @@ else ac_cv_c_gcc_strength_bug="yes" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_gcc_strength_bug="no" else @@ -4304,7 +4307,7 @@ fi echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6 -echo "configure:4308: checking "whether external symbols need an underscore prefix"" >&5 +echo "configure:4311: checking "whether external symbols need an underscore prefix"" >&5 if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4316,14 +4319,14 @@ _ac_test: .long 0 EOF cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_c_extern_prefix="yes" else @@ -4347,7 +4350,7 @@ fi echo $ac_n "checking "whether assembler accepts .string"""... $ac_c" 1>&6 -echo "configure:4351: checking "whether assembler accepts .string"" >&5 +echo "configure:4354: checking "whether assembler accepts .string"" >&5 if eval "test \"`echo '$''{'ac_cv_c_asm_string'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4357,14 +4360,14 @@ cat > conftest_asm.s < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_c_asm_string="yes" else @@ -4391,21 +4394,21 @@ LDSHARED="" if test "$LIBEXT" = "so" then echo $ac_n "checking "whether we can build a Linux dll"""... $ac_c" 1>&6 -echo "configure:4395: checking "whether we can build a Linux dll"" >&5 +echo "configure:4398: checking "whether we can build a Linux dll"" >&5 if eval "test \"`echo '$''{'ac_cv_c_dll_linux'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else saved_cflags=$CFLAGS CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_c_dll_linux="yes" else @@ -4425,21 +4428,21 @@ echo "$ac_t""$ac_cv_c_dll_linux" 1>&6 LDSHARED="\$(CC) -shared -Wl,-soname,\$(SONAME),-rpath,\$(libdir)" else echo $ac_n "checking whether we can build a UnixWare (Solaris) dll""... $ac_c" 1>&6 -echo "configure:4429: checking whether we can build a UnixWare (Solaris) dll" >&5 +echo "configure:4432: checking whether we can build a UnixWare (Solaris) dll" >&5 if eval "test \"`echo '$''{'ac_cv_c_dll_unixware'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else saved_cflags=$CFLAGS CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_c_dll_unixware="yes" else @@ -4459,21 +4462,21 @@ echo "$ac_t""$ac_cv_c_dll_unixware" 1>&6 LDSHARED="\$(CC) -Wl,-G,-h,\$(libdir)/\$(SONAME)" else echo $ac_n "checking "whether we can build a NetBSD dll"""... $ac_c" 1>&6 -echo "configure:4463: checking "whether we can build a NetBSD dll"" >&5 +echo "configure:4466: checking "whether we can build a NetBSD dll"" >&5 if eval "test \"`echo '$''{'ac_cv_c_dll_netbsd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else saved_cflags=$CFLAGS CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_c_dll_netbsd="yes" else @@ -4510,21 +4513,21 @@ if test "$LIBEXT" = "so"; then else DLL_LINK="-L\$(DLLDIR) \$(DLLS:%=-l%) -L\$(TOPOBJDIR) -lwine \$(X_LIBS) \$(XLIB)" echo $ac_n "checking whether the linker supports --[no]-whole-archive (Linux)""... $ac_c" 1>&6 -echo "configure:4514: checking whether the linker supports --[no]-whole-archive (Linux)" >&5 +echo "configure:4517: checking whether the linker supports --[no]-whole-archive (Linux)" >&5 if eval "test \"`echo '$''{'ac_cv_c_whole_archive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else saved_cflags=$CFLAGS CFLAGS="$CFLAGS -Wl,--whole-archive -Wl,--no-whole-archive" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_c_whole_archive="yes" else @@ -4544,21 +4547,21 @@ echo "$ac_t""$ac_cv_c_whole_archive" 1>&6 DLL_LINK="-Wl,--whole-archive $DLL_LINK -Wl,--no-whole-archive" else echo $ac_n "checking whether the linker supports -z {all,default}extract (Linux)""... $ac_c" 1>&6 -echo "configure:4548: checking whether the linker supports -z {all,default}extract (Linux)" >&5 +echo "configure:4551: checking whether the linker supports -z {all,default}extract (Linux)" >&5 if eval "test \"`echo '$''{'ac_cv_c_allextract'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else saved_cflags=$CFLAGS CFLAGS="$CFLAGS -Wl,-z,allextract -Wl,-z,defaultextract" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_c_allextract="yes" else @@ -4589,7 +4592,7 @@ fi wine_cv_libc_reentrant=no echo $ac_n "checking "for reentrant libc: __errno_location"""... $ac_c" 1>&6 -echo "configure:4593: checking "for reentrant libc: __errno_location"" >&5 +echo "configure:4596: checking "for reentrant libc: __errno_location"" >&5 if eval "test \"`echo '$''{'wine_cv_libc_r__errno_location'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4597,14 +4600,14 @@ else wine_cv_libc_r__errno_location=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then wine_cv_libc_r__errno_location=yes else @@ -4629,7 +4632,7 @@ EOF wine_cv_libc_reentrant=__errno_location fi echo $ac_n "checking "for reentrant libc: __error"""... $ac_c" 1>&6 -echo "configure:4633: checking "for reentrant libc: __error"" >&5 +echo "configure:4636: checking "for reentrant libc: __error"" >&5 if eval "test \"`echo '$''{'wine_cv_libc_r__error'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4637,14 +4640,14 @@ else wine_cv_libc_r__error=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then wine_cv_libc_r__error=yes else @@ -4669,7 +4672,7 @@ EOF wine_cv_libc_reentrant=__error fi echo $ac_n "checking "for reentrant libc: ___errno"""... $ac_c" 1>&6 -echo "configure:4673: checking "for reentrant libc: ___errno"" >&5 +echo "configure:4676: checking "for reentrant libc: ___errno"" >&5 if eval "test \"`echo '$''{'wine_cv_libc_r___errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4677,14 +4680,14 @@ else wine_cv_libc_r___errno=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then wine_cv_libc_r___errno=yes else @@ -4709,7 +4712,7 @@ EOF wine_cv_libc_reentrant=___errno fi echo $ac_n "checking "for reentrant libc: __thr_errno"""... $ac_c" 1>&6 -echo "configure:4713: checking "for reentrant libc: __thr_errno"" >&5 +echo "configure:4716: checking "for reentrant libc: __thr_errno"" >&5 if eval "test \"`echo '$''{'wine_cv_libc_r__thr_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4717,14 +4720,14 @@ else wine_cv_libc_r__thr_errno=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then wine_cv_libc_r__thr_errno=yes else @@ -4760,7 +4763,7 @@ fi if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no" then echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6 -echo "configure:4764: checking "for reentrant X libraries"" >&5 +echo "configure:4767: checking "for reentrant X libraries"" >&5 if eval "test \"`echo '$''{'wine_cv_x_reentrant'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4806,14 +4809,14 @@ fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4810: checking whether byte ordering is bigendian" >&5 +echo "configure:4813: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -4824,11 +4827,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -4839,7 +4842,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -4859,7 +4862,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -4900,19 +4903,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:4904: checking for working alloca.h" >&5 +echo "configure:4907: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { void *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -4933,12 +4936,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4937: checking for alloca" >&5 +echo "configure:4940: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -4998,12 +5001,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:5002: checking whether alloca needs Cray hooks" >&5 +echo "configure:5005: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5032: checking for $ac_func" >&5 +echo "configure:5035: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5083,7 +5086,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:5087: checking stack direction for C alloca" >&5 +echo "configure:5090: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5091,7 +5094,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -5162,12 +5165,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5166: checking for $ac_func" >&5 +echo "configure:5169: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5267,17 +5270,17 @@ for ac_hdr in \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5271: checking for $ac_hdr" >&5 +echo "configure:5274: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5304,12 +5307,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:5308: checking whether stat file-mode macros are broken" >&5 +echo "configure:5311: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5362,12 +5365,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:5366: checking for working const" >&5 +echo "configure:5369: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -5437,21 +5440,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:5441: checking for inline" >&5 +echo "configure:5444: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -5477,12 +5480,12 @@ EOF esac echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:5481: checking for ANSI C header files" >&5 +echo "configure:5484: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5490,7 +5493,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5497: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5507,7 +5510,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -5525,7 +5528,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -5546,7 +5549,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -5557,7 +5560,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:5561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -5581,12 +5584,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:5585: checking for size_t" >&5 +echo "configure:5588: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5614,7 +5617,7 @@ EOF fi echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:5618: checking size of long long" >&5 +echo "configure:5621: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5622,7 +5625,7 @@ else ac_cv_sizeof_long_long=0 else cat > conftest.$ac_ext < main() @@ -5633,7 +5636,7 @@ main() exit(0); } EOF -if { (eval echo configure:5637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -5656,12 +5659,12 @@ EOF if test "$ac_cv_header_linux_joystick_h" = "yes" then echo $ac_n "checking "whether linux/joystick.h uses the Linux 2.2+ API"""... $ac_c" 1>&6 -echo "configure:5660: checking "whether linux/joystick.h uses the Linux 2.2+ API"" >&5 +echo "configure:5663: checking "whether linux/joystick.h uses the Linux 2.2+ API"" >&5 if eval "test \"`echo '$''{'wine_cv_linux_joystick_22_api'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5676,7 +5679,7 @@ int main() { /*empty*/ ; return 0; } EOF -if { (eval echo configure:5680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_linux_joystick_22_api=yes else @@ -5703,12 +5706,12 @@ fi if test "$ac_cv_header_sys_vfs_h" = "yes" then echo $ac_n "checking "whether sys/vfs.h defines statfs"""... $ac_c" 1>&6 -echo "configure:5707: checking "whether sys/vfs.h defines statfs"" >&5 +echo "configure:5710: checking "whether sys/vfs.h defines statfs"" >&5 if eval "test \"`echo '$''{'wine_cv_sys_vfs_has_statfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5725,7 +5728,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_vfs_has_statfs=yes else @@ -5752,12 +5755,12 @@ fi if test "$ac_cv_header_sys_statfs_h" = "yes" then echo $ac_n "checking "whether sys/statfs.h defines statfs"""... $ac_c" 1>&6 -echo "configure:5756: checking "whether sys/statfs.h defines statfs"" >&5 +echo "configure:5759: checking "whether sys/statfs.h defines statfs"" >&5 if eval "test \"`echo '$''{'wine_cv_sys_statfs_has_statfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5772,7 +5775,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_statfs_has_statfs=yes else @@ -5799,12 +5802,12 @@ fi if test "$ac_cv_header_sys_mount_h" = "yes" then echo $ac_n "checking "whether sys/mount.h defines statfs"""... $ac_c" 1>&6 -echo "configure:5803: checking "whether sys/mount.h defines statfs"" >&5 +echo "configure:5806: checking "whether sys/mount.h defines statfs"" >&5 if eval "test \"`echo '$''{'wine_cv_sys_mount_has_statfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5819,7 +5822,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_mount_has_statfs=yes else @@ -5845,7 +5848,7 @@ fi echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6 -echo "configure:5849: checking "for statfs.f_bfree"" >&5 +echo "configure:5852: checking "for statfs.f_bfree"" >&5 if eval "test \"`echo '$''{'wine_cv_statfs_bfree'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5854,7 +5857,7 @@ else wine_cv_statfs_bfree=no else cat > conftest.$ac_ext < @@ -5881,7 +5884,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_statfs_bfree=yes else @@ -5905,7 +5908,7 @@ EOF fi echo $ac_n "checking "for statfs.f_bavail"""... $ac_c" 1>&6 -echo "configure:5909: checking "for statfs.f_bavail"" >&5 +echo "configure:5912: checking "for statfs.f_bavail"" >&5 if eval "test \"`echo '$''{'wine_cv_statfs_bavail'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5914,7 +5917,7 @@ else wine_cv_statfs_bavail=no else cat > conftest.$ac_ext < @@ -5941,7 +5944,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_statfs_bavail=yes else @@ -5966,12 +5969,12 @@ fi echo $ac_n "checking "for msg_accrights in struct msghdr"""... $ac_c" 1>&6 -echo "configure:5970: checking "for msg_accrights in struct msghdr"" >&5 +echo "configure:5973: checking "for msg_accrights in struct msghdr"" >&5 if eval "test \"`echo '$''{'ac_cv_c_msg_accrights'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5979,7 +5982,7 @@ int main() { struct msghdr hdr; hdr.msg_accrights=0 ; return 0; } EOF -if { (eval echo configure:5983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_msg_accrights="yes" else @@ -6002,12 +6005,12 @@ fi echo $ac_n "checking "for sun_len in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:6006: checking "for sun_len in struct sockaddr_un"" >&5 +echo "configure:6009: checking "for sun_len in struct sockaddr_un"" >&5 if eval "test \"`echo '$''{'ac_cv_c_sun_len'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6016,7 +6019,7 @@ int main() { static struct sockaddr_un addr; addr.sun_len = 1 ; return 0; } EOF -if { (eval echo configure:6020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_sun_len="yes" else @@ -6039,12 +6042,12 @@ fi echo $ac_n "checking "whether we need to define __i386__"""... $ac_c" 1>&6 -echo "configure:6043: checking "whether we need to define __i386__"" >&5 +echo "configure:6046: checking "whether we need to define __i386__"" >&5 if eval "test \"`echo '$''{'ac_cv_cpp_def_i386'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <ref = 1; -#ifdef HAVE_LIBXXF86DGA2 - if (ddpriv->version == 2) - ICOM_VTBL(dsurf) = (ICOM_VTABLE(IDirectDrawSurface)*)&dga2_dds4vt; - else -#endif /* defined(HAVE_LIBXXF86DGA2) */ - ICOM_VTBL(dsurf) = (ICOM_VTABLE(IDirectDrawSurface)*)&dga_dds4vt; dsurf->s.ddraw = This; dsurf->s.palette = NULL; dspriv->fb_height = -1; /* This is to have non-on screen surfaces freed */ @@ -194,84 +191,21 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface( return DD_OK; } -#ifdef HAVE_LIBXXF86DGA2 -static HRESULT WINAPI DGA_IDirectDraw2Impl_SetCooperativeLevel( - LPDIRECTDRAW2 iface,HWND hwnd,DWORD cooplevel +static HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface( + LPDIRECTDRAW2 iface,LPDDSURFACEDESC lpddsd,LPDIRECTDRAWSURFACE *lpdsf, + IUnknown *lpunk ) { - ICOM_THIS(IDirectDraw2Impl,iface); - DDPRIVATE(This); - HRESULT ret; - int evbase, erbase; + HRESULT ret; + IDirectDrawSurfaceImpl* dsurf; - ret = IDirectDraw2Impl_SetCooperativeLevel(iface, hwnd, cooplevel); + ret = DGA_IDirectDraw2Impl_CreateSurface_no_VT(iface, lpddsd, lpdsf, lpunk); - if (ddpriv->version != 2) { - return ret; - } else { - if (ret != DD_OK) - return ret; + dsurf = *(IDirectDrawSurfaceImpl**)lpdsf; + ICOM_VTBL(dsurf) = (ICOM_VTABLE(IDirectDrawSurface)*)&dga_dds4vt; - TSXDGAQueryExtension(display, &evbase, &erbase); - - /* Now, start handling of DGA events giving the handle to the DDraw window - as the window for which the event will be reported */ - TSXDGASelectInput(display, DefaultScreen(display), - KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask|PointerMotionMask ); - X11DRV_EVENT_SetDGAStatus(hwnd, evbase); - return DD_OK; - } + return ret; } -#endif -#ifdef HAVE_LIBXXF86DGA2 -void _DGA_Initialize_FrameBuffer(IDirectDrawImpl *This, int mode) { - DDPIXELFORMAT *pf = &(This->d.directdraw_pixelformat); - DDPRIVATE(This); - - /* Now, get the device / mode description */ - ddpriv->dev = TSXDGASetMode(display, DefaultScreen(display), mode); - - ddpriv->fb_width = ddpriv->dev->mode.imageWidth; - TSXDGASetViewport(display,DefaultScreen(display),0,0, XDGAFlipImmediate); - ddpriv->fb_height = ddpriv->dev->mode.viewportHeight; - TRACE("video framebuffer: begin %p, width %d, memsize %d\n", - ddpriv->dev->data, - ddpriv->dev->mode.imageWidth, - (ddpriv->dev->mode.imageWidth * - ddpriv->dev->mode.imageHeight * - (ddpriv->dev->mode.bitsPerPixel / 8)) - ); - TRACE("viewport height: %d\n", ddpriv->dev->mode.viewportHeight); - /* Get the screen dimensions as seen by Wine. - * In that case, it may be better to ignore the -desktop mode and return the - * real screen size => print a warning */ - This->d.height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); - This->d.width = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); - ddpriv->fb_addr = ddpriv->dev->data; - ddpriv->fb_memsize = (ddpriv->dev->mode.imageWidth * - ddpriv->dev->mode.imageHeight * - (ddpriv->dev->mode.bitsPerPixel / 8)); - ddpriv->vpmask = 0; - - /* Fill the screen pixelformat */ - pf->dwSize = sizeof(DDPIXELFORMAT); - pf->dwFourCC = 0; - pf->u.dwRGBBitCount = ddpriv->dev->mode.bitsPerPixel; - if (ddpriv->dev->mode.depth == 8) { - pf->dwFlags = DDPF_PALETTEINDEXED8|DDPF_RGB; - pf->u1.dwRBitMask = 0; - pf->u2.dwGBitMask = 0; - pf->u3.dwBBitMask = 0; - } else { - pf->dwFlags = DDPF_RGB; - pf->u1.dwRBitMask = ddpriv->dev->mode.redMask; - pf->u2.dwGBitMask = ddpriv->dev->mode.greenMask; - pf->u3.dwBBitMask = ddpriv->dev->mode.blueMask; - } - pf->u4.dwRGBAlphaBitMask= 0; - This->d.screen_pixelformat = *pf; -} -#endif /* defined(HAVE_LIBXXF86DGA2) */ static HRESULT WINAPI DGA_IDirectDrawImpl_SetDisplayMode( LPDIRECTDRAW iface,DWORD width,DWORD height,DWORD depth @@ -282,45 +216,6 @@ static HRESULT WINAPI DGA_IDirectDrawImpl_SetDisplayMode( TRACE("(%p)->(%ld,%ld,%ld)\n", This, width, height, depth); -#ifdef HAVE_LIBXXF86DGA2 - if (ddpriv->version == 2) { - XDGAMode *modes = ddpriv->modes; - int mode_to_use = -1; - - /* Search in the list a display mode that corresponds to what is requested */ - for (i = 0; i < ddpriv->num_modes; i++) { - if ((height == modes[i].viewportHeight) && - (width == modes[i].viewportWidth) && - (depth == modes[i].depth) - ) - mode_to_use = modes[i].num; - } - - if (mode_to_use < 0) { - ERR("Could not find matching mode !!!\n"); - return DDERR_UNSUPPORTEDMODE; - } else { - TRACE("Using mode number %d\n", mode_to_use); - - TSXDGACloseFramebuffer(display, DefaultScreen(display)); - - if (!TSXDGAOpenFramebuffer(display, DefaultScreen(display))) { - ERR("Error opening the frame buffer !!!\n"); - return DDERR_GENERIC; - } - - /* Initialize the frame buffer */ - _DGA_Initialize_FrameBuffer(This, mode_to_use); - - /* Re-get (if necessary) the DGA events */ - TSXDGASelectInput(display, DefaultScreen(display), - KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask|PointerMotionMask ); - } - - return DD_OK; - } -#endif /* defined(HAVE_LIBXXF86DGA2) */ - /* We hope getting the asked for depth */ if (_common_depth_to_pixelformat(depth, &(This->d.directdraw_pixelformat), &(This->d.screen_pixelformat), NULL) != -1) { /* I.e. no visual found or emulated */ @@ -341,9 +236,6 @@ static HRESULT WINAPI DGA_IDirectDrawImpl_SetDisplayMode( _common_IDirectDrawImpl_SetDisplayMode(This); #ifdef HAVE_LIBXXF86VM -#ifdef HAVE_LIBXXF86DGA2 - if (ddpriv->version == 1) /* Only for DGA 1.0, it crashes with DGA 2.0 */ -#endif /* defined(HAVE_LIBXXF86DGA2) */ { XF86VidModeModeInfo **all_modes, *vidmode = NULL; XF86VidModeModeLine mod_tmp; @@ -403,7 +295,7 @@ static HRESULT WINAPI DGA_IDirectDrawImpl_SetDisplayMode( return DD_OK; } -static HRESULT WINAPI DGA_IDirectDraw2Impl_GetCaps( +HRESULT WINAPI DGA_IDirectDraw2Impl_GetCaps( LPDIRECTDRAW2 iface,LPDDCAPS caps1,LPDDCAPS caps2 ) { ICOM_THIS(IDirectDraw2Impl,iface); @@ -425,6 +317,7 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_GetCaps( return DD_OK; } +#if 0 /* Not used as of now.... */ static void fill_caps(LPDDCAPS caps) { /* This function tries to fill the capabilities of Wine's DDraw * implementation. Needs to be fixed, though.. */ @@ -458,6 +351,7 @@ static void fill_caps(LPDDCAPS caps) { caps->ddsCaps.dwCaps |= DDSCAPS_3DDEVICE | DDSCAPS_MIPMAP | DDSCAPS_TEXTURE | DDSCAPS_ZBUFFER; #endif } +#endif static HRESULT WINAPI DGA_IDirectDraw2Impl_CreatePalette( LPDIRECTDRAW2 iface,DWORD dwFlags,LPPALETTEENTRY palent,LPDIRECTDRAWPALETTE *lpddpal,LPUNKNOWN lpunk @@ -515,42 +409,24 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_RestoreDisplayMode(LPDIRECTDRAW2 ifac static ULONG WINAPI DGA_IDirectDraw2Impl_Release(LPDIRECTDRAW2 iface) { ICOM_THIS(IDirectDraw2Impl,iface); - DDPRIVATE(This); TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); if (!--(This->ref)) { -#ifdef HAVE_LIBXXF86DGA2 - if (ddpriv->version == 2) { - TRACE("Closing access to the FrameBuffer\n"); - TSXDGACloseFramebuffer(display, DefaultScreen(display)); - TRACE("Going back to normal X mode of operation\n"); - TSXDGASetMode(display, DefaultScreen(display), 0); - - /* Set the input handling back to absolute */ - X11DRV_EVENT_SetInputMethod(X11DRV_INPUT_ABSOLUTE); - - /* Remove the handling of DGA2 events */ - X11DRV_EVENT_SetDGAStatus(0, -1); - - /* Free the modes list */ - TSXFree(ddpriv->modes); - } else -#endif /* defined(HAVE_LIBXXF86DGA2) */ - TSXF86DGADirectVideo(display,DefaultScreen(display),0); - if (This->d.window && GetPropA(This->d.window,ddProp)) - DestroyWindow(This->d.window); + TSXF86DGADirectVideo(display,DefaultScreen(display),0); + if (This->d.window && GetPropA(This->d.window,ddProp)) + DestroyWindow(This->d.window); #ifdef HAVE_LIBXXF86VM - if (orig_mode) { - TSXF86VidModeSwitchToMode( - display, - DefaultScreen(display), - orig_mode - ); - if (orig_mode->privsize) + if (orig_mode) { + TSXF86VidModeSwitchToMode( + display, + DefaultScreen(display), + orig_mode + ); + if (orig_mode->privsize) TSXFree(orig_mode->private); - free(orig_mode); - orig_mode = NULL; - } + free(orig_mode); + orig_mode = NULL; + } #endif #ifdef RESTORE_SIGNALS @@ -562,7 +438,7 @@ static ULONG WINAPI DGA_IDirectDraw2Impl_Release(LPDIRECTDRAW2 iface) { return This->ref; } -static HRESULT WINAPI DGA_IDirectDraw2Impl_QueryInterface( +HRESULT WINAPI DGA_IDirectDraw2Impl_QueryInterface( LPDIRECTDRAW2 iface,REFIID refiid,LPVOID *obj ) { ICOM_THIS(IDirectDraw2Impl,iface); @@ -612,7 +488,6 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_EnumDisplayModes( ) { ICOM_THIS(IDirectDraw2Impl,iface); DDSURFACEDESC ddsfd; - DDPRIVATE(This); static struct { int w,h; } modes[5] = { /* some usual modes */ @@ -635,116 +510,68 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_EnumDisplayModes( ddsfd.ddsCaps.dwCaps = 0; ddsfd.dwBackBufferCount = 1; -#ifdef HAVE_LIBXXF86DGA2 - if (ddpriv->version == 2) { - XDGAMode *modes = ddpriv->modes; - - ddsfd.dwFlags |= DDSD_PITCH; - for (i = 0; i < ddpriv->num_modes; i++) { - if (TRACE_ON(ddraw)) { - DPRINTF(" Enumerating mode %d : %s (FB: %dx%d / VP: %dx%d) - depth %d -", - modes[i].num, - modes[i].name, modes[i].imageWidth, modes[i].imageHeight, - modes[i].viewportWidth, modes[i].viewportHeight, - modes[i].depth); - if (modes[i].flags & XDGAConcurrentAccess) DPRINTF(" XDGAConcurrentAccess "); - if (modes[i].flags & XDGASolidFillRect) DPRINTF(" XDGASolidFillRect "); - if (modes[i].flags & XDGABlitRect) DPRINTF(" XDGABlitRect "); - if (modes[i].flags & XDGABlitTransRect) DPRINTF(" XDGABlitTransRect "); - if (modes[i].flags & XDGAPixmap) DPRINTF(" XDGAPixmap "); - DPRINTF("\n"); - } - /* Fill the pixel format */ - ddsfd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); - ddsfd.ddpfPixelFormat.dwFourCC = 0; - ddsfd.ddpfPixelFormat.u4.dwRGBAlphaBitMask= 0; - ddsfd.ddpfPixelFormat.u.dwRGBBitCount = modes[i].bitsPerPixel; - if (modes[i].depth == 8) { - ddsfd.ddpfPixelFormat.dwFlags = DDPF_RGB|DDPF_PALETTEINDEXED8; - ddsfd.ddpfPixelFormat.u1.dwRBitMask = 0; - ddsfd.ddpfPixelFormat.u2.dwGBitMask = 0; - ddsfd.ddpfPixelFormat.u3.dwBBitMask = 0; - ddsfd.ddsCaps.dwCaps = DDSCAPS_PALETTE; - } else { - ddsfd.ddpfPixelFormat.dwFlags = DDPF_RGB; - ddsfd.ddpfPixelFormat.u1.dwRBitMask = modes[i].redMask; - ddsfd.ddpfPixelFormat.u2.dwGBitMask = modes[i].greenMask; - ddsfd.ddpfPixelFormat.u3.dwBBitMask = modes[i].blueMask; - } - - ddsfd.dwWidth = modes[i].viewportWidth; - ddsfd.dwHeight = modes[i].viewportHeight; - ddsfd.lPitch = modes[i].imageWidth; - - /* Send mode to the application */ - if (!modescb(&ddsfd,context)) return DD_OK; - } - } else { -#endif - for (i=0;i 8 */ - if (depths[i]==8) { - ddsfd.ddpfPixelFormat.u1.dwRBitMask = 0; - ddsfd.ddpfPixelFormat.u2.dwGBitMask = 0; - ddsfd.ddpfPixelFormat.u3.dwBBitMask = 0; - ddsfd.ddpfPixelFormat.u4.dwRGBAlphaBitMask= 0; - ddsfd.ddsCaps.dwCaps=DDSCAPS_PALETTE; - ddsfd.ddpfPixelFormat.dwFlags|=DDPF_PALETTEINDEXED8; - } else { - ddsfd.ddpfPixelFormat.u4.dwRGBAlphaBitMask= 0; - - /* FIXME: We should query those from X itself */ - switch (depths[i]) { - case 16: - ddsfd.ddpfPixelFormat.u1.dwRBitMask = 0xF800; - ddsfd.ddpfPixelFormat.u2.dwGBitMask = 0x07E0; - ddsfd.ddpfPixelFormat.u3.dwBBitMask= 0x001F; - break; - case 24: - ddsfd.ddpfPixelFormat.u1.dwRBitMask = 0x00FF0000; - ddsfd.ddpfPixelFormat.u2.dwGBitMask = 0x0000FF00; - ddsfd.ddpfPixelFormat.u3.dwBBitMask= 0x000000FF; - break; - case 32: - ddsfd.ddpfPixelFormat.u1.dwRBitMask = 0x00FF0000; - ddsfd.ddpfPixelFormat.u2.dwGBitMask = 0x0000FF00; - ddsfd.ddpfPixelFormat.u3.dwBBitMask= 0x000000FF; - break; - } - } - - ddsfd.dwWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); - ddsfd.dwHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); - TRACE(" enumerating (%ldx%ldx%d)\n",ddsfd.dwWidth,ddsfd.dwHeight,depths[i]); - if (!modescb(&ddsfd,context)) return DD_OK; - - for (j=0;j 8 */ + if (depths[i]==8) { + ddsfd.ddpfPixelFormat.u1.dwRBitMask = 0; + ddsfd.ddpfPixelFormat.u2.dwGBitMask = 0; + ddsfd.ddpfPixelFormat.u3.dwBBitMask = 0; + ddsfd.ddpfPixelFormat.u4.dwRGBAlphaBitMask= 0; + ddsfd.ddsCaps.dwCaps=DDSCAPS_PALETTE; + ddsfd.ddpfPixelFormat.dwFlags|=DDPF_PALETTEINDEXED8; + } else { + ddsfd.ddpfPixelFormat.u4.dwRGBAlphaBitMask= 0; + + /* FIXME: We should query those from X itself */ + switch (depths[i]) { + case 16: + ddsfd.ddpfPixelFormat.u1.dwRBitMask = 0xF800; + ddsfd.ddpfPixelFormat.u2.dwGBitMask = 0x07E0; + ddsfd.ddpfPixelFormat.u3.dwBBitMask= 0x001F; + break; + case 24: + ddsfd.ddpfPixelFormat.u1.dwRBitMask = 0x00FF0000; + ddsfd.ddpfPixelFormat.u2.dwGBitMask = 0x0000FF00; + ddsfd.ddpfPixelFormat.u3.dwBBitMask= 0x000000FF; + break; + case 32: + ddsfd.ddpfPixelFormat.u1.dwRBitMask = 0x00FF0000; + ddsfd.ddpfPixelFormat.u2.dwGBitMask = 0x0000FF00; + ddsfd.ddpfPixelFormat.u3.dwBBitMask= 0x000000FF; + break; } -#ifdef HAVE_LIBXXF86DGA2 } -#endif - return DD_OK; + + ddsfd.dwWidth = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); + ddsfd.dwHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); + TRACE(" enumerating (%ldx%ldx%d)\n",ddsfd.dwWidth,ddsfd.dwHeight,depths[i]); + if (!modescb(&ddsfd,context)) return DD_OK; + + for (j=0;j +#include +#include +#include +#include +#include + +#include "winerror.h" +#include "wine/exception.h" +#include "ddraw.h" +#include "d3d.h" +#include "debugtools.h" +#include "message.h" +#include "options.h" +#include "monitor.h" + +DEFAULT_DEBUG_CHANNEL(ddraw); + +#include "dga2_private.h" + +struct ICOM_VTABLE(IDirectDraw) dga2_ddvt; +struct ICOM_VTABLE(IDirectDraw2) dga2_dd2vt; +struct ICOM_VTABLE(IDirectDraw4) dga2_dd4vt; + +#define DDPRIVATE(x) dga2_dd_private *ddpriv = ((dga2_dd_private*)(x)->private) +#define DPPRIVATE(x) dga2_dp_private *dppriv = ((dga2_dp_private*)(x)->private) + +/******************************************************************************* + * IDirectDraw + */ +static HRESULT WINAPI DGA2_IDirectDraw2Impl_CreateSurface( + LPDIRECTDRAW2 iface,LPDDSURFACEDESC lpddsd,LPDIRECTDRAWSURFACE *lpdsf, + IUnknown *lpunk +) { + HRESULT ret; + IDirectDrawSurfaceImpl* dsurf; + + ret = DGA_IDirectDraw2Impl_CreateSurface_no_VT(iface, lpddsd, lpdsf, lpunk); + + dsurf = *(IDirectDrawSurfaceImpl**)lpdsf; + ICOM_VTBL(dsurf) = (ICOM_VTABLE(IDirectDrawSurface)*)&dga2_dds4vt; + + return ret; +} + +static HRESULT WINAPI DGA2_IDirectDraw2Impl_SetCooperativeLevel( + LPDIRECTDRAW2 iface,HWND hwnd,DWORD cooplevel +) { + /* ICOM_THIS(IDirectDraw2Impl,iface); */ + HRESULT ret; + int evbase, erbase; + + ret = IDirectDraw2Impl_SetCooperativeLevel(iface, hwnd, cooplevel); + + if (ret != DD_OK) + return ret; + + TSXDGAQueryExtension(display, &evbase, &erbase); + + /* Now, start handling of DGA events giving the handle to the DDraw window + as the window for which the event will be reported */ + TSXDGASelectInput(display, DefaultScreen(display), + KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask|PointerMotionMask ); + X11DRV_EVENT_SetDGAStatus(hwnd, evbase); + return DD_OK; +} + +void _DGA2_Initialize_FrameBuffer(IDirectDrawImpl *This, int mode) { + DDPIXELFORMAT *pf = &(This->d.directdraw_pixelformat); + DDPRIVATE(This); + + /* Now, get the device / mode description */ + ddpriv->dev = TSXDGASetMode(display, DefaultScreen(display), mode); + + ddpriv->DGA.fb_width = ddpriv->dev->mode.imageWidth; + TSXDGASetViewport(display,DefaultScreen(display),0,0, XDGAFlipImmediate); + ddpriv->DGA.fb_height = ddpriv->dev->mode.viewportHeight; + TRACE("video framebuffer: begin %p, width %d, memsize %d\n", + ddpriv->dev->data, + ddpriv->dev->mode.imageWidth, + (ddpriv->dev->mode.imageWidth * + ddpriv->dev->mode.imageHeight * + (ddpriv->dev->mode.bitsPerPixel / 8)) + ); + TRACE("viewport height: %d\n", ddpriv->dev->mode.viewportHeight); + /* Get the screen dimensions as seen by Wine. + * In that case, it may be better to ignore the -desktop mode and return the + * real screen size => print a warning */ + This->d.height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); + This->d.width = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); + ddpriv->DGA.fb_addr = ddpriv->dev->data; + ddpriv->DGA.fb_memsize = (ddpriv->dev->mode.imageWidth * + ddpriv->dev->mode.imageHeight * + (ddpriv->dev->mode.bitsPerPixel / 8)); + ddpriv->DGA.vpmask = 0; + + /* Fill the screen pixelformat */ + pf->dwSize = sizeof(DDPIXELFORMAT); + pf->dwFourCC = 0; + pf->u.dwRGBBitCount = ddpriv->dev->mode.bitsPerPixel; + if (ddpriv->dev->mode.depth == 8) { + pf->dwFlags = DDPF_PALETTEINDEXED8|DDPF_RGB; + pf->u1.dwRBitMask = 0; + pf->u2.dwGBitMask = 0; + pf->u3.dwBBitMask = 0; + } else { + pf->dwFlags = DDPF_RGB; + pf->u1.dwRBitMask = ddpriv->dev->mode.redMask; + pf->u2.dwGBitMask = ddpriv->dev->mode.greenMask; + pf->u3.dwBBitMask = ddpriv->dev->mode.blueMask; + } + pf->u4.dwRGBAlphaBitMask= 0; + This->d.screen_pixelformat = *pf; +} + +static HRESULT WINAPI DGA2_IDirectDrawImpl_SetDisplayMode( + LPDIRECTDRAW iface,DWORD width,DWORD height,DWORD depth +) { + ICOM_THIS(IDirectDrawImpl,iface); + DDPRIVATE(This); + int i; + XDGAMode *modes = ddpriv->modes; + int mode_to_use = -1; + + TRACE("(%p)->(%ld,%ld,%ld)\n", This, width, height, depth); + + /* Search in the list a display mode that corresponds to what is requested */ + for (i = 0; i < ddpriv->num_modes; i++) { + if ((height == modes[i].viewportHeight) && + (width == modes[i].viewportWidth) && + (depth == modes[i].depth) + ) + mode_to_use = modes[i].num; + } + + if (mode_to_use < 0) { + ERR("Could not find matching mode !!!\n"); + return DDERR_UNSUPPORTEDMODE; + } else { + TRACE("Using mode number %d\n", mode_to_use); + + TSXDGACloseFramebuffer(display, DefaultScreen(display)); + + if (!TSXDGAOpenFramebuffer(display, DefaultScreen(display))) { + ERR("Error opening the frame buffer !!!\n"); + return DDERR_GENERIC; + } + + /* Initialize the frame buffer */ + _DGA2_Initialize_FrameBuffer(This, mode_to_use); + + /* Re-get (if necessary) the DGA events */ + TSXDGASelectInput(display, DefaultScreen(display), + KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask|PointerMotionMask ); + } + + return DD_OK; +} + +static HRESULT WINAPI DGA2_IDirectDraw2Impl_CreatePalette( + LPDIRECTDRAW2 iface,DWORD dwFlags,LPPALETTEENTRY palent,LPDIRECTDRAWPALETTE *lpddpal,LPUNKNOWN lpunk +) { + ICOM_THIS(IDirectDraw2Impl,iface); + IDirectDrawPaletteImpl* ddpal; + dga_dp_private *dppriv; + HRESULT res; + int xsize = 0,i; + DDPRIVATE(This); + + TRACE("(%p)->(%08lx,%p,%p,%p)\n",This,dwFlags,palent,lpddpal,lpunk); + res = common_IDirectDraw2Impl_CreatePalette(This,dwFlags,palent,(IDirectDrawPaletteImpl**)lpddpal,lpunk,&xsize); + if (res != 0) + return res; + ddpal = *(IDirectDrawPaletteImpl**)lpddpal; + ddpal->private = HeapAlloc( + GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(dga_dp_private) + ); + dppriv = (dga_dp_private*)ddpal->private; + + ICOM_VTBL(ddpal)= &dga_ddpalvt; + if (This->d.directdraw_pixelformat.u.dwRGBBitCount<=8) { + dppriv->cm = TSXDGACreateColormap(display,DefaultScreen(display), ddpriv->dev, AllocAll); + } else { + ERR("why are we doing CreatePalette in hi/truecolor?\n"); + dppriv->cm = 0; + } + if (dppriv->cm && xsize) { + for (i=0;ipalents[i].peRed<<8; + xc.blue = ddpal->palents[i].peBlue<<8; + xc.green = ddpal->palents[i].peGreen<<8; + xc.flags = DoRed|DoBlue|DoGreen; + xc.pixel = i; + TSXStoreColor(display,dppriv->cm,&xc); + } + } + return DD_OK; +} + +static HRESULT WINAPI DGA2_IDirectDraw2Impl_RestoreDisplayMode(LPDIRECTDRAW2 iface) { + ICOM_THIS(IDirectDraw2Impl,iface); + TRACE("(%p)->()\n",This); + Sleep(1000); + + XDGACloseFramebuffer(display,DefaultScreen(display)); + XDGASetMode(display,DefaultScreen(display), 0); + + return DD_OK; +} + +static ULONG WINAPI DGA2_IDirectDraw2Impl_Release(LPDIRECTDRAW2 iface) { + ICOM_THIS(IDirectDraw2Impl,iface); + DDPRIVATE(This); + TRACE("(%p)->() decrementing from %lu.\n", This, This->ref ); + + if (!--(This->ref)) { + TRACE("Closing access to the FrameBuffer\n"); + TSXDGACloseFramebuffer(display, DefaultScreen(display)); + TRACE("Going back to normal X mode of operation\n"); + TSXDGASetMode(display, DefaultScreen(display), 0); + + /* Set the input handling back to absolute */ + X11DRV_EVENT_SetInputMethod(X11DRV_INPUT_ABSOLUTE); + + /* Remove the handling of DGA2 events */ + X11DRV_EVENT_SetDGAStatus(0, -1); + + /* Free the modes list */ + TSXFree(ddpriv->modes); + + HeapFree(GetProcessHeap(),0,This); + return S_OK; + } + return This->ref; +} + +static HRESULT WINAPI DGA2_IDirectDraw2Impl_EnumDisplayModes( + LPDIRECTDRAW2 iface,DWORD dwFlags,LPDDSURFACEDESC lpddsfd,LPVOID context,LPDDENUMMODESCALLBACK modescb +) { + ICOM_THIS(IDirectDraw2Impl,iface); + DDSURFACEDESC ddsfd; + DDPRIVATE(This); + int i; + XDGAMode *modes = ddpriv->modes; + + TRACE("(%p)->(0x%08lx,%p,%p,%p)\n",This,dwFlags,lpddsfd,context,modescb); + ddsfd.dwSize = sizeof(ddsfd); + ddsfd.dwFlags = DDSD_HEIGHT|DDSD_WIDTH|DDSD_BACKBUFFERCOUNT|DDSD_PIXELFORMAT|DDSD_CAPS; + if (dwFlags & DDEDM_REFRESHRATES) { + ddsfd.dwFlags |= DDSD_REFRESHRATE; + ddsfd.u.dwRefreshRate = 60; + } + ddsfd.ddsCaps.dwCaps = 0; + ddsfd.dwBackBufferCount = 1; + + + ddsfd.dwFlags |= DDSD_PITCH; + for (i = 0; i < ddpriv->num_modes; i++) { + if (TRACE_ON(ddraw)) { + DPRINTF(" Enumerating mode %d : %s (FB: %dx%d / VP: %dx%d) - depth %d -", + modes[i].num, + modes[i].name, modes[i].imageWidth, modes[i].imageHeight, + modes[i].viewportWidth, modes[i].viewportHeight, + modes[i].depth); + if (modes[i].flags & XDGAConcurrentAccess) DPRINTF(" XDGAConcurrentAccess "); + if (modes[i].flags & XDGASolidFillRect) DPRINTF(" XDGASolidFillRect "); + if (modes[i].flags & XDGABlitRect) DPRINTF(" XDGABlitRect "); + if (modes[i].flags & XDGABlitTransRect) DPRINTF(" XDGABlitTransRect "); + if (modes[i].flags & XDGAPixmap) DPRINTF(" XDGAPixmap "); + DPRINTF("\n"); + } + /* Fill the pixel format */ + ddsfd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT); + ddsfd.ddpfPixelFormat.dwFourCC = 0; + ddsfd.ddpfPixelFormat.u4.dwRGBAlphaBitMask= 0; + ddsfd.ddpfPixelFormat.u.dwRGBBitCount = modes[i].bitsPerPixel; + if (modes[i].depth == 8) { + ddsfd.ddpfPixelFormat.dwFlags = DDPF_RGB|DDPF_PALETTEINDEXED8; + ddsfd.ddpfPixelFormat.u1.dwRBitMask = 0; + ddsfd.ddpfPixelFormat.u2.dwGBitMask = 0; + ddsfd.ddpfPixelFormat.u3.dwBBitMask = 0; + ddsfd.ddsCaps.dwCaps = DDSCAPS_PALETTE; + } else { + ddsfd.ddpfPixelFormat.dwFlags = DDPF_RGB; + ddsfd.ddpfPixelFormat.u1.dwRBitMask = modes[i].redMask; + ddsfd.ddpfPixelFormat.u2.dwGBitMask = modes[i].greenMask; + ddsfd.ddpfPixelFormat.u3.dwBBitMask = modes[i].blueMask; + } + + ddsfd.dwWidth = modes[i].viewportWidth; + ddsfd.dwHeight = modes[i].viewportHeight; + ddsfd.lPitch = modes[i].imageWidth; + + /* Send mode to the application */ + if (!modescb(&ddsfd,context)) return DD_OK; + } + + return DD_OK; +} + +/* Note: Hack so we can reuse the old functions without compiler warnings */ +#if !defined(__STRICT_ANSI__) && defined(__GNUC__) +# define XCAST(fun) (typeof(dga2_ddvt.fn##fun)) +#else +# define XCAST(fun) (void *) +#endif + +struct ICOM_VTABLE(IDirectDraw) dga2_ddvt = +{ + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + XCAST(QueryInterface)DGA_IDirectDraw2Impl_QueryInterface, + XCAST(AddRef)IDirectDraw2Impl_AddRef, + XCAST(Release)DGA2_IDirectDraw2Impl_Release, + XCAST(Compact)IDirectDraw2Impl_Compact, + XCAST(CreateClipper)IDirectDraw2Impl_CreateClipper, + XCAST(CreatePalette)DGA2_IDirectDraw2Impl_CreatePalette, + XCAST(CreateSurface)DGA2_IDirectDraw2Impl_CreateSurface, + XCAST(DuplicateSurface)IDirectDraw2Impl_DuplicateSurface, + XCAST(EnumDisplayModes)DGA2_IDirectDraw2Impl_EnumDisplayModes, + XCAST(EnumSurfaces)IDirectDraw2Impl_EnumSurfaces, + XCAST(FlipToGDISurface)IDirectDraw2Impl_FlipToGDISurface, + XCAST(GetCaps)DGA_IDirectDraw2Impl_GetCaps, + XCAST(GetDisplayMode)DGA_IDirectDraw2Impl_GetDisplayMode, + XCAST(GetFourCCCodes)IDirectDraw2Impl_GetFourCCCodes, + XCAST(GetGDISurface)IDirectDraw2Impl_GetGDISurface, + XCAST(GetMonitorFrequency)IDirectDraw2Impl_GetMonitorFrequency, + XCAST(GetScanLine)IDirectDraw2Impl_GetScanLine, + XCAST(GetVerticalBlankStatus)IDirectDraw2Impl_GetVerticalBlankStatus, + XCAST(Initialize)IDirectDraw2Impl_Initialize, + XCAST(RestoreDisplayMode)DGA2_IDirectDraw2Impl_RestoreDisplayMode, + XCAST(SetCooperativeLevel)DGA2_IDirectDraw2Impl_SetCooperativeLevel, + DGA2_IDirectDrawImpl_SetDisplayMode, + XCAST(WaitForVerticalBlank)IDirectDraw2Impl_WaitForVerticalBlank, +}; +#undef XCAST + +/***************************************************************************** + * IDirectDraw2 + * + */ + +static HRESULT WINAPI DGA2_IDirectDraw2Impl_SetDisplayMode( + LPDIRECTDRAW2 iface,DWORD width,DWORD height,DWORD depth,DWORD dwRefreshRate, DWORD dwFlags +) { + FIXME( "Ignored parameters (0x%08lx,0x%08lx)\n", dwRefreshRate, dwFlags ); + return DGA2_IDirectDrawImpl_SetDisplayMode((LPDIRECTDRAW)iface,width,height,depth); +} + +ICOM_VTABLE(IDirectDraw2) dga2_dd2vt = +{ + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + DGA_IDirectDraw2Impl_QueryInterface, + IDirectDraw2Impl_AddRef, + DGA2_IDirectDraw2Impl_Release, + IDirectDraw2Impl_Compact, + IDirectDraw2Impl_CreateClipper, + DGA2_IDirectDraw2Impl_CreatePalette, + DGA2_IDirectDraw2Impl_CreateSurface, + IDirectDraw2Impl_DuplicateSurface, + DGA2_IDirectDraw2Impl_EnumDisplayModes, + IDirectDraw2Impl_EnumSurfaces, + IDirectDraw2Impl_FlipToGDISurface, + DGA_IDirectDraw2Impl_GetCaps, + DGA_IDirectDraw2Impl_GetDisplayMode, + IDirectDraw2Impl_GetFourCCCodes, + IDirectDraw2Impl_GetGDISurface, + IDirectDraw2Impl_GetMonitorFrequency, + IDirectDraw2Impl_GetScanLine, + IDirectDraw2Impl_GetVerticalBlankStatus, + IDirectDraw2Impl_Initialize, + DGA2_IDirectDraw2Impl_RestoreDisplayMode, + DGA2_IDirectDraw2Impl_SetCooperativeLevel, + DGA2_IDirectDraw2Impl_SetDisplayMode, + IDirectDraw2Impl_WaitForVerticalBlank, + DGA_IDirectDraw2Impl_GetAvailableVidMem +}; + +#if !defined(__STRICT_ANSI__) && defined(__GNUC__) +# define XCAST(fun) (typeof(dga2_dd4vt.fn##fun)) +#else +# define XCAST(fun) (void*) +#endif + +ICOM_VTABLE(IDirectDraw4) dga2_dd4vt = +{ + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + XCAST(QueryInterface)DGA_IDirectDraw2Impl_QueryInterface, + XCAST(AddRef)IDirectDraw2Impl_AddRef, + XCAST(Release)DGA2_IDirectDraw2Impl_Release, + XCAST(Compact)IDirectDraw2Impl_Compact, + XCAST(CreateClipper)IDirectDraw2Impl_CreateClipper, + XCAST(CreatePalette)DGA2_IDirectDraw2Impl_CreatePalette, + XCAST(CreateSurface)DGA2_IDirectDraw2Impl_CreateSurface, + XCAST(DuplicateSurface)IDirectDraw2Impl_DuplicateSurface, + XCAST(EnumDisplayModes)DGA2_IDirectDraw2Impl_EnumDisplayModes, + XCAST(EnumSurfaces)IDirectDraw2Impl_EnumSurfaces, + XCAST(FlipToGDISurface)IDirectDraw2Impl_FlipToGDISurface, + XCAST(GetCaps)DGA_IDirectDraw2Impl_GetCaps, + XCAST(GetDisplayMode)DGA_IDirectDraw2Impl_GetDisplayMode, + XCAST(GetFourCCCodes)IDirectDraw2Impl_GetFourCCCodes, + XCAST(GetGDISurface)IDirectDraw2Impl_GetGDISurface, + XCAST(GetMonitorFrequency)IDirectDraw2Impl_GetMonitorFrequency, + XCAST(GetScanLine)IDirectDraw2Impl_GetScanLine, + XCAST(GetVerticalBlankStatus)IDirectDraw2Impl_GetVerticalBlankStatus, + XCAST(Initialize)IDirectDraw2Impl_Initialize, + XCAST(RestoreDisplayMode)DGA2_IDirectDraw2Impl_RestoreDisplayMode, + XCAST(SetCooperativeLevel)DGA2_IDirectDraw2Impl_SetCooperativeLevel, + XCAST(SetDisplayMode)DGA2_IDirectDrawImpl_SetDisplayMode, + XCAST(WaitForVerticalBlank)IDirectDraw2Impl_WaitForVerticalBlank, + XCAST(GetAvailableVidMem)DGA_IDirectDraw2Impl_GetAvailableVidMem, + IDirectDraw4Impl_GetSurfaceFromDC, + IDirectDraw4Impl_RestoreAllSurfaces, + IDirectDraw4Impl_TestCooperativeLevel, + IDirectDraw4Impl_GetDeviceIdentifier +}; +#undef XCAST diff --git a/dlls/ddraw/dga.c b/dlls/ddraw/dga.c index e64db78ca73..0990171b718 100644 --- a/dlls/ddraw/dga.c +++ b/dlls/ddraw/dga.c @@ -82,18 +82,6 @@ DDRAW_DGA_Available(void) return 0; } -#ifdef HAVE_LIBXXF86DGA2 - if (majver >= 2) { - /* We have DGA 2.0 available ! */ - if (TSXDGAOpenFramebuffer(display, DefaultScreen(display))) { - TSXDGACloseFramebuffer(display, DefaultScreen(display)); - return_value = 2; - } else - return_value = 0; - return return_value; - } -#endif /* defined(HAVE_LIBXXF86DGA2) */ - /* You don't have to be root to use DGA extensions. Simply having access * to /dev/mem will do the trick * This can be achieved by adding the user to the "kmem" group on @@ -139,105 +127,47 @@ DGA_Create( LPDIRECTDRAW *lplpDD ) { ddraw->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(dga_dd_private)); dgpriv = (dga_dd_private*)ddraw->private; -#ifdef HAVE_LIBXXF86DGA2 - if (dga_version == 1) { - dgpriv->version = 1; -#endif /* defined(HAVE_LIBXXF86DGA2) */ - TSXF86DGAQueryVersion(display,&major,&minor); - TRACE("XF86DGA is version %d.%d\n",major,minor); - TSXF86DGAQueryDirectVideo(display,DefaultScreen(display),&flags); - if (!(flags & XF86DGADirectPresent)) - MESSAGE("direct video is NOT PRESENT.\n"); - TSXF86DGAGetVideo(display,DefaultScreen(display),&addr,&width,&banksize,&memsize); - dgpriv->fb_width = width; - TSXF86DGAGetViewPortSize(display,DefaultScreen(display),&width,&height); - TSXF86DGASetViewPort(display,DefaultScreen(display),0,0); - dgpriv->fb_height = height; - TRACE("video framebuffer: begin %p, width %d,banksize %d,memsize %d\n", - addr,width,banksize,memsize - ); - TRACE("viewport height: %d\n",height); - /* Get the screen dimensions as seen by Wine. - * In that case, it may be better to ignore the -desktop mode and - * return the real screen size => print a warning - */ - ddraw->d.height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); - ddraw->d.width = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); - if ((ddraw->d.height != height) || (ddraw->d.width != width)) - WARN("You seem to be running in -desktop mode. This may prove dangerous in DGA mode...\n"); - dgpriv->fb_addr = addr; - dgpriv->fb_memsize = memsize; - dgpriv->vpmask = 0; - - /* just assume the default depth is the DGA depth too */ - depth = DefaultDepthOfScreen(X11DRV_GetXScreen()); - - _common_depth_to_pixelformat(depth, &(ddraw->d.directdraw_pixelformat), &(ddraw->d.screen_pixelformat), NULL); + TSXF86DGAQueryVersion(display,&major,&minor); + TRACE("XF86DGA is version %d.%d\n",major,minor); + + TSXF86DGAQueryDirectVideo(display,DefaultScreen(display),&flags); + if (!(flags & XF86DGADirectPresent)) + MESSAGE("direct video is NOT PRESENT.\n"); + TSXF86DGAGetVideo(display,DefaultScreen(display),&addr,&width,&banksize,&memsize); + dgpriv->fb_width = width; + TSXF86DGAGetViewPortSize(display,DefaultScreen(display),&width,&height); + TSXF86DGASetViewPort(display,DefaultScreen(display),0,0); + dgpriv->fb_height = height; + TRACE("video framebuffer: begin %p, width %d,banksize %d,memsize %d\n", + addr,width,banksize,memsize + ); + TRACE("viewport height: %d\n",height); + /* Get the screen dimensions as seen by Wine. + * In that case, it may be better to ignore the -desktop mode and + * return the real screen size => print a warning + */ + ddraw->d.height = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); + ddraw->d.width = MONITOR_GetWidth(&MONITOR_PrimaryMonitor); + if ((ddraw->d.height != height) || (ddraw->d.width != width)) + WARN("You seem to be running in -desktop mode. This may prove dangerous in DGA mode...\n"); + dgpriv->fb_addr = addr; + dgpriv->fb_memsize = memsize; + dgpriv->vpmask = 0; + /* The cast is because DGA2's install colormap does not return a value whereas + DGA1 version does */ + dgpriv->InstallColormap = (void (*)(Display *, int, Colormap)) TSXF86DGAInstallColormap; + + /* just assume the default depth is the DGA depth too */ + depth = DefaultDepthOfScreen(X11DRV_GetXScreen()); + + _common_depth_to_pixelformat(depth, &(ddraw->d.directdraw_pixelformat), &(ddraw->d.screen_pixelformat), NULL); + #ifdef RESTORE_SIGNALS - SIGNAL_Init(); + SIGNAL_Init(); #endif -#ifdef HAVE_LIBXXF86DGA2 - } else { - XDGAMode *modes; - int i, num_modes; - int mode_to_use = 0; - dgpriv->version = 2; - - TSXDGAQueryVersion(display,&major,&minor); - TRACE("XDGA is version %d.%d\n",major,minor); - - TRACE("Opening the frame buffer.\n"); - if (!TSXDGAOpenFramebuffer(display, DefaultScreen(display))) { - ERR("Error opening the frame buffer !!!\n"); - return DDERR_GENERIC; - } - - /* List all available modes */ - modes = TSXDGAQueryModes(display, DefaultScreen(display), &num_modes); - dgpriv->modes = modes; - dgpriv->num_modes = num_modes; - - TRACE("Available modes :\n"); - for (i = 0; i < num_modes; i++) { - if (TRACE_ON(ddraw)) { - DPRINTF(" %d) - %s (FB: %dx%d / VP: %dx%d) - depth %d -", - modes[i].num, - modes[i].name, modes[i].imageWidth, modes[i].imageHeight, - modes[i].viewportWidth, modes[i].viewportHeight, - modes[i].depth - ); -#define XX(x) if (modes[i].flags & x) DPRINTF(" "#x" "); - XX(XDGAConcurrentAccess); - XX(XDGASolidFillRect); - XX(XDGABlitRect); - XX(XDGABlitTransRect); - XX(XDGAPixmap); -#undef XX - DPRINTF("\n"); - } - if ((MONITOR_GetHeight(&MONITOR_PrimaryMonitor) == modes[i].viewportHeight) && - (MONITOR_GetWidth(&MONITOR_PrimaryMonitor) == modes[i].viewportWidth) && - (MONITOR_GetDepth(&MONITOR_PrimaryMonitor) == modes[i].depth) - ) { - mode_to_use = modes[i].num; - } - } - if (mode_to_use == 0) { - ERR("Could not find mode !\n"); - mode_to_use = 1; - } else { - DPRINTF("Using mode number %d\n", mode_to_use); - } - - /* Initialize the frame buffer */ - _DGA_Initialize_FrameBuffer(*lplpDD, mode_to_use); - /* Set the input handling for relative mouse movements */ - X11DRV_EVENT_SetInputMethod(X11DRV_INPUT_RELATIVE); - } -#endif /* defined(HAVE_LIBXXF86DGA2) */ return DD_OK; } diff --git a/dlls/ddraw/dga2.c b/dlls/ddraw/dga2.c new file mode 100644 index 00000000000..8b9b3c3c130 --- /dev/null +++ b/dlls/ddraw/dga2.c @@ -0,0 +1,194 @@ +/* DirectDraw using DGA2 + * + * Based (well, plagiarized :-) ) on Marcus' dga.c + */ + +#include "config.h" +#include "winerror.h" + +#include +#include +#ifdef HAVE_SYS_SIGNAL_H +# include +#endif +#include +#include +#include + +#include "gdi.h" +#include "heap.h" +#include "dc.h" +#include "win.h" +#include "wine/exception.h" +#include "ddraw.h" +#include "d3d.h" +#include "debugtools.h" +#include "spy.h" +#include "message.h" +#include "options.h" +#include "monitor.h" + +#include "dga2_private.h" + +DEFAULT_DEBUG_CHANNEL(ddraw); + +static inline BOOL get_option( const char *name, BOOL def ) { + return PROFILE_GetWineIniBool( "x11drv", name, def ); +} + +static BYTE +DDRAW_DGA2_Available(void) +{ + int evbase, evret, majver, minver; + static BYTE return_value = 0xFF; + + /* This prevents from probing X times for DGA */ + if (return_value != 0xFF) + return return_value; + + if (!get_option( "UseDGA", 1 )) { + TRACE("UseDGA disabled.\n"); + return_value = 0; + return 0; + } + + /* First, query the extenstion and its version */ + if (!TSXF86DGAQueryExtension(display,&evbase,&evret)) { + TRACE("DGA extension not detected.\n"); + return_value = 0; + return 0; + } + + if (!TSXF86DGAQueryVersion(display,&majver,&minver)) { + TRACE("DGA version not detected.\n"); + return_value = 0; + return 0; + } + + if (majver >= 2) { + /* We have DGA 2.0 available ! */ + if (TSXDGAOpenFramebuffer(display, DefaultScreen(display))) { + TSXDGACloseFramebuffer(display, DefaultScreen(display)); + return_value = 2; + } else + return_value = 0; + return return_value; + } + + return 0; +} + +HRESULT +DGA2_Create( LPDIRECTDRAW *lplpDD ) { + IDirectDrawImpl* ddraw; + dga2_dd_private* dgpriv; + int major,minor; + int dga_version; + XDGAMode *modes; + int i, num_modes; + int mode_to_use = 0; + + /* Get DGA availability / version */ + dga_version = DDRAW_DGA2_Available(); + if (dga_version == 0) + return DDERR_GENERIC; + + /* If we were just testing ... return OK */ + if (lplpDD == NULL) + return DD_OK; + + ddraw = (IDirectDrawImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawImpl)); + *lplpDD = (LPDIRECTDRAW)ddraw; + ddraw->ref = 1; + ICOM_VTBL(ddraw) = &dga2_ddvt; + + ddraw->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(dga2_dd_private)); + + dgpriv = (dga2_dd_private*)ddraw->private; + + TSXDGAQueryVersion(display,&major,&minor); + TRACE("XDGA is version %d.%d\n",major,minor); + + TRACE("Opening the frame buffer.\n"); + if (!TSXDGAOpenFramebuffer(display, DefaultScreen(display))) { + ERR("Error opening the frame buffer !!!\n"); + return DDERR_GENERIC; + } + + /* List all available modes */ + modes = TSXDGAQueryModes(display, DefaultScreen(display), &num_modes); + dgpriv->modes = modes; + dgpriv->num_modes = num_modes; + + TRACE("Available modes :\n"); + for (i = 0; i < num_modes; i++) { + if (TRACE_ON(ddraw)) { + DPRINTF(" %d) - %s (FB: %dx%d / VP: %dx%d) - depth %d -", + modes[i].num, + modes[i].name, modes[i].imageWidth, modes[i].imageHeight, + modes[i].viewportWidth, modes[i].viewportHeight, + modes[i].depth + ); +#define XX(x) if (modes[i].flags & x) DPRINTF(" "#x" "); + XX(XDGAConcurrentAccess); + XX(XDGASolidFillRect); + XX(XDGABlitRect); + XX(XDGABlitTransRect); + XX(XDGAPixmap); +#undef XX + DPRINTF("\n"); + } + if ((MONITOR_GetHeight(&MONITOR_PrimaryMonitor) == modes[i].viewportHeight) && + (MONITOR_GetWidth(&MONITOR_PrimaryMonitor) == modes[i].viewportWidth) && + (MONITOR_GetDepth(&MONITOR_PrimaryMonitor) == modes[i].depth) + ) { + mode_to_use = modes[i].num; + } + } + if (mode_to_use == 0) { + ERR("Could not find mode !\n"); + mode_to_use = 1; + } else { + DPRINTF("Using mode number %d\n", mode_to_use); + } + + dgpriv->DGA.InstallColormap = TSXDGAInstallColormap; + + /* Initialize the frame buffer */ + _DGA2_Initialize_FrameBuffer(ddraw, mode_to_use); + + /* Set the input handling for relative mouse movements */ + X11DRV_EVENT_SetInputMethod(X11DRV_INPUT_RELATIVE); + + return DD_OK; +} + +/* Where do these GUIDs come from? mkuuid. + * They exist solely to distinguish between the targets Wine support, + * and should be different than any other GUIDs in existence. + */ +static GUID DGA2_DirectDraw_GUID = { /* e2dcb020-dc60-11d1-8407-9714f5d50803 */ + 0xe2dcb020, + 0xdc60, + 0x11d1, + {0x84, 0x07, 0x97, 0x14, 0xf5, 0xd5, 0x08, 0x03} +}; + +ddraw_driver dga2_driver = { + &DGA2_DirectDraw_GUID, + "display", + "WINE XF86DGA2 DirectDraw Driver", + 150, + DGA2_Create +}; + +#ifdef __GNUC__ +static void DGA2_register(void) __attribute__((constructor)); +#else /* defined(__GNUC__) */ +static void __asm__dummy_dll_init(void) { + asm("\t.section .init ,\"ax\"\n" + "\tcall DGA2_register\n" + "\t.previous\n"); +} +#endif /* defined(__GNUC__) */ +static void DGA2_register(void) { ddraw_register_driver(&dga2_driver); } diff --git a/dlls/ddraw/dga2_private.h b/dlls/ddraw/dga2_private.h new file mode 100644 index 00000000000..b32c01a42a4 --- /dev/null +++ b/dlls/ddraw/dga2_private.h @@ -0,0 +1,28 @@ +#ifndef __WINE_DDRAW_DGA2_PRIVATE_H +#define __WINE_DDRAW_DGA2_PRIVATE_H + +#include "ddraw_private.h" +#include "x11_private.h" +#include "dga_private.h" + +#include "ts_xf86dga.h" +#include "ts_xf86dga2.h" + +extern ICOM_VTABLE(IDirectDrawSurface4) dga2_dds4vt; +extern ICOM_VTABLE(IDirectDraw) dga2_ddvt; + +typedef struct dga2_dd_private { + /* Reuse of the DGA code */ + dga_dd_private DGA; + + XDGADevice *dev; + XDGAMode *modes; + int num_modes; +} dga2_dd_private; + +typedef x11_dp_private dga2_dp_private; /* reuse X11 palette stuff */ +typedef dga_ds_private dga2_ds_private; /* reuse of DGA1 surface stuff */ + +extern void _DGA2_Initialize_FrameBuffer(IDirectDrawImpl *This, int mode); + +#endif /* __WINE_DDRAW_DGA2_PRIVATE_H */ diff --git a/dlls/ddraw/dga_private.h b/dlls/ddraw/dga_private.h index 30802202e0d..5e606bcbb7b 100644 --- a/dlls/ddraw/dga_private.h +++ b/dlls/ddraw/dga_private.h @@ -5,9 +5,6 @@ #include "x11_private.h" #include "ts_xf86dga.h" -#ifdef HAVE_LIBXXF86DGA2 -# include "ts_xf86dga2.h" -#endif /* defined(HAVE_LIBXXF86DGA2) */ #ifdef HAVE_LIBXXF86VM # include "ts_xf86vmode.h" @@ -15,10 +12,6 @@ extern XF86VidModeModeInfo *orig_mode; #endif /* defined(HAVE_LIBXXF86VM) */ extern ICOM_VTABLE(IDirectDrawSurface4) dga_dds4vt; -#ifdef HAVE_LIBXXF86DGA2 -extern ICOM_VTABLE(IDirectDrawSurface4) dga2_dds4vt; -#endif /* defined(HAVE_LIBXXF86DGA2) */ - extern ICOM_VTABLE(IDirectDraw) dga_ddvt; extern ICOM_VTABLE(IDirectDrawPalette) dga_ddpalvt; @@ -28,12 +21,7 @@ typedef struct dga_dd_private { caddr_t fb_addr; /* start address of the framebuffer */ DWORD fb_memsize; /* total memory on the card */ DWORD vpmask; /* viewports in use flag bitmap */ - DWORD version; /* DGA version */ -#ifdef HAVE_LIBXXF86DGA2 - XDGADevice *dev; - XDGAMode *modes; - int num_modes; -#endif + void (*InstallColormap)(Display *, int, Colormap) ; } dga_dd_private; typedef x11_dp_private dga_dp_private; /* reuse X11 palette stuff */ @@ -42,8 +30,17 @@ typedef struct dga_ds_private { DWORD fb_height; } dga_ds_private; -#ifdef HAVE_LIBXXF86DGA2 -extern void _DGA_Initialize_FrameBuffer(IDirectDrawImpl *This, int mode); -#endif +/* For usage in DGA2 */ +extern ULONG WINAPI DGA_IDirectDrawSurface4Impl_Release(LPDIRECTDRAWSURFACE4 iface) ; +extern HRESULT WINAPI DGA_IDirectDrawSurface4Impl_SetPalette(LPDIRECTDRAWSURFACE4 iface,LPDIRECTDRAWPALETTE pal) ; +extern HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface_no_VT(LPDIRECTDRAW2 iface,LPDDSURFACEDESC lpddsd, + LPDIRECTDRAWSURFACE *lpdsf,IUnknown *lpunk) ; + +extern HRESULT WINAPI DGA_IDirectDraw2Impl_QueryInterface(LPDIRECTDRAW2 iface,REFIID refiid,LPVOID *obj) ; +extern HRESULT WINAPI DGA_IDirectDraw2Impl_GetCaps(LPDIRECTDRAW2 iface,LPDDCAPS caps1,LPDDCAPS caps2) ; + +extern HRESULT WINAPI DGA_IDirectDraw2Impl_GetDisplayMode(LPDIRECTDRAW2 iface,LPDDSURFACEDESC lpddsfd) ; +extern HRESULT WINAPI DGA_IDirectDraw2Impl_GetAvailableVidMem(LPDIRECTDRAW2 iface,LPDDSCAPS ddscaps,LPDWORD total,LPDWORD free) ; + #endif /* __WINE_DDRAW_DGA_PRIVATE_H */ diff --git a/dlls/ddraw/dpalette/dga.c b/dlls/ddraw/dpalette/dga.c index 98278997555..4ffdb858b80 100644 --- a/dlls/ddraw/dpalette/dga.c +++ b/dlls/ddraw/dpalette/dga.c @@ -55,12 +55,7 @@ HRESULT WINAPI DGA_IDirectDrawPaletteImpl_SetEntries( This->palents[start+i].peGreen = palent[i].peGreen; This->palents[start+i].peFlags = palent[i].peFlags; } -#ifdef HAVE_LIBXXF86DGA2 - if (ddpriv->version == 2) { - TSXDGAInstallColormap(display,DefaultScreen(display),dppriv->cm); - } else -#endif /* defined(HAVE_LIBXXF86DGA2) */ - TSXF86DGAInstallColormap(display,DefaultScreen(display),dppriv->cm); + ddpriv->InstallColormap(display,DefaultScreen(display),dppriv->cm); return DD_OK; } ICOM_VTABLE(IDirectDrawPalette) dga_ddpalvt = diff --git a/dlls/ddraw/dsurface/dga.c b/dlls/ddraw/dsurface/dga.c index b91cb0a3b0d..3dc2aa592aa 100644 --- a/dlls/ddraw/dsurface/dga.c +++ b/dlls/ddraw/dsurface/dga.c @@ -69,46 +69,6 @@ HRESULT WINAPI DGA_IDirectDrawSurface4Impl_Flip( return DD_OK; } -#ifdef HAVE_LIBXXF86DGA2 -HRESULT WINAPI DGA2_IDirectDrawSurface4Impl_Flip( - LPDIRECTDRAWSURFACE4 iface,LPDIRECTDRAWSURFACE4 flipto,DWORD dwFlags -) { - ICOM_THIS(IDirectDrawSurface4Impl,iface); - IDirectDrawSurface4Impl* iflipto=(IDirectDrawSurface4Impl*)flipto; - DWORD xheight; - DSPRIVATE(This); - dga_ds_private *fspriv; - LPBYTE surf; - - TRACE("(%p)->Flip(%p,%08lx)\n",This,iflipto,dwFlags); - iflipto = _common_find_flipto(This,iflipto); - - /* and flip! */ - fspriv = (dga_ds_private*)iflipto->private; - TSXDGASetViewport(display,DefaultScreen(display),0,fspriv->fb_height, XDGAFlipRetrace); - TSXDGASync(display,DefaultScreen(display)); - TSXFlush(display); - if (iflipto->s.palette) { - DPPRIVATE(iflipto->s.palette); - if (dppriv->cm) - TSXDGAInstallColormap(display,DefaultScreen(display),dppriv->cm); - } - - /* We need to switch the lowlevel surfaces, for DGA this is: */ - /* The height within the framebuffer */ - xheight = dspriv->fb_height; - dspriv->fb_height = fspriv->fb_height; - fspriv->fb_height = xheight; - - /* And the assciated surface pointer */ - surf = This->s.surface_desc.u1.lpSurface; - This->s.surface_desc.u1.lpSurface = iflipto->s.surface_desc.u1.lpSurface; - iflipto->s.surface_desc.u1.lpSurface = surf; - - return DD_OK; -} -#endif /* defined(HAVE_LIBXXF86DGA2) */ - HRESULT WINAPI DGA_IDirectDrawSurface4Impl_SetPalette( LPDIRECTDRAWSURFACE4 iface,LPDIRECTDRAWPALETTE pal ) { @@ -129,12 +89,7 @@ HRESULT WINAPI DGA_IDirectDrawSurface4Impl_SetPalette( IDirectDrawPalette_Release( (IDirectDrawPalette*)This->s.palette ); This->s.palette = ipal; fppriv = (dga_dp_private*)This->s.palette->private; -#ifdef HAVE_LIBXXF86DGA2 - if (ddpriv->version == 2) - TSXDGAInstallColormap(display,DefaultScreen(display),fppriv->cm); - else -#endif /* defined(HAVE_LIBXXF86DGA2) */ - TSXF86DGAInstallColormap(display,DefaultScreen(display),fppriv->cm); + ddpriv->InstallColormap(display,DefaultScreen(display),fppriv->cm); } return DD_OK; } @@ -218,55 +173,3 @@ ICOM_VTABLE(IDirectDrawSurface4) dga_dds4vt = IDirectDrawSurface4Impl_GetUniquenessValue, IDirectDrawSurface4Impl_ChangeUniquenessValue }; - -#ifdef HAVE_LIBXXF86DGA2 -ICOM_VTABLE(IDirectDrawSurface4) dga2_dds4vt = -{ - ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE - IDirectDrawSurface4Impl_QueryInterface, - IDirectDrawSurface4Impl_AddRef, - DGA_IDirectDrawSurface4Impl_Release, - IDirectDrawSurface4Impl_AddAttachedSurface, - IDirectDrawSurface4Impl_AddOverlayDirtyRect, - IDirectDrawSurface4Impl_Blt, - IDirectDrawSurface4Impl_BltBatch, - IDirectDrawSurface4Impl_BltFast, - IDirectDrawSurface4Impl_DeleteAttachedSurface, - IDirectDrawSurface4Impl_EnumAttachedSurfaces, - IDirectDrawSurface4Impl_EnumOverlayZOrders, - DGA2_IDirectDrawSurface4Impl_Flip, - IDirectDrawSurface4Impl_GetAttachedSurface, - IDirectDrawSurface4Impl_GetBltStatus, - IDirectDrawSurface4Impl_GetCaps, - IDirectDrawSurface4Impl_GetClipper, - IDirectDrawSurface4Impl_GetColorKey, - IDirectDrawSurface4Impl_GetDC, - IDirectDrawSurface4Impl_GetFlipStatus, - IDirectDrawSurface4Impl_GetOverlayPosition, - IDirectDrawSurface4Impl_GetPalette, - IDirectDrawSurface4Impl_GetPixelFormat, - IDirectDrawSurface4Impl_GetSurfaceDesc, - IDirectDrawSurface4Impl_Initialize, - IDirectDrawSurface4Impl_IsLost, - IDirectDrawSurface4Impl_Lock, - IDirectDrawSurface4Impl_ReleaseDC, - IDirectDrawSurface4Impl_Restore, - IDirectDrawSurface4Impl_SetClipper, - IDirectDrawSurface4Impl_SetColorKey, - IDirectDrawSurface4Impl_SetOverlayPosition, - DGA_IDirectDrawSurface4Impl_SetPalette, - IDirectDrawSurface4Impl_Unlock, - IDirectDrawSurface4Impl_UpdateOverlay, - IDirectDrawSurface4Impl_UpdateOverlayDisplay, - IDirectDrawSurface4Impl_UpdateOverlayZOrder, - IDirectDrawSurface4Impl_GetDDInterface, - IDirectDrawSurface4Impl_PageLock, - IDirectDrawSurface4Impl_PageUnlock, - IDirectDrawSurface4Impl_SetSurfaceDesc, - IDirectDrawSurface4Impl_SetPrivateData, - IDirectDrawSurface4Impl_GetPrivateData, - IDirectDrawSurface4Impl_FreePrivateData, - IDirectDrawSurface4Impl_GetUniquenessValue, - IDirectDrawSurface4Impl_ChangeUniquenessValue -}; -#endif /* defined(HAVE_LIBXXF86DGA2) */ diff --git a/dlls/ddraw/dsurface/dga2.c b/dlls/ddraw/dsurface/dga2.c new file mode 100644 index 00000000000..f4f6d8dff5f --- /dev/null +++ b/dlls/ddraw/dsurface/dga2.c @@ -0,0 +1,110 @@ +/* DirectDrawSurface XF86DGA implementation + * + * DGA2's specific DirectDrawSurface routines + */ +#include "config.h" +#include "winerror.h" + +#include +#include +#include +#include +#include +#include + +#include "debugtools.h" +#include "dga2_private.h" + +DEFAULT_DEBUG_CHANNEL(ddraw); + +#define DDPRIVATE(x) dga2_dd_private *ddpriv = ((dga2_dd_private*)(x)->private) +#define DPPRIVATE(x) dga2_dp_private *dppriv = ((dga2_dp_private*)(x)->private) +#define DSPRIVATE(x) dga2_ds_private *dspriv = ((dga2_ds_private*)(x)->private) + +HRESULT WINAPI DGA2_IDirectDrawSurface4Impl_Flip( + LPDIRECTDRAWSURFACE4 iface,LPDIRECTDRAWSURFACE4 flipto,DWORD dwFlags +) { + ICOM_THIS(IDirectDrawSurface4Impl,iface); + IDirectDrawSurface4Impl* iflipto=(IDirectDrawSurface4Impl*)flipto; + DWORD xheight; + DSPRIVATE(This); + dga_ds_private *fspriv; + LPBYTE surf; + + TRACE("(%p)->Flip(%p,%08lx)\n",This,iflipto,dwFlags); + iflipto = _common_find_flipto(This,iflipto); + + /* and flip! */ + fspriv = (dga_ds_private*)iflipto->private; + TSXDGASetViewport(display,DefaultScreen(display),0,fspriv->fb_height, XDGAFlipRetrace); + TSXDGASync(display,DefaultScreen(display)); + TSXFlush(display); + if (iflipto->s.palette) { + DPPRIVATE(iflipto->s.palette); + if (dppriv->cm) + TSXDGAInstallColormap(display,DefaultScreen(display),dppriv->cm); + } + + /* We need to switch the lowlevel surfaces, for DGA this is: */ + /* The height within the framebuffer */ + xheight = dspriv->fb_height; + dspriv->fb_height = fspriv->fb_height; + fspriv->fb_height = xheight; + + /* And the assciated surface pointer */ + surf = This->s.surface_desc.u1.lpSurface; + This->s.surface_desc.u1.lpSurface = iflipto->s.surface_desc.u1.lpSurface; + iflipto->s.surface_desc.u1.lpSurface = surf; + + return DD_OK; +} + +ICOM_VTABLE(IDirectDrawSurface4) dga2_dds4vt = +{ + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + IDirectDrawSurface4Impl_QueryInterface, + IDirectDrawSurface4Impl_AddRef, + DGA_IDirectDrawSurface4Impl_Release, + IDirectDrawSurface4Impl_AddAttachedSurface, + IDirectDrawSurface4Impl_AddOverlayDirtyRect, + IDirectDrawSurface4Impl_Blt, + IDirectDrawSurface4Impl_BltBatch, + IDirectDrawSurface4Impl_BltFast, + IDirectDrawSurface4Impl_DeleteAttachedSurface, + IDirectDrawSurface4Impl_EnumAttachedSurfaces, + IDirectDrawSurface4Impl_EnumOverlayZOrders, + DGA2_IDirectDrawSurface4Impl_Flip, + IDirectDrawSurface4Impl_GetAttachedSurface, + IDirectDrawSurface4Impl_GetBltStatus, + IDirectDrawSurface4Impl_GetCaps, + IDirectDrawSurface4Impl_GetClipper, + IDirectDrawSurface4Impl_GetColorKey, + IDirectDrawSurface4Impl_GetDC, + IDirectDrawSurface4Impl_GetFlipStatus, + IDirectDrawSurface4Impl_GetOverlayPosition, + IDirectDrawSurface4Impl_GetPalette, + IDirectDrawSurface4Impl_GetPixelFormat, + IDirectDrawSurface4Impl_GetSurfaceDesc, + IDirectDrawSurface4Impl_Initialize, + IDirectDrawSurface4Impl_IsLost, + IDirectDrawSurface4Impl_Lock, + IDirectDrawSurface4Impl_ReleaseDC, + IDirectDrawSurface4Impl_Restore, + IDirectDrawSurface4Impl_SetClipper, + IDirectDrawSurface4Impl_SetColorKey, + IDirectDrawSurface4Impl_SetOverlayPosition, + DGA_IDirectDrawSurface4Impl_SetPalette, + IDirectDrawSurface4Impl_Unlock, + IDirectDrawSurface4Impl_UpdateOverlay, + IDirectDrawSurface4Impl_UpdateOverlayDisplay, + IDirectDrawSurface4Impl_UpdateOverlayZOrder, + IDirectDrawSurface4Impl_GetDDInterface, + IDirectDrawSurface4Impl_PageLock, + IDirectDrawSurface4Impl_PageUnlock, + IDirectDrawSurface4Impl_SetSurfaceDesc, + IDirectDrawSurface4Impl_SetPrivateData, + IDirectDrawSurface4Impl_GetPrivateData, + IDirectDrawSurface4Impl_FreePrivateData, + IDirectDrawSurface4Impl_GetUniquenessValue, + IDirectDrawSurface4Impl_ChangeUniquenessValue +};