summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-05 23:12:17 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-05 23:12:17 +0800
commit5682f4dee271696d42cce6645d9b72f1375430a3 (patch)
tree92aca1312723191b3a661e03fa0e1aa0df3e6f21
parent82e501d2794008c19bbaa61fbc96c2824dbde34d (diff)
downloadpttbbs-5682f4dee271696d42cce6645d9b72f1375430a3.tar
pttbbs-5682f4dee271696d42cce6645d9b72f1375430a3.tar.gz
pttbbs-5682f4dee271696d42cce6645d9b72f1375430a3.tar.bz2
pttbbs-5682f4dee271696d42cce6645d9b72f1375430a3.tar.lz
pttbbs-5682f4dee271696d42cce6645d9b72f1375430a3.tar.xz
pttbbs-5682f4dee271696d42cce6645d9b72f1375430a3.tar.zst
pttbbs-5682f4dee271696d42cce6645d9b72f1375430a3.zip
pmore: play old ascii art movie
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2769 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/pmore.c46
1 files changed, 38 insertions, 8 deletions
diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c
index f4940782..73eb76c3 100644
--- a/mbbsd/pmore.c
+++ b/mbbsd/pmore.c
@@ -258,6 +258,7 @@ enum {
MFDISP_MOVIE_YES,
MFDISP_MOVIE_NO,
MFDISP_MOVIE_PLAYING,
+ MFDISP_MOVIE_PLAYING_OLD,
} _MFDISP_MOVIE_MODES;
unsigned char * mf_movieFrameHeader(unsigned char *p);
@@ -1312,7 +1313,7 @@ PMORE_UINAV_FORWARDPAGE()
}
inline static void
-PMORE_UINAV_FORWARLINE()
+PMORE_UINAV_FORWARDLINE()
{
if(mf_viewedAll())
return;
@@ -1403,6 +1404,7 @@ pmore(char *fpath, int promptend)
}
break;
+ case MFDISP_MOVIE_PLAYING_OLD:
case MFDISP_MOVIE_PLAYING:
{
int w = t_columns - 1;
@@ -1417,13 +1419,24 @@ pmore(char *fpath, int promptend)
/* user did not hit anything.
* play next frame.
*/
- if(!mf_movieNextFrame(&frameclk))
+ if(moviemode == MFDISP_MOVIE_PLAYING)
{
- /* nothing more */
- moviemode = MFDISP_MOVIE_YES;
+ if(!mf_movieNextFrame(&frameclk))
+ moviemode = MFDISP_MOVIE_YES; // nothing more
}
- } else
- moviemode = MFDISP_MOVIE_YES;
+ else if(moviemode == MFDISP_MOVIE_PLAYING_OLD)
+ {
+ if(mf_viewedAll())
+ moviemode = MFDISP_MOVIE_NO;
+ else
+ PMORE_UINAV_FORWARDPAGE();
+ }
+ } else {
+ if(moviemode == MFDISP_MOVIE_PLAYING)
+ moviemode = MFDISP_MOVIE_YES;
+ else if(moviemode == MFDISP_MOVIE_PLAYING_OLD)
+ moviemode = MFDISP_MOVIE_NO;
+ }
continue;
}
#endif
@@ -1612,7 +1625,7 @@ pmore(char *fpath, int promptend)
mf_backward(1);
break;
case 'j': case 'J':
- PMORE_UINAV_FORWARLINE();
+ PMORE_UINAV_FORWARDLINE();
break;
case Ctrl('F'):
@@ -1643,7 +1656,7 @@ pmore(char *fpath, int promptend)
(promptend == 2 && (ch == '\r' || ch == '\n')))
flExit = 1, retval = READ_NEXT;
else
- PMORE_UINAV_FORWARLINE();
+ PMORE_UINAV_FORWARDLINE();
break;
case ' ':
@@ -1816,6 +1829,23 @@ pmore(char *fpath, int promptend)
moviemode = MFDISP_MOVIE_PLAYING;
mf_movieNextFrame(&frameclk);
MFDISP_DIRTY();
+ }
+ else if (moviemode == MFDISP_MOVIE_NO)
+ {
+ static char buf[10]="1";
+ move(b_lines-1, 0);
+ getdata_buf(b_lines - 1, 0,
+ "這不是已知的動畫檔格式,"
+ "若要直接播放請輸入播放速度(單位為秒): ",
+ buf, 8, LCECHO);
+ if(buf[0])
+ {
+ sscanf(buf, "%f", &frameclk);
+ if(frameclk < 0.1f)
+ frameclk = 0.1f;
+ moviemode = MFDISP_MOVIE_PLAYING_OLD;
+ MFDISP_DIRTY();
+ }
}
break;
#endif