|
I did something Noobish... Again... |
weapon_S
Member #7,859
October 2006
|
If you don't want to be exposed to sloppy code stop reading... But if I compile with DJGPP it says (or something): This shouldn't happen. I've compiled dozens of times with DJGPP on that computer and never had that problem. It shouldn't be reverting to mode-x.(I run it under windows 95). Also the line where I check SET_GFX_MODE never returns a non-zero. Here's the startup:
And if I make everything so it does work in mode-x I get a traceback of 1 line(!) |
Tobias Dammers
Member #2,604
August 2002
|
Hmmm... quick thought: if((main_field != 0) || (status_field != 0))my_error(__LINE__); I'm not very good with operator precedence, but your original statement may or may not evaluate to: if((main_field != (0 || status_field)) != 0)my_error(__LINE__); which is equivalent to if((main_field != status_field) != 0)my_error(__LINE__); which in turn can be boiled down to if(main_field != status_field)my_error(__LINE__); ...which is very likely to be true. Not sure though, I might have operator precedence wrong. if(main_field || status_field)my_error(__LINE__); ...but even this doesn't make too much sense; it means that if the creation of any of the 2 sub-bitmaps was successful, you throw an error. I think you mean the opposite: if(!main_field || !status_field)my_error(__LINE__); Try this and see if it fixes the error. --- |
weapon_S
Member #7,859
October 2006
|
That was the hilarious typing misstake I was talking about... |
Tobias Dammers
Member #2,604
August 2002
|
If there has been no error, then allegro_error is undefined (i.e. cannot be trusted to tell you anything meaningful). Inspecting allegro_error makes sense only if an allegro function call has failed. --- |
CGamesPlay
Member #2,559
July 2002
|
Not related to the error, but... (main_field != 0) || (status_field != 0) // Equivalent main_field != 0 || status_field != 0 // Furthermore (main_field != (0 || status_field)) != 0 // NOT Equivalent (main_field != status_field) != 0 // Correct reduction main_field != (bool) status_field weapon_S: Just print out the value of your driver name: textprintf_ex(screen, font, 2, 2, -1, 0, "I am using graphics driver %s", gfx_driver->name); readkey();
-- Ryan Patterson - <http://cgamesplay.com/> |
Tobias Dammers
Member #2,604
August 2002
|
Thought I might be wrong... --- |
weapon_S
Member #7,859
October 2006
|
I fixed it (I think). Quote: main_field != (bool) status_field As with many mathematic deductions it's not the same, because if they're both true I get true. Which isn't the case with the original expression,... I think. |
CGamesPlay
Member #2,559
July 2002
|
Quote: I had a function definition at the end of main. I think it confused END_OF_MAIN. Just for your information, that wasn't the problem. -- Ryan Patterson - <http://cgamesplay.com/> |
|