 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
sakya
Joined: 28 Apr 2006 Posts: 190
|
Posted: Tue Apr 15, 2008 8:07 pm Post subject: |
|
|
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/OSLib_MOD_1_0_0.rar
Source download: http://www.sakya.it/OSLib_MOD/downloads/OSLib_MOD_1_0_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 |
|
| Back to top |
|
 |
Drakon
Joined: 08 Apr 2008 Posts: 13 Location: Poznan - Poland
|
Posted: Tue Apr 15, 2008 8:17 pm Post subject: |
|
|
| Loooooooo nice man :> Thanks for sharing :) |
|
| Back to top |
|
 |
BlackShark
Joined: 02 Mar 2007 Posts: 11
|
Posted: Tue Apr 15, 2008 11:53 pm Post subject: |
|
|
nice work, ill check it out now. _________________ Programmer van der C |
|
| Back to top |
|
 |
Sp3ct0r
Joined: 16 Apr 2008 Posts: 3
|
Posted: Wed Apr 16, 2008 9:02 am Post subject: |
|
|
| Sweet! This is just what I needed. Thanks man! :D |
|
| Back to top |
|
 |
reefbarman
Joined: 08 Jan 2007 Posts: 87 Location: Australia
|
Posted: Tue Apr 22, 2008 4:56 pm Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
sakya
Joined: 28 Apr 2006 Posts: 190
|
Posted: Tue Apr 22, 2008 6:02 pm Post subject: |
|
|
Hi! :)
| 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 |
Thanks.
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 |
|
| Back to top |
|
 |
reefbarman
Joined: 08 Jan 2007 Posts: 87 Location: Australia
|
Posted: Thu Apr 24, 2008 6:35 pm Post subject: |
|
|
| sakya wrote: | Hi! :)
| 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 |
Thanks.
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 |
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 oslib
what change were made to the original functions that may cause the side affects im seeing?
thanks |
|
| Back to top |
|
 |
sakya
Joined: 28 Apr 2006 Posts: 190
|
Posted: Fri Apr 25, 2008 9:47 pm Post subject: |
|
|
Hi! :)
| 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 |
I don't know, I made some changes to controls but I don't have problems.
Can you post some code, please?
Ciaooo
Sakya |
|
| Back to top |
|
 |
Alois2992
Joined: 22 Nov 2007 Posts: 7
|
Posted: Mon May 05, 2008 1:16 am Post subject: 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:
| Code: |
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;
}
|
I hope someone or maybe even brunni can help me, it's really important _________________ Sorry for my bad English... I'm still learning |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Mon May 05, 2008 1:24 am Post subject: |
|
|
Using freetype at runtime like that is notoriously slow.
Hence why OSLib and other engines tend to use a bitmap font texture. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|