![]() |
|
Alien 8 - Source code released |
Ignacio
Member #1,703
December 2001
![]() |
Hi all! |
SiegeLord
Member #7,827
October 2006
![]() |
Thanks for releasing the source! I had to change the code in a few places to make it compile, but otherwise it worked flawlessly under Linux. EDIT: Here are the two changes (well there was the third one, but that is to define the platform, so that was normal). I had to expand these conditionals, because the left side could not be resolved by gcc. On line 2785 in juego.c (dato==D_X?movs[f].m0:movs[f].m1)=(dif<0?-1:1); I changed it to: if(dato==D_X) movs[f].m0 = (dif<0?-1:1); else movs[f].m1 = (dif<0?-1:1); and on line 2812 in juego.c (dato==D_X?movs[f].m0:movs[f].m1)=dif; changed to if(dato==D_X) movs[f].m0 = dif; else movs[f].m1;
"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Peter Hull
Member #1,136
March 2001
|
I've built a Mac version too - it was one of the easier 'conversions' It works OK but I need to modify it slightly to avoid writing its config files into the executable bundle. Pete
|
Neil Walker
Member #210
April 2000
![]() |
I don't know why linux didn't work as he's using mingw, which should be the same. Just remember though (unless he's forgotten!) that the encryption code for generating high-score entries is deleted from the source code. Unfortunately it will always be that case for source code releases/conversions supplying source code as we don't want our algorithm know. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Peter Hull
Member #1,136
March 2001
|
AFAIK, (a?b:c) isn't an lvalue in standard C but it is in C++. However in GCC it is even in C. I don't know why SiegLord's didn't work - maybe he has a different version of gcc. Pete
|
SiegeLord
Member #7,827
October 2006
![]() |
My gcc version is 4.2.3, if that helps. I did compile the thing in Code::Blocks, but even doing something like 'gcc test.c' with test.c being: int main() { int a,b; (1 ? a : b) = 1; return 0; } still throws the error, so it isn't anything special that C::B does. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
James Stanley
Member #7,275
May 2006
![]() |
Quote: Unfortunately it will always be that case for source code releases/conversions supplying source code as we don't want our algorithm know.
Security by obscurity ain't security. EDIT: |
OICW
Member #4,069
November 2003
![]() |
AFAIK ternary operator can be used for assining value or comparing. So determining which value should be assigned through ternary operator is quite weird and I wonder why it worked. Quote: AFAIK, (a?b:c) isn't an lvalue in standard C but it is in C++. However in GCC it is even in C. I don't know why SiegLord's didn't work - maybe he has a different version of gcc. That depends on C standard, there's difference between ANSI C and C99. I can't recall which one is it, but one allows C++ like constructs, for example for (int i = 0; i < 10; i++) printf("i = %d", i); while the other isn't. I think that the benevolent one is ANSI C but I'm not sure about that. [My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
Vanneto
Member #8,643
May 2007
|
The C99 standard supports initializing variables in for() loops AFAIK. In capitalist America bank robs you. |
OICW
Member #4,069
November 2003
![]() |
Vanneto: nope, this is what compiler threw at me when I compiled the code above (for cycle): [My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
Matthew Leverton
Supreme Loser
January 1999
![]() |
The error message implies you aren't using C99. |
OICW
Member #4,069
November 2003
![]() |
Oh well, then it's the ANSI C that forbids it. [My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
Neil Walker
Member #210
April 2000
![]() |
Quote:
Security by obscurity ain't security. Unless it's just the key being obscured, but you make it sound like the algorithm is the secret part. If the algorithm hasn't been reviewed by most of the cryptographic community, it can't be considered secure. I never said it was secure. Giving somebody the key to your cake cupboard makes them more like to eat them then not. It's simply to stop most people who play our games from generating their own codes and spoiling the highscore tables. The codes generated are both lightly encrypted and contain key data that makes it obvious when they've cheated by using memory trainers (for the games that don't have anti-trainer code in), so cracking it might not necessarily give you a good code Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Ignacio
Member #1,703
December 2001
![]() |
Hi there, about the lvalue stuff, I thought it was standard C. If it's not, of it it depends on the version, I'll just try to avoid that on my future games |
|