#130469 - Azenris - Sun Jun 03, 2007 10:32 pm
NDS
Ive been trying to read through a few sites on including data but i feel as though im just confusing myself more. Hoping you can direct me to a simple explanation or point out whats exactly going on.
Im using the makefile included with devkitpro located in the examples\nds\templates\arm9 folder.
I have had my game working but I started reading including data in .h files was bad practice and this is what I was doing (had the tile data in it).
So now i've decided I wanna do it the proper way. Which is something I dont quite get.
===============================================
the file was originally blocks.h and included in the main.cpp.
it included data such as
so here is where I started trying things. I removed the
#ifndef _INCLUDE_BLOCKS_H
#define _INCLUDE_BLOCKS_H
#endif
and renamed it blocks.cpp and placed it in the source folder.
I then made another file in the include folder, blocks.h which had
etc...
I included the blocks.h in the main.cpp.
I attempted to compile assuming the blocks.cpp would be made an object file or something and linked in, but I get the error i have not declared them. redBlock1 not declared. etc
===============================================
what on earth am I doing here :)
P.S Not sure where to post this, I just saw beginner section and thought it was right for me!
Last edited by Azenris on Mon Jun 04, 2007 3:39 pm; edited 1 time in total
Ive been trying to read through a few sites on including data but i feel as though im just confusing myself more. Hoping you can direct me to a simple explanation or point out whats exactly going on.
Im using the makefile included with devkitpro located in the examples\nds\templates\arm9 folder.
I have had my game working but I started reading including data in .h files was bad practice and this is what I was doing (had the tile data in it).
So now i've decided I wanna do it the proper way. Which is something I dont quite get.
===============================================
the file was originally blocks.h and included in the main.cpp.
it included data such as
Code: |
const u8 redBlock1[64] = { ... }; const u8 yellowBlock1[64] = { ... }; |
so here is where I started trying things. I removed the
#ifndef _INCLUDE_BLOCKS_H
#define _INCLUDE_BLOCKS_H
#endif
and renamed it blocks.cpp and placed it in the source folder.
I then made another file in the include folder, blocks.h which had
Code: |
extern const u8 redBlock1[]; extern const u8 yellowBlock1[]; extern const u8 greenBlock1[]; extern const u8 blueBlock1[]; extern const u8 purpleBlock1[]; extern const u8 blackBlock1[]; |
etc...
I included the blocks.h in the main.cpp.
I attempted to compile assuming the blocks.cpp would be made an object file or something and linked in, but I get the error i have not declared them. redBlock1 not declared. etc
===============================================
what on earth am I doing here :)
P.S Not sure where to post this, I just saw beginner section and thought it was right for me!
Last edited by Azenris on Mon Jun 04, 2007 3:39 pm; edited 1 time in total