I need code to dissasemble.
I'm currently on a hunt for graphics code. I wish to devour all I encounter! Bwahahahaha. (Except for sdl... it gives me stomach cramps.)
Anyway, I/m intrested in going through the source of other peoples games to get a better idea of efficient programming/faster graphics rendering.
Does anybody know of games written in C (preferably with OpenGL) that I could poke through?
Simple things would be best, as I'm not sure I'm capable of deciphering super-large fps games yet.
Thanks!
Anyway, I/m intrested in going through the source of other peoples games to get a better idea of efficient programming/faster graphics rendering.
Does anybody know of games written in C (preferably with OpenGL) that I could poke through?
Simple things would be best, as I'm not sure I'm capable of deciphering super-large fps games yet.
Thanks!
Have a look at OMG entry N0x35C497E
http://www.fax.xmgfree.com
Theres a couple of graphics optimisations there, like the GUI is hard coded for example.
http://www.fax.xmgfree.com
Theres a couple of graphics optimisations there, like the GUI is hard coded for example.
Sir, e^iπ + 1 = 0, hence God exists; reply!
Thanks.
Actually, it doesn't have to be an optimization, any code I can look at/learn from. Ranging from source code for full built games to empty game engines.
Actually, it doesn't have to be an optimization, any code I can look at/learn from. Ranging from source code for full built games to empty game engines.
I think ive recommended it to you before but Nehe.gamedev.net is about as good as you will find for C/C++ OpenGL code. It goes from simple programs up to pretty advanced topics. After that pick up a copy of the Red Book.
And I really enjoyed Brian Greenstones new book on mac game programming.
And I really enjoyed Brian Greenstones new book on mac game programming.
I have the Red Book, actually, and I'm slowly working my way through it.
I also have brian greenstones book, but I've been warned away from using it.
I also have brian greenstones book, but I've been warned away from using it.
Quote:Ranging from source code for full built games to empty game engines.Its the source code of a fully built game engine with levels and resources as well.
Sir, e^iπ + 1 = 0, hence God exists; reply!
unknown Wrote:Its the source code of a fully built game engine with levels and resources as well.
I know.
And wow, that game you sent me the link to does the graphics in a very original style.
The source code for my games can be found on my website:
http://www.sacredsoftware.net/
It probably ranges from decent to completely unreadable, so beware. Infiltration is probably a reasonably good place to start; Water Tower 3D might be a bit more complex than what you're looking for, and Bees and QnDMaze are perhaps too simple.
http://www.sacredsoftware.net/
It probably ranges from decent to completely unreadable, so beware. Infiltration is probably a reasonably good place to start; Water Tower 3D might be a bit more complex than what you're looking for, and Bees and QnDMaze are perhaps too simple.
Actually, I QnDMAze seems awfully complicated, but that's probably because I don't know a scrap of cocoa. 
EDIT : How hard are game engines like "Crystal" to learn and use?

