TORCS and OpenSolaris 2009.06

Andrey Sokolov <[email protected]> Wed, 6 Oct 2010 14:35:59 +0400
Newsgroups gmane.games.torcs.devel
Message-ID <[email protected]>
I have compiled TORCS 1.3.1 under OpenSolaris 2009.06. I suggest to apply
following patches to the TORCS source code.

*** 1/torcs-1.3.1/src/libs/tgfclient/guifont.cpp        2008-11-09
20:50:22.000000000 +0300
--- torcs-1.3.1/src/libs/tgfclient/guifont.cpp  2010-10-06
10:33:38.890106440 +0400
***************
*** 26,31 ****
--- 26,35 ----
  #include <windows.h>
  #elif defined(__FreeBSD__)
  #include <machine/endian.h>
+ #elif defined(sun)
+ #define BIG_ENDIAN 1234
+ #define LITTLE_ENDIAN 4321
+ #define BYTE_ORDER LITTLE_ENDIAN
  #else
  #include <endian.h>
  #endif





*** 1/torcs-1.3.1/src/modules/simu/simuv2/simu.cpp      2006-02-20
23:15:15.000000000 +0300
--- torcs-1.3.1/src/modules/simu/simuv2/simu.cpp        2010-10-06
11:13:39.455106017 +0400
***************
*** 56,73 ****
      tClutch           *clutch = &(trans->clutch);

      /* sanity check */
! #ifndef WIN32
!     if (isnan(car->ctrl->accelCmd) || isinf(car->ctrl->accelCmd))
car->ctrl->accelCmd = 0;
!     if (isnan(car->ctrl->brakeCmd) || isinf(car->ctrl->brakeCmd))
car->ctrl->brakeCmd = 0;
!     if (isnan(car->ctrl->clutchCmd) || isinf(car->ctrl->clutchCmd))
car->ctrl->clutchCmd = 0;
!     if (isnan(car->ctrl->steer) || isinf(car->ctrl->steer))
car->ctrl->steer = 0;
!     if (isnan(car->ctrl->gear) || isinf(car->ctrl->gear)) car->ctrl->gear
= 0;
! #else
      if (isnan(car->ctrl->accelCmd)) car->ctrl->accelCmd = 0;
      if (isnan(car->ctrl->brakeCmd)) car->ctrl->brakeCmd = 0;
      if (isnan(car->ctrl->clutchCmd)) car->ctrl->clutchCmd = 0;
      if (isnan(car->ctrl->steer)) car->ctrl->steer = 0;
      if (isnan(car->ctrl->gear)) car->ctrl->gear = 0;
  #endif

      /* When the car is broken try to send it on the track side */
--- 56,73 ----
      tClutch           *clutch = &(trans->clutch);

      /* sanity check */
! #if defined WIN32 || defined sun
      if (isnan(car->ctrl->accelCmd)) car->ctrl->accelCmd = 0;
      if (isnan(car->ctrl->brakeCmd)) car->ctrl->brakeCmd = 0;
      if (isnan(car->ctrl->clutchCmd)) car->ctrl->clutchCmd = 0;
      if (isnan(car->ctrl->steer)) car->ctrl->steer = 0;
      if (isnan(car->ctrl->gear)) car->ctrl->gear = 0;
+ #else
+     if (isnan(car->ctrl->accelCmd) || isinf(car->ctrl->accelCmd))
car->ctrl->accelCmd = 0;
+     if (isnan(car->ctrl->brakeCmd) || isinf(car->ctrl->brakeCmd))
car->ctrl->brakeCmd = 0;
+     if (isnan(car->ctrl->clutchCmd) || isinf(car->ctrl->clutchCmd))
car->ctrl->clutchCmd = 0;
+     if (isnan(car->ctrl->steer) || isinf(car->ctrl->steer))
car->ctrl->steer = 0;
+     if (isnan(car->ctrl->gear) || isinf(car->ctrl->gear)) car->ctrl->gear
= 0;
  #endif

      /* When the car is broken try to send it on the track side */







*** 1/torcs-1.3.1/src/modules/graphic/ssggraph/grscene.cpp      2006-02-20
23:16:09.000000000 +0300
--- torcs-1.3.1/src/modules/graphic/ssggraph/grscene.cpp        2010-10-06
10:48:07.208170635 +0400
***************
*** 81,87 ****
  ssgBranch *CarlightAnchor = 0;

  ssgBranch *ThePits = 0;
! ssgTransform *sun = NULL ;

  static void initBackground(void);

--- 81,87 ----
  ssgBranch *CarlightAnchor = 0;

  ssgBranch *ThePits = 0;
! ssgTransform *sun_grscene = NULL ;

  static void initBackground(void);

***************
*** 150,162 ****
      glEnable(GL_LIGHT0);
      glEnable(GL_DEPTH_TEST);

!     if (!sun) {
        ssgaLensFlare      *sun_obj      = NULL ;
        sun_obj  = new ssgaLensFlare () ;
!       sun      = new ssgTransform ;
!       sun      -> setTransform    ( light_position ) ;
!       sun      -> addKid          ( sun_obj  ) ;
!       SunAnchor-> addKid(sun) ;
      }

      /* GUIONS GL_TRUE */
--- 150,162 ----
      glEnable(GL_LIGHT0);
      glEnable(GL_DEPTH_TEST);

!     if (!sun_grscene) {
        ssgaLensFlare      *sun_obj      = NULL ;
        sun_obj  = new ssgaLensFlare () ;
!       sun_grscene      = new ssgTransform ;
!       sun_grscene      -> setTransform    ( light_position ) ;
!       sun_grscene      -> addKid          ( sun_obj  ) ;
!       SunAnchor-> addKid(sun_grscene) ;
      }

      /* GUIONS GL_TRUE */




*** 1/torcs-1.3.1/src/drivers/olethros/learn.cpp        2008-05-31
02:18:32.000000000 +0400
--- torcs-1.3.1/src/drivers/olethros/learn.cpp  2010-10-06
10:50:13.902332672 +0400
***************
*** 17,23 ****
   *
*

***************************************************************************/

!
  #include "learn.h"
  #include <learning/ANN.h>
  #include <learning/string_utils.h>
--- 17,25 ----
   *
*

***************************************************************************/

! #ifdef sun
!  #include <ieeefp.h>
! #endif
  #include "learn.h"
  #include <learning/ANN.h>
  #include <learning/string_utils.h>

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb

_______________________________________________
Torcs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/torcs-devel