Nintendo 3DS
如何將圖片資源打包到3dsx檔案
步驟如下:
1. 在編譯目錄下產生romfs/gfx/資料夾
2. 將編譯好的xxx.t3x放到romfs/gfx/資料夾內
3. 程式如下(只列出部份程式):
1 2 3 4 5 6 7 8 9 10 11 | int main ( void ) { romfsInit (); FILE * f = fopen ( "romfs:/gfx/xxx.t3x" , "rb" ); Tex3DS_TextureImportStdio (f, xxx, NULL , false ); fclose (f); romfsExit (); return 0; } |
4. 編譯部份,加入romfs選項即可
$ 3dsxtool main.elf main.3dsx --smdh=main.smdh --romfs=romfs