1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
void display()
{
scare_mouse();
acquire_screen();
clear_bitmap(buffer);
clear_bitmap(buffer2);
stretch_blit(background, buffer, scrollx, scrolly, background->w, background->h, 0, 0, int(background->w*scale), int(background ->h*scale));
if(inP1A)
{
blit(C2BM1, buffer,0,0,int(mx+10),int(my+35),C2BM1->w,C2BM1->h);
if(mb);
}
if(inP1B)
{
blit(C2BM1, buffer,0,0,int(mx+10),int(my+35),C2BM1->w,C2BM1->h);
if(mb);
}
if(inP1C)
{
blit(C2BM1, buffer,0,0,int(mx+10),int(my+35),C2BM1->w,C2BM1->h);
if(mb);
}
if(TGridOn == true)
{
masked_stretch_blit(TGrid, buffer, scrollx, scrolly, TGrid->w,TGrid ->h,0,0, int(TGrid->w*scale), int(TGrid ->h*scale));
}
if(mx+int(scale*scrollx > 470) && mx+ int(scale*scrollx) < 510)
{
//textprintf_ex(buffer,font,1,200,WHITE,0, "X condition met");
if(my+int(scale*scrolly) > 310 && my+int(scale*scrolly) < 350)
{
//textprintf_ex(buffer,font,1,220,WHITE,0, "X and Y conditions met");
masked_stretch_blit(MTowerBS, buffer, 0,0,MTowerBS->w,MTowerBS ->h, int(228 - scrollx * scale), int(148 - scrolly * scale), int(MTowerBS->w*scale), int(MTowerBS ->h*scale));
}
}
stretch_sprite(buffer, MTowerB, int(230 - scrollx * scale), int(150 - scrolly * scale), int(MTowerB->w*scale), int(MTowerB->h*scale));
draw_sprite(buffer, MTowerB, int(320 - scrollx * scale), int(210 - scrolly * scale));
masked_blit(backpanel, buffer2, 0, 0, 0, 0, backpanel->w-1, backpanel->h-1);
/* Show this for testing purposes
*/
textprintf_ex(buffer,font,1,5,WHITE,-1, "X on Screen: %d",mouse_x);
textprintf_ex(buffer,font,1,15,WHITE,-1, "Y on Screen: %d",mouse_y);
textprintf_ex(buffer,font,1,30,WHITE,-1, "X on Background: %d",int(Mx));
textprintf_ex(buffer,font,1,40,WHITE,-1, "Y on Background: %d",int(My));
textprintf_ex(buffer,font,1,65,WHITE,-1, "X: %d",scrollx);
textprintf_ex(buffer,font,1,75,WHITE,-1, "Y: %d",scrolly);
textprintf_ex(buffer,font,1,100,WHITE,-1, "Scale: %f",scale);
textprintf_ex(buffer2,font,10,470,BLACK,-1, "Player 1 gold: %d",gold[0]);
textprintf_ex(buffer2,font,10,480,BLACK,-1, "Player 2 gold: %d",gold[1]);
p1A->setUpBoxes1(background, BLACK);
pic1_x += 7;
if(pic1_x < 550)
stretch_blit(BPMB1,buffer,0,0,BPMB1->w,BPMB1->h,pic1_x,200,BPMB1->w,BPMB1->h);
masked_blit(buffer2, screen, 0, 0, 0, 0, buffer2->w, buffer2->h);
blit(buffer, screen, 0, 0, 0, 0, buffer->w, buffer->h);
release_screen();
show_mouse(screen);
unscare_mouse();
}
void setXandY(double shcale)
{
scale = shcale;
if(shcale == 1)
{
maxX = 0;
maxY = 38;
}
else if(shcale == 1.5)
{
maxX = 58;
maxY = 190;
}
else if(shcale == 2)
{
maxX = 168;
maxY = 266;
}
else if(shcale == 3)
{
maxX = 277;
maxY = 342;
}
else
{
maxX = 350;
maxY = 450;
}
if(scrollx>maxX)
scrollx = maxX;
if(scrolly>maxY)
scrolly = maxY;
}
|