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$
|
||||
*
|
||||
* 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.
|
||||
* See the file COPYING in the source tree root for full license agreement.
|
||||
|
|
@ -838,6 +838,12 @@ int solitaire(void){
|
|||
unsigned char c;
|
||||
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)) {
|
||||
case MENU_QUIT:
|
||||
return SOLITAIRE_QUIT;
|
||||
|
|
@ -1153,6 +1159,7 @@ int solitaire(void){
|
|||
break;
|
||||
}
|
||||
if(rem != NOT_A_CARD) {
|
||||
int cur_rem_old = cur_rem;
|
||||
/* draw new cards form the remains of the deck */
|
||||
if(cur_rem == NOT_A_CARD){
|
||||
cur_rem = rem;
|
||||
|
|
@ -1169,6 +1176,10 @@ int solitaire(void){
|
|||
if(i == CARDS_PER_DRAW){
|
||||
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;
|
||||
|
||||
|
|
@ -1198,6 +1209,9 @@ int solitaire(void){
|
|||
c = find_card_col(cur_card);
|
||||
if(c != NOT_A_COL && c != 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