Thread: Strange problem

  1. #1
    Registered User ~Kyo~'s Avatar
    Join Date
    Jun 2004
    Posts
    320

    Strange problem

    Hello all I have this code it works fine on both my computers but my when my friend trys to run my game it has a problem and would crash if not for the try catch code. This is the code that my log file is pointing to being the problem although I am not sure if it is that or something else. Any ideas on what might be going wrong would be appreciated.

    taken from source.cpp function ini()
    Code:
    try
    	  {
    		for(int z=0;z<256;z++)
    		{
    			int alpha = z;
    			for(int y=0;y<256;y++)
    			{
    				for(int x=0;x<256;x++)
    				{
    					MyLightMap[x][y][z] = ((x*alpha)+((y*(255-alpha))))/256;
    				}
    			}
    			if(z%3 == 0)  //some graphics for the loading process
    			{
    				count++;
    				int ncount = count*1.171875;
    				char LOADTEXT[16] = "LOADING... ###%";// using 11 12 13
    				LOADTEXT[11] = '0' + ncount/100;
    				LOADTEXT[12] = '0' + (ncount%100)/10;
    				LOADTEXT[13] = '0' + ncount%10;
    				blit(LAYOUT,BUFFER,0,0,0,0,scrx,scry);
    				try  //in case font didnt load properly
    				{
    					textout(BUFFER,big_font,LOADTEXT,scrx/2,scry/2,makecol(z,z,z));
    				}
    				catch(...)
    				{
    					textout(BUFFER,font,LOADTEXT,scrx/2,scry/2,makecol(z,z,z));
    				}
    				blit(BUFFER,screen,0,0,0,0,scrx,scry);
    			}
    		}
    		if(DEBUGMODE)DEBUG<<"Blend Mode Enabled OK"<<endl;
    	  }
    	  catch(...)
    	  {
    		if(DEBUGMODE)DEBUG<<"Blend Mode Encountered a problem and was unable to initalize."<<endl;
    		DRAW_LIGHTS = false;
    	  }
    To see for yourself you can download the program and support files at ftp://24.0.62.164/
    Also keep in mind that it does work on my computers but not on his.
    Use at your own risk etc etc. It is about 5 megs so it might take a little while.

    edit: the game crashes later on still on his comp but I think if I can see what is wrong here I can fix it in the other spots.
    Last edited by ~Kyo~; 02-15-2006 at 03:57 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strange problem
    By h3ro in forum Windows Programming
    Replies: 2
    Last Post: 09-02-2008, 12:14 AM
  2. Strange problem with GETLINE
    By wco5002 in forum C++ Programming
    Replies: 13
    Last Post: 07-07-2008, 09:57 AM
  3. Strange problem
    By G4B3 in forum C Programming
    Replies: 6
    Last Post: 05-14-2008, 02:07 PM
  4. Strange problem with classes in header files
    By samGwilliam in forum C++ Programming
    Replies: 2
    Last Post: 02-29-2008, 04:55 AM