video_switch returning odd results

Posted By: Anonymous

video_switch returning odd results - 11/07/02 08:57

i am trying to toggle through video modes, and when the player reaches a video mode that he doesn't support, to start over at mode 6 (the whole point of this is I don't want to toggle through those lame lo-res modes).

I am watching for the value returned of video_switch, which supposedly will be 0 if it fails, but it is returning 16. Anyone know what I am doing wrong?

Pete

function game_resolution()
{
var v;
v=video_mode+1;
if v==11 { v=6;}
v=video_switch(v,0,0);
printnum(v); ...this is printing 16!!!!
if cow==0 { breakpoint;} //testing...
InventoryDisplay(0);
_show_resolution();
}
Posted By: mudhole

Re: video_switch returning odd results - 11/12/02 08:17

video_switch does not return a useful value - or at least not one that is documented. It sets the result variable to 1 if the switch was successful and 0 if it was not. The setting of result occurs internally, so you do not need the returned value.

eg.

code:
function game_resolution()
{
var v;
v=video_mode+1;
if v==11 { v=6;}
video_switch(v,0,0); // don't need the return value
printnum(result); // result holds whether the switch was successful
if cow==0 { breakpoint;} //testing...
InventoryDisplay(0);
_show_resolution();
}


Posted By: Anonymous

Re: video_switch returning odd results - 11/12/02 10:37

Video_switch is in fact supposed to return either 0 or the new video mode - the same value it sets Result to. So there should not be a difference. It works when I try it here - so there must be a different reason for your problem.
© 2024 lite-C Forums