Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  


Okay, I was browsing the forums today and stumbled upon this thread, which made me go "omg". For those of you lazy enough not to read it - Mark, Sir Sapo's awesome artist is releasing some of his older sprites that they're not going to use into the public domain.

Happy Birthday Mark!

His stuff is absolutely amazing - check Sir Sapo's journal for proof. And again, for those poor few of you who are reading me from an offline buffer of some sort, here's a part of the package being released -

Now, when I first saw these I went 'omg'. Because they really are awesome - I love Mark's art style. I don't care what people say about "black line borders", but I really love them and love using them. They bring tone to the image, iirc, and help bring it alive.

When I downloaded the package, I was even happier - the tank images are already cut into different pieces - chasises, turrets, guns, everything ready to be put together. Hell, there are even image masks for most of the components. Absolutely awesomeness.

You all know I can never complete a project, but this at least has given me incentive to actually get off my butt and write that OGL adapter I've been meaning to write. I might not get around to writing an actual tank game (and anything I did couldn't give justice to those awesome sprites), but I've been needing to do this for awhile. And if I do stay productive, I'll be able to use OGL's rotational facilities to make the tanks, turrets and guns spin around properly.

First step - implement all of the 2D API so its functional with the GUI framework. I've written out all of the functions it should implement -

class OGLGfxAdapter {
SDL_Surface* _screen;

// typedefs
typedef unsigned int TextureType;
typedef unsigned int ColorType;
typedef float SizeType;

// texture management
typedef std::vector< TextureType > TexListType;
TexListType _textures;

bool _createScreenSurface( int screenW, int screenH, bool fullscreen );


// screen ops
void clear();
void flip();

// screen accessors
int screenW();
int screenH();

// blitting ops - to screen
void fillRect( ColorType color, int x, int y, int w, int h );
void fillRect( ColorType color, pawn::math::Rect<int> dim );
void blitTexture( TextureType src, int dx, int dy );

// blitting ops - to texture
void fillRect( TextureType tex, ColorType color );
void fillRect( TextureType tex, ColorType color, int x, int y, int w, int h );
void fillRect( TextureType tex, ColorType color, pawn::math::Rect<int> dim );
void blitTexture( TextureType dest, TextureType src, int dx, int dy );

// texture creation ops
TextureType createTexture( std::string filename );
TextureType createTexture( int w, int h );
void freeTexture( TextureType tex );

// colorkey/alpha
void setColorKey( TextureType tex, ColorType color );
ColorType getColorKey( TextureType tex );

// helper factory functions
ColorType makeColor( int r, int g, int b, int a = 0 );

// text functionality
void drawText( std::string text, ColorType color, int x, int y );

Which isn't too bad. The only ones I think I'm going to have a problem with are the colorkey ones and the texture-to-texture blit operations. And I still haven't decided how I'm going to do the fill ops either yet - there is no real minimum specs laid down for how well they should perform or under what conditions they're supposed to perform in.

That's what a lousy documentation job'll do :)

For screen rect filling I think I have two easy options, since the system can't guarentee that it'll make the same calls every pass (and the calls may not be in the same order) - I can draw them all in immediate mode as they come in, or I can batch the calls as quads in a vertex array and render them all at once. I'm kind of leaning toward an immediate mode solution, but the vertex array option would almost surely have better performance. The only problem with it is that the draw call would have to be made in the flip function, which means all the fillRect's would be overlaid on top of everything else. Which I guess is what you'd want anyway, since most of that is for GUI-specific rendering.

For the texture-to-texture blitting (which is used primarily in a couple texture utility functions) I think I remember reading something about setting the render target to a texture; but as I've never had need to do that before I'll have to read up and see if that's do-able. There has to be some way to do it :P

I did have to end up killing some functionality of the original SDL prototype adapter - locking/unlocking surfaces to modify/access pixel data. This was because those operations, in OpenGL, are just too slow to rely upon. (and there are some quirks with getting pixels in windowed mode when the window is partially obsured by another window). All in all, those functions are used by very few texture operations (read: like 1) so it wasn't too much pain.

So yeah. Thank you Sir Sapo and Mark the Artist for giving my life new purpose. I'm looking forward to a playable release of your latest to-be hit :)
Sign in to follow this  


Recommended Comments

I'm looking forward to seeing what you can do with those sprites, we lost interest too early to have anything really cool running. Mark and I were actually just having a conversation about how cool it would be if someone actually made something cool with his stuff, so maybe you'll be able to make his dream come true (I'm apparently failing[grin]). Incidently, we were also just talking about how critical everyone is about his black outlines... it's actually kind of eerie how similar your post and our conversation were.....

Anyways, I'm sure he'll be glad to hear something positive about his outlines!

EDIT: Of course the one time someone links to my journal, my latest post has a huge screen of one of my crappy demos[grin]

Share this comment

Link to comment
I'm carazy happy that someone can use those- this is gonna be cool.

I really didn't expect you though, Mushu, although I have been reading this journal for a while now.
You better get a tank shooting shit by let's say... 1/2 of an hour.

Awesome luck and lots of LOLS

-Mark the Artist

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!