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,455
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,034
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,455
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,034
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
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, though only sometimes when some people arent home
    +1
  • K3Nv2 @ K3Nv2:
    Honey he's playing gta again
    +2
  • BigOnYa @ BigOnYa:
    WUT! Get my belt.
    +1
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, but atleast i have the amazing spiderman and red dead redemption 1 too, they are more family friendly compared to GTA (i think)
  • K3Nv2 @ K3Nv2:
    If it's modded you always have everything
    +1
  • K3Nv2 @ K3Nv2:
    My pc already has every ps3 game
  • Xdqwerty @ Xdqwerty:
    @K3Nv2, it only has like 26 GB avaliable right now
  • Psionic Roshambo @ Psionic Roshambo:
    GTAV is fine beating up hookers is OK, they don't mind!
  • Xdqwerty @ Xdqwerty:
    @Psionic Roshambo, uhhhhhhhhh how do I tell you i entered their club once?
    +1
  • BigOnYa @ BigOnYa:
    Just don't pick them up, and drive to a hidden location.
    +1
  • K3Nv2 @ K3Nv2:
    If you do run them over and get your money back
    +2
  • Xdqwerty @ Xdqwerty:
    @K3Nv2,
    @BigOnYa a strip club
  • K3Nv2 @ K3Nv2:
    The strip club you shoot up the hookers you pick up
    +1
  • BigOnYa @ BigOnYa:
    You actually get to own that strip club, later in the game.
  • K3Nv2 @ K3Nv2:
    After you shoot it up
  • BigOnYa @ BigOnYa:
    I'm still pissed I had to pay for that game again, (3rd time) just to get the next gen(4k) update. It should be free. Typical Rockstar move tho.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I live like walking distance to a strip club lol
  • Psionic Roshambo @ Psionic Roshambo:
    I should check it out some day
    +1
  • BigOnYa @ BigOnYa:
    No you shouldnt, you may run into one of your long lost daughters you never knew you had.
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    BigOnYa I had a modified version with texture mods and all kinds of goodies lol https://m.youtube.com/watch?v=Vo5g4kxs4UU&t=64s
  • Psionic Roshambo @ Psionic Roshambo:
    Me playing it like 4 years ago on a 2080 Ti lol
  • Psionic Roshambo @ Psionic Roshambo:
    Lol that reminds me I am like 60% sure my step daughter is dead...
  • Psionic Roshambo @ Psionic Roshambo:
    Meth addicts don't move out of a house they are trying to sell and the boyfriend says she moved and does not know where lol
  • K3Nv2 @ K3Nv2:
    I was about to be like can't wait for gta6 so @Psionic Roshambo can tell me places to go then you drop that
    +2
    K3Nv2 @ K3Nv2: I was about to be like can't wait for gta6 so @Psionic Roshambo can tell me places to go then... +2