Homebrew [Release] {beta} sf2dlib - Simple and Fast 2D library (using the GPU)

Cid2mizard

Well-Known Member
Member
Joined
Aug 16, 2007
Messages
401
Trophies
1
Age
43
Location
Maubeuge
XP
2,443
Country
France
I rebuild all project for ninjhax 2.5 but i have a problem with TileMap 2DS...

sf2d_draw_texture_rotate() have a problem, we lost many pixel from x and y... sf2d_draw_texture_part_rotate_scale() have same problem...

Explain with image...
before.png after.png
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,033
Country
United States
I rebuild all project for ninjhax 2.5 but i have a problem with TileMap 2DS...

sf2d_draw_texture_rotate() have a problem, we lost many pixel from x and y... sf2d_draw_texture_part_rotate_scale() have same problem...

Explain with image...
View attachment 28957 View attachment 28959
I can't see a difference aside from the displacement. Perhaps some words might help?
 

Cid2mizard

Well-Known Member
Member
Joined
Aug 16, 2007
Messages
401
Trophies
1
Age
43
Location
Maubeuge
XP
2,443
Country
France
I can't see a difference aside from the displacement. Perhaps some words might help?

sf2d_draw_texture(text_img, 88, 83) and sf2d_draw_texture_rotate(text_img, 88, 83, 0) have not same position... but i think on rotate function 88, 83 are center of position ^^, it's not a bug...
 
Last edited by Cid2mizard,

Garcia98

Hey! Listen!
Member
Joined
Sep 8, 2015
Messages
361
Trophies
0
Location
Salamanca
Website
github.com
XP
267
Country
sf2d_draw_texture(text_img, 88, 83) and sf2d_draw_texture_rotate(text_img, 88, 83, 0) have not same position... but i think on rotate function 88, 83 are center of position ^^, it's not a bug...

Yes, in normal draw function the coordinates are the ones at the top left corner of the image while in the rotate function they are the ones at the center of the image
 

retrohead

Well-Known Member
Member
Joined
May 2, 2003
Messages
278
Trophies
0
Location
Manchester
Website
www.ds-scene.net
XP
593
Country
I compiled the sample but its not booting via NH2.5. Citra also throws errors.

I downloaded the latest sf2dlib and citrulib yesterday. Am I missing something? Should the sample work in citra and NH2.5?
 

neobrain

-
Member
Joined
Apr 25, 2014
Messages
306
Trophies
0
XP
730
Country
I compiled the sample but its not booting via NH2.5. Citra also throws errors.

I downloaded the latest sf2dlib and citrulib yesterday. Am I missing something? Should the sample work in citra and NH2.5?

sf2dlib revision 26be2ea and ctrulib revision b9e5ddb should work fine, at the very least in Citra. If they don't, submit an issue on the sf2dlib repository. Make sure you use an up-to-date build of nihstro (hasn't been updated in a while, but just in case you're using an ancient release... builds available at http://4dsdev.org/thread.php?id=14).
 

retrohead

Well-Known Member
Member
Joined
May 2, 2003
Messages
278
Trophies
0
Location
Manchester
Website
www.ds-scene.net
XP
593
Country
sf2dlib revision 26be2ea and ctrulib revision b9e5ddb should work fine, at the very least in Citra. If they don't, submit an issue on the sf2dlib repository. Make sure you use an up-to-date build of nihstro (hasn't been updated in a while, but just in case you're using an ancient release... builds available at http://4dsdev.org/thread.php?id=14).
Thanks, it seems I'm using a newer version of sf2dlib which is using picasso instead of nihstro. I'll install an older version.

Update: Well I've compiled and installed both those old versions of sf2dlib/ctrulib and now it's working. Thanks again
 
Last edited by retrohead,

xerpi

Well-Known Member
OP
Member
Joined
Dec 25, 2011
Messages
212
Trophies
1
Age
28
Location
Barcelona
XP
1,329
Country
Last edited by xerpi,

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,033
Country
United States

Urbanshadow

Well-Known Member
Member
Joined
Oct 16, 2015
Messages
1,578
Trophies
0
Age
33
XP
1,723
Country
I'm not getting very definited borders in 3d mode with images loaded with libsfil. It's a known issue or it's my fault?
The X displacement for my stereo pair ranges from 0 to 10 pixels (increasing on the GFX_LEFT) depending on the 3d slider state.
I am seeing ghostly edges in the x axis for an alpha enabled png loaded with libsfil.
 

retrohead

Well-Known Member
Member
Joined
May 2, 2003
Messages
278
Trophies
0
Location
Manchester
Website
www.ds-scene.net
XP
593
Country
What do you mean with "texture flipping"?
Probably H flip and V flip to mirror the texture.
It looks like you are passing the texture params unaltered - not just limited to the filter values. As such you may want to rename it to reflect this and change the value to unsigned. You should change it to unsigned regardless of my suggestion.
Compiles made by this commit are crashing but d9147df works fine. It seems to be the new "int tex_filters" in the struct, I had to move it to the end of the struct to get anything to run. I converted it to u32 for good measure too.

Edit: is it just me or are the filters pretty useless? There's not much difference between them that I can notice.

Edit 2: Forget that, I see what elhobbs was saying now. You need to send the other params along with the min mag filters.

eg.
rename to params
changed from int to u32

sf2d_texture_set_tex_filters(sf2d_texture *texture, u32 filters)
texture->tex_filters =

so you use it like this:

sf2d_texture_set_tex_params(tex,GPU_TEXTURE_MAG_FILTER(GPU_LINEAR)| GPU_TEXTURE_MIN_FILTER(GPU_LINEAR)|GPU_TEXTURE_WRAP_S(GPU_REPEAT)|GPU_TEXTURE_WRAP_T(GPU_REPEAT))

It's MUCH nicer for scaling old DS games up from 256*192 but I now need to render to a temp buffer as the alignment goes out a bit when I scale. I think it's because you convert from a float for scale into sizes then back into a float so it's losing data. I'd actually prefer if we could send width and height in px instead of a float as they tend to add decimals randomly.
 
Last edited by retrohead,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=bgCjp3-rF_Y