pls
Junior Member
Posts: 24
|
Post by pls on Jun 22, 2018 12:04:24 GMT -8
Hi, I created two bitmap files for a small space shooting game. One is space ships etc called space.h. The other is a rotating meteor called meteor_assets.h. When I install the two included files I get an error message. When used separately they both work.
It appears that the variable ASSETS_END is defined in both of the include files. How do I combine the two files?
I attached the three files for the game. See error messages below:
-pls
In file included from Peter_Space4.ino:22:0: /tmp/arduino_build_785964/sketch/meteor_assets.h:5:0: warning: "ASSETS_END" redefined [enabled by default] #define ASSETS_END 22176UL ^ In file included from Peter_Space4.ino:21:0: /tmp/arduino_build_785964/sketch/space.h:58:0: note: this is the location of the previous definition #define ASSETS_END 168480UL ^ In file included from Peter_Space4.ino:22:0: /tmp/arduino_build_785964/sketch/meteor_assets.h:227:0: warning: "LOAD_ASSETS" redefined [enabled by default] #define LOAD_ASSETS() (GD.copy(__assets, sizeof(__assets)), GD.loadptr = ASSETS_END) ^ In file included from Peter_Space4.ino:21:0: /tmp/arduino_build_785964/sketch/space.h:1:0: note: this is the location of the previous definition #define LOAD_ASSETS() GD.safeload("space.gd2"); ^
Attachments:Peter_Space4.ino (3.98 KB)
meteor_assets.h (15.16 KB)
space.h (2.33 KB)
|
|
pls
Junior Member
Posts: 24
|
Post by pls on Jun 28, 2018 12:10:34 GMT -8
All, Not finding a method to combine the my 2 bitmap files into one, I decided to use brute force. I made one file with all the bitmaps I needed for my demo into one file and not use the 'cell' method. Since the demo uses only 3 ship bitmaps, 1 laser bitmap and 6 rotating meteor bitmaps I can put all the bitmaps into one file using the gd3asset program and not run out of numbers.
I had thought that I might be able to use the python method suggested in another post ( see gameduino2.proboards.com/thread/127/bitmap-cells-frustration) to convert a block of same size bitmaps into cells and then combine them into a file with the other bitmaps that I needed. But I could not find a way to do this. SO I quit trying. ( I also will have to learn yet another programming language, Python ). I also noticed that in the frogger demo game that some of the bitmaps contained several cells and others had only one cell. But I concluded that the cells were all the same bitmap. I might be wrong about this. If some one has a definitive answer and is willing to share it I would like to know. Anyway I have had fun looking at the python, c++ code and the data sheets. If you are interested I have attached the main code and the converted bitmaps.
pls
Attachments:Peter_Space5.ino (4.26 KB)
space2.h (41.74 KB)
|
|
|
Post by tftlcdcyg on Jun 29, 2018 8:33:10 GMT -8
The assets rotation can be reached through this function:
static void rotate_Center(float a, int CXY) { GD.cmd_translate(F16(CXY),F16(CXY)); GD.cmd_rotate(a); GD.cmd_translate(F16(-CXY), F16(-CXY)); }
|
|
pls
Junior Member
Posts: 24
|
Post by pls on Jun 29, 2018 11:00:53 GMT -8
tftlcdcyg,
Thanks for the information.
pls
|
|