作者hrs113355.bbs@XDBBS.twbbs.org (最愛笨小史的分子) 看板: itoc
標題Re: [功能] 支援pmore2007互動式動畫
時間叉滴小站 (2008/04/13 Sun 10:59:31)
注意:pmore(piaip's more) 套用到Maple3的Patch,請以這篇文章為主
我之前PO的那篇就請忽略,這篇有更簡便的套用方式,和程式碼整理
若有些部分之前有出現過,這裡卻沒有出現,表示你只要改這篇所提的部分即可
特別感謝piaip長輩的協助和辛勞,他已經把M3 porting的部分整合進現行的pmore.c裡
我之前改的部分有些地方還是有很大的問題或是不嚴謹,也是他用更好的方式寫進pmore
往後不管要實裝或是更新都可以跟著pttbbs的svn跑
在pmore.c裡也有簡單的移植介紹
// ---------------------------------------------------------------- <PORTING>
// Maple3 Porting
// ----------------------------------------------------------------
// To use pmore in Maple3(itoc), you need to:
// (1) [config.h] #define M3_USE_PMORE
// (2) [more.c] more(): comment the block between fimage:
// #ifdef M3_USE_PMORE
// + cmd = pmore(fpath, footer && footer != (char*)-1);
// +#else
// if (!(fimage = f_img(fpath, &fsize)))
// .....................................................
// free(fimage);
// +#endif // M3_USE_PMORE
// if (!cmd) /* ...
下面是詳細的作法
: include/config.h
+ #define M3_USE_PMORE
: maple/more.c:more()
+ #ifdef M3_USE_PMORE
+ cmd = pmore(fpath, footer && footer != (char*)-1);
+ #else
if (!(fimage = f_img(fpath, &fsize)))
return -1;
foff = fimage;
..... 中間省略 ......
free(fimage);
+ #endif // M3_USE_PMORE
if (!cmd) /* 檔案正常秀完,要處理 footer */
: maple/pmore.c
直接下載 https://opensvn.csie.org/pttbbs/trunk/pttbbs/mbbsd/pmore.c
(或用svn指令抓取)
到maple/下
: maple/Makefile
加入pmore.c/pmore.o
SRC = ...
+ pmore.c
OBJ = ...
+ pmore.o
: maple/post.c
- /* Thor.990204: 為考慮more 傳回值 */
- if ((key = more(fpath, FOOTER_POST)) < 0)
- break;
-
post_history(xo, hdr);
allpost_history(xo, hdr);
strcpy(currtitle, str_ttl(hdr->title));
+ /* Thor.990204: 為考慮more 傳回值 */
+ if ((key = more(fpath, FOOTER_POST)) < 0)
+ break;
+
--
telnet://xdbbs.twbbs.org -> [叉滴小站]
--
※ 發信站: 叉滴小站(XDBBS.twbbs.org)
◆ 作者: hrs113355
◆ 故鄉: 59.121.104.8 (你好網子)