Author Topic: Platform Independant Dingoo SDK  (Read 52934 times)

flatmush (OP)

  • *
  • Posts: 283
Re: Platform Independant Dingoo SDK
« Reply #30 on: April 08, 2010, 07:03:20 pm »
Doesn't matter, it just compiles a copy of the source if you have it but I didn't release it yet, all the headers and the lib are there though so you can still compile fgl stuff.

Harteex

  • * Administrator
  • Posts: 709
    • Harteex Productions
Re: Platform Independant Dingoo SDK
« Reply #31 on: April 09, 2010, 08:52:08 pm »
I just changed the font functions a bit, you can now specify the transparent color.
Anyone using the font functions will have to replace gfx_texture to gfx_font and use the gfx_font_load function instead to load it.

flatmush (OP)

  • *
  • Posts: 283
Re: Platform Independant Dingoo SDK
« Reply #32 on: April 12, 2010, 04:22:49 pm »
OK, everyone who hasn't updated yet should update to r94, it's a big change as you can see on the google-code (I'm not repeating stuff here). The links at the top are updated.

Shin-NiL

  • *
  • Posts: 375
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: Platform Independant Dingoo SDK
« Reply #33 on: April 12, 2010, 05:06:25 pm »

@Shin-NiL: You can also compile with this windows-toolchain stuff for Dingux. I have an early port of SDL compiled for this. But this is only tested when compiling for Dingux. I don't know if this SDL lib also works with flatmush-SDK. If someone is interested in, tell me, i will share it.

Thank you SiENcE, I did not know that  ;)

Did you mean a SDL for native development? It would be so great, I'm interested!

SiENcE

  • **
  • Posts: 653
    • Crank Gaming (Dingux Apps)
Re: Platform Independant Dingoo SDK
« Reply #34 on: April 12, 2010, 11:07:54 pm »
Mh. Currently this is only tested on Dingux. I don't know how much Flatmush's SDK uses from this Toolchain. Header files, libs ...? If not it SDL must be compiled against the SDK and not the Toolchain.

flatmush (OP)

  • *
  • Posts: 283
Re: Platform Independant Dingoo SDK
« Reply #35 on: April 12, 2010, 11:48:19 pm »
The SDK only uses the compiler tools and libgcc from the toolchain, not any of the headers or other libs.

SiENcE

  • **
  • Posts: 653
    • Crank Gaming (Dingux Apps)
Re: Platform Independant Dingoo SDK
« Reply #36 on: April 13, 2010, 09:10:16 am »
Ok. So it has to be tested.

flatmush (OP)

  • *
  • Posts: 283
Re: Platform Independant Dingoo SDK
« Reply #37 on: April 18, 2010, 12:55:55 am »
Critical bugfix, all users should update.

yefeng

Re: Platform Independant Dingoo SDK
« Reply #38 on: April 23, 2010, 05:14:20 am »
Well,the color of font is white,I think it'll be nice that adding a argument "gfx_color inColor" to function "gfx_font_print" , ;)
Code: [Select]
void gfx_font_print(int16_t inX, int16_t inY, gfx_font* inFont, char* inString, gfx_color inColor) {
if((inFont == NULL) || (inString == NULL) || (inFont->texture == NULL))
return;

uint16_t* tempBuffer = gfx_render_target->address;
uint16_t* tempFont = inFont->texture->address;
uint8_t*  tempChar;
int16_t   tempX = inX;
int16_t   tempY = inY;
uintptr_t i, j, x, y;

for(tempChar = (uint8_t*)inString; *tempChar != '\0'; tempChar++) {
if(*tempChar == ' ') {
tempX += (inFont->texture->width >> 4);
continue;
}
if(*tempChar == '\t') {
tempX += ((inFont->texture->width >> 4) << 2);
continue;
}
if(*tempChar == '\r') {
tempX = inX;
continue;
}
if(*tempChar == '\n') {
tempX = inX;
tempY += (inFont->texture->height >> 4);
continue;
}
for(j = ((*tempChar >> 4) * (inFont->texture->height >> 4)), y = tempY; (j < (((*tempChar >> 4) + 1) * (inFont->texture->height >> 4))) && (y < gfx_render_target->height); j++, y++) {
for(i = ((*tempChar & 0x0F) * (inFont->texture->width >> 4)), x = tempX; (i < (((*tempChar & 0x0F) + 1) * (inFont->texture->width >> 4))) && (x < gfx_render_target->width); i++, x++) {
if (tempFont[(j * inFont->texture->width) + i] != inFont->colorKey) {
tempBuffer[(y * gfx_render_target->width) + x] = ~(tempFont[(j * inFont->texture->width) + i]) | inColor;
}
}
}
tempX += (inFont->texture->width >> 4);
}
}

« Last Edit: April 23, 2010, 05:23:41 am by yefeng »

flatmush (OP)

  • *
  • Posts: 283
Re: Platform Independant Dingoo SDK
« Reply #39 on: April 23, 2010, 07:41:49 am »
The fonts thing is currently made to support mult-colored bitmap fonts using color key for the background, if you want to change the source to have the possibility to do colorized fonts too then you can post the code and I'll add it to the SDK. I'll also add an issue ticket on this incase anybody else wants to fix it.

yefeng

Re: Platform Independant Dingoo SDK
« Reply #40 on: April 23, 2010, 10:36:22 am »

Here is the screenshot!


Compiled app file with source code download:
http://www.file-pasta.com/file/0/ColorFont.zip

Two sml LIB source file have a small changed:
1.graphics.h
http://www.file-pasta.com/file/0/graphics.h
2.graphics.c
http://www.file-pasta.com/file/0/graphics.c


Harteex

  • * Administrator
  • Posts: 709
    • Harteex Productions
Re: Platform Independant Dingoo SDK
« Reply #41 on: April 23, 2010, 09:36:55 pm »
To explain the problem, some fonts already contain colors in the actual tga's. Those fonts won't really work that well with this code.

So I guess our options are:

1. Make a new set of functions which accepts colors, for example gfx_font_print_color()
or
2. Add a function gfx_font_set_color() / gfx_font_clear_color() which controls the color with the normal font functions

comatsu

  • Guest
Re: Platform Independant Dingoo SDK
« Reply #42 on: May 18, 2010, 01:24:51 pm »
So I've installed Cygwin and the SDK following the instructions in the txt.
However when I try to built the samples included with the SDK I get an error: "cannot find -lsml"

If I try to build the program in the 'test' folder I get another error: "unrecognized option '-Wextra'"

Could anyone tell me what im doing wrong please?
« Last Edit: May 18, 2010, 01:27:08 pm by comatsu »

Harteex

  • * Administrator
  • Posts: 709
    • Harteex Productions
Re: Platform Independant Dingoo SDK
« Reply #43 on: May 18, 2010, 01:52:50 pm »
If it can't find sml it sounds like the installation didn't work out properly.. maybe you could post your install log.
./install &> log.txt

comatsu

  • Guest
Re: Platform Independant Dingoo SDK
« Reply #44 on: May 18, 2010, 01:57:57 pm »
Install log (bit long).  If i should post the txt file instead let me know and i'll remove this.
[log removed]

Problem solved. Thanks Harteex.
For anyone having the same problem make sure you are don't have an older version of the mipsel compilers installed.
« Last Edit: May 18, 2010, 02:32:29 pm by comatsu »

 

Post a new topic