IMPORTANT: TIME TO DECIDE

Programming, graphics, sound, etc

Moderators: jean.vivien.maurice, Nicosmos, woody, ced117, erin

Forum rules
Due to uncontrollable amounts of spam we will be moving to
https://sourceforge.net/apps/phpbb/extremetuxracer/


New user registration has been disabled for this reason.

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Wed Jun 10, 2009 6:49 am

What graphics card to you have?

An older NVidia FX 5200, it's the same card that works fine on Linux. No, this card with OpenGL 2.1 is ok.
it only happens for the Holy Grail and Challenge one races. Those two courses crash the game consistently

That's an important clue. The difference between the working courses and the "bad" courses is the size and the amount of items. For one of the "bad" courses I reduced the items in items.lst, and it worked. I think there's a bug in the code. For the case I don't find the bug immediately I'll implement more error messages.
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Wed Jun 10, 2009 9:56 am

Ok, I've found the cause. All crashing courses contain items placed at or behind the backward border of the course. You can delete them at the top of items.lst, the remotest items are listed first. I don't know why these courses don't crash on Linux, but it should be possible to fix the bug.
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby cpicon92 » Thu Jun 11, 2009 8:13 pm

I just tested it on an intel integrated graphics chipset and the textures work fine there too.
cpicon92: utilisateur de Windows; défenseur du logiciel emprisonné
a.k.a. kpicon92
User avatar
cpicon92
 
Posts: 865
Joined: Sun Apr 08, 2007 5:06 pm
Location: New York, USA

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Fri Jun 12, 2009 10:30 am

The texture problem is not very urgent. To find out the reason I must be able to compile some test programs on Windows. The other bug is fixed (array overflow in Course.GetYCoords, abs(z) has to be < course_length).

The revised code is online now:
- english comments, additional hints
- a config file for the most important config params.
http://www.erinacom.de/tux/bunnyhill/files/bunnyhill-0.08b.tar.gz
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby cpicon92 » Sat Jun 13, 2009 9:14 pm

Here is a list of the small modifications necessary to compile on windows:
Code: Select all
--- bh.h   Thu Jan 15 04:14:12 1970
+++ bh.h   Thu Jan 15 04:14:12 1970
@@ -20,9 +20,6 @@
// --------------------------------------------------------------------

// the following includes seem to be used by Unix and Windows
-#ifdef WINDOWS
-#include <windows.h>
-#endif
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
@@ -37,26 +34,25 @@


//#ifdef IS_UNiX
-//#   include <pwd.h>
+#   include <pwd.h>
#   include <unistd.h>
#   include <sys/types.h>
-//#   include <pwd.h>
+#   include <pwd.h>
#   include <dirent.h>
#   include <sys/time.h>
#   include <sys/types.h>
#   include <dirent.h>
-//#   include <GL/glx.h>
-//#   define SEP "/"
+#   include <GL/glx.h>
+#   define SEP "/"
//#else // Windows
-#   define SEP "\\"
+//#   define SEP "\\"
//#endif



-//#include <png.h>
+#include <png.h>
#include <GL/gl.h>
#include <GL/glu.h>
-#include <GL/glext.h>
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_mixer.h"
--- main.cpp   Thu Jan 15 04:14:12 1970
+++ main.cpp   Thu Jan 15 04:14:12 1970
@@ -62,14 +62,14 @@
   if (strcmp (argv[0], "./bh") == 0) getcwd (game.progdir, 256);      
   else {
      strcpy (game.progdir, argv[0]);
-      if (strlen (game.progdir) > 5) game.progdir[strlen(game.progdir)-7] = 0;
+      if (strlen (game.progdir) > 5) game.progdir[strlen(game.progdir)-3] = 0;
   } // alternatively: else strcpy (game.progdir, PROGDIR);

   // homedir for config file
/*    struct passwd *pwent;
     pwent = getpwuid (getuid ());
   strcpy (game.config_dir, pwent->pw_dir);*/
-/*
+
   strcpy (game.test_frame, "tux_sad.lst");

   game.course_id = 0;
@@ -83,7 +83,7 @@
   game.new_coursemenu = true;
   game.new_campaignmenu = true;
   game.new_campaignintro = true;
-   game.keylock = true;*/
+   game.keylock = true;
}
// -----------------------------------------------------------------

@@ -336,8 +336,6 @@
          return 0;
         break;
   }

-  return 0;

}

--- Makefile   Thu Jan 15 04:14:12 1970
+++ Makefile   Thu Jan 15 04:14:12 1970
@@ -10,7 +10,7 @@
gui_elements.o ft_font.o 

CFLAGS = -Wall -O2 -I/usr/include/freetype2
-LDFLAGS = -lopengl32 -lglu32 -lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_mixer -lfreetype
+LDFLAGS = -lglut -lGL -lGLU -lSDL -lSDL_image -lSDL_mixer -lfreetype

$(BIN) : $(OBJ)
   g++ -o $(BIN) $(OBJ) $(LDFLAGS) $(CFLAGS)
--- ogl.cpp   Thu Jan 15 04:14:12 1970
+++ ogl.cpp   Thu Jan 15 04:14:12 1970
@@ -16,17 +16,9 @@
       glproc = (TProcPtr) SDL_GL_GetProcAddress;
   if (glproc) {
      glLockArraysEXT_p = (PFNGLLOCKARRAYSEXTPROC)
-#ifdef WINDOWS
-          wglGetProcAddress ( "glLockArraysEXT" );
-#else
          (*glproc) ((GLubyte*) "glLockArraysEXT");
-#endif
      glUnlockArraysEXT_p = (PFNGLUNLOCKARRAYSEXTPROC)
-#ifdef WINDOWS
-          wglGetProcAddress ( "glUnlockArraysEXT" );
-#else
          (*glproc) ((GLubyte*) "glUnlockArraysEXT");
-#endif
   
      if (glLockArraysEXT_p == 0 || glUnlockArraysEXT_p == 0) {
            printf ("GL_EXT_compiled_vertex_array extension not supported");

A good deal of these will prevent compilation on linux, so some of these will have to implemented in a "if windows, if unix" sort of situation.
cpicon92: utilisateur de Windows; défenseur du logiciel emprisonné
a.k.a. kpicon92
User avatar
cpicon92
 
Posts: 865
Joined: Sun Apr 08, 2007 5:06 pm
Location: New York, USA

Re: IMPORTANT: TIME TO DECIDE

Postby povl » Sat Jun 13, 2009 10:35 pm

And here are some diffs to make it compile on Mac OS X 10.5.7 (with freetype and SDL provided by Fink). It seems to work well, with fast frame rates on my iMac (Radeon HD 2600 Pro).

Code: Select all
diff -ur bunnyhill/Makefile bunnyhill-0.08mod/Makefile
--- bunnyhill/Makefile   2009-06-05 15:06:53.000000000 +0100
+++ bunnyhill-0.08mod/Makefile   2009-06-13 22:22:54.000000000 +0100
@@ -1,6 +1,6 @@
# Makefile Bunny Hill

-CC = g++
+CC = g++-4.2
BIN = bh
OBJ = main.o ogl.o textures.o mathlib.o collision.o player.o \
course.o spx.o common.o physics.o hud.o view.o env.o loop.o \
@@ -9,8 +9,8 @@
config.o image.o race.o font.o gllib.o lernen.o gui_menu.o \
gui_elements.o ft_font.o 

-CFLAGS = -Wall -O2 -I/usr/include/freetype2
-LDFLAGS = -lglut -lGL -lGLU -lSDL -lSDL_image -lSDL_mixer -lfreetype
+CFLAGS = -Wall -O2 -I/sw/include/freetype2 -I/sw/include -I/sw/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE
+LDFLAGS = -framework OpenGL -L/sw/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -lSDL_image -lSDL_mixer -lfreetype -lz -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices

$(BIN) : $(OBJ)
   g++ -o $(BIN) $(OBJ) $(LDFLAGS) $(CFLAGS)
Only in bunnyhill: bh
diff -ur bunnyhill/bh.h bunnyhill-0.08mod/bh.h
--- bunnyhill/bh.h   2009-06-05 18:22:50.000000000 +0100
+++ bunnyhill-0.08mod/bh.h   2009-06-13 23:14:11.000000000 +0100
@@ -42,7 +42,7 @@
#   include <sys/time.h>
#   include <sys/types.h>
#   include <dirent.h>
-#   include <GL/glx.h>
+//#   include <GL/glx.h>
#   define SEP "/"
//#else // Windows
//#   define SEP "\\"
@@ -51,8 +51,15 @@


#include <png.h>
+#ifdef __APPLE_CC__
+#include <OpenGL/gl.h>
+#include <OpenGL/glu.h>
+#include <OpenGL/glext.h>
+#else
#include <GL/gl.h>
#include <GL/glu.h>
+#include <GL/glext.h>
+#endif
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_mixer.h"
Only in bunnyhill-0.08mod/data/courses: .DS_Store
diff -ur bunnyhill/ogl.cpp bunnyhill-0.08mod/ogl.cpp
--- bunnyhill/ogl.cpp   2009-05-31 10:05:46.000000000 +0100
+++ bunnyhill-0.08mod/ogl.cpp   2009-06-13 22:15:53.000000000 +0100
@@ -7,13 +7,16 @@

typedef void (*(*TProcPtr) (const GLubyte *)) ();

+#ifdef GL_GLEXT_FUNCTION_POINTERS
PFNGLLOCKARRAYSEXTPROC glLockArraysEXT_p = 0;
PFNGLUNLOCKARRAYSEXTPROC glUnlockArraysEXT_p = 0;
+#endif

void InitGLExtensions () {
   TProcPtr glproc = 0;

       glproc = (TProcPtr) SDL_GL_GetProcAddress;
+#ifdef GL_GLEXT_FUNCTION_POINTERS
   if (glproc) {
      glLockArraysEXT_p = (PFNGLLOCKARRAYSEXTPROC)
          (*glproc) ((GLubyte*) "glLockArraysEXT");
@@ -28,6 +31,7 @@
     } else {
      Message ("No function available for obtaining GL proc addresses");
     }
+#endif
}

// --------------------------------------------------------------------
diff -ur bunnyhill/ogl.h bunnyhill-0.08mod/ogl.h
--- bunnyhill/ogl.h   2009-05-28 10:41:31.000000000 +0100
+++ bunnyhill-0.08mod/ogl.h   2009-06-13 22:14:21.000000000 +0100
@@ -40,7 +40,12 @@
void SetMaterial (TColor diff, TColor spec, float exp);
void SetMaterial (TColor diff, TColor amb, TColor spec, float exp);

+#ifdef GL_GLEXT_FUNCTION_POINTERS
extern PFNGLLOCKARRAYSEXTPROC glLockArraysEXT_p;
extern PFNGLUNLOCKARRAYSEXTPROC glUnlockArraysEXT_p;
+#else
+#define glLockArraysEXT_p glLockArraysEXT
+#define glUnlockArraysEXT_p glUnlockArraysEXT
+#endif

#endif
povl
 
Posts: 4
Joined: Mon Aug 04, 2008 9:08 pm
Location: Cambridge, UK

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Sun Jun 14, 2009 10:28 am

Sorry, a stupid question. What does it mean:

Code: Select all
@@ -20,9 +20,6 @@


SVN code? I've never worked with SVN or CVS.
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby slythfox » Sun Jun 14, 2009 11:51 am

erin wrote:Sorry, a stupid question. What does it mean:

Code: Select all
@@ -20,9 +20,6 @@


SVN code? I've never worked with SVN or CVS.
It's part of the diff output. It's metadata. See unified format of diff.
slythfox
 
Posts: 177
Joined: Mon Apr 23, 2007 2:41 am

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Sun Jun 14, 2009 4:17 pm

Thank you. I didn't use this unix command though I've been working on Linux for several years. Indeed, it's useful.
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby cpicon92 » Wed Jun 17, 2009 3:14 pm

i was just wondering, are you going to do anything about the deprecated conversion strings?
cpicon92: utilisateur de Windows; défenseur du logiciel emprisonné
a.k.a. kpicon92
User avatar
cpicon92
 
Posts: 865
Joined: Sun Apr 08, 2007 5:06 pm
Location: New York, USA

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Thu Jun 18, 2009 9:02 am

are you going to do anything about the deprecated conversion strings?

What do you mean with the deprecated strings?

The old C strings are already replaced with instances of string class. The functions which need a string param (e.g. for loading files) are declared with the param "const char *" now. They are called with "anystring.c_str()". So no buffer overflow can happen since the C-string output in the string class is declared constant.

Or do you mean the precompiler directives like "#ifdef WINDOWS - #endif"? I admit that I haven't changed it yet. But that's only a little step and I'll do it as soon as I'm able to compile with mingw. I need to test it on my computer.

If it is really intended to take the Bunny Hill code as a new branch of ETR (I'm missing some clear statements) it will be the best that any other developer will maintain the code. This person should be familiar with SVN repositories and capable to improve the code in terms of the ETR criterions. I will be ready to help and answer if there are any questions. Main developer? No, that's not a fitting role for me.
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby erin » Thu Jun 25, 2009 8:01 am

Ok, let's bring this thread to end. The enthusiasm for a new Tuxracer branch seems to be limited. So my decision: If someone is really interested in the Bunny Hill code: feel free to enhance it, to improve it, to adapt it to ETR standard etc. I'm ready to answer if there are questions, but for the time being I've finished the development of Tuxracer. Other tasks are waiting for me.
erin
 
Posts: 276
Joined: Mon Oct 08, 2007 8:10 am

Re: IMPORTANT: TIME TO DECIDE

Postby cpicon92 » Sat Jun 27, 2009 3:05 pm

Thanks for your code, erin. We will try to use it as best as we can. For the time being there isn't much I can do because I'll be in the middle of nowhere with 56k internet for about a month.
cpicon92: utilisateur de Windows; défenseur du logiciel emprisonné
a.k.a. kpicon92
User avatar
cpicon92
 
Posts: 865
Joined: Sun Apr 08, 2007 5:06 pm
Location: New York, USA

Re: IMPORTANT: TIME TO DECIDE

Postby slythfox » Sun Jun 28, 2009 5:53 pm

cpicon92 wrote:Thanks for your code, erin. We will try to use it as best as we can. For the time being there isn't much I can do because I'll be in the middle of nowhere with 56k internet for about a month.
Do you think we could create a branch for erin's code, and then a development branch based on erin's code to be modified and merged with 0.5 etr code?

I may be able to contribute to the code a bit.
slythfox
 
Posts: 177
Joined: Mon Apr 23, 2007 2:41 am

Re: IMPORTANT: TIME TO DECIDE

Postby cpicon92 » Tue Jun 30, 2009 10:49 am

That's the goal, i had in mind too, it think we could release 0.5 as is (because it's ready to be released anyway. Then, once we've merged the two branches we'll call that 1.0.
cpicon92: utilisateur de Windows; défenseur du logiciel emprisonné
a.k.a. kpicon92
User avatar
cpicon92
 
Posts: 865
Joined: Sun Apr 08, 2007 5:06 pm
Location: New York, USA

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron