Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (TedMar), 1,420 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | chip programmers | 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