[TuxKart-devel] Patch for status text during game start
Status: Alpha
Brought to you by:
sjbaker
From: Mads B. D. <ma...@ch...> - 2001-01-12 13:09:50
|
Hi there. The following is a patch against tuxkart-0.0.3 that adds a status text during start of a new game. It changes the "static" declaration of 2 functions, and I do not know if it uses pu correctly - I hacked it in to demonstrate OSS to a friend. If replying, please cc me, as I am not on the tuxkart-devel list. Thanks, Mads diff -ru tuxkart-0.0.3.org/src/start_tuxkart.cxx tuxkart-0.0.3/src/start_tuxkart.cxx --- tuxkart-0.0.3.org/src/start_tuxkart.cxx Sun Jul 2 08:26:03 2000 +++ tuxkart-0.0.3/src/start_tuxkart.cxx Fri Jan 12 14:03:34 2001 @@ -22,6 +22,9 @@ static ssgSimpleState *intro_gst ; +/* This is to show some status during loads */ +puButton *statusButton ; + #define MAX_TRACKS 10 static char *track_names [ MAX_TRACKS ] ; @@ -71,7 +74,7 @@ * * \***********************************/ -static void displayfn (void) +void displayfn (void) { glMatrixMode ( GL_PROJECTION ) ; glLoadIdentity () ; @@ -118,9 +121,16 @@ int t ; int nl ; + /* Center the status button in the middle of the screen */ + statusButton = new puButton( 240, 200, 400, 250); + statusButton -> setLegend ( "Starting Game" ) ; + displayfn(); + trackButtons -> getValue ( & t ) ; nl = atoi ( numLapsText->getLegend () ) ; + tuxkart_main ( nl, track_idents[t] ) ; + delete numLapsSlider ; delete numLapsText ; delete playButton ; @@ -129,8 +139,9 @@ delete intro_gst ; delete sorority ; delete fnt ; + + delete statusButton; - tuxkart_main ( nl, track_idents[t] ) ; } diff -ru tuxkart-0.0.3.org/src/tuxkart.cxx tuxkart-0.0.3/src/tuxkart.cxx --- tuxkart-0.0.3.org/src/tuxkart.cxx Tue Jul 4 07:38:06 2000 +++ tuxkart-0.0.3/src/tuxkart.cxx Fri Jan 12 14:01:42 2001 @@ -1,6 +1,10 @@ - #include "tuxkart.h" +/* Stuff to show status while loading first map */ +#include <plib/pu.h> +extern puButton *statusButton ; +extern void displayfn(); + #define MIN_CAM_DISTANCE 5.0f #define MAX_CAM_DISTANCE 15.0f @@ -472,6 +476,8 @@ scene -> addKid ( kart[1] -> getModel() ) ; kart[1]->getModel()->clrTraversalMaskBits(SSGTRAV_ISECT|SSGTRAV_HOT); + statusButton -> setLegend ( "Loading Karts" ) ; + displayfn(); for ( int i = 2 ; i < NUM_KARTS ; i++ ) { kart[i] = new AutoKartDriver ( i, new ssgTransform ) ; @@ -480,6 +486,8 @@ } + statusButton -> setLegend ( "Loading Projectiles" ) ; + displayfn(); for ( int i = 0 ; i < NUM_PROJECTILES ; i++ ) { projectile[i] = new Projectile ( new ssgTransform ) ; @@ -494,7 +502,12 @@ sprintf ( fname, "data/%s.loc", trackname ) ; + statusButton -> setLegend ( "Loading Tracks" ) ; + displayfn(); load_track ( trackb, fname ) ; + + statusButton -> setLegend ( "Loading Players" ) ; + displayfn(); load_players () ; return TRUE ; -- Mads Bondo Dydensborg. ma...@ch... Sure, some companies might run successful businesses by making Linux easier to use and offering technical support for the systems, but no business model based on service and support is ever going to approach the incredible level of profitability of a Microsoft-style 'pay us for breathing' business - Pat Dorsey, Morningstar |