Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, AndrewAMD), 877 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Invalid Function Arguments?? #411394
11/16/12 09:19
11/16/12 09:19
Joined: Nov 2011
Posts: 139
India
Yashas Offline OP
Member
Yashas  Offline OP
Member

Joined: Nov 2011
Posts: 139
India
Code:
void GoGoGo ()
{
	BMAP * TEMP;
	int i = integer(random(6));
	TEMP = &SpeedRunShapes[i];
	pan_setwindow(SpeedRun_ControlsRunning,1,200,150,200,200,TEMP,200,200);
}



I get Invalid Function Arguments in a MessageBox.
Pointer is initialized with a address of a Bitmap.

The Error is caused by "pan_setwindow" function.
Thanks


Keep smiling laugh
http://translation.babylon.com/ - Translate many languages
Re: Invalid Function Arguments?? [Re: Yashas] #411408
11/16/12 11:46
11/16/12 11:46
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
I see three possibilities:
1. TEMP should be the address of a bitmap but in fact isn't
2. SpeedRun_ControlsRunning isn't a valid panel.
3. There is not yet a window at panel index is. In this case you should replace the 1 with a 0 in oder to create a new window.


Always learn from history, to be sure you make the same mistakes again...
Re: Invalid Function Arguments?? [Re: Uhrwerk] #411425
11/16/12 15:18
11/16/12 15:18
Joined: Nov 2011
Posts: 139
India
Yashas Offline OP
Member
Yashas  Offline OP
Member

Joined: Nov 2011
Posts: 139
India
Originally Posted By: Uhrwerk
I see three possibilities:
1. TEMP should be the address of a bitmap but in fact isn't
2. SpeedRun_ControlsRunning isn't a valid panel.
3. There is not yet a window at panel index is. In this case you should replace the 1 with a 0 in oder to create a new window.


All the conditions you told exist.

Some more information:
Code:
BMAP * SpeedRunShapes[10];
SpeedRunShapes[0] = "shape1.tga";
SpeedRunShapes[1] = "shape2.tga";
SpeedRunShapes[2] = "shape3.tga";
SpeedRunShapes[3] = "shape4.tga";
SpeedRunShapes[4] = "shape5.tga";
SpeedRunShapes[5] = "shape6.tga";



Code:
PANEL * SpeedRun_ControlsRunning =
{
	layer = 12;
	digits(10,10,"Time Remaining:%2.f","Arial#30b",1,Time);
	digits(300,10,"Score:%2.f","Arial#30b",1,Score);
	digits(170,130,"Remember this shape","Arial#30b",1,0);
	window(200,150,200,200,"shape1.tga",200,200);
	flags = TRANSLUCENT;	
}



Keep smiling laugh
http://translation.babylon.com/ - Translate many languages
Re: Invalid Function Arguments?? [Re: Yashas] #411426
11/16/12 15:22
11/16/12 15:22
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
SpeedRunShapes is an array of bitmap pointers. You cannot assign character arrays to its elements.

http://www.conitec.net/beta/abmap_create.htm


Always learn from history, to be sure you make the same mistakes again...
Re: Invalid Function Arguments?? [Re: Yashas] #411427
11/16/12 15:23
11/16/12 15:23
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Code:
1. TEMP should be the address of a bitmap but in fact isn't

wink
Where do you declare the bmaps?
Code:
SpeedRunShapes[0] = "shape1.tga";
SpeedRunShapes[1] = "shape2.tga";
SpeedRunShapes[2] = "shape3.tga";
SpeedRunShapes[3] = "shape4.tga";
SpeedRunShapes[4] = "shape5.tga";
SpeedRunShapes[5] = "shape6.tga";



If you do them outside of a function, then that is the problem. You can't do that wink . You need to create them inside a function (using bmap_create).

Re: Invalid Function Arguments?? [Re: 3dgs_snake] #411428
11/16/12 15:38
11/16/12 15:38
Joined: Nov 2011
Posts: 139
India
Yashas Offline OP
Member
Yashas  Offline OP
Member

Joined: Nov 2011
Posts: 139
India
Ofc , I declared it inside the function(main) ,for the sake of reducing the size of my post I just copied the snips that were the part of the problem.


Keep smiling laugh
http://translation.babylon.com/ - Translate many languages
Re: Invalid Function Arguments?? [Re: Yashas] #411429
11/16/12 16:02
11/16/12 16:02
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
It doesn't matter where you declare them. You can't assign char arrays to bitmap pointers.


Always learn from history, to be sure you make the same mistakes again...
Re: Invalid Function Arguments?? [Re: Uhrwerk] #411437
11/16/12 16:52
11/16/12 16:52
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
According to the error message my interpretation is as follows..
You gave a addres to a pointer in the arguments list by using & (address of)
.. I see you initialised the pointer as an array but passed its address
instead try not using the pointer initializing but instead this
bmap array[10] and also dont pass address of in =&bla[]


Compulsive compiler
Re: Invalid Function Arguments?? [Re: Wjbender] #411441
11/16/12 17:14
11/16/12 17:14
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
if you do it inside a function you have to use - as 3dgs_snake already said - 'bmap_create' like this:
Code:
SpeedRunShapes[0] = bmap_create("shape1.tga");


Last edited by Kartoffel; 11/16/12 17:15.

POTATO-MAN saves the day! - Random
Re: Invalid Function Arguments?? [Re: Kartoffel] #411479
11/17/12 02:38
11/17/12 02:38
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
After doing as Kartoffel (and 3dgs_snake) have suggested,
you MIGHT also need change your TEMP allocation to
Code:
TEMP = SpeedRunShapes[i];

ie: remove the "&" addressof operator. The array already contains pointers(addresses)...

[EDIT] Because if you DO use the '&', you are passing the address
to the pointer, NOT the address of the actual bmap 'struct'.



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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