summaryrefslogtreecommitdiffstats
path: root/mbbsd/menu.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-26 19:12:56 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-26 19:12:56 +0800
commit2124ed3a627d9f19d51c9b6eb0b6543fb2fd96ed (patch)
tree4832d9eef407784729206fab9bc4d172881bf270 /mbbsd/menu.c
parent93d4cfc9955a16f6dc42ac3f7de55ec398e91bdc (diff)
downloadpttbbs-2124ed3a627d9f19d51c9b6eb0b6543fb2fd96ed.tar
pttbbs-2124ed3a627d9f19d51c9b6eb0b6543fb2fd96ed.tar.gz
pttbbs-2124ed3a627d9f19d51c9b6eb0b6543fb2fd96ed.tar.bz2
pttbbs-2124ed3a627d9f19d51c9b6eb0b6543fb2fd96ed.tar.lz
pttbbs-2124ed3a627d9f19d51c9b6eb0b6543fb2fd96ed.tar.xz
pttbbs-2124ed3a627d9f19d51c9b6eb0b6543fb2fd96ed.tar.zst
pttbbs-2124ed3a627d9f19d51c9b6eb0b6543fb2fd96ed.zip
* refine ordersong
* merge topsong and ordersong to single ordersong.c * change max song from MAX_MOVIE to MAX_SONG * change random menu 'movie' to sequential slide show mode git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4779 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/menu.c')
-rw-r--r--mbbsd/menu.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/mbbsd/menu.c b/mbbsd/menu.c
index bbb540f3..bd598cea 100644
--- a/mbbsd/menu.c
+++ b/mbbsd/menu.c
@@ -266,7 +266,15 @@ movie(int cmdmode)
} else if (cmdmode == 999999) { /* Goodbye my friend */
i = 0;
} else {
- i = N_SYSMOVIE + (int)(((float)SHM->last_film - N_SYSMOVIE + 1) * (random() / (RAND_MAX + 1.0)));
+ // do not use random. we work in slide show mode.
+ // since menu is updated per hour, the total presentation time
+ // should be less than one hour. 3600/MAX_MOVIE(500)=7.
+ // syncnow();
+ if (SHM->last_film > N_SYSMOVIE)
+ i = N_SYSMOVIE + (now / (3600 / MAX_MOVIE) ) %
+ (SHM->last_film+1-N_SYSMOVIE);
+ else
+ i = 0; // SHM->last_film;
}
move(1, 0);
@@ -277,6 +285,10 @@ movie(int cmdmode)
out_lines(SHM->notes[i], 11, 0); /* ¥u¦L11¦æ´N¦n */
#endif
outs(ANSI_RESET);
+#ifdef DEBUG
+ // XXX piaip test
+ move(FILMROW, 0); prints(" [ %d ] ", i);
+#endif
}
typedef struct {