#7991 - Ninja - Mon Jun 30, 2003 4:06 am
Hi. I have just finished my sprite text support for my game, which uses the last part of the OAM memory, and counts backwards to set up the sprite characters. Basically, the format is similar to TextOut() on the Windows GDI, and the prototype is like this:
u16 SpriteText256(s16 x, s16 y, char* text, u8 length);
x and y are the coordinates to print the text,
text is the text,
length is the length of the character array inputted.
it returns the current sprite number when it finishes to ease the erasure process.
I was going to use a string instead of the last two input parameters, but the compiler didn't seem to think that was such a great idea. It wouldn't accept a string as a data type.
Anyways, the function works just fine. I can print all the text I want until I run out of sprites. :) The problem is that I had intended to print numbers like this:
That's essentially how I would handle this problem in windows. The problem is that I get a million linking errors when trying to compile this code in GCC. It could be that my make file is in error perhaps, but I would have absolutely no clue how to fix that... I am not so good with make files.
I am using the GBA Appwizard in Visual Studio 6.
Any ideas on how I could get this working would be greatly appreciated.
u16 SpriteText256(s16 x, s16 y, char* text, u8 length);
x and y are the coordinates to print the text,
text is the text,
length is the length of the character array inputted.
it returns the current sprite number when it finishes to ease the erasure process.
I was going to use a string instead of the last two input parameters, but the compiler didn't seem to think that was such a great idea. It wouldn't accept a string as a data type.
Anyways, the function works just fine. I can print all the text I want until I run out of sprites. :) The problem is that I had intended to print numbers like this:
Code: |
#include <stdio.h> int framesPerSec = getFPS(); //pseudo-code int length; char buffer[32]; length = sprintf(buffer, "Current FPS: %d", framePerSec); SpriteText256(10, 10, buffer, length); |
That's essentially how I would handle this problem in windows. The problem is that I get a million linking errors when trying to compile this code in GCC. It could be that my make file is in error perhaps, but I would have absolutely no clue how to fix that... I am not so good with make files.
I am using the GBA Appwizard in Visual Studio 6.
Any ideas on how I could get this working would be greatly appreciated.