[Interested?] OldSchool Library
Hi! :)
Sorry for the double post....
Just to inform I released a modified version of OSLib (called OSLib MOD).
More info here:
http://www.sakya.it/forums/viewtopic.php?f=7&t=10
Changelog:
-Added: oslSetReadKeysFunction(int (*sceCtrlReadBufferPositive)(SceCtrlData *pad_data, int count));
You can pass to it a function from a kernel prx, so you'll be able to read all buttons (VOLUME_UP, NOTE...)
oslUnsetReadKeysFunction();
-Added: All USB.c functions now works
-Added: OSL_VERSION
-Added: oslSetHoldForAnalog
-Added: support for intraFont.
-Added: Dialogs (message, error and net conf)
-Added: On Screen Keyboard
-Added: Save and load
-Fixed: Tagged MP3 and ATRAC3+ now works
-Fixed: osl_keys->analogToDPadSensivity now works correctly
Download: http://www.sakya.it/OSLib_MOD/downloads ... _1_0_0.rar
Source download: http://www.sakya.it/OSLib_MOD/downloads ... _0_src.rar
Documentation: http://www.sakya.it/OSLib_MOD/doc/html
Ciaooo
Sakya
Sorry for the double post....
Just to inform I released a modified version of OSLib (called OSLib MOD).
More info here:
http://www.sakya.it/forums/viewtopic.php?f=7&t=10
Changelog:
-Added: oslSetReadKeysFunction(int (*sceCtrlReadBufferPositive)(SceCtrlData *pad_data, int count));
You can pass to it a function from a kernel prx, so you'll be able to read all buttons (VOLUME_UP, NOTE...)
oslUnsetReadKeysFunction();
-Added: All USB.c functions now works
-Added: OSL_VERSION
-Added: oslSetHoldForAnalog
-Added: support for intraFont.
-Added: Dialogs (message, error and net conf)
-Added: On Screen Keyboard
-Added: Save and load
-Fixed: Tagged MP3 and ATRAC3+ now works
-Fixed: osl_keys->analogToDPadSensivity now works correctly
Download: http://www.sakya.it/OSLib_MOD/downloads ... _1_0_0.rar
Source download: http://www.sakya.it/OSLib_MOD/downloads ... _0_src.rar
Documentation: http://www.sakya.it/OSLib_MOD/doc/html
Ciaooo
Sakya
Last edited by sakya on Tue Apr 15, 2008 11:21 pm, edited 1 time in total.
-
- Posts: 11
- Joined: Fri Mar 02, 2007 5:06 pm
- Contact:
-
- Posts: 87
- Joined: Mon Jan 08, 2007 12:16 pm
- Location: Australia
Hi! :)
I just released a bugfix version 1.0.1. ;)
More details here:
http://www.sakya.it/forums/viewtopic.php?f=7&t=13
Ciaooo
Sakya
Thanks.reefbarman wrote:i love oslib and use it in most of my projects and this modified version jsut makes it so much better please keep up the good work, and keep the updates coming
I just released a bugfix version 1.0.1. ;)
More details here:
http://www.sakya.it/forums/viewtopic.php?f=7&t=13
Ciaooo
Sakya
-
- Posts: 87
- Joined: Mon Jan 08, 2007 12:16 pm
- Location: Australia
hi i just tried your oslib_mod in my app that already contained the original oslib and just did a complete swap, but after doing so i got some really strange things happening in my app the app has a cursor that moved by itself around the screen where it shouldn't without user control, this doesn't happen with the standard oslibsakya wrote:Hi! :)Thanks.reefbarman wrote:i love oslib and use it in most of my projects and this modified version jsut makes it so much better please keep up the good work, and keep the updates coming
I just released a bugfix version 1.0.1. ;)
More details here:
http://www.sakya.it/forums/viewtopic.php?f=7&t=13
Ciaooo
Sakya
what change were made to the original functions that may cause the side affects im seeing?
thanks
Hi! :)
Can you post some code, please?
Ciaooo
Sakya
I don't know, I made some changes to controls but I don't have problems.reefbarman wrote:i got some really strange things happening in my app the app has a cursor that moved by itself around the screen where it shouldn't without user control, this doesn't happen with the standard oslib
Can you post some code, please?
Ciaooo
Sakya
OSLib and freetype
Hi,
I just tried to render text with OSLib, but the fonts that came with OSLib didn't satisfy me. So I decided to try freetype on OSLib. Now I've some results but it doesn't work very well. The capitals begin to flicker after some seconds and I can't find a reason for this strange behaviour.
Here some Code:
I hope someone or maybe even brunni can help me, it's really important
I just tried to render text with OSLib, but the fonts that came with OSLib didn't satisfy me. So I decided to try freetype on OSLib. Now I've some results but it doesn't work very well. The capitals begin to flicker after some seconds and I can't find a reason for this strange behaviour.
Here some Code:
Code: Select all
OSL_IMAGE* FontEngine::RenderString(std::string str, FE_Font* font, RenderColor color)
{
if(!font->init)
{
//return new OSL_IMAGE;
}
OSL_IMAGE* img;
std::vector<OSL_IMAGE*> Images;
//FT_GlyphSlot slot = font->face->glyph; // a small shortcut
int pen_x = 0;
//unsigned int n;
for (unsigned int n = 0; n < str.length(); n++ )
{
FT_Load_Glyph( font->face, FT_Get_Char_Index( font->face, str.at(n) ), FT_LOAD_DEFAULT );
//continue;
FT_Glyph glyph;
FT_Get_Glyph( font->face->glyph, &glyph );
// throw std::runtime_error("FT_Get_Glyph failed");
//Convert the glyph to a bitmap.
FT_Glyph_To_Bitmap( &glyph, ft_render_mode_normal, 0, 1 );
FT_BitmapGlyph bitmap_glyph = (FT_BitmapGlyph)glyph;
//This reference will make accessing the bitmap easier
FT_Bitmap& bitmap=bitmap_glyph->bitmap;
//Use our helper function to get the widths of
//the bitmap data that we will need in order to create
//our texture.
int width = next_p2( bitmap.width );
int height = next_p2( bitmap.rows );
//Allocate memory for the texture data.
img = oslCreateImage(width, height, OSL_IN_RAM, OSL_PF_8888);
oslLockImage(img);
//Here we fill in the data for the expanded bitmap.
//Notice that we are using two channel bitmap (one for
//luminocity and one for alpha), but we assign
//both luminocity and alpha to the value that we
//find in the FreeType bitmap.
//We use the ?: operator so that value which we use
//will be 0 if we are in the padding zone, and whatever
//is the the Freetype bitmap otherwise.
int *ptr = (int *)img->data;
for(int j=0; j <height;j++)
{
for(int i=0; i < width; i++)
{
float alpha = (i>=bitmap.width || j>=bitmap.rows) ?
0 : bitmap.buffer[i + bitmap.width*j];
alpha /= 255 ;
//fprintf(stderr, "%i ", int(alpha));
*ptr++ = RGBA(color.col.r, color.col.g, color.col.b, int(color.col.a * alpha));
}
//fprintf(stderr, "\n");
}// load glyph image into the slot (erase previous one)
oslUnlockImage(img);
//oslDrawImageXY(img, pen_x, 0);
//pen_x += img->sizeX;
Images.push_back(img);
}
img = NULL;
int width = 0;
int height = 0;
for(unsigned int g = 0; g < Images.size(); g++)
{
width += Images[g]->sizeX;
if(Images[g]->sizeY > height)
{
height = Images[g]->sizeY;
}
}
//fprintf(stderr, "width: %i, height: %i\n", width, height);
img = oslCreateImage(width, height, OSL_IN_VRAM, OSL_PF_8888);
oslClearImage(img, RGBA(0, 0, 0, 0));
oslSetAlphaWrite(OSL_FXAW_SET, 255, 0);
//But do not draw transparent pixels (only those greater than 0).
oslSetAlphaTest(OSL_FXAT_GREATER, 0);
oslSetDrawBuffer(img);
int posx = 0;
for(unsigned int g = 0; g < Images.size(); g++)
{
oslDrawImageXY(Images[g], posx, 0);
posx += Images[g]->sizeY;
oslDeleteImage(Images[g]);
}
oslSetDrawBuffer(OSL_DEFAULT_BUFFER);
oslMoveImageTo( img, OSL_IN_RAM);
return img;
}
Sorry for my bad English... I'm still learning
-
- Posts: 376
- Joined: Wed May 10, 2006 11:31 pm