card.c ucard.c"%yTEXTCWIE u#include #include #include #include "card.h" #include "sprite.h" void PlotAngledSuit(GsOT *OT, esuit suit, short x, short y, short scalex); void PlotAngledValue(GsOT *OT, esuit suit, u_char value, short x, short y, short scalex); void PlotCard(GsOT *OT, card *c, short x, short y) { GsSPRITE cardspr; InitSpr(&cardspr); cardspr.w = 16; cardspr.h = 24; cardspr.x = x; cardspr.y = y; if (!c->valid) {CalcSprPos(cardspr,640+64,0);} else { if (c->value>10) {CalcSprPos(cardspr,640+16*(c->value-10),0);} else {CalcSprPos(cardspr,640,0);} PlotSuit(OT, c->suit, x+1, y+1); PlotValue(OT, c->suit, c->value, x+7, y+15); } GsSortFastSprite(&cardspr, OT, 12); } void PlotAngledCard(GsOT *OT, card *c, short x, short y, short angle) { GsSPRITE cardspr; InitSpr(&cardspr); cardspr.w = 16; cardspr.h = 24; if (angle<1024 || angle>3072) { if (angle<1024) cardspr.scalex = (1024-angle)<<2; else cardspr.scalex = (angle-3072)<<2; cardspr.x = x+(4096-cardspr.scalex>>9); cardspr.y = y; if (c->value>10) {CalcSprPos(cardspr,640+16*(c->value-10),0);} else {CalcSprPos(cardspr,640,0);} PlotAngledSuit(OT, c->suit, cardspr.x, cardspr.y, cardspr.scalex); PlotAngledValue(OT, c->suit, c->value, cardspr.x+(cardspr.scalex>>9), cardspr.y+15, cardspr.scalex); GsSortSprite(&cardspr, OT, 10); } if (angle>1024 && angle<3072) { if (angle<2048) cardspr.scalex = (angle-1024)<<2; else cardspr.scalex = (3072-angle)<<2; cardspr.x = x+(4096-cardspr.scalex>>9); cardspr.y = y; CalcSprPos(cardspr,640+5*16,0); GsSortSprite(&cardspr, OT, 10); } } void PlotAngledSuit(GsOT *OT, esuit suit, short x, short y, short scalex) { GsSPRITE infospr; InitSpr(&infospr); infospr.w = infospr.h = 8; infospr.x = x; infospr.y = y; infospr.scalex = scalex; CalcSprPos(infospr,640+suit*8,40); GsSortSprite(&infospr, OT, 9); } void PlotAngledValue(GsOT *OT, esuit suit, u_char value, short x, short y, short scalex) { GsSPRITE infospr; InitSpr(&infospr); infospr.w = infospr.h = 8; infospr.x = x; infospr.y = y; infospr.scalex = scalex; switch(suit) { case heart: case diamond: CalcSprPos(infospr,640+((value-1)*8),24); break; case spade: case club: CalcSprPos(infospr,640+((value-1)*8),32); break; } GsSortSprite(&infospr, OT, 9); } void PlotSuit(GsOT *OT, esuit suit, short x, short y) { GsSPRITE infospr; InitSpr(&infospr); infospr.w = infospr.h = 8; infospr.x = x; infospr.y = y; CalcSprPos(infospr,640+suit*8,40); GsSortFastSprite(&infospr, OT, 11); } void PlotValue(GsOT *OT, esuit suit, u_char value, short x, short y) { GsSPRITE infospr; InitSpr(&infospr); infospr.w = infospr.h = 8; infospr.x = x; infospr.y = y; switch(suit) { case heart: case diamond: CalcSprPos(infospr,640+((value-1)*8),24); break; case spade: case club: CalcSprPos(infospr,640+((value-1)*8),32); break; } GsSortFastSprite(&infospr, OT, 11); } void PlotBackFace(GsOT *OT, short x, short y) { GsSPRITE backspr; InitSpr(&backspr); backspr.w = 16; backspr.h = 24; backspr.x = x; backspr.y = y; CalcSprPos(backspr,640+5*16,0); GsSortFastSprite(&backspr, OT, 12); } ZZRcard.crrior IDE 2.0.3encesallerTEXTCWIEu  <DGHIK M(NLPxQRSH Monaco4P4P &ZZRNX1RMPSRMWBB*LR