0 registered members (),
677
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Invalid Function Arguments??
#411394
11/16/12 09:19
11/16/12 09:19
|
Joined: Nov 2011
Posts: 139 India
Yashas
OP
Member
|
OP
Member
Joined: Nov 2011
Posts: 139
India
|
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
|
|
|
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
Expert
|
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
OP
Member
|
OP
Member
Joined: Nov 2011
Posts: 139
India
|
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:
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";
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;
}
|
|
|
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
Expert
|
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
Wjbender
User
|
User
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
Expert
|
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:
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
Expert
|
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
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
|
|
|
|