It is currently 28 Apr 2024, 03:38
   
Text Size

C question -magic related

Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

Re: C question -magic related

Postby jatill » 28 Apr 2009, 12:15

Snacko wrote:@jatill
I've downloaded the latest source files and they're a mess.
Thanks for your kind words as always :/

There's a tons of warning generated, because all the functions aren't defined in the header.
There are some unneeded files like ManalinkEc.asm, ManalinkEc.def and others. Plus if you recoded the karoos into c you should move or delete the *.asm files as the linker is clueless and doesn't know which version it should link to the asm or c one. Same goes for shadow ability.
At first I had no idea what you saying, but then I looked at the source I'm uploading. I didn't realize it was including the old files, since my own bin directory doesn't contain half those file any more. I'll make sure to purge that out for next version.

I'd like to clean up the warnings, but don't know how. What do I have to do? What does it mean to define a function in the header?
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: C question -magic related

Postby Snacko » 28 Apr 2009, 12:23

jatill you're doing good work with the cards, however the end package doesn't even compile!

The missing function is put_card_from_deck_into_hand.

If you use a function before you declare it the compiler doesn't know about it. To fix the warnings for redeclaration of functions you have to add them to manalink.h

You need to declare them meaning
return_value function_name(type1, type2, type2);
you can basically just copy paste the it from the function like
int count_domain(int player, int card);
Code: Select all
/* Our own functions */
void untap_card(int, int);
It's important to keep a clean working source, because currently you need to fix it before it starts working and that's just bad.
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: C question -magic related

Postby jatill » 28 Apr 2009, 12:27

Snacko wrote:jatill you're doing good work with the cards, however the end package doesn't even compile!

The missing function is put_card_from_deck_into_hand.

If you use a function before you declare it the compiler doesn't know about it. To fix the warnings for redeclaration of functions you have to add them to manalink.h

You need to declare them meaning
return_value function_name(type1, type2, type2);
you can basically just copy paste the it from the function like
int count_domain(int player, int card);
Code: Select all
/* Our own functions */
void untap_card(int, int);
It's important to keep a clean working source, because currently you need to fix it before it starts working and that's just bad.
Again, the problem with compiling was because I was appending to my src zip instead of rewriting it each time. I corrected my deploy script and today's version will have source that (hopefully) compiles for people other than myself!

While you're offering advice, how do I create a global variable? I assume I do that in the header somehow, too?
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: C question -magic related

Postby Snacko » 28 Apr 2009, 12:45

Actually you don't need to do it in the header and shouldn't.

In one file you define your variable like:
global int my_global_int;

and in the other files that want to use this variable you do:
extern int my_global_int;

There are also -W* switches to gcc that warn you about common programming mistakes, hover if the code is "badly written" (doesn't follow those rules) it spews a lot of informing warnings.
I can try and fix the source for those switches so they're enforced in the future once you upload the proper files.
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: C question -magic related

Postby gmzombie » 30 Apr 2009, 01:56

with the cards1.dat is there a way to implement it like Harry did for the original skyeditor? What do you think guys?
can I maze of ith your snowstorm?

http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
gmzombie
 
Posts: 857
Joined: 26 Feb 2009, 01:05
Location: Wyoming, Mi
Has thanked: 200 times
Been thanked: 51 times

Previous

Return to Development

Who is online

Users browsing this forum: No registered users and 30 guests


Who is online

In total there are 30 users online :: 0 registered, 0 hidden and 30 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 30 guests

Login Form