<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.1//EN">

<!-- 

TODO:
    Rewrite the glide section
    Add more DRI stuff
    Add a FAQ
    Add some stuff about hl mods 

-->


 <article>

  <!-- Header -->
  <articleinfo>
   
   <!-- title of HOWTO, include the word HOWTO -->
   
   <title>HOWTO run Half-Life using WINE</title>
   
  <authorgroup>
    
    <author>
     <firstname>David</firstname>
     <surname>Hammerton</surname>
     <affiliation>
      <address>
        <email>crazney@crazney.net</email>
      </address>
     </affiliation>
    </author>
    
    <author>
     <firstname>Adam</firstname>
     <surname>Torgerson</surname>
     <affiliation>
      <address>
         <email>may1937@may1937.net</email>
      </address>
     </affiliation>
    </author>
    
    <author>
     <firstname>Lars</firstname>
     <surname>Munch</surname>
     <affiliation>
      <address>
         <email>c948114@student.dtu.dk</email>
      </address>
     </affiliation>
    </author>
    
   </authorgroup>
   
   <revhistory>
    <revision>
     <revnumber>0.5</revnumber>
     <date>2002-09-23</date>
     <authorinitials>Adam</authorinitials>
     <revremark>
           Updated my email, changed a bunch of stuff.
     </revremark>
    </revision>
 
    <revision>
     <revnumber>0.4.1</revnumber>
     <date>2001-06-03</date>
     <authorinitials>David</authorinitials>
     <revremark>
           Updated my email address and a few out-of-date things changed.
     </revremark>
    </revision>
   
    <revision>
     <revnumber>0.4</revnumber>
     <date>2001-06-01</date>
     <authorinitials>Lars</authorinitials>
     <revremark>
           Changed document style to Docbook SGML 4.1. Generate the
           document as described in: <ulink
           url="http://www.linuxdoc.org/LDP/LDP-Author-Guide/usingldpdsssl.html">Using
           ldp.dsl</ulink>
        </revremark>
    </revision>
    
    <revision>
     <revnumber>0.3</revnumber>
     <date>2001-03-19</date>
     <authorinitials>Adam</authorinitials>
     <revremark>
          I mostly fixed grammatical errors, I added some stuff in the
          OpenGL troubleshooting section and sound section, and
          generally cleaned it up a bit.  There is a little note for
          you down in the sound troubleshooting section so take a look
          at that definately. Also I know *nothing* about SGML so I
          just opened the file, saw that it looked like HTML, and went
          at it. If I screwed things up let me know.
       </revremark>
    </revision>
    <!-- Additional (*earlier*) revision histories go here -->
   </revhistory>
   
   <pubdate>Version 0.5, September 23rd 2002</pubdate>

   <abstract>
    
    <para>
     This HOWTO will help guide most people through setting up
     Half-Life to run at a very usable state under Linux or other
     un*x's using WINE.
    </para>

   </abstract>
   
  </articleinfo>
  
  <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  <!-- Section: Introduction                                         -->
  <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  
  <sect1>
   <title>Introduction</title>
   
   <sect2>
    <title>Introduction</title>
    
    <para>
     This HOWTO will help guide most people through setting up
     Half-Life to run at a very usable state under Linux or other
     un*x's using WINE. WINE is not a windows emulator, but it does
     let you run many windows programs under Linux. This HOWTO is
     designed for OpenGL users, for software Half-Life, I recommend
     you see the <ulink url="http://eg4l.sourceforge.net/ehl/">EHL
     project</ulink> (which doesn't look active anymore).
    </para>
   </sect2>

   <sect2>
    <title>Acknowledgments</title>

    <para>
     This HOWTO has been built from many recources, such as other
     HOWTOs, web sites, newsgroups, people on IRC and my personal
     experience. The two main recources were <ulink
     url="http://www.doc.ic.ac.uk/~dwm99/Computing/Wine+Half-Life-HOWTO">David
     McBride's HOWTO</ulink> and the <ulink
     url="news:comp.emultaors.ms-windows.wine">WINE newsgroup</ulink>.
     Also a few idea's come from the brain of Sting of Death who has a
     website <ulink url="http://eg4l.sourceforge.net/ehl/">Emulated
     Half Life</ulink>
    </para>
   </sect2>
   
   <sect2>
    <title>License</title>

    <para>
     Linux Half-Life Howto: Running Half-Life under WINE Copyright (C)
     2000, 2001, 2002 David Hammerton
    </para>

    <para>
     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License as
     published by the Free Software Foundation; either version 2 of
     the License, or (at your option) any later version.
    </para>

    <para>
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     General Public License for more details.
    </para>

    <para>
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    </para>

    <para>
     A copy of the GPL can be found at <ulink
     url="http://www.gnu.org/copyleft/gpl.html">the GNU
     Homepage</ulink>
    </para>
   </sect2>
   
   <sect2>
    <title>Latest Version</title>
    
    <para>
     The latest version of this document should be found at
     <ulink url="http://lhl.linuxgames.com/">LHL</ulink>
    </para>
   </sect2>
   
  </sect1>
  
  <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  <!-- Section: Doing It                                             -->
  <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->

  <sect1>
   <title>Doing It</title>

   <sect2>
    <title>Requirements</title>
    
    <para>
    <itemizedlist>

     <listitem>
      <para>
       An x86 PC that can conforms to the Half-Life system
       requirements. Actually, maybe a bit better than what's on the
       box since WINE doesn't run quite as good as native windoze.
      </para>
     </listitem>

     <listitem>
      <para>
       A relatively recent Linux install
      </para>
     </listitem>

     <listitem>
      <para>
       XFree86 4.0.1 or later (XFree86 4.2.0 is recommended for DRI
       users).
      </para>
     </listitem>

     <listitem>
      <para>
       Half-Life
      </para>
     </listitem>

     <listitem>
      <para>
       A 3D accelerator card that supports OpenGL under Linux
      </para>
     </listitem>

     <listitem>
      <para>
       Your 3D card setup and working in XFree86
      </para>
     </listitem>

     <listitem>
      <para>
       You do NOT need any Windows partition or installation
      </para>
     </listitem>

     <listitem>
      <para>
       If you are experiencing sound problems, you may need to
       switch to OSS sound drivers for your sound card. For some
       cards, Alsa simply doesn't play nice with Wine.
      </para>
     </listitem>

    </itemizedlist>
    </para>
  
   </sect2> 
   
   <sect2>
    <title>3D</title>
    
    <sect3>
     <title>General installation</title>
     
     <para>
      This HOWTO does <bold>not</bold> cover installing and setting up your 3D
      card for Linux. This HOWTO assumes you have a working 3D card
      (you can run Quake3, Heretic2, Descent3, or whatever else in 3D
      accelerated mode). Here are some links:
      </para>
     
     <para>
      <itemizedlist>
       
       <listitem>
          <para>
           NVidia chipsets (TNT/TNT2/GeForce/GeForce2 etc): <ulink
           url="http://www.nvidia.com/Products/Drivers.nsf/Linux.html">NVidia
           Linux Drivers</ulink>
         </para>
       </listitem>

       <listitem>
        <para>
	 For help in determining if your Nvidia card is properly
	 configured, please use the nvcheck.sh script. A local copy
	 is <ulink url="http://lhl.linuxgames.com/nvcheck.sh">here</ulink>.
	</para>
       </listitem>

       <listitem>
	<para>
          New 3DFX chipsets (Voodoo's 3, 4 & 5): <ulink
          url="http://dri.sourceforge.net/">DRI Project</ulink> 3DFX
          glide drivers for XFree86 3.3.6: <ulink
          url="http://linux.3dfx.com/">3DFX</ulink> and
          <ulink url="http://glide.sourceforge.net/">the Glide project</ulink>
         </para>
       </listitem>

       <listitem>
	<para>
          Matrox GX00 / ATI Rage 128 / Intel i810/ 3dlabs Oxygen:
          <ulink url="http://dri.sourceforge.net/">DRI Project</ulink>
         </para>
       </listitem>

       <listitem>
	<para>
          Mesa: <ulink url="http://mesa3d.sourceforge.net/">The Mesa
          3-D graphics library</ulink>
         </para>
       </listitem>
      </itemizedlist>
      </para>       

    </sect3>
    
    <sect3>
     <title>NVidia users</title>
     
     <para>
      NVidia cards are the best for getting this working. They have
      the best support under Linux, hence run the fastest and most
      stable in most situations. There are no special settings requred
      for NVidia users, just follow this HOWTO.
     </para>
    </sect3>

    <sect3>
     <title>3DFX users</title>
     
     <para>
      Since the release of XFree86 4.0.2, the latest TDFX branch has
      been put into the DRI CVS - so it may be possible for 3DFX users
      to download and compile XFree86 and DRI from CVS - this is
      untested! It may be even better with the recent release of
      XFree86 4.0.3, but this is untested as well. If anyone tests
      this out and it works, let someone know. Otherwise, continue
      with the old method:
     </para>

     <para>
      3DFX users seem to have it a bit tough, but it is still
      possible. I have been in contact with one very helpful person
      who has finally got CS working well with his 3DFX card (voodoo
      3). You have two options, DRI (x4.0.1), but currently this seems
      ridiculously slow, so I'm not going to bother. The other options
      is Glide (x3.3.6). As I dont have a voodoo 3, I cant be sure
      what is here is correct, but here is what should work.
     </para>
 
     <para>
      From email from Lars Munch <email>c948114@student.dtu.dk</email>
     </para>

     <para>
     <screen>
Here is what I did:
------
First remove all traces of glide and mesa.
 
Get the latest Device3Dfx driver from the cvs at
glide.sourceforge.net and install those. Requered if you
run kernel 2.4.x.
 
Get the Glide V3 source rpm from linux.3dfx.com. Rebuild and
install those, both the libraries the devel stuff.
 
Then get Mesa 3.4 from mesa3d.sourceforge.net. You will need
both MesaDemos and MesaLib. Compile it using 
 
# ./configure --without-svga --without-ggi --with-glide=/usr \
              --prefix=/usr --sysconfdir=/etc
 
And do 

# make; make install.
 
Now test it a lot, to make sure at actually works (testGlide3x,
quake etc..).
 
You can use export MESA_FX_INFO=1 to get some usefull
statistics.

Install the WickedGL drivers (miniGL from Wicked3D) and they
give a VERY good performance 30-70 fps at 640x480.

Then configure the wine sources with --enable-opengl option ,
and run halflife/counter-strike with:
 
# export MESA_GLX_FX=fullscreen
 
# wine -desktop hl.exe -- hl.exe -gl -gldrv Default -w 640 -full \
       -game cstrike -noipx -nojoy -numericping -console -toconsole</screen>
      </para>
    </sect3>

    <sect3>
     <title>G400 users</title>

     <para>
      I have finally been contacted by a user who is running LHL
      wonderfully with his G400.  There are a few steps to take, it
      seems easier than the 3DFX users. Note: you will probably need a
      fairly fast CPU (500+ anyone?).
     </para>

     <para>
      Now that XFree86 4.0.2 (XFree86 4.2.0, actually) is out, all that
      you must do is install that.. it will NOT work with the normal
      X4.0.1 release, you MUST use XFree86 4.0.2. You will also
      probably get some flickering, to fix this look down in the
      troubleshooting section, there is a fix there. For the best performance,
      you will probably want to upgrade to 4.2.0.
    </para>
    </sect3>

    <sect3>
     <title>Other DRI users</title>

     <para>
      ATI Radeon should work with newer versions of X. Other than that, 
      I havent heard from any other DRI users yet, but please let me
      know how you go. Try and get the latest XFree86 DRI from CVS as
      described in the G400 section, let me know.
     </para>
    </sect3>

   </sect2> <!-- End 3D -->

   <sect2>
    <title>Installing WINE</title>

    <para>
     The first step we must do is install WINE. Depending on how much
     you've played around with Linux, this shouldnt be a huge
     hassle. If you already have WINE installed from an RPM/binary
     package or otherwise, remove it. We will be installing from source
     and will get an up-to-the minute version with CVS. 
     In RPM based systems do this:
    </para>

    <para>
     <screen>
      # rpm -qa |grep WINE
      # rpm -qa |grep wine
      # rpm -e "whatever showed up above"
     </screen>
    </para>

    <para>
     In a Debian based system do this:
    </para>

    <screen># apt-get remove wine</screen>

    <para>
     If you have previously compiled and installed WINE from source,
     go into the source directory and:
    </para>

    <para>
     <screen>
      # make uninstall
     </screen>
    </para>

    <para>
    <orderedlist>
     <listitem>
       <para>
        Now, download WINE. With Transgaming now working on it, I recommend
	getting their version (winex). I will assume that you
        downloaded wine into /usr/src, so your wine source will
        be in /usr/src/wine. For more information on this process, please
	see the 
	<ulink url="http://sf.net/projects/winex/">winex Sourceforge
	project site.</ulink>
       </para>

       <para>To use CVS, try this:</para>
       
       <para>
       <screen>
        # export CVSROOT=:pserver:anonymous@cvs.winex.sf.net:/cvsroot/winex
	# cvs login
	*** There is no password (leave it empty) ***
	# cvs -z3 co wine</screen>
       </para>

       <para>
        Please note this is a rather large CVS checkout. It may take
	a while for modem users.  Also, there are some
        binaries of WINE compiled with OpenGL support. These are
        untested as far as I know, so don't complain if they don't work.
       </para>
      </listitem>

     <listitem>
       <para>
       Get the development packages for OpenGL for your distro. For
       Debian, this is xlibmesa-dev. Other distros should have similar
       packages. You are also going to need a file called
       glext.h. Let's see if you have it:
       </para>

       <para>
       <screen>
        # updatedb
	# locate glext.h</screen>
       </para>

       <para>
        If your system doesnt already have glext.h, then you will need
        to get it before compiling WINE. I have made a copy available
        <ulink url="http://lhl.linuxgames.com/glext.h">here</ulink>, download it and put
        it in "/usr/X11R6/include/GL/". WINE will not compile with
        OpenGL support without this file.
       </para>
      </listitem>

      <listitem>
       <para>
        Now to compile, first configure wine. Go into /usr/src/wine and:
	<screen>
	 # ./configure --enable-opengl
	</screen>
	Wine will configure itself. Check the screen output to make sure OpenGL
	was properly detected. Mine looks like this:
	<screen>
	 checking GL/gl.h usability... yes
	 checking GL/gl.h presence... yes
	 checking for GL/gl.h... yes
	 checking GL/glx.h usability... yes
	 checking GL/glx.h presence... yes
	 checking for GL/glx.h... yes
	 checking for GL/glext.h... yes
	 checking for up-to-date OpenGL version... yes
	 checking for thread-safe OpenGL version... yes
	 checking for glXCreateContext in -lGL... yes
	 checking for glXGetProcAddressARB in -lGL... yes
	 checking for OpenGL extension functions prototypes... no
	 checking for gluLookAt in -lGLU... yes
	</screen>
       </para>

       <para>
        If everything appears to be good, check include/config.h
	for "#define HAVE_OPENGL 1". If this line is commented out, or not in
	the file, <bold>OpenGL support will not build.</bold> Don't even bother
	compiling Wine yet; first fix your OpenGL problem. Only when
	include/config.h contains that line should you move on to the next step.
       </para>

      </listitem>

      <listitem>
       <para>
        With Wine configured (and OpenGL support enabled), it's time to compile.
	From /usr/src/wine:
	<screen>
	 # make depend
	 # make
	</screen>
	Wine will compile so go take a nap or whatever. If you are really bored
	you can read some funny IRC quotes <ulink url="http://bash.org/?random">
	here</ulink>. Once done, it should say "Wine build complete." and we can
	install it with:
	<screen>
	 # make install
	</screen>
	Wine is now compiled and installed on your system.
       </para>
      </listitem>

      <listitem>
       <para>
        Time to configure wine.conf. Open up wine.conf in your
        faviourate editor. A sample file can be found at
        '/usr/src/wine/documentation/samples/config'.
        Your standard C drive should probably be set to
        /usr/local/wine, check thats the case in wine.conf. You will
        also want a drive that points to your CD-ROM mount point to
        install Half-Life.  Now go down to the [x11drv] section,
        ensure that double-buffering is ON. useDGA may be either on or
        off as DGA now works in XFree86. Some people have reported to
        have problems with this, try fiddling around with useDGA and
        double-buffering (set them to off) if something doesnt
        work. Once the config file works fine, go to your home
        directory (as the user you will be running LHL as) and:
       </para>

       <para>
       <screen>
        # mkdir ~/.wine/
	# cp /usr/src/wine/documentation/samples/config ~/.wine/config</screen>
       </para>
      </listitem>
      
     </orderedlist>
    </para>
    
    <para>WINE should now be installed and configured.</para>
   </sect2> <!-- Installing WINE -->
   
   <sect2>
    <title>Installing Half-Life</title>

    <para>Half-Life should be ready to install.</para>

    <para>Put the HL cd into your cdrom, then:</para>

    <para>
    <screen>
     # mount /xxx (your cdrom's mount point)
     # cd /xxx
     # wine SETUP.EXE</screen>
    </para>

    <para>
     Follow through the installation, it should install perfectly. At
     the end if the installer hangs (which it often does), go back to
     your main console with "CTRL+ALT+F1", login as root and
     type:
    </para>

    <para>
    <screen>
     # killall -9 wine
     # ps -ax</screen>
    </para>

    <para>
     to make sure no WINE clients/servers are running any more. If any
     are running, kill them off individually.
    </para>

    <para>
     Do the same procedure for each patch you load (HL, CS
     etc).. Although you must remember you can only run a .exe from a
     path that exists in wine.conf!
    </para>
   </sect2> <!-- Installing Half-Life -->

   <sect2>
    <title>Running and setting up Half-Life</title>

    <para>
     This is it, good or bad ;-). cd into your Half-Life dir 'cd
     /usr/local/wine/games/Half-Life/' (or wherever you installed it
     and then run:
    </para>

    <para><screen>$ wine hl.exe -- hl.exe -console</screen></para>

    <para>
     (please note, when you get it working, dont run it like
     this.. run it from my script found in the section "missing
     gamespy?") You will see the menu's SLOWLY generate infront of
     you. Once there finished, click "Configuration" -> "Video" ->
     "Video Modes". Set it to OpenGL, whatever res you play in and the
     default driver. Click ok. It may freeze when you click OK, but
     that shouldnt matter (it didn't for me) - just go back to a
     console with "CTRL+ALT+F1" and `killall -9 wine`. Make sure the
     res you chose is one that you have configured in your
     "XF86Config" ("XF86Config-4" for Debian) file (X Windows
     configuration).
    </para>

    <para>
     Configure your keys now. The internal key-binder now works, so
     you should have not problems. You can always manually edit
     "config.cfg" if needs be.
    </para>
   </sect2> <!-- Running and setting up Half-Life -->

   <sect2>
    <title>Playing mods</title>
    
    <para>
     If you want to play any mods (CS, DoD, whatever), first install
     the mod with Wine, the same way you installed Halflife. Follow the
     setup program as normal and when it is done, you can launch directly
     into the mod with something like the following:
     <screen>$ wine hl.exe -- hl.exe -console -game cstrike</screen>
     The above is for CS, but replace the 'cstrike' with the mod of your
     choice.
    </para>
   </sect2> <!-- Playing mods -->

  </sect1>

  
  <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  <!-- Section: Troubleshooting                                      -->
  <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  
  <sect1>
   <title>Troubleshooting</title>
   
   <sect2>
    <title>Sound problems</title>
    
    <sect3>
     <title>Sound laggs a bit</title>

     <para>
      I had some problems with some sounds playing a bit late (eg
      shoot a gun in CS, and the noise comes too late). To fix this,
      put in your "config.cfg" for each mod the line
     </para>

     <para><screen> _snd_mixahead "0.23" </screen></para>

     <para>
      (the value 0.23 works 100% for me, some people say that other
      values work better for them. DO NOT use a negative value here,
      as it will not work at all!)  That should solve that
      problem. Also, if you find Half-Life starts to crash when this
      is set, try messing around with the values.
     </para>

     <para>
      Someone else is having this same problem, but this does not fix
      it. If you have been able to fix this with any other method,
      please contact me.
     </para>

     <para>
      Please note, this problem seems to be fixed in new versions of
      Wine so you shouldn't have to do this anymore.
     </para>

    </sect3>

    <sect3>
     <title>No sound at all</title>

     <para>
      With some sound cards, the Enlightened Sound Daemon (esd), may
      cause sounds to not work (this is generally only under
      Gnome). KDE has a similar sound server called arts. Try this:
     </para>

     <para>
      <screen>
       # ps aux | grep esd
      </screen>
     </para>

     <para>
      If "esd -nobeeps" or something similar comes up, this may be
      your problem. Right click on the Gnome panel, "Panel" -> "Add to
      Panel" -> "Applet" -> "Multimedia" -> "Sound Monitor". Right
      click on the new applet, and choose "Place esound in
      standby". esd is now disabled, so give it another shot.
     </para>

     <para>
      I am not sure how to check for and disable arts. It will probably
      be similar to the above, replacing esd with arts of course.
      Disabling it might be done through the KDE Control Center thing.
      Any comments on this (if it's even a problem) would be appreciated.
     </para>

     <para>
      Another possible cause is that your sound card is using Alsa
      and has an implmentation that is incompatible with Wine. Some
      Alsa drivers work fine; others do not. If you are having problems
      with sound, you may want to try switching to OSS drivers. To
      check if you use Alsa, type:
      <screen>
       # lsmod
      </screen>
      If a bunch of snd-***-*** stuff comes up, you are using the Alsa
      drivers. If you think Alsa might be the cause of sound not working,
      you will have to change to OSS drivers. Unfortunately not all distros
      handle this in the same way, so I can only provide pointers. The OSS
      modules are typically only the name of the chip so the proper module
      names should be 'soundcore' and (for me) 'maestro3'. If you have an
      SB Live, the module is 'emu10k1'. You will probably need to edit
      some files in /etc (modules.autoload in Gentoo) to make this change
      permanent.
     </para>

    </sect3>

    <sect3>
     <title>No radio sounds in CS</title>

     <para>
      This is a problem with not having the "-game cstrike" on the
      command line - you can download the latest hl launch script for
      use with XQF - the link is under the section "Miss Gamespy?".
     </para> 

     <para>
      NOTE: I believe this problem has been fixed in Wine as well. Is
      anyway still not getting radio sounds??
    </sect3>
   </sect2> <!-- Sound problems -->

   <sect2>
    <title>Graphics problems</title>

    <sect3>
     <title>Messy fonts</title>

     <para>
      If you find that the text in some games are a bit dodgy (eg
      scoreboard), then you should get a few errors about not finding
      font files. These errors will show up in the console when
      loading the game. One file may be "1026_Scoreboard
      Text.tga". Yes, you see it judges the resolution wrong, hence
      cant find the file. So find out what res its looking for, quit
      Half-Life, goto the sub-directory from your HL install
      "valve/gfx/vgui/fonts" and copy whatever files of the res you
      SHOULD be using, to the files that half life thinks your
      using.. eg, i have this in mine:
     </para>

     <para>
      <screen>
       1024_Briefing Text.tga        1024_Scoreboard Text.tga
       1026_Briefing Text.tga@        1026_Scoreboard Text.tga@
       1024_CommandMenuText.tga     1024_Team Info Text.tga
       1026_CommandMenu Text.tga@    1026_Team Info Text.tga@
       1024_Primary Button Text.tga  1024_Title Font.tga
       1026_Primary Button Text.tga@  1026_Title Font.tga@
      </screen>
     </para>

     <para>
      Another way that seems to solve this is to not run Half-Life
      fullscreen (uncheck the box in Video Modes) and in the WINE
      config file, let your window manager draw windows.  This also
      seems to get rid of the green line that many have reported. It's
      kind of nifty because then you can still watch your IRC messages
      or whatever while you play. But using this method may prevent you
      from focusing in full screen correctly.
     </para>
    </sect3>

    <sect3>
     <title>Graphicks flicker a lot and/or walls are see through</title>

     <para>
      This problem generally occurs with DRI users, although there is
      a easy solution to it, add/modify the following line in all
      Half-Life config.cfg's:
     </para>

     <para><screen>gl_ztrick 0</screen></para>

     <para>
      Some users have reported that this doesnt fix it, we are still
      investigating a correct solution. NOTE: Is anyone experiencing
      this still??
     </para>
    </sect3>

    <sect3>
     <title>Doesnt run full screen?</title>

     <para>
      Well, depedning on what res you have set up, there should be a
      box in the centre of your screen running CS as that size. Simply
      press "ctrl+alt+keypad_plus" until it fits snug, this res will
      have to be one of your avaialble working resolutions defined in
      XF86Config.  To get back to normal, press "ctrl+alt+keypad_plus"
      again until you reach your desired resolution.
     </para>
    </sect3>

    <sect3>
     <title>Half-Life is considerably dark</title>

     <para>
      This is a problem several people have had, and there apears to
      be an easy fix for it, use the program "xgamma" to change the
      brightness of XFree86.. for example, add in your launch script
      before Half-Life loads something similar to this:
     </para>

     <para><screen># xgamma -gamma 3.0</screen></para>

     <para>
      The 3.0 value is what you will have to change to suit your
      eyes. After running Half-Life in your script, be sure and change
      the gamma value back, or things will look funny.
     </para>
    </sect3>

    <sect3>
     <title>XFree86 dies when I start Half-Life</title>

     <para>
      There could be a number of things effecting this, but the
      most likely cause is strange GL drivers hanging around.
      If you are using the NVidia drivers, ensure you have removed
      all old mesa libraries (search for libGL.so, leave only NVidia
      ones). Also see the section below "The supported OpenGL mode is
      not supported by your video card".
     </para>
    </sect3>

    <sect3>
     <title>The supported OpenGL mode is not supported by your video
     card</title>

     <para>
      This is a problem with WINE linking to the correct OpenGL
      drivers.. firstly make sure OpenGL is compiled into WINE (check
      out the output of ./configure manually).  Most of the time you
      will have to find whether WINE is linking the wrong .so's and
      .a's.  This URL is very helpful:
      http://wine.screenweavers.com/cgi-bin/fom?file=139
     </para>

     <para>
      First, let's make sure OpenGL is working on your system. We will
      run the glxinfo utility as shown below. The output is from my
      Nvidia Geforce2Go based system:
      <screen>
       $ glxinfo
       name of display: :0.0
       display: :0  screen: 0
       direct rendering: Yes
       server glx vendor string: NVIDIA Corporation
       server glx version string: 1.2
       server glx extensions:
        GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer
       client glx vendor string: NVIDIA Corporation
       client glx version string: 1.2
       client glx extensions:
        GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_visual_info, 
	GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_SGI_video_sync, 
	GLX_SGIX_swap_group, GLX_SGIX_swap_barrier, GLX_SGIX_fbconfig, 
	GLX_SGIX_pbuffer
       GLX extensions:
	GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig, 
	GLX_SGIX_pbuffer, GLX_ARB_get_proc_address
       OpenGL vendor string: NVIDIA Corporation
       OpenGL renderer string: GeForce2 MX/AGP/SSE
       OpenGL version string: 1.3.1 NVIDIA 31.23
       OpenGL extensions:
        GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_texture_compression, 
        GL_ARB_texture_cube_map, GL_ARB_texture_env_add, 
        GL_ARB_texture_env_combine, GL_ARB_texture_env_dot3, 
        GL_ARB_transpose_matrix, GL_S3_s3tc, GL_EXT_abgr, GL_EXT_bgra, 
        GL_EXT_blend_color, GL_EXT_blend_minmax, GL_EXT_blend_subtract, 
        GL_EXT_clip_volume_hint, GL_EXT_compiled_vertex_array, 
        GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_multi_draw_arrays, 
        GL_EXT_packed_pixels, GL_EXT_paletted_texture, GL_EXT_point_parameters, 
        GL_EXT_rescale_normal, GL_EXT_secondary_color, 
        GL_EXT_separate_specular_color, GL_EXT_shared_texture_palette, 
        GL_EXT_stencil_wrap, GL_EXT_texture_compression_s3tc, 
        GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add, 
        GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, 
        GL_EXT_texture_cube_map, GL_EXT_texture_filter_anisotropic, 
        GL_EXT_texture_lod, GL_EXT_texture_lod_bias, GL_EXT_texture_object, 
        GL_EXT_vertex_array, GL_EXT_vertex_weighting, 
        GL_IBM_texture_mirrored_repeat, GL_KTX_buffer_region, GL_NV_blend_square, 
        GL_NV_evaluators, GL_NV_fence, GL_NV_fog_distance, 
        GL_NV_light_max_exponent, GL_NV_packed_depth_stencil, 
        GL_NV_register_combiners, GL_NV_texgen_emboss, GL_NV_texgen_reflection, 
        GL_NV_texture_env_combine4, GL_NV_texture_rectangle, 
        GL_NV_vertex_array_range, GL_NV_vertex_array_range2, GL_NV_vertex_program, 
        GL_NV_vertex_program1_1, GL_SGIS_generate_mipmap, GL_SGIS_multitexture, 
        GL_SGIS_texture_lod
       glu version: 1.3
       glu extensions:
        GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess
       
       visual  x  bf lv rg d st colorbuffer ax dp st accumbuffer  ms  cav
        id dep cl sp sz l  ci b ro  r  g  b  a bf th cl  r  g  b  a ns b eat
	----------------------------------------------------------------------
	0x21 16 tc  0 16  0 r  y  .  5  6  5  0  0 16  0 16 16 16 16  0 0 None
	0x22 16 dc  0 16  0 r  y  .  5  6  5  0  0 16  0 16 16 16 16  0 0 None
	0x23 16 tc  0 16  0 r  .  .  5  6  5  0  0 16  0 16 16 16 16  0 0 None
	0x24 16 dc  0 16  0 r  .  .  5  6  5  0  0 16  0 16 16 16 16  0 0 None
      </screen>
     If you have a different Nvidia card, or use the DRI drivers, your
     output may be different. The important thing here is that GLX is
     up and running so as long as you don't see any error messages,
     things should work. One important line is "direct rendering: Yes".
     If this says "No", you are running software OpenGL and things will
     be very slow, so please figure out what's wrong and get that
     direct rendering working before continuing.
     </para>

     <para>
      Now let's test a native OpenGL game and make sure it runs
      smoothly. I recommend either Quake3 or UT2003. Assuming these
      run with acceptable performance, continue on. If they are slow
      and jumpy, Halflife probably will be as well so fix the problem before
      proceeding.
     </para>

     <para>
      Find where WINE put you libopengl32.so (This is the WINE
      OpenGL support library. Mine is in /usr/local/lib). Then what
      you need to do it:
     </para>

     <para><screen>$ ldd libopengl32.so</screen></para>

     <para>
      The output should be similar to the following for an NVidia
      card:
     </para>

     <para>
     <screen>
        libx11drv.so => /usr/local/lib/libx11drv.so (0x4004a000)
        libkernel32.so => /usr/local/lib/libkernel32.so (0x40099000)
        libwine.so => /usr/local/lib/libwine.so (0x40113000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x40137000)
        libm.so.6 => /lib/libm.so.6 (0x40177000)
        libutil.so.1 => /lib/libutil.so.1 (0x40195000)
        libdl.so.2 => /lib/libdl.so.2 (0x40198000)
        libc.so.6 => /lib/libc.so.6 (0x4019b000)
        libuser32.so => /usr/local/lib/libuser32.so (0x402aa000)
        libgdi32.so => /usr/local/lib/libgdi32.so (0x4037b000)
        libwine_tsx11.so => /usr/local/lib/libwine_tsx11.so (0x403e7000)
        libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x403f4000)
        libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x403fd000)
        libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4 (0x40413000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0x40421000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40458000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40466000)
        libntdll.so => /usr/local/lib/libntdll.so (0x40540000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaaa000)
        libGLcore.so.1 => /usr/lib/libGLcore.so.1 (0x40637000)
        libwine_unicode.so => /usr/local/lib/libwine_unicode.so (0x40842000)</screen>
     </para>

     <para>
      The most important lines are libGL.so.1 and libGLcore.so.1. Be
      sure it is pointing to the proper <emphasis>NVidia</emphasis>
      libGL.so.1 and libGLcore.so.1. To check this, go into their
      directory (in this case /usr/lib/) and:
     </para>

     <para><screen># ls -l libGL*</screen></para>

     <para>Look for something like:</para>

     <screen>
      lrwxrwxrwx    1 root     root           16 Mar 17 09:33 libGL.so -> libGL.so.1.0.769
      lrwxrwxrwx    1 root     root           16 Mar 17 09:33 libGL.so.1 -> libGL.so.1.0.769
      -rwxr-xr-x    1 root     root       218388 Mar 17 09:33 libGL.so.1.0.769
      lrwxrwxrwx    1 root     root           13 Mar 17 02:17 libGLU.so -> libGLU.so.1.3
      lrwxrwxrwx    1 root     root           13 Mar 17 02:16 libGLU.so.1 -> libGLU.so.1.3
      -rw-r--r--    1 root     root       487348 Feb 21 21:13 libGLU.so.1.3
      lrwxrwxrwx    1 root     root           20 Mar 17 09:33 libGLcore.so.1 -> libGLcore.so.1.0.769
      -rwxr-xr-x    1 root     root      2075568 Mar 17 09:33 libGLcore.so.1.0.769
      -rw-r--r--    1 root     root        26168 Feb 21 21:13 libGLw.a
     </screen>

     <para>
      Notice libGL.so.1 is a symlink to libGL.so.1.0.769 and same for
      libGLcore.so.1 (which are the proper libs for 0.9-769 NVidia
      drivers). If you have anything else, it is probably traces of
      Mesa sitting around, which will cause it to NOT WORK. Get rid of
      them and run ldconfig again.
     </para>

     <para>
      There is also a chance that your library path may not be
      properly set. If so, edit /etc/ld.so.conf and add a line to the
      path of your libopengl32.so.
     </para>
    </sect3>
   </sect2> <!-- Graphics problems -->

   <sect2>
    <title>Miss gamespy?</title>

    <para>
     <ulink url="http://www.linuxgames.com/xqf/">Get XQF</ulink>, it has support for
     Half-Life. But the way that it starts Half-Life is not suitable
     for us, so I have created a script that works well,
     <ulink url="http://lhl.linuxgames.com/hl"> available here</ulink>. Put it wherever you want, and
     setup XQF to use it. You will have to edit my hl file and change
     the res and the directory that you use. Also have to 'chmod +x
     hl' it to make it executable. You may also want to add that
     xgamma stuff we talked about earlier.
    </para>
   </sect2> <!-- Miss gamespy? -->
  </sect1>
  
  <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  <!-- Section: Closing                                              -->
  <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  
  <sect1>
   <title>Closing</title>

   <para>
    EVERYTHING SHOULD WORK. But, please note, this is a BETA howto, if
    it doesnt work, PLEASE check the board
    (http://lhl.linuxgames.com), check IRC (#lhl on
    irc.openprojects.net), or email me, and I'll try to help
    <email>crazney@crazney.net</email> or <email>may1937@may1937.net</email>.
   </para>

  </sect1>

 </article>
 
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-namecase-general:t
sgml-general-insert-case:lower
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:nil
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->

