|
Post by rayman on Jul 26, 2017 13:42:11 GMT -8
hi @all i use an ft812 with gd3-lib ... load_assets and cmd_loadimage in the same programm dosn't work the asset is 189644byte, the image is a 800x400 background-image.png 129660byte assets 185k image 126k sum 311k the ft812 has 1mb ram, where is the problem follow code broken bg-image GD.begin(~GD_CALIBRATE); GD.cmd_setrotate(0); LOAD_ASSETS(); GD.BitmapHandle(15); GD.cmd_loadimage(ASSETS_END, 0); GD.load("bg001.png"); the follow has broken assets GD.begin(~GD_CALIBRATE); GD.cmd_setrotate(0); LOAD_ASSETS(); GD.BitmapHandle(15); GD.cmd_loadimage(-1, 0); GD.load("bg001.png"); who overwrites the memory when and why
|
|
|
Post by rayman on Jul 26, 2017 21:55:54 GMT -8
... if i pack everything into a asset $> gd2asset -o assets.h -f def.bin BIG_NUMBERS/0.png BIG_NUMBERS/1.png BIG_NUMBERS/2.png BIG_NUMBERS/3.png BIG_NUMBERS/4.png BIG_NUMBERS/5.png BIG_NUMBERS/6.png BIG_NUMBERS/7.png BIG_NUMBERS/R.png graph/teufel.png sym/bat.png sym/sat.png bg001.png Assets report ------------- Header file: assets.h GD3 RAM used: 957644 Output file: def.bin File size: 64505
and use the follew testcode on startup GD.ClearColorRGB(BLACK); GD.Clear(); LOAD_ASSETS(); ...
in main-loop GD.ClearColorRGB(BLACK); GD.Clear(); GD.Begin(BITMAPS); GD.Vertex2ii(0, 0, BG001_HANDLE); ... ... GD.Begin(BITMAPS); GD.Vertex2ii(400-43, 240-64, SAT_HANDLE);
i have this result
|
|
|
Post by lightcalamar on Jul 26, 2017 23:07:20 GMT -8
Could you attach images? In the images for example with GD2Assets the option; gd2assets -f xxxx.gd2 -o xxxx.h mypics.png,format=ARB4 After; GD.begin(); LOAD_ASSETS(); GD.BitmapLayout(ARGB4, 2 * 64, 64); // override the bitmap layoutinsert code here Visit this link; gameduino2.proboards.com/thread/344/convert-bitmap-cells
|
|
|
Post by rayman on Jul 26, 2017 23:53:29 GMT -8
all images for my gd2asset call in the attachment ... images.tgz (137.66 KB) thx for your time
|
|
|
Post by tftlcdcyg on Jul 27, 2017 1:36:40 GMT -8
The "windows-size" is it not the same that "GRAM-size"
The asset converter bring two sizes:
GDX RAM (FT8XX file size)
File size (Windows file size) The corret size to consider in account is RAM-size, so you must combine RAM-size of background image and RAM-size of your prefer group of assets.
Remember this gold Asset key: the file name of each image inside the group of assets, must be start with a letter.
|
|
|
Post by rayman on Jul 27, 2017 1:43:32 GMT -8
i have put all images in one asset for test, the result is Header file: assets.h GD3 RAM used: 957644 <-- 957644 < 1mb Output file: def.bin File size: 64505 and the problme is the same...see my previous post
|
|
|
Post by tftlcdcyg on Jul 27, 2017 3:24:10 GMT -8
Well the png images of 800x480 on FT81X maybe have some limit on the GRAM. In order to avoid such limitation, we can split such kind of images, and introduce in the asset group. int PXL=-390, PXD=400-PXL, SpeedX=40, XMov=1;
void loop() { GD.Clear(); GD.Begin(BITMAPS);
if(XMov==1){ PXL=PXL+SpeedX; PXD=400-PXL; if(PXL>=0){XMov=0;} }
GD.SaveContext(); GD.VertexTranslateX(16*PXL); GD.Vertex2ii(0, 0, 12); //left panel GD.Vertex2ii(360, 170, 0); GD.SaveContext(); GD.ColorRGB(255,0,0); GD.Vertex2ii(390, 110, 9); GD.RestoreContext(); GD.SaveContext(); GD.ColorRGB(0,15,255); GD.Vertex2ii(390, 340, 10); GD.RestoreContext(); GD.SaveContext(); GD.ColorRGB(0,255,0); GD.Vertex2ii(260, 215, 11); GD.RestoreContext(); GD.RestoreContext();
GD.SaveContext(); GD.VertexTranslateX(16*PXD); GD.Vertex2ii(0, 0, 13); //right panel GD.RestoreContext();
GD.swap(); }
Ic1.gd2 (64.48 KB) Ic1.h (1.97 KB)
|
|
|
Post by rayman on Jul 27, 2017 5:40:12 GMT -8
thx, i will try the same times
|
|
|
Post by tftlcdcyg on Jul 27, 2017 5:43:19 GMT -8
In the setup
void setup() { GD.begin();
LOAD_ASSETS(); }
|
|
|
Post by rayman on Jul 27, 2017 6:05:05 GMT -8
thx for help, works now ... can i share my background and reflect in the middle of screen ? that would save the half of memory ... or is that a bad idea because of the draw speed in main loop thx
|
|
|
Post by lightcalamar on Jul 27, 2017 6:08:30 GMT -8
|
|
|
Post by rayman on Jul 27, 2017 6:12:19 GMT -8
In the setup void setup() { GD.begin();
LOAD_ASSETS(); } is right
|
|
|
Post by rayman on Jul 27, 2017 6:14:34 GMT -8
... joop ... very nice
|
|