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

  • Thread starter Thread starter xerpi
  • Start date Start date
  • Views Views 97,253
  • Replies Replies 501
  • Likes Likes 32
I am trying to make this on my mac and i get this error
shader.vsh
/bin/bash: nihstro-assemble: command not found
make[1]: *** [shader.vsh.o] Error 127
make: *** [build] Error 2

Can anyone help?
You need the nihstro-assemble binarys. But sadly don't know how to make them on mac :(
 
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
 
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?
 
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,
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
 
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?
 
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).
 
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,
Last edited by xerpi,
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.
 
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