|
2 registered members (steyr, alibaba),
534
guests, and 4
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Gamestudio 7.84 public beta
[Re: sPlKe]
#321432
04/29/10 07:12
04/29/10 07:12
|
Joined: Oct 2007
Posts: 5,209 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
|
Hello JCL, I do not know if this is the way it's supposed to be or if this was same in the previous versions, but i have this problem: when i create a lite-c function that takes ENTITY* as a parameter, i cannot pass NULL as that paramater. i.e this function
function some_func(ENTITY* ent,PANEL* pnl){
if(ent!=NULL) // do stuff
else if(pnl!=NULL) //do something else
else return 0;
}
calling it like this, does not compile: some_func(NULL,some_valid_panel); i have to call it like this: ENTITY* temp_ent = NULL; some_func(temp_ent,some_valid_panel);
3333333333
|
|
|
Re: Gamestudio 7.84 public beta
[Re: jcl]
#321439
04/29/10 09:02
04/29/10 09:02
|
Joined: Oct 2007
Posts: 5,209 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
|
yeah it was actually psuedo code, i was just giving and example. I also know it's valid syntax. here is the situation stripped down as much as possbile: so i have this setting:
BMAP* web = "#1024x1024x32";
PANEL* web_panel = {
bmap = web;
flags = SHOW;
}
int update(void* view,ENTITY* ent,PANEL* panel){
return 0;
}
there is that update function which does nothing other than returning 0. if i call the function like this, everything is fine:
void main(){
level_load("");
void* view = NULL;//normally there is function here that either returns NULL or a valid void*
ENTITY* null_ent = NULL;
update(view,null_ent,web_panel);
}
but if i call it like this, it does not compile:
void main(){
level_load("");
void* view = NULL;//normally there is function here that either returns NULL or a valid void*
update(view,NULL,web_panel);
}
it says, update wrong type/number of parameters. EDIT: Stripped the code down a litte more
Last edited by Quadraxas; 04/29/10 09:11.
3333333333
|
|
|
Re: Gamestudio 7.84 public beta
[Re: jcl]
#321444
04/29/10 09:30
04/29/10 09:30
|
Joined: Oct 2007
Posts: 5,209 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
|
right, i didnot know that there was a function called update in there, thanks for the help.
3333333333
|
|
|
|