3 #include "chat_slot.h"
\r
4 #include "process_chat.h"
\r
6 #include "../mydef.h"
\r
8 //
\82±
\82Ì
\83\
\81[
\83X
\93à
\82Å
\82µ
\82©
\8eg
\82í
\82È
\82¢
\83\81\83\
\83b
\83h
\r
9 void drawComment(SDL_Surface* surf,CHAT_SLOT* slot,int now_vpos);
\r
12 *
\83R
\83\81\83\93\83g
\82ð
\95`
\89æ
\82·
\82é
\81B
\r
14 int chat_process(DATA* data,SDL_Surface* surf,const int now_vpos){
\r
15 CHAT* chat = &data->chat;
\r
16 CHAT_SLOT* slot = &data->slot;
\r
17 FILE* log = data->log;
\r
18 /*
\8c©
\82¹
\82È
\82¢
\82à
\82Ì
\82ð
\8dí
\8f\9c*/
\r
19 CHAT_SLOT_ITEM* slot_item;
\r
20 CHAT_ITEM* chat_item;
\r
21 resetChatSlotIterator(slot);
\r
22 while((slot_item = getChatSlotErased(slot,now_vpos)) != NULL){
\r
23 chat_item = slot_item->chat_item;
\r
24 fprintf(log,"[process-chat/process]<vpos:%6d>com%4d<color:%2d loc:%2d size:%2d %6d-%6d(%6d)> erased. \n",now_vpos,chat_item->no,chat_item->color,chat_item->location,chat_item->size,chat_item->vstart,chat_item->vend,chat_item->vpos);
\r
26 deleteChatSlot(slot,slot_item);
\r
28 /*
\8c©
\82¹
\82é
\82à
\82Ì
\82ð
\83Z
\83b
\83g*/
\r
29 resetChatIterator(chat);
\r
30 while((chat_item = getChatShowed(chat,now_vpos)) != NULL){
\r
31 fprintf(log,"[process-chat/process]<vpos:%6d>com%4d<color:%2d loc:%2d size:%2d %6d-%6d(%6d)> added. \n",now_vpos,chat_item->no,chat_item->color,chat_item->location,chat_item->size,chat_item->vstart,chat_item->vend,chat_item->vpos);
\r
33 addChatSlot(data,slot,chat_item,surf->w,surf->h);
\r
35 drawComment(surf,slot,now_vpos);
\r
40 *
\83\8c\83C
\83\84\8f\87\82É
\82»
\82Á
\82Ä
\95`
\89æ
\82·
\82é
\r
43 void drawComment(SDL_Surface* surf,CHAT_SLOT* slot,int now_vpos){
\r
46 int max_item = slot->max_item;
\r
47 CHAT_SLOT_ITEM* item;
\r
48 for(i=0;i<max_item;i++){
\r
49 item = &slot->item[i];
\r
51 rect.x = getX(now_vpos,item,surf->w);
\r
53 SDL_BlitSurface(item->surf,NULL,surf,&rect);
\r
59 *
\88Ê
\92u
\82ð
\8b\81\82ß
\82é
\r
61 int getX(int now_vpos,const CHAT_SLOT_ITEM* item,int video_width){
\r
62 int text_width = item->surf->w;
\r
63 int width = video_width;
\r
64 if(item->chat_item->location != CMD_LOC_DEF){
\r
65 return (width - text_width) >>1;
\r
67 int tmp = now_vpos - item->chat_item->vpos + TEXT_AHEAD_SEC;
\r
68 return width - ((tmp * (width + text_width)) / TEXT_SHOW_SEC);
\r