Welcome
Welcome to a320

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!

Drawing sprites

Any and all A320 homebrew topics

Moderator: Moderators

Drawing sprites

Postby Wiredbomb0 on Mon May 11, 2009 8:23 am

Hey there peoples. Just wanting to ask a question.

With the S2DSDK, how exactly do you draw a sprite. Do I have to program each pixel and use PutPixel to draw each pixel, or can I use the *.s2dtex files or something like that. Any help would be appreciated thanks.
Wiredbomb0
 
Posts: 166
Joined: Thu Apr 23, 2009 10:08 am
Location: Victoria, Australia

Re: Drawing sprites

Postby SiENcE on Mon May 11, 2009 10:53 am

I think you should firstly compile the samples including the bubblebobble (paopao) example.
Then read the code how they do it.
SiENcE
 
Posts: 67
Joined: Wed Apr 29, 2009 9:19 am
Location: Berlin/Germany

Re: Drawing sprites

Postby Wiredbomb0 on Mon May 11, 2009 10:02 pm

lol, great! It's going to take me ages to download that file. Okay, goody. Thanks!
Wiredbomb0
 
Posts: 166
Joined: Thu Apr 23, 2009 10:08 am
Location: Victoria, Australia

Re: Drawing sprites

Postby Wiredbomb0 on Tue May 12, 2009 12:40 pm

:shock:

What the hell? I can barely understand what's going on. Can anyone be kind enough to fill me in on how it works? Is the *.s2dtex files, like a *.zip with lots of sprites in it?
Wiredbomb0
 
Posts: 166
Joined: Thu Apr 23, 2009 10:08 am
Location: Victoria, Australia

Re: Drawing sprites

Postby joyrider on Tue May 12, 2009 5:53 pm

Wiredbomb0 wrote::shock:

What the hell? I can barely understand what's going on. Can anyone be kind enough to fill me in on how it works? Is the *.s2dtex files, like a *.zip with lots of sprites in it?


s2dtext files are (raw ?) images converted to a certain format like rgb565 (the ones i used). You have to use a tga file and convert it to a s2dtex file using the texture converter in the tools directory of the sdk. once you have the s2dtext file you can load it in the s2dsdk. Have a look at the s2dsdk's sample or booblepop. the file must exist in the same directory as your executeable when running in windows, so add it as a resource in the VC++ ide.

For getting it to work on the dingoo it's a whole other story. you have to create a res directory where all the *.bat files are and put your assets/resources in that directory. in your code you have to call InitDLRes(); at the start of your program and ReleaseDlRes(); at the end depening how you use the s2dsdk. these functions will make it possible to access your assests / resources which gets embeded in the .app file using the dlmake.exe file.

For rubido i just used one of the examples "pmp" directories provided and modified it a bit to my liking. once you got everything you have to build your game / app using those batch files, i didn't modify any of those, just letted it compile with the rest. Just have a look around a bit it's not that hard if you look at the examples source codes.

I did had to trial and error a bit but i got the hang of it now :)
joyrider
 
Posts: 77
Joined: Sun May 03, 2009 4:27 pm

Re: Drawing sprites

Postby Wiredbomb0 on Wed May 13, 2009 8:15 am

Okay, fair enough. Thanks for the tips. I just downloaded the entire collection of 2008 programs, cause I couldn't do an offline install of C++ for my computer (which isn't connected to the internet). Going to see how that works out.
Wiredbomb0
 
Posts: 166
Joined: Thu Apr 23, 2009 10:08 am
Location: Victoria, Australia

Re: Drawing sprites

Postby Wiredbomb0 on Thu May 14, 2009 12:10 pm

Okay, I've been looking through the code (to be honest, I can't understand a freaking word. It's just gone over my head) and I've found nothing worth of use. I made my own logo (well, what else will my games be organised under eh?) and I've successfully converted it to s2dtex (although it through a lot of hissy fits and didn't do all of the selected things, 656 I think didn't work). Here is what I've done:

1) Rextracted helloworldpixel again (didn't want heaps of s2dtex's in one folder).
2) I copied across the TextureManager.h/.cpp files into the approiate directories, and included them in the project.
3) I copied the alpha logo one to inc/res (made the folder) and included them in the project (Add Existing Item).
4) Added this code to the GameEngine::Init:

Code: Select all
TextureManager::TextureManager();
   s2d::Char* file = "../res/Logo_alpha.s2dtex";
   s2d::Char* path = 0;
   TextureManager::FindOrLoadTexture(file,path);


It gives me:

Code: Select all
1>c:\documents and settings\ciaran\desktop\pong\pong\source\src\gameengine.cpp(45) : error C2352: 'TextureManager::FindOrLoadTexture' : illegal call of non-static member function
1>        c:\documents and settings\ciaran\desktop\pong\pong\source\inc\texturemanager.h(40) : see declaration of 'TextureManager::FindOrLoadTexture


Anyone know what's going on?
Wiredbomb0
 
Posts: 166
Joined: Thu Apr 23, 2009 10:08 am
Location: Victoria, Australia


Return to Homebrew

Who is online

Users browsing this forum: nine10 and 2 guests