C question -magic related
Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!
PLEASE DO NOT REPORT BUGS HERE!
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
Re: C question -magic related
by jatill » 28 Apr 2009, 12:15
Thanks for your kind words as always :/Snacko wrote:@jatill
I've downloaded the latest source files and they're a mess.
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.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.
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?
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: C question -magic related
by 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);
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);
Re: C question -magic related
by jatill » 28 Apr 2009, 12:27
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!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);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.
- Code: Select all
/* Our own functions */
void untap_card(int, int);
While you're offering advice, how do I create a global variable? I assume I do that in the header somehow, too?
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: C question -magic related
by 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.
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.
Re: C question -magic related
by 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.
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
20 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 30 guests