Homebrew Homebrew Development

smealum

growing up sucks.
Member
Joined
May 1, 2006
Messages
635
Trophies
2
Age
31
Location
SF
Website
www.smealum.net
XP
2,516
Country
United States

catlover007

Developer
Developer
Joined
Oct 23, 2015
Messages
722
Trophies
1
XP
3,947
Country
Germany
How would I use a gif in homebrew?
you probably mean an animated one, don't you?

The easist way is to simply unpack the image into single frames and then use them in your program. An alternative would be to use a library(like this one: https://github.com/hidefromkgb/gif_load), if you want to load the gifs from the internet or from file and you can't prepare them. But in the end you have to unpack the gif into single frames(whether you're doing it on the fly or in advance) and then proceed as if you're drawing an animated sprite.
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
245
Country
United States
I need help, this isn't necessarily 3ds related, more of c++ in general, but since the software is for the 3ds I figure I might as well go here anyway.
In the file MaVeRo-3D.cpp (the main file) [see repo: https://github.com/Magicrafter13/MaVeRo-3D] I can't figure out what's wrong, but after a few hours I was able to deduce it had something to do with the sprite_init arrays.
The problem is at line 286. If I comment it out, the program runs fine, but with it, the 3ds will crash. I have figured out it is the R3 G3 B3 and A3 arrays that are causing it in some way. Because I can still use the test_tile_sprite object fine with the other arrays, but not the 3rd set. I have no idea what's wrong and even with extensive googling I have not been able to even figure out the problem!
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
245
Country
United States
I'm having some kind of issue, printing some lines, it seems like a while loop type symptom.. but it's not...
https://github.com/Magicrafter13/MaVeRo-3D
in the main file (MaVeRo-3D.cpp) at line 477 I have a for loop which is supposed to draw some tiles, it gets to the end (prints drawing: 69, which is the end of the for loop obviously) but then it freezes. If I had some cout's in the drawing function it just prints text forever, I don't know why it's getting stuck, since it should draw the 69th one, and then set I to 70, thus ending the for loop. But I think it may have something to do with my use of vectors, since I am new to them, and probably messed something up.

--------------------- MERGED ---------------------------

If I change the number from 70 to 69 in the for loop, it freezes at 68. So I assume, that it always freezes at the last one, which just confuses me even more.

--------------------- MERGED ---------------------------

EDIT: I changed it to 1, and it doesn't lock up, but it doesn't draw the first tile either... but I suppose I can figure that out later. The main problem right now, is what's wrong with this for loop...

edit 2: if it's 3 or higher then it freezes. But 2 and 1 work (and probably 0, but that would be pointless).
 
Last edited by Magicrafter13,
D

Deleted User

Guest
Quick question; I'm trying to compile Jansson (found here in the PortLibs: https://github.com/devkitPro/3ds_portlibs/). I followed the instructions, updated my Makefile, and double-checked that everything was installed to $DEVKITPRO/portlibs/armv6k, but whenever I try to compile my program, I end up with this:

Code:
In file included from /home/fluffy/Documents/Projects/3DS-VN-Engine/source/main.cpp:7:0:
/home/fluffy/Documents/Projects/test/source/test.hpp:6:21: fatal error: jansson.h: No such file or directory
compilation terminated.

Are there any paths I need to set before it compiles, or is there something wrong with my installation? Any help would be appreciated.

EDIT: Nevermind, it was in issue with the Makefile. Just set LIBDIRS to

Code:
LIBDIRS = $(PORTLIBS) $(CTRULIB)

I believe I asked this question before. Heh.
 
Last edited by ,

Pikachuk

Well-Known Member
Member
Joined
Mar 19, 2016
Messages
767
Trophies
0
Age
23
Location
Bordeaux
XP
749
Country
France
i'd like to use stereoscopic 3d with sdl by adding a z axis to the sdl structures
but i'd like to know how to manage the 3d to allow the 3ds to make the specified pixels 3d depending on the axis
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,033
Country
United States
i'd like to use stereoscopic 3d with sdl by adding a z axis to the sdl structures
but i'd like to know how to manage the 3d to allow the 3ds to make the specified pixels 3d depending on the axis
The 3d effect requires creating a left and right image with objects at different offsets and sizes based on distance. This can be done with the 3d hardware by rendering a 3d scene twice using two different viewpoints. Or it can be accomplished by updating the framebuffer directly with different layers or objects adjusted for each viewpoint.
 

Pikachuk

Well-Known Member
Member
Joined
Mar 19, 2016
Messages
767
Trophies
0
Age
23
Location
Bordeaux
XP
749
Country
France
The 3d effect requires creating a left and right image with objects at different offsets and sizes based on distance. This can be done with the 3d hardware by rendering a 3d scene twice using two different viewpoints. Or it can be accomplished by updating the framebuffer directly with different layers or objects adjusted for each viewpoint.
since i'm using sdl for 3ds, i guess i'll have to modify directly the sdl source, it uses libcitro3d
does libcitro3d has options to manage the stereoscopic 3d ?
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,033
Country
United States
since i'm using sdl for 3ds, i guess i'll have to modify directly the sdl source, it uses libcitro3d
does libcitro3d has options to manage the stereoscopic 3d ?
Yes, though I suspect you will need to adjust the viewpoint (position, projection, etc. ) for each frame manually.
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
i'd like to use stereoscopic 3d with sdl by adding a z axis to the sdl structures
but i'd like to know how to manage the 3d to allow the 3ds to make the specified pixels 3d depending on the axis
You could do it but It would be better to handle the x offset for the 2 screens with custom code, so the only change to the SDL lib would be to have two main surfaces to draw on. Or like I did for top screen and bottom screen, you could have a big surface with half rendered on the left screen, and the other half on the bottom screen.

since i'm using sdl for 3ds, i guess i'll have to modify directly the sdl source, it uses libcitro3d
does libcitro3d has options to manage the stereoscopic 3d ?

SDL uses citro3d only for a fast draw from the buffer to the phisical screen. And SDL is a 2d lib so you can't modify it to draw 3d objects, but only to have different deep effects for 2d objects.

If you want 3d drawing you should use open GL. There is an unfinished open GL wrapper for citro3d, but never tested it.
 

Pikachuk

Well-Known Member
Member
Joined
Mar 19, 2016
Messages
767
Trophies
0
Age
23
Location
Bordeaux
XP
749
Country
France
You could do it but It would be better to handle the x offset for the 2 screens with custom code, so the only change to the SDL lib would be to have two main surfaces to draw on. Or like I did for top screen and bottom screen, you could have a big surface with half rendered on the left screen, and the other half on the bottom screen.



SDL uses citro3d only for a fast draw from the buffer to the phisical screen. And SDL is a 2d lib so you can't modify it to draw 3d objects, but only to have different deep effects for 2d objects.

If you want 3d drawing you should use open GL. There is an unfinished open GL wrapper for citro3d, but never tested it.
actually i'm already working like this, the rendering works with one main surface of 411x480 the top screen uses a surface of 411x240 blitted on the top and the bottom screen a surface of 320x240 blitted on the bottom and centered on the x axis

actually i don't want 3d rendering, just a deep effect

for the 3d effect i was expecting to have to render two images for the top screen and ajust the x values the z would be a managed value per game object the manager would use this value to set the correct x value on each screen

actually i just don't know how i should render the two surfaces to the stereoscopic screen (not blitting them on each other but rendering one on the left side and the other on the right side for the 3d)
 

trainboy2019

Well-Known Member
Member
Joined
Oct 6, 2015
Messages
1,114
Trophies
0
Age
23
Location
GA
XP
1,107
Country
United States
It seems whenever I press start with my home-brew I'm developing, it returns to the home menu rather than the home-brew menu. How would I fix this?
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
It seems whenever I press start with my home-brew I'm developing, it returns to the home menu rather than the home-brew menu. How would I fix this?

Probably your code misses to close some processes (e.g. romfs) befor exiting and the system crashes. This is The only reason I'm aware of a 3dsx returning to 3ds menu (with a rebout) instead to HBL menu.

Show an example of homebrew of yours to have more hints.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Veho @ Veho: Spring is in the air. +1