# HG changeset patch # User Christopher Rogers # Date 1291430457 0 # Node ID ab3747cf211d8b5b286184062f3f0782fce6c4a6 # Parent 4fe0fd2676eb1c06a5e130d3049a8ea358ce0cf8 Add foobillard. An OpenGL billard game for Linux. diff -r 4fe0fd2676eb -r ab3747cf211d foobillard/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/receipt Sat Dec 04 02:40:57 2010 +0000 @@ -0,0 +1,40 @@ +# SliTaz package receipt. + +PACKAGE="foobillard" +VERSION="3.0a" +CATEGORY="games" +SHORT_DESC="An OpenGL billiard game for Linux." +MAINTAINER="slaxemulator@gmail.com" +DEPENDS="libsdl freetype libpng mesa libglu-mesa" +BUILD_DEPENDS="libsdl-dev freetype-dev libpng-dev libglu-mesa mesa-dev zlib-dev" +TARBALL="$PACKAGE-$VERSION.tar.gz" +WEB_SITE="http://foobillard.sourceforge.net/" +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" + +# Rules to configure and make the package. +compile_rules() +{ + cd $src + sed -i -e 's/-lXaw//' -e 's/-lXi//' src/Makefile.in + patch -p1 < ../stuff/03_bugfixes + patch -p1 < ../stuff/05_foul_explanation + patch -p1 < ../stuff/06_show_ball_to_hit + patch -p0 < ../stuff/snooker_reset.patch + patch -p0 < ../stuff/snooker_draw.patch + + ./configure \ + --prefix=/usr \ + --infodir=/usr/share/info \ + --mandir=/usr/share/man \ + $CONFIGURE_ARGS && + make && make DESTDIR=$PWD/_pkg install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/share + cp -a $_pkg/usr/bin $fs/usr + cp -a $_pkg/usr/share/foobillard $fs/usr/share +} + diff -r 4fe0fd2676eb -r ab3747cf211d foobillard/stuff/03_bugfixes --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/stuff/03_bugfixes Sat Dec 04 02:40:57 2010 +0000 @@ -0,0 +1,36 @@ +Index: foobillard-3.0a/src/ball.c +=================================================================== +--- foobillard-3.0a.orig/src/ball.c 2006-10-12 16:42:39.000000000 +0200 ++++ foobillard-3.0a/src/ball.c 2006-10-12 16:42:48.000000000 +0200 +@@ -1821,6 +1821,7 @@ + } else if( options_cuberef && cuberef_binds!=0 ){ + glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, cuberef_binds[i]); + #ifdef GL_VERTEX_PROGRAM_NV ++#ifdef USE_BALL_FRESNEL + { + myvec cam_pos2; + // cam_pos2=vec_scale(vec_unit(vec_diff(cam_pos,balls.ball[i].r)),BALL_D/2.5); +@@ -1829,6 +1830,7 @@ + BALL_D/2.0,BALL_D/2.5,0,0 ); + } + #endif ++#endif + draw_ball(&balls.ball[i],cam_pos,cam_FOV,win_width,0); + }else{ + draw_ball(&balls.ball[i],cam_pos,cam_FOV,win_width,0); +Index: foobillard-3.0a/src/evaluate_move.c +=================================================================== +--- foobillard-3.0a.orig/src/evaluate_move.c 2006-10-12 16:42:43.000000000 +0200 ++++ foobillard-3.0a/src/evaluate_move.c 2006-10-12 16:42:48.000000000 +0200 +@@ -385,6 +385,11 @@ + int ball_out; + int other_player=(act_player==1)?0:1; + int b1hit = BM_get_1st_ball_hit(); if (b1hit>=8) b1hit=1; ++ if(st.to_play==SN_DONE) ++ { ++ BM_reset_move_info(); ++ return; ++ } + + if( player[act_player].place_cue_ball ) player[act_player].place_cue_ball=0; + printf("EVAL start\n"); diff -r 4fe0fd2676eb -r ab3747cf211d foobillard/stuff/05_foul_explanation --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/stuff/05_foul_explanation Sat Dec 04 02:40:57 2010 +0000 @@ -0,0 +1,262 @@ +Index: foobillard-3.0a/src/billard3d.c +=================================================================== +--- foobillard-3.0a.orig/src/billard3d.c 2006-10-12 16:44:17.000000000 +0200 ++++ foobillard-3.0a/src/billard3d.c 2006-10-12 16:44:31.000000000 +0200 +@@ -331,6 +331,8 @@ + static textObj * winner_name_text_obj; + static textObj * winner_text_obj; + ++textObj * last_fault_text; ++ + #ifndef _WIN32 + + enum optionType +@@ -3322,6 +3324,13 @@ + if( player[act_player].text != 0 ){ + textObj_draw( player[act_player].text ); + } ++ /* last fault */ ++ if (strcmp("x", last_fault_text->str)!=0) { ++ glTranslatef(0.0, 70.0, 0.0); ++ textObj_draw(last_fault_text); ++ glTranslatef(0.0,-70.0,0.0); ++ } ++ + glTranslatef(0,30,0); + if (gametype==GAME_8BALL){ + switch(player[act_player].half_full){ +@@ -5197,6 +5206,9 @@ + } + DPRINTF("created winner text obj's\n"); + ++ ++ last_fault_text = textObj_new( "x", options_help_fontname, 20 ); ++ + init_menu(); + + sys_set_timer(frametime_ms, Idle_timer); /* assure a framerate of max 50 fps (1frame/20ms) */ +Index: foobillard-3.0a/src/evaluate_move.c +=================================================================== +--- foobillard-3.0a.orig/src/evaluate_move.c 2006-10-12 16:44:22.000000000 +0200 ++++ foobillard-3.0a/src/evaluate_move.c 2006-10-12 16:44:31.000000000 +0200 +@@ -4,6 +4,9 @@ + ** Copyright (C) 2001 Florian Berger + ** Email: harpin_floh@yahoo.de, florian.berger@jk.uni-linz.ac.at + ** ++** Small changes to output a reason why the last shot was a fault by ++** Thorsten Gunkel ++** + ** This program is free software; you can redistribute it and/or modify + ** it under the terms of the GNU General Public License Version 2 as + ** published by the Free Software Foundation; +@@ -108,11 +111,12 @@ + + /* wenn fremde kugel zuerst angespielt -> foul */ + first_ball_hit=BM_get_1st_ball_hit(); +- if( player[act_player].half_full == BALL_FULL ){ +- if ( first_ball_hit>8 && first_ball_hit<16 ) foul=1; +- } +- if( player[act_player].half_full == BALL_HALF ){ +- if ( first_ball_hit>0 && first_ball_hit<8 ) foul=1; ++ if( ++ ( player[act_player].half_full == BALL_FULL && first_ball_hit>8 && first_ball_hit<16 ) || ++ ( player[act_player].half_full == BALL_HALF && first_ball_hit>0 && first_ball_hit<8 ) ++ ){ ++ foul=1; ++ textObj_setText(last_fault_text, "First ball hit was not one of yours"); + } + + /* erst an 2. stelle, da oben kein foul bei break */ +@@ -146,7 +150,10 @@ + } + } + } +- if(eigene_da) foul=1; ++ if(eigene_da){ ++ foul=1; ++ textObj_setText(last_fault_text, "You hit the 8-Ball too soon"); ++ } + } + + /* wenn angespielte kugel im strafraum */ +@@ -154,6 +161,7 @@ + in_strafraum(BM_get_1st_ball_hit_pos()) && + !BM_get_non_strafraum_wall_hit_before_1st_ball(in_strafraum) ){ + foul=1; ++ textObj_setText(last_fault_text, "You hit a ball not behind the head string"); + } + + /* wenn eigene rein naechster */ +@@ -169,7 +177,10 @@ + } + + +- if( BM_get_balls_hit()==0 ) foul=1; ++ if( BM_get_balls_hit()==0 ){ ++ foul=1; ++ textObj_setText(last_fault_text, "No Ball hit"); ++ } + + /* wenn weisse rein */ + if( BM_get_white_out() ){ +@@ -177,6 +188,7 @@ + foul=1; + balls.ball[0].in_game=1; + balls.ball[0].in_hole=0; ++ textObj_setText(last_fault_text, "White ball potted"); + } + + /* wenn foul */ +@@ -188,6 +200,8 @@ + balls.ball[0].w=vec_xyz(0.0,0.0,0.0); + balls.ball[0].r=vec_xyz(0.0,-TABLE_L/4.0,0.0); + // balls.ball[0].r=vec_xyz(x,y,0.0); ++ } else { ++ textObj_setText(last_fault_text, "x"); + } + + /* if 8 out */ +@@ -221,6 +235,7 @@ + else + { + player[(act_player==1)?0:1].winner=1; ++ textObj_setText(last_fault_text, "8 ball potted too soon"); + } + + } +@@ -277,9 +292,15 @@ + nextplayer=0; + } + +- if( BM_get_balls_hit()==0 ) foul=1; +- +- if( BM_get_1st_ball_hit()!=minball ) foul=1; ++ if( BM_get_balls_hit()==0 ){ ++ textObj_setText(last_fault_text, "No Ball hit"); ++ foul=1; ++ } else { ++ if( BM_get_1st_ball_hit()!=minball ){ ++ textObj_setText(last_fault_text, "First ball hit was not the lowest"); ++ foul=1; ++ } ++ } + + /* wenn weisse rein */ + if( BM_get_white_out() ){ +@@ -287,6 +308,7 @@ + nextplayer=1; + pballs->ball[0].in_game=1; + pballs->ball[0].in_hole=0; ++ textObj_setText(last_fault_text, "White ball is potted"); + } + + /* wenn foul - weisse platzieren */ +@@ -297,6 +319,8 @@ + pballs->ball[0].v=vec_xyz(0.0,0.0,0.0); + pballs->ball[0].w=vec_xyz(0.0,0.0,0.0); + pballs->ball[0].r=vec_xyz(0,-TABLE_L/4.0,0.0); ++ } else { ++ textObj_setText(last_fault_text, "x"); + } + + fprintf(stderr,"foul:%d, nextplayer:%d, BM_get_ball_out(9):%d\n",foul,nextplayer,BM_get_ball_out(9)); +@@ -409,6 +433,7 @@ + act_penalty =MAX(act_penalty,(BM_get_1st_ball_hit()<=7?BM_get_1st_ball_hit():4)); + spot_snooker_ball(pballs,0); + player[other_player].place_cue_ball=1; ++ textObj_setText(last_fault_text, "White ball is potted"); + } + + switch(st.to_play) +@@ -420,6 +445,11 @@ + foul=1; + act_penalty=MAX(act_penalty,b1hit); + printf("EVAL foul 1\n"); ++ if( BM_get_balls_hit()==0 ){ ++ textObj_setText(last_fault_text, "No Ball hit"); ++ } else { ++ textObj_setText(last_fault_text, "First ball hit was not a red one"); ++ } + } + i=1; + while((ball_out=BM_get_nth_ball_out(i++))>=0) +@@ -434,6 +464,11 @@ + act_penalty=MAX(act_penalty,ball_out); + foul=1; + printf("EVAL foul 2\n"); ++ if (BM_get_white_out()){ ++ textObj_setText(last_fault_text, "White ball potted"); ++ } else { ++ textObj_setText(last_fault_text, "Potted ball was not a red one"); ++ } + } + } + for(i=2;i<8;i++) +@@ -449,6 +484,11 @@ + foul=1; + printf("EVAL foul 3\n"); + act_penalty=MAX(act_penalty,7); ++ if( BM_get_balls_hit()==0 ){ ++ textObj_setText(last_fault_text, "No Ball hit"); ++ } else { ++ textObj_setText(last_fault_text, "First ball hit was not a colored one"); ++ } + } + color_to_pot=b1hit; + i=1; +@@ -464,6 +504,11 @@ + foul=1; + printf("EVAL foul 4\n"); + act_penalty=MAX(act_penalty,ball_out==1?7:ball_out); ++ if (BM_get_white_out()){ ++ textObj_setText(last_fault_text, "White ball potted"); ++ } else { ++ textObj_setText(last_fault_text, "Potted ball was not a colored one"); ++ } + } + } + if(red_balls_are_in_game) +@@ -490,6 +535,11 @@ + printf("EVAL foul 5\n"); + act_penalty=MAX(act_penalty,b1hit); + act_penalty=MAX(act_penalty,color_to_pot); ++ if( BM_get_balls_hit()==0 ){ ++ textObj_setText(last_fault_text, "No Ball hit"); ++ } else { ++ textObj_setText(last_fault_text, "First ball hit was not the correct one"); ++ } + } + i=1; + while((ball_out=BM_get_nth_ball_out(i++))>=0) +@@ -505,6 +555,11 @@ + printf("EVAL foul 6\n"); + act_penalty=MAX(act_penalty,b1hit); + act_penalty=MAX(act_penalty,color_to_pot); ++ if (BM_get_white_out()){ ++ textObj_setText(last_fault_text, "White ball potted"); ++ } else { ++ textObj_setText(last_fault_text, "Potted ball was not the correct one"); ++ } + } + } + if(!foul && act_score>0) st.to_play++; +@@ -528,6 +583,7 @@ + { + player[act_player].score += act_score ; + printf("EVAL no foul\n"); ++ textObj_setText(last_fault_text, "x"); + } + if(act_score==0 || foul) + { +Index: foobillard-3.0a/src/evaluate_move.h +=================================================================== +--- foobillard-3.0a.orig/src/evaluate_move.h 2006-10-12 16:44:24.000000000 +0200 ++++ foobillard-3.0a/src/evaluate_move.h 2006-10-12 16:44:31.000000000 +0200 +@@ -31,6 +31,7 @@ + BallsType * pballs, int * pqueue_view, float * pXque ); + #endif + ++extern textObj * last_fault_text; + + void evaluate_last_move_8ball ( struct Player * player, int * actual_player, + BallsType * pballs, int * pqueue_view, float * pXque ); diff -r 4fe0fd2676eb -r ab3747cf211d foobillard/stuff/06_show_ball_to_hit --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/stuff/06_show_ball_to_hit Sat Dec 04 02:40:57 2010 +0000 @@ -0,0 +1,255 @@ +Index: foobillard-3.0a/src/billard.c +=================================================================== +--- foobillard-3.0a.orig/src/billard.c 2006-10-12 16:45:04.000000000 +0200 ++++ foobillard-3.0a/src/billard.c 2006-10-12 16:45:23.000000000 +0200 +@@ -31,6 +31,8 @@ + void * (*billard_malloc)( size_t size ) = malloc; + void (*billard_free)( void * ptr ) = free; + ++SnookerState snooker_state={SN_PLAY_RED}; ++ + void setfunc_create_scene( void (*func)( BallsType * balls ) ) + { + create_scene=func; +Index: foobillard-3.0a/src/billard.h +=================================================================== +--- foobillard-3.0a.orig/src/billard.h 2006-10-12 16:45:05.000000000 +0200 ++++ foobillard-3.0a/src/billard.h 2006-10-12 16:45:23.000000000 +0200 +@@ -76,9 +76,30 @@ + #define BALL_HALF 2 + #define BALL_ANY 0 + ++typedef enum ++{ ++ SN_PLAY_RED, ++ SN_PLAY_ANY_COLOR, ++ SN_PLAY_YELLOW, ++ SN_PLAY_GREEN, ++ SN_PLAY_BROWN, ++ SN_PLAY_BLUE, ++ SN_PLAY_PINK, ++ SN_PLAY_BLACK, ++ SN_DONE ++} ++SnookerBallToPlay; ++ ++typedef struct ++{ ++ SnookerBallToPlay to_play; ++} ++SnookerState; ++ + #ifndef BILLARD_C + extern void (*create_scene)( BallsType * balls ); + extern void (*create_walls)( BordersType * walls ); ++extern SnookerState snooker_state; + #endif + + void create_0hole_walls( BordersType * walls ); /* carambol */ +Index: foobillard-3.0a/src/billard3d.c +=================================================================== +--- foobillard-3.0a.orig/src/billard3d.c 2006-10-12 16:45:08.000000000 +0200 ++++ foobillard-3.0a/src/billard3d.c 2006-10-12 16:45:23.000000000 +0200 +@@ -829,6 +829,7 @@ + player[act_player].place_cue_ball=1; + human_player_roster.player[0].cue_ball=0; human_player_roster.player[1].cue_ball=0; + human_player_roster.player[act_player].place_cue_ball=1; ++ snooker_state.to_play=SN_PLAY_RED; + } + } + +@@ -1787,6 +1788,7 @@ + /* score text */ + for(i=0;i<2;i++){ + char str[256]; ++ char *color; + switch(gametype){ + case GAME_8BALL: strcpy(str,"0"); break; + case GAME_9BALL: +@@ -1805,7 +1807,44 @@ + sprintf( str, "%d", player[i].score ); + break; + case GAME_SNOOKER: +- sprintf( str, "%c%03d %s", (player[i].score<0)?'-':'+', abs(player[i].score), player[i].snooker_on_red ? "red":"col" ); ++ switch(snooker_state.to_play) ++ { ++ case SN_PLAY_RED: ++ color="red"; ++ break; ++ case SN_PLAY_ANY_COLOR: ++ color="color"; ++ break; ++ case SN_PLAY_YELLOW: ++ color="yellow"; ++ break; ++ case SN_PLAY_GREEN: ++ color="green"; ++ break; ++ case SN_PLAY_BROWN: ++ color="brown"; ++ break; ++ case SN_PLAY_BLUE: ++ color="blue"; ++ break; ++ case SN_PLAY_PINK: ++ color="pink"; ++ break; ++ case SN_PLAY_BLACK: ++ color="black"; ++ break; ++ case SN_DONE: ++ color=""; ++ break; ++ } ++ if(i==act_player) ++ { ++ sprintf( str, "%.3d %s", player[i].score, color); ++ } ++ else ++ { ++ sprintf( str, "%.3d", player[i].score); ++ } + break; + } + textObj_setText( player[i].score_text, str ); +Index: foobillard-3.0a/src/evaluate_move.c +=================================================================== +--- foobillard-3.0a.orig/src/evaluate_move.c 2006-10-12 16:45:12.000000000 +0200 ++++ foobillard-3.0a/src/evaluate_move.c 2006-10-12 16:45:23.000000000 +0200 +@@ -30,26 +30,6 @@ + + #define MAX(x,y) ((x)>(y)?(x):(y)); + +-typedef enum +-{ +- SN_PLAY_RED, +- SN_PLAY_ANY_COLOR, +- SN_PLAY_YELLOW, +- SN_PLAY_GREEN, +- SN_PLAY_BROWN, +- SN_PLAY_BLUE, +- SN_PLAY_PINK, +- SN_PLAY_BLACK, +- SN_DONE +-} +-SnookerBallToPlay; +- +-typedef struct +-{ +- SnookerBallToPlay to_play; +-} +-SnookerState; +- + + void spot_snooker_ball(BallsType *balls,int nr); + +@@ -400,7 +380,6 @@ + #define act_player (*pact_player) + #define IS_RED(x) ( x==1 || x>=8 ) + int red_balls_are_in_game=0; +- static SnookerState st={SN_PLAY_RED}; + int color_to_pot; + int i; + int act_score=0; +@@ -409,7 +388,7 @@ + int ball_out; + int other_player=(act_player==1)?0:1; + int b1hit = BM_get_1st_ball_hit(); if (b1hit>=8) b1hit=1; +- if(st.to_play==SN_DONE) ++ if(snooker_state.to_play==SN_DONE) + { + BM_reset_move_info(); + return; +@@ -417,7 +396,7 @@ + + if( player[act_player].place_cue_ball ) player[act_player].place_cue_ball=0; + printf("EVAL start\n"); +- printf("EVAL to_play=%d\n",st.to_play); ++ printf("EVAL to_play=%d\n",snooker_state.to_play); + printf("EVAL b1hit=%d\n",b1hit); + for(i=0;inr;i++){ + if( IS_RED(pballs->ball[i].nr) && pballs->ball[i].in_game ){ +@@ -436,7 +415,7 @@ + textObj_setText(last_fault_text, "White ball is potted"); + } + +- switch(st.to_play) ++ switch(snooker_state.to_play) + { + case SN_PLAY_RED: + color_to_pot=1; +@@ -476,7 +455,7 @@ + if( BM_get_ball_out(i)) + spot_snooker_ball(pballs,i); + } +- st.to_play=SN_PLAY_ANY_COLOR; ++ snooker_state.to_play=SN_PLAY_ANY_COLOR; + break; + case SN_PLAY_ANY_COLOR: + if(b1hit==1) +@@ -512,9 +491,9 @@ + } + } + if(red_balls_are_in_game) +- st.to_play=SN_PLAY_RED; ++ snooker_state.to_play=SN_PLAY_RED; + else +- st.to_play=SN_PLAY_YELLOW; ++ snooker_state.to_play=SN_PLAY_YELLOW; + + for(i=2;i<8;i++) + { +@@ -528,7 +507,7 @@ + case SN_PLAY_BLUE: + case SN_PLAY_PINK: + case SN_PLAY_BLACK: +- color_to_pot=st.to_play; ++ color_to_pot=snooker_state.to_play; + if(b1hit!=color_to_pot) + { + foul=1; +@@ -562,9 +541,9 @@ + } + } + } +- if(!foul && act_score>0) st.to_play++; ++ if(!foul && act_score>0) snooker_state.to_play++; + +- for(i=st.to_play;i<8;i++) ++ for(i=snooker_state.to_play;i<8;i++) + { + if( BM_get_ball_out(i)) + spot_snooker_ball(pballs,i); +@@ -590,13 +569,13 @@ + printf("EVAL next player\n"); + if(red_balls_are_in_game) + { +- st.to_play=SN_PLAY_RED; ++ snooker_state.to_play=SN_PLAY_RED; + } + else + { +- if(st.to_play<=SN_PLAY_ANY_COLOR) ++ if(snooker_state.to_play<=SN_PLAY_ANY_COLOR) + { +- st.to_play=SN_PLAY_YELLOW; ++ snooker_state.to_play=SN_PLAY_YELLOW; + } + } + player[act_player].queue_view=*pqueue_view; +@@ -605,11 +584,11 @@ + *pqueue_view=player[act_player].queue_view; + } + +- player[act_player].snooker_on_red=st.to_play==SN_PLAY_RED; +- player[act_player].snooker_next_color=st.to_play; +- printf("EVAL to_play=%d\n",st.to_play); ++ player[act_player].snooker_on_red=snooker_state.to_play==SN_PLAY_RED; ++ player[act_player].snooker_next_color=snooker_state.to_play; ++ printf("EVAL to_play=%d\n",snooker_state.to_play); + +- if(st.to_play==SN_DONE) ++ if(snooker_state.to_play==SN_DONE) + { + int other_player; + diff -r 4fe0fd2676eb -r ab3747cf211d foobillard/stuff/foobillard.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/stuff/foobillard.desktop Sat Dec 04 02:40:57 2010 +0000 @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Foobillard +Comment=A 3D billiards game using OpenGL +Exec=foobillard +Icon=foobillard.png +Terminal=false +Type=Application +Categories=Game;SportsGame; +StartupNotify=false diff -r 4fe0fd2676eb -r ab3747cf211d foobillard/stuff/foobillard.png Binary file foobillard/stuff/foobillard.png has changed diff -r 4fe0fd2676eb -r ab3747cf211d foobillard/stuff/snooker_draw.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/stuff/snooker_draw.patch Sat Dec 04 02:40:57 2010 +0000 @@ -0,0 +1,48 @@ +Index: src/evaluate_move.c +=================================================================== +--- src/evaluate_move.c (revision 6) ++++ src/evaluate_move.c (working copy) +@@ -602,6 +602,11 @@ + player[act_player].winner=0; + player[other_player].winner=1; + } ++ if(player[act_player].score==player[other_player].score) { ++ player[act_player].winner=1; ++ player[other_player].winner=1; ++ } ++ + } + + printf("EVAL done\n"); +Index: src/billard3d.c +=================================================================== +--- src/billard3d.c (revision 6) ++++ src/billard3d.c (working copy) +@@ -1760,8 +1760,17 @@ + options_gamemode==options_gamemode_tournament && + (player[0].winner || player[1].winner) ) + { +- tournament_evaluate_last_match( &tournament_state ); +- tournament_state.wait_for_next_match=1; ++ if ( player[0].winner == player[1].winner ) ++ { // Draw ++ restart_game_common(); ++ player[act_player].winner=0; ++ player[other_player].winner=0; ++ } ++ else ++ { ++ tournament_evaluate_last_match( &tournament_state ); ++ tournament_state.wait_for_next_match=1; ++ } + } + } else { + int old_cueball_ind; +@@ -3654,6 +3663,7 @@ + create_walls( &walls ); + create_scene( &balls ); + g_shot_due=1; ++ snooker_state.to_play=SN_PLAY_RED; + } + + diff -r 4fe0fd2676eb -r ab3747cf211d foobillard/stuff/snooker_reset.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foobillard/stuff/snooker_reset.patch Sat Dec 04 02:40:57 2010 +0000 @@ -0,0 +1,11 @@ +--- src/billard3d.c 2010-02-27 04:01:40.000000000 -0600 ++++ src/billard3d.c 2010-02-27 04:02:59.000000000 -0600 +@@ -1219,6 +1219,8 @@ + printf("tournament_state_setup_next_match 7\n"); + queue_view=player[act_player].queue_view; + printf("tournament_state_setup_next_match 8\n"); ++ snooker_state.to_play = SN_PLAY_RED; ++ printf("tournament_state_setup_next_match 9\n"); + } + + void create_players_text()