PDA

View Full Version : Chess Graphics Loading



vasanth
12-01-2002, 09:50 AM
I am writing a chess game for my school project..(Console game).. i am using BGI graphics, mouse support and bitmapsupport... My game is pretty built now.. the interface, move validation, mouse movments etc.. but the problem is with the image quality.. the images i have stored are very small and is 24bit BMP... they look good on paint.. but not on the console.. Here is a part of my code which reads and displays the image on the screen.... Help me display the image better..




void wking(int sx,int sy) \\sx and sy are the screen position to place image
{
char a;
ifstream ifil;
ifil.open("C:\\project\\image\\wking.bmp", ios::in); \\image size 40 x 60
for(int i=0;i<54;i++)ifil.get(a);
for(i=0;i<60;i++)
for(int j=0;j<40;j++)
{
ifil.get(a);
ifil.get(a);
ifil.get(a);
int g=a,k;
if(a<0)g+=256;
k=g/16;
setcolor(k);
if(a!=0)putpixel(sx+j,sy+200-i,k);
}
ifil.close();
}

TechWins
12-01-2002, 12:17 PM
no need for cross posting, vasanth.:)

Hammer
12-01-2002, 12:37 PM
Hmm, I could've sworn I just removed one of these!

Anyway, all answers here please (http://www.cprogramming.com/cboard/showthread.php?s=&threadid=29773).