Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (steyr, alibaba), 534 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Gamestudio 7.84 public beta [Re: bart_the_13th] #320640
04/23/10 11:53
04/23/10 11:53
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
you can use frames from another file, other than that no diffrence?


3333333333
Re: Gamestudio 7.84 public beta [Re: Quad] #320734
04/24/10 01:14
04/24/10 01:14
Joined: Jul 2004
Posts: 4,206
Innsbruck, Austria
sPlKe Offline
Expert
sPlKe  Offline
Expert

Joined: Jul 2004
Posts: 4,206
Innsbruck, Austria
bmap problem no longer a problem.

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 Offline
Senior Expert
Quad  Offline
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
Code:
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: Quad] #321435
04/29/10 07:36
04/29/10 07:36
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
This won't compile because you can not just write "// do stuff". You need at least one valid C command between if and else.

Calling a user defined function with NULL for an entity pointer however is absolutely normal, valid syntax.

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 Offline
Senior Expert
Quad  Offline
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:
Code:
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:
Code:
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:

Code:
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: Quad] #321442
04/29/10 09:18
04/29/10 09:18
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
This won't compile either because you named the function "update". However there is already a function "update". You can find it in the header, afuncs.h.

When you have two functions of the same name, lite-C assumes that you're overloading them. Overloaded functions require precisely the parameter list that they are defined with. Otherwise the compiler finds no match in the function list and won't know which of the function to call.

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 Offline
Senior Expert
Quad  Offline
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
Re: Gamestudio 7.84 public beta [Re: Quad] #321447
04/29/10 10:11
04/29/10 10:11
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
(ENTITY*)NULL as parameter should do... although your function name is not chosen very good...

Page 2 of 2 1 2

Moderated by  Matt_Coles 

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