i've been wanting to learn C for a while and i've been using Rockbox for a while so, 1+1=2; make a plugin for Rockbox!
i do have programing experience (php mostly) and over the course of 3 days ive run into two problems that i cant figure out.
1) assigning data to a custom data structure
ive created a data structure and can access data from it easily enough but im having problems actually assigning data to begin with
this works but is the unwanted (nearly useless) method
typedef struct{
int width;
int height;
int num_subimg;
int num_subimg_per_row;
int cur_subimg;
} str_sprite;
str_sprite test_var = {1, 2, 3, 4, 5};
rb->splashf(HZ, "width = %d", test_var.width);
and this is the wished for style that should work based on my learning c book and google searches
typedef struct{
int width;
int height;
int num_subimg;
int num_subimg_per_row;
int cur_subimg;
} str_sprite;
str_sprite test_var;
test_var.width = 1;
test_var.height = 2;
test_var.num_subimg = 3;
test_var.num_subimg_per_row = 4;
test_var.cur_subimg = 5;
rb->splashf(HZ, "width = %d", test_var.width);
the error i keep getting is "test_game.c:65: error: parse error before '.' token"
line 65 is: test_var.width = 1;
its probably a stupid 'duh' error but i cant figure it out
2)custom images in plugin
i've tried copying how other plugins use their own images but i cant figure it out. i have edited all the required SOURCES files (i think) and added the images to the directory of apps\plugins\bitmaps\native. i also opened them in photoshop and saved them as 16bit bmp which seems to be the standard. i also followed the naming standard of *plugin name*_*filename*.*width*x*height*x*depth*.bmp
after i compile i get errors to my images missing .h file. due to the fact that i cant find the other images .h files i've concluded they must be created during the compiling process and that my image's .h file is not.
so my question is what do i have to edit to get the compiler to generate the .h file or if i completely got this wrong please explain the whole image thing in rockbox
ps. i already figured out how to manipulate images (used the rockbox logo) already in rockbox, just not my own