EDIT : How hard are game engines like "Crystal" to learn and use?
While we're at it, here's these. They seem to function but they're hacker-ish.
Which leads me to a question: how come my inline assembler stopped working when I put SDL in? It compiles but produces nonsense results. I can't seem to get asm_blocks to function either.
float ReciprocalSquareRoot(float x)
{
float approx = __frsqrte(x);
return approx * (1.5 - approx * approx * 0.5 * x);
}
// E5 means correct to 5 digits
float SquareRootE5(float x)
{
float result, result2;
if(x == 0.0) return 0.0;
result = __fres(__frsqrte(x));
result2 = result * result;
result += (x - result2) * __frsqrte(result2) * 0.5;
result2 = result * result;
result += (x - result2) * __frsqrte(result2) * 0.5;
}
float vtan(float x, float y)
{
float d = ReciprocalSquareRoot(x * x + y * y);
if(y >= 0.0)
{
if(x >= 0.0)
{
if(x > y) return fasin(y * d);
else return facos(x * d);
}
else
{
if(y > -x) return piOver2 + fasin(-x * d);
else return Pi - fasin(y * d);
}
}
else
{
if(x < 0.0)
{
if(-x > -y) return Pi + fasin(-y * d);
else return oneAndHalfPi - fasin(-x * d);
}
else
{
if(-y > x) return oneAndHalfPi + fasin(x * d);
else return twoPi - fasin(-y * d);
}
}
}
// about 2.3 times faster than 1.0 / a (G3), correct to a few parts in 10^7
float ReciprocalE6(float a)
{
float result;
result = __fres(a);
result += result - result * result * a;
return result;
}
// this is 0.58% accurate from 0°..45° (don't use negative angles)
// the worst case absolute error is about 0.0009
inline float fasin(float x)
{
return x * (1.0089 + 0.2914 * x * x * x);
}
inline float facos(float x)
{
return piOver2 - x * (1.0089 + 0.2914 * x * x * x);
}
// produces incorrect results with SDL
float __fres(float x)
{
// this is just unreal, xcode's inline assembly sucks big ones
asm("fres %1,%0" : "=f" (x) : "f" (x));
return x;
}
// produces incorrect results with SDL
float __frsqrte(float x)
{
asm("frsqrte %1,%0" : "=f" (x) : "f" (x));
return x;
}
Which leads me to a question: how come my inline assembler stopped working when I put SDL in? It compiles but produces nonsense results. I can't seem to get asm_blocks to function either.
float ReciprocalSquareRoot(float x)
{
float approx = __frsqrte(x);
return approx * (1.5 - approx * approx * 0.5 * x);
}
// E5 means correct to 5 digits
float SquareRootE5(float x)
{
float result, result2;
if(x == 0.0) return 0.0;
result = __fres(__frsqrte(x));
result2 = result * result;
result += (x - result2) * __frsqrte(result2) * 0.5;
result2 = result * result;
result += (x - result2) * __frsqrte(result2) * 0.5;
}
float vtan(float x, float y)
{
float d = ReciprocalSquareRoot(x * x + y * y);
if(y >= 0.0)
{
if(x >= 0.0)
{
if(x > y) return fasin(y * d);
else return facos(x * d);
}
else
{
if(y > -x) return piOver2 + fasin(-x * d);
else return Pi - fasin(y * d);
}
}
else
{
if(x < 0.0)
{
if(-x > -y) return Pi + fasin(-y * d);
else return oneAndHalfPi - fasin(-x * d);
}
else
{
if(-y > x) return oneAndHalfPi + fasin(x * d);
else return twoPi - fasin(-y * d);
}
}
}
// about 2.3 times faster than 1.0 / a (G3), correct to a few parts in 10^7
float ReciprocalE6(float a)
{
float result;
result = __fres(a);
result += result - result * result * a;
return result;
}
// this is 0.58% accurate from 0°..45° (don't use negative angles)
// the worst case absolute error is about 0.0009
inline float fasin(float x)
{
return x * (1.0089 + 0.2914 * x * x * x);
}
inline float facos(float x)
{
return piOver2 - x * (1.0089 + 0.2914 * x * x * x);
}
// produces incorrect results with SDL
float __fres(float x)
{
// this is just unreal, xcode's inline assembly sucks big ones
asm("fres %1,%0" : "=f" (x) : "f" (x));
return x;
}
// produces incorrect results with SDL
float __frsqrte(float x)
{
asm("frsqrte %1,%0" : "=f" (x) : "f" (x));
return x;
}
#include <ppc_intrinsics.h> to get official apple-supported equivalents to your __fres and __frsqrte functions, amongst others.
'course, in the brave new world of Intel, they perhaps don't hold as much pull
'course, in the brave new world of Intel, they perhaps don't hold as much pull
omg it worked. This is better than sex.
I just sifted through the documentation for that and I still can't find it.
TY!
I just sifted through the documentation for that and I still can't find it.
TY!

