forked from len0rd/rockbox
* fix some cursor bugs (patch 1222287)
* added call to srand (patch 1223090) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6876 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b16cc2636e
commit
316eb6538e
1 changed files with 60 additions and 46 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
* $Id$
|
* $Id$
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 dionoea (Antoine Cellerier)
|
* Copyright (C) 2004-2005 dionoea (Antoine Cellerier)
|
||||||
*
|
*
|
||||||
* All files in this archive are subject to the GNU General Public License.
|
* All files in this archive are subject to the GNU General Public License.
|
||||||
* See the file COPYING in the source tree root for full license agreement.
|
* See the file COPYING in the source tree root for full license agreement.
|
||||||
|
|
@ -641,7 +641,7 @@ void solitaire_init(void){
|
||||||
/* we now finished dealing the cards. The game can start ! (at last) */
|
/* we now finished dealing the cards. The game can start ! (at last) */
|
||||||
|
|
||||||
/* init the stack */
|
/* init the stack */
|
||||||
for(i = 0; i<COLORS;i++){
|
for(i = 0; i<COLORS; i++){
|
||||||
stacks[i] = NOT_A_CARD;
|
stacks[i] = NOT_A_CARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -838,6 +838,12 @@ int solitaire(void){
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
int biggest_col_length;
|
int biggest_col_length;
|
||||||
|
|
||||||
|
struct tm time;
|
||||||
|
time = *(rb->get_time());
|
||||||
|
rb->srand( ( ( ( time.tm_year + 365 * time.tm_yday ) * 24
|
||||||
|
+ time.tm_hour ) * 60 + time.tm_min ) * 60 + time.tm_sec );
|
||||||
|
|
||||||
|
|
||||||
switch(solitaire_menu(MENU_BEFOREGAME)) {
|
switch(solitaire_menu(MENU_BEFOREGAME)) {
|
||||||
case MENU_QUIT:
|
case MENU_QUIT:
|
||||||
return SOLITAIRE_QUIT;
|
return SOLITAIRE_QUIT;
|
||||||
|
|
@ -1153,6 +1159,7 @@ int solitaire(void){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(rem != NOT_A_CARD) {
|
if(rem != NOT_A_CARD) {
|
||||||
|
int cur_rem_old = cur_rem;
|
||||||
/* draw new cards form the remains of the deck */
|
/* draw new cards form the remains of the deck */
|
||||||
if(cur_rem == NOT_A_CARD){
|
if(cur_rem == NOT_A_CARD){
|
||||||
cur_rem = rem;
|
cur_rem = rem;
|
||||||
|
|
@ -1169,6 +1176,10 @@ int solitaire(void){
|
||||||
if(i == CARDS_PER_DRAW){
|
if(i == CARDS_PER_DRAW){
|
||||||
cur_rem = NOT_A_CARD;
|
cur_rem = NOT_A_CARD;
|
||||||
}
|
}
|
||||||
|
/* if cursor was on remains' stack when new cards were
|
||||||
|
* drawn, put cursor on top of remains' stack */
|
||||||
|
if(cur_col == REM_COL && cur_card == cur_rem_old)
|
||||||
|
cur_card = cur_rem;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1198,6 +1209,9 @@ int solitaire(void){
|
||||||
c = find_card_col(cur_card);
|
c = find_card_col(cur_card);
|
||||||
if(c != NOT_A_COL && c != cur_col)
|
if(c != NOT_A_COL && c != cur_col)
|
||||||
cur_card = find_last_card(cur_col);
|
cur_card = find_last_card(cur_col);
|
||||||
|
|
||||||
|
if(cur_card == NOT_A_CARD && find_last_card(cur_col) != NOT_A_CARD)
|
||||||
|
cur_card = find_last_card(cur_col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue