[Example]Loading Sprites via NitroFS!

Learn to use DS Game Maker by Example!

[Example]Loading Sprites via NitroFS!

Postby Foxi4 » June 25th, 2011, 3:25 pm

Once again a fancy Source for you to review. It's fully commented and ready for action!
NitroFS Sprites.dsgm
(61.69 KiB) Downloaded 95 times

SPOILER ALERT! the *huge* sprite we'll be loading is one of the newest FalloutDS sprites I'm using in my project!

Please, do Comment!
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1114
Joined: December 31st, 2010, 3:25 am

Re: [Example]Loading Sprites via NitroFS!

Postby Foxi4 » July 3rd, 2011, 11:08 pm

...guess nobody's interested in reviewing the code.

Look guys, I know this isn't perfect - I do want to improve it. I want to push it to the point where the sprites will be accessible via the standard DSGM actions (although that'll probably require editing the makefile... :/) so do me a favour and at least take a "glance", mmm-kay? I'm not "experienced enough" to see any space for significant improvement, this IS a rough sketch...
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1114
Joined: December 31st, 2010, 3:25 am

Re: [Example]Loading Sprites via NitroFS!

Postby Buck_7 » July 4th, 2011, 7:51 pm

Okay, this is pretty cool. So this dosen't take up any space?
Upcoming games I'm working on:
  • Minecraft2DS
  • Bow Man DS
  • Bird poo!
------------------------------------------------------------------------
COOL LOOK 3D portal port for DS! http://drunkencoders.com/2013/01/dstal-advance/
needMusic?needHelp?Ask.
User avatar
Buck_7
 
Posts: 963
Joined: February 19th, 2011, 1:44 am

Re: [Example]Loading Sprites via NitroFS!

Postby Foxi4 » July 5th, 2011, 5:10 am

Well, not exactly. The buffers are fixed and memory IS allocated for them, but that's a huge space saver anyways.

In the example, there is 1 buffer char* into which a sprite is loaded. The difference between this and the standard method is that you can have as many sprites as you like and load them from Nitro into the buffer whenever you like, rather than keeping all of them in RAM at the same time.

If you have a room in which you know you will use only, say, 5 sprites and you have 25 sprites altogether, it's more "space efficient" to prepare 5 buffers and load the 5 sprites you need rather than loading all the sprites when the application starts. You save ALOT of RAM space and you can swap the sprites currently loaded at any given time.
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1114
Joined: December 31st, 2010, 3:25 am

Re: [Example]Loading Sprites via NitroFS!

Postby Foxi4 » July 15th, 2011, 12:25 am

Example now obselete, reffer to NitroSpritesLib.
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1114
Joined: December 31st, 2010, 3:25 am


Return to Tutorials & Examples

Who is online

Users browsing this forum: No registered users and 1 guest

cron