Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,699 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
video_switch returning odd results #10888
11/07/02 08:57
11/07/02 08:57

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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

Re: video_switch returning odd results #10889
11/12/02 08:17
11/12/02 08:17
Joined: Jun 2002
Posts: 248
NZ
mudhole Offline
Member
mudhole  Offline
Member

Joined: Jun 2002
Posts: 248
NZ
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();
}



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

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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.


Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1