Thread: HELP - Debugging EYES ARE SQUARE!

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    13

    HELP - Debugging EYES ARE SQUARE!

    Hey could someone take a look at my code, Its just direct X, ive tried loads of stuff, Its probably somthin stupid as im not the best of programmers, anyways heres the link.....

    www.btinternet.com/~ashley.canning/frodo.zip

    if you manage to solve the error :-) I hope you can, then could you send it to
    [email protected]

    Sorry if its asking a bit much, if so Maybe you could tell me what part is wrong and ill change it :-)

  2. #2
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    hmmmm, i have a better idea, you post the code you think has a problem and then come back to look at the replies
    Monday - what a way to spend a seventh of your life

  3. #3
    Its not that I wouldn't like to help, its just that I'm too lazy to go there, download that, unzip it, open it, run it, read it, test it, fix it, send it back... You get the picture. Like iain said: Post your errors or the relevant code and we'll take a peek at it.
    "There's always another way"
    -lightatdawn (lightatdawn.cprogramming.com)

  4. #4
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    Perhaps a hint as to what the program is meant to do, and what the error you are talking about is? I dont get any compile errors, just a couple of warnings, the resolution changes, screen clears and then it drops back to windows. I havent read your code properly yet but it doesnt look like it's supposed to do much more from it's length.

    The warnings:
    GameMain.cpp(26) : warning C4305: '=' : truncation from 'const long' to 'unsigned char'
    GameMain.cpp(26) : warning C4309: '=' : truncation of constant value

    The code:

    Code:
    #include "Globals.h"
    
    int GameMain()
    {
    	HRESULT hret;
    	memset(lpddsprimary,0,sizeof(LPDIRECTDRAWSURFACE4));
    
    	if(KEYDOWN(VK_ESCAPE)) { PostQuitMessage(0); }
    
    	CLEARMEM(ddsd);
    
    	hret = lpddsback->Lock(NULL, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, NULL);
    	if(hret != DD_OK)
    	{		
    		ERR(hret);
    		return 1;
    	}
    
    	UCHAR *videomem = (UCHAR*)ddsd.lpSurface;
    
    
    	for(int x = 0; x < 500; x++)
    	{
    		for(int y = 0; y < 500; y++)
    		{
    	videomem[x + y * ddsd.lPitch] = _RGB(50,0,0); // warnings are on this line
    		}
    	}
    
    	hret = lpddsback->Unlock(NULL);
    	if(hret != DD_OK)
    	{		
    		ERR(hret);
    		return 1;
    	}
    
    	hret = lpddsprimary->Flip(NULL,DDFLIP_WAIT);
    	if(hret != DD_OK)
    	{		
    		ERR(hret);
    		return 1;
    	}
    
    	return 0;
    }

  5. #5
    bobish
    Guest
    from what was posted it looks like its suposed to draw pixels. However it seems that the pixels are not being drawn. I had that problem (and am still having) when learning direct draw to so I fell your pain. That doesn't i have the energy to download ad unzip so do us all a favor okay.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tic Tac Toe Comp Move help
    By swgh in forum C++ Programming
    Replies: 5
    Last Post: 09-24-2008, 11:05 AM
  2. Loop seg error
    By Zishaan in forum Game Programming
    Replies: 2
    Last Post: 03-28-2007, 01:27 PM
  3. Forced moves trouble!!
    By Zishaan in forum Game Programming
    Replies: 0
    Last Post: 03-27-2007, 06:57 PM
  4. Help with my draughts game
    By Zishaan in forum C++ Programming
    Replies: 9
    Last Post: 03-24-2007, 07:33 AM
  5. Need another set of eyes for debugging...
    By jstn in forum C Programming
    Replies: 5
    Last Post: 06-04-2002, 10:55 AM