Thread: Chess Graphics Loading

  1. #1
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683

    Chess Graphics Loading

    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..

    Code:
    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();
    }

  2. #2
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    no need for cross posting, vasanth.

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Hmm, I could've sworn I just removed one of these!

    Anyway, all answers here please.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cargo loading system
    By kyle rull in forum C Programming
    Replies: 1
    Last Post: 04-20-2009, 12:16 PM
  2. Beginning Game Programming Type Books
    By bumfluff in forum Game Programming
    Replies: 36
    Last Post: 09-13-2006, 04:15 PM
  3. Ultra chess engine contest
    By yodacpp in forum Projects and Job Recruitment
    Replies: 8
    Last Post: 11-21-2004, 07:58 AM
  4. egavga.bgi problem
    By sunil21 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 09-22-2003, 05:06 PM