Mercurial > otakunoraifu
comparison window/picture.cc @ 48:ed6c21dde840
* use correct format (%p) for pointers
author | thib |
---|---|
date | Wed, 15 Apr 2009 20:28:19 +0000 |
parents | 01aa5ddf7dc8 |
children | 15a18fbe6f21 |
comparison
equal
deleted
inserted
replaced
47:5f548e5957a8 | 48:ed6c21dde840 |
---|---|
128 rpos.rmove(surface_x, surface_y); | 128 rpos.rmove(surface_x, surface_y); |
129 if (surface_w >= 0 && surface_h >= 0) { | 129 if (surface_w >= 0 && surface_h >= 0) { |
130 Rect clip(surface_x, surface_y, surface_x+surface_w, surface_y+surface_h); | 130 Rect clip(surface_x, surface_y, surface_x+surface_w, surface_y+surface_h); |
131 rpos.intersect(clip); | 131 rpos.intersect(clip); |
132 } | 132 } |
133 //if (apos.ty < 200) fprintf(stderr,"Blit: %08x : (%d,%d,%d,%d) -> (%d,%d,%d,%d)\n",surface_own,rpos_orig.lx,rpos_orig.ty,rpos_orig.rx,rpos_orig.by,apos.lx,apos.ty,apos.rx,apos.by); | 133 //if (apos.ty < 200) fprintf(stderr,"Blit: %p : (%d,%d,%d,%d) -> (%d,%d,%d,%d)\n",surface_own,rpos_orig.lx,rpos_orig.ty,rpos_orig.rx,rpos_orig.by,apos.lx,apos.ty,apos.rx,apos.by); |
134 root->BlitSurface(surface_own, rpos, surface_alpha, surface_alpha_rect, root->surface, apos, attribute); | 134 root->BlitSurface(surface_own, rpos, surface_alpha, surface_alpha_rect, root->surface, apos, attribute); |
135 rpos.rmove(-surface_x, -surface_y); | 135 rpos.rmove(-surface_x, -surface_y); |
136 } else if (parent == 0) { // 親がいないなら背景消去の責任をもつ | 136 } else if (parent == 0) { // 親がいないなら背景消去の責任をもつ |
137 DSurfaceFill(root->surface, apos, 0, 0, 0); | 137 DSurfaceFill(root->surface, apos, 0, 0, 0); |
138 } | 138 } |
149 rpos.rmove(surface_x, surface_y); | 149 rpos.rmove(surface_x, surface_y); |
150 if (surface_w >= 0 && surface_h >= 0) { | 150 if (surface_w >= 0 && surface_h >= 0) { |
151 Rect clip(surface_x, surface_y, surface_x+surface_w, surface_y+surface_h); | 151 Rect clip(surface_x, surface_y, surface_x+surface_w, surface_y+surface_h); |
152 rpos.intersect(clip); | 152 rpos.intersect(clip); |
153 } | 153 } |
154 //if (apos.ty < 200) fprintf(stderr,"S-Blit: %08x : (%d,%d,%d,%d) -> (%d,%d,%d,%d)\n",surface_own,rel_pos.lx,rel_pos.ty,rel_pos.rx,rel_pos.by,apos.lx,apos.ty,apos.rx,apos.by); | 154 //if (apos.ty < 200) fprintf(stderr,"S-Blit: %p : (%d,%d,%d,%d) -> (%d,%d,%d,%d)\n",surface_own,rel_pos.lx,rel_pos.ty,rel_pos.rx,rel_pos.by,apos.lx,apos.ty,apos.rx,apos.by); |
155 root->BlitSurface(surface_own, rpos, surface_alpha, surface_alpha_rect, screen, apos, attribute); | 155 root->BlitSurface(surface_own, rpos, surface_alpha, surface_alpha_rect, screen, apos, attribute); |
156 } | 156 } |
157 | 157 |
158 Rect PicBase::QueryAbsPos(Rect& rpos) { | 158 Rect PicBase::QueryAbsPos(Rect& rpos) { |
159 rpos.intersect(Rect(0, 0, rel_pos.width(), rel_pos.height())); | 159 rpos.intersect(Rect(0, 0, rel_pos.width(), rel_pos.height())); |
538 } | 538 } |
539 void PicContainer::BlitChildren(Rect rpos) { | 539 void PicContainer::BlitChildren(Rect rpos) { |
540 if (print_blit) fprintf(stderr,"bc."); | 540 if (print_blit) fprintf(stderr,"bc."); |
541 iterator end = children.end(); | 541 iterator end = children.end(); |
542 for (iterator it = children.begin(); it != end; it++) { | 542 for (iterator it = children.begin(); it != end; it++) { |
543 if ( (*it)->is_hidden_now) if(print_blit) fprintf(stderr,"bch %08x;",*it); | 543 if ( (*it)->is_hidden_now) if(print_blit) fprintf(stderr,"bch %p;",*it); |
544 if ( (*it)->is_hidden_now) continue; | 544 if ( (*it)->is_hidden_now) continue; |
545 if ( (*it)->rel_pos.is_crossed(rpos)) { | 545 if ( (*it)->rel_pos.is_crossed(rpos)) { |
546 Rect cpos = child_pos(rpos, *it); | 546 Rect cpos = child_pos(rpos, *it); |
547 (*it)->Blit(cpos); | 547 (*it)->Blit(cpos); |
548 } | 548 } |
884 int i; | 884 int i; |
885 for (i=0; i<num; i++) { | 885 for (i=0; i<num; i++) { |
886 UpdateItem& item = update_rects[i]; | 886 UpdateItem& item = update_rects[i]; |
887 Rect& ur = item.apos; | 887 Rect& ur = item.apos; |
888 if (ur.width() == 0) continue; | 888 if (ur.width() == 0) continue; |
889 if(print_blit)fprintf(stderr,"%08x: %d,%d,%d,%d",item.pic, item.apos.lx, item.apos.ty, item.apos.rx, item.apos.by); | 889 if(print_blit)fprintf(stderr,"%p: %d,%d,%d,%d",item.pic, item.apos.lx, item.apos.ty, item.apos.rx, item.apos.by); |
890 | 890 |
891 item.pic->ExecReBlit(item.rpos); | 891 item.pic->ExecReBlit(item.rpos); |
892 if(print_blit)fprintf(stderr,"\n"); | 892 if(print_blit)fprintf(stderr,"\n"); |
893 ur.intersect(confine); | 893 ur.intersect(confine); |
894 r[n].x = ur.lx; | 894 r[n].x = ur.lx; |
953 | 953 |
954 #ifndef ALPHA_MAX | 954 #ifndef ALPHA_MAX |
955 #define ALPHA_MAX 255 | 955 #define ALPHA_MAX 255 |
956 #endif | 956 #endif |
957 void PicRoot::BlitSurface(Surface* src, const Rect& src_r, const unsigned char* alpha, const Rect& alpha_r, Surface* dest, const Rect& dest_r, int attribute) const { | 957 void PicRoot::BlitSurface(Surface* src, const Rect& src_r, const unsigned char* alpha, const Rect& alpha_r, Surface* dest, const Rect& dest_r, int attribute) const { |
958 if (print_blit) fprintf(stderr," s %08x %d:%d:%d:%d;",src, dest_r.lx, dest_r.ty, dest_r.rx, dest_r.by); | 958 if (print_blit) fprintf(stderr," s %p %d:%d:%d:%d;",src, dest_r.lx, dest_r.ty, dest_r.rx, dest_r.by); |
959 SDL_Rect sr = SDLed(src_r); SDL_Rect dr = SDLed(dest_r); | 959 SDL_Rect sr = SDLed(src_r); SDL_Rect dr = SDLed(dest_r); |
960 | 960 |
961 if (attribute & PicBase::BLIT_MULTIPLY) { | 961 if (attribute & PicBase::BLIT_MULTIPLY) { |
962 if (print_blit) fprintf(stderr,"M"); | 962 if (print_blit) fprintf(stderr,"M"); |
963 DSurfaceBlitMultiply(src, src_r, dest, dest_r); | 963 DSurfaceBlitMultiply(src, src_r, dest, dest_r); |