scaling routine speeded up a little bit by using less switch case and using inline.. static inline is now used

origin
stpohle 23 years ago
parent d5c9290cd3
commit 47253f0d3a

@ -1,8 +1,11 @@
$Id: ChangeLog,v 1.30 2003/07/24 01:47:48 stpohle Exp $
$Id: ChangeLog,v 1.31 2003/07/24 13:04:50 stpohle Exp $
Version 0.9.10
==============
- scaling routine speeded up a little. Using inline functions
and much less "switch case".
- TekKRat made two new players, the first two
tilesets with the pseudo 3D effect
(64x96 pixel tileset) and another tileset.

@ -1,4 +1,4 @@
/* $Id: gfx.h,v 1.16 2003/07/24 12:41:27 stpohle Exp $ */
/* $Id: gfx.h,v 1.17 2003/07/24 13:04:50 stpohle Exp $ */
#ifndef _GFX_H_
#define _GFX_H_
@ -82,14 +82,8 @@ extern void gfx_free_players ();
// gfxpixelimage.c
extern void getRGBpixel (SDL_Surface *surface, int x, int y, int *R, int *G, int *B);
inline Uint32 getpixel(SDL_Surface *surface, int x, int y);
inline void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
inline Uint32 getpixel16(SDL_Surface *surface, int x, int y);
inline void putpixel16(SDL_Surface *surface, int x, int y, Uint32 pixel);
inline Uint32 getpixel24(SDL_Surface *surface, int x, int y);
inline void putpixel24(SDL_Surface *surface, int x, int y, Uint32 pixel);
inline Uint32 getpixel32(SDL_Surface *surface, int x, int y);
inline void putpixel32(SDL_Surface *surface, int x, int y, Uint32 pixel);
extern Uint32 getpixel(SDL_Surface *surface, int x, int y);
extern void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
extern void scale (short int *dpattern, short int x, short int y);
extern SDL_Surface *scale_image (SDL_Surface * orginal, int newx, int newy);
extern void shade_pixel(SDL_Surface *s, int x, int y, int c);

@ -1,4 +1,4 @@
/* $Id: gfxpixelimage.c,v 1.2 2003/07/24 12:41:27 stpohle Exp $ */
/* $Id: gfxpixelimage.c,v 1.3 2003/07/24 13:04:50 stpohle Exp $ */
/* gfx pixel manipulation and image manipulation */
#include "bomberclone.h"
@ -54,7 +54,7 @@ getpixel (SDL_Surface * surface, int x, int y)
};
inline Uint32
static inline Uint32
getpixel32 (SDL_Surface * surface, int x, int y)
{
/* Here p is the address to the pixel we want to retrieve */
@ -63,7 +63,7 @@ getpixel32 (SDL_Surface * surface, int x, int y)
};
inline Uint32
static inline Uint32
getpixel24 (SDL_Surface * surface, int x, int y)
{
/* Here p is the address to the pixel we want to retrieve */
@ -76,7 +76,7 @@ getpixel24 (SDL_Surface * surface, int x, int y)
};
inline Uint32
static inline Uint32
getpixel16 (SDL_Surface * surface, int x, int y)
{
/* Here p is the address to the pixel we want to retrieve */
@ -86,7 +86,7 @@ getpixel16 (SDL_Surface * surface, int x, int y)
/* putpixel seperated for every BPP version */
void
inline void
putpixel (SDL_Surface * surface, int x, int y, Uint32 pixel)
{
/* Here p is the address to the pixel we want to set */
@ -119,7 +119,7 @@ putpixel (SDL_Surface * surface, int x, int y, Uint32 pixel)
};
inline void
static inline void
putpixel32 (SDL_Surface * surface, int x, int y, Uint32 pixel)
{
/* Here p is the address to the pixel we want to set */
@ -128,7 +128,7 @@ putpixel32 (SDL_Surface * surface, int x, int y, Uint32 pixel)
};
inline void
static inline void
putpixel24 (SDL_Surface * surface, int x, int y, Uint32 pixel)
{
/* Here p is the address to the pixel we want to set */
@ -145,7 +145,7 @@ putpixel24 (SDL_Surface * surface, int x, int y, Uint32 pixel)
};
inline void
static inline void
putpixel16 (SDL_Surface * surface, int x, int y, Uint32 pixel)
{
/* Here p is the address to the pixel we want to set */

Loading…
Cancel
Save