Replace BMP image file loading with PNG image file loading

This commit is contained in:
2014-07-01 01:41:59 +02:00
committed by Valeriano A.R
parent f9108ac1d3
commit 8a61c17d5c
81 changed files with 8168 additions and 174 deletions

View File

@@ -458,68 +458,69 @@ void GameEnts_Init(){
// Load and initialize media.
//
img_player=Draw_LoadImage("data/player.bmp");
img_platform=Draw_LoadImage("data/platform.bmp");
img_block=Draw_LoadImage("data/block.bmp");
img_player=Draw_LoadImage("data/player.png");
img_platform=Draw_LoadImage("data/platform.png");
img_block=Draw_LoadImage("data/block.png");
// Wizard
img_wizard[0]=Draw_LoadImage("data/wizard_left.bmp");
img_wizard[1]=Draw_LoadImage("data/wizard_right.bmp");
img_wizard[0]=Draw_LoadImage("data/wizard_left.png");
//img_wizard[1]=Draw_LoadImage("data/wizard_right.png");
img_wizard[1]=Draw_LoadImage("data/wizard_right.png");
// Magik Ball
img_magikball=Draw_LoadImage("data/magikball.bmp");
img_magikball=Draw_LoadImage("data/magikball.png");
// Load the earth images
img_earth[ 0]=Draw_LoadImage("data/earth/0.bmp");
img_earth[ 1]=Draw_LoadImage("data/earth/1.bmp");
img_earth[ 2]=Draw_LoadImage("data/earth/2.bmp");
img_earth[ 3]=Draw_LoadImage("data/earth/3.bmp");
img_earth[ 4]=Draw_LoadImage("data/earth/4.bmp");
img_earth[ 5]=Draw_LoadImage("data/earth/5.bmp");
img_earth[ 6]=Draw_LoadImage("data/earth/6.bmp");
img_earth[ 7]=Draw_LoadImage("data/earth/7.bmp");
img_earth[ 8]=Draw_LoadImage("data/earth/8.bmp");
img_earth[ 9]=Draw_LoadImage("data/earth/9.bmp");
img_earth[10]=Draw_LoadImage("data/earth/A.bmp");
img_earth[11]=Draw_LoadImage("data/earth/B.bmp");
img_earth[12]=Draw_LoadImage("data/earth/C.bmp");
img_earth[13]=Draw_LoadImage("data/earth/D.bmp");
img_earth[14]=Draw_LoadImage("data/earth/E.bmp");
img_earth[15]=Draw_LoadImage("data/earth/F.bmp");
img_earth[ 0]=Draw_LoadImage("data/earth/0.png");
img_earth[ 1]=Draw_LoadImage("data/earth/1.png");
img_earth[ 2]=Draw_LoadImage("data/earth/2.png");
img_earth[ 3]=Draw_LoadImage("data/earth/3.png");
img_earth[ 4]=Draw_LoadImage("data/earth/4.png");
img_earth[ 5]=Draw_LoadImage("data/earth/5.png");
img_earth[ 6]=Draw_LoadImage("data/earth/6.png");
img_earth[ 7]=Draw_LoadImage("data/earth/7.png");
img_earth[ 8]=Draw_LoadImage("data/earth/8.png");
img_earth[ 9]=Draw_LoadImage("data/earth/9.png");
img_earth[10]=Draw_LoadImage("data/earth/A.png");
img_earth[11]=Draw_LoadImage("data/earth/B.png");
img_earth[12]=Draw_LoadImage("data/earth/C.png");
img_earth[13]=Draw_LoadImage("data/earth/D.png");
img_earth[14]=Draw_LoadImage("data/earth/E.png");
img_earth[15]=Draw_LoadImage("data/earth/F.png");
// FIXME: Earth back
// Stone Brick
img_stoneBrick=Draw_LoadImage("data/rock.bmp");
img_stoneBrick=Draw_LoadImage("data/rock.png");
// FIXME: Stone Brick back
// Spiked Bush
img_spikedBush=Draw_LoadImage("data/spikedbush.bmp");
img_spikedBush=Draw_LoadImage("data/spikedbush.png");
// FIXME: Lava Pit
// FIXME: Fireball
// Flower
img_flower[0]=Draw_LoadImage("data/flower_left.bmp");
img_flower[1]=Draw_LoadImage("data/flower_right.bmp");
img_flower[0]=Draw_LoadImage("data/flower_left.png");
img_flower[1]=Draw_LoadImage("data/flower_right.png");
// Spike
img_spike[0]=Draw_LoadImage("data/spike_left.bmp");
img_spike[1]=Draw_LoadImage("data/spike_right.bmp");
img_spike[0]=Draw_LoadImage("data/spike_left.png");
img_spike[1]=Draw_LoadImage("data/spike_right.png");
// Carnivore Plant
img_carnivorePlant[0]=Draw_LoadImage("data/carnivoreplant_left.bmp");
img_carnivorePlant[1]=Draw_LoadImage("data/carnivoreplant_right.bmp");
img_carnivorePlant[0]=Draw_LoadImage("data/carnivoreplant_left.png");
img_carnivorePlant[1]=Draw_LoadImage("data/carnivoreplant_right.png");
// Bunny
img_bunny[0]=Draw_LoadImage("data/bunny_left.bmp");
img_bunny[1]=Draw_LoadImage("data/bunny_right.bmp");
img_bunny[0]=Draw_LoadImage("data/bunny_left.png");
img_bunny[1]=Draw_LoadImage("data/bunny_right.png");
// Spider
img_spider[0]=Draw_LoadImage("data/spider_left.bmp");
img_spider[1]=Draw_LoadImage("data/spider_right.bmp");
img_spider[0]=Draw_LoadImage("data/spider_left.png");
img_spider[1]=Draw_LoadImage("data/spider_right.png");
// FIXME: Guard

View File

@@ -20,6 +20,7 @@
#include <GL/gl.h>
#endif
#endif
#include "lodepng.c"
#include <SDL/SDL.h>
#include "Time.h"
@@ -28,16 +29,33 @@
#include "Draw.h"
////////////////////////////////////////////////
// DrawImage //
///////////////
// Image container.
typedef struct TDrawImage TDrawImage, *DrawImage;
struct TDrawImage {
unsigned char *data;
int x,y;
int w,h;
GLuint tex;
};
// Globals
SDL_Surface *_screen=NULL;
int _width;
int _height;
long long proc_t_frame=33333;
long long draw_t_frame=16667;
int _fps=60;
QuadArray2D _quadArray=NULL;
GLuint _tex=-1;
DrawImage _currentImg=NULL;
float _color[4];
/////////////////////////////
// Draw_Init
//
@@ -84,6 +102,7 @@ int Draw_Init(int width,int height,char *title,int pfps,int fps){
SDL_WM_SetCaption(title, NULL);
proc_t_frame=1000000/pfps;
draw_t_frame=1000000/fps;
_fps=fps;
_width=width;
_height=height;
@@ -228,118 +247,79 @@ void Draw_Clean(
}
////////////////////////////////////////////////
// DrawImage //
///////////////
// Image container.
typedef struct Tag_DrawImage {
SDL_Surface *surf;
GLuint tex;
int x,y;
} DrawImage;
/////////////////////////////
// Draw_LoadSurface
//
// Loads a surface.
SDL_Surface *Draw_LoadSurface(char *filename){
SDL_Surface *surf;
// Load the BMP as a surface
surf=SDL_LoadBMP(filename);
if(surf == NULL){
printf("Draw_LoadImage: Failure Loading image: %s\n",filename);
printf("Draw_LoadImage: SDL Error: %s\n",SDL_GetError());
return(NULL);
}
if (surf->format->BytesPerPixel==4) {
// Swap RGB to BGR
Uint32 *ptr,*ptr_end;
ptr=(Uint32 *)surf->pixels;
ptr_end=ptr+(surf->w*surf->h);
while (ptr<ptr_end) {
unsigned char temp;
unsigned char *pixel;
pixel=(unsigned char *)ptr;
temp=pixel[2];
pixel[2]=pixel[0];
pixel[0]=temp;
ptr++;
}
}
return(surf);
}
/////////////////////////////
// Draw_UploadGLTexture
//
// Uploads a OpenGL texture.
GLuint Draw_UploadGLTexture(SDL_Surface *surf){
GLuint Draw_UploadGLTexture(int w, int h, unsigned char *pixels){
GLuint tex;
// Generate OpenGL texture
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
//glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
//glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
// Load OpenGL texture
glBindTexture(GL_TEXTURE_2D, tex);
glPixelStorei( GL_UNPACK_ROW_LENGTH, surf->w );
glPixelStorei( GL_UNPACK_ROW_LENGTH, w );
glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
//glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,
// surf->w, surf->h, 0,
// GL_RGBA, GL_UNSIGNED_BYTE, surf->pixels);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
surf->w, surf->h, 0,
GL_RGBA, GL_UNSIGNED_BYTE, surf->pixels);
//glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8,
// imagen->ancho, imagen->alto, 0,
// GL_RGB, GL_UNSIGNED_BYTE, imagen->data);
w, h, 0,
GL_RGBA, GL_UNSIGNED_BYTE, pixels);
return(tex);
}
/////////////////////////////
// Draw_CreateImage
//
DrawImg Draw_CreateImage(int w,int h){
DrawImage image;
// Create the image container
image=malloc(sizeof(TDrawImage));
image->data=malloc(w*h*4);
image->x=0;
image->y=0;
image->w=w;
image->h=h;
image->tex=-1;
return((DrawImg)image);
}
/////////////////////////////
// Draw_LoadImage
//
// Loads a image, giving a reference.
DrawImg Draw_LoadImage(char *filename){
DrawImage *image;
SDL_Surface *surf;
DrawImage image;
// Loads the surface
surf=Draw_LoadSurface(filename);
if(surf == NULL){
return(NULL);
// Try loading PNG images
if(EndsWith(filename,".png") || EndsWith(filename,".PNG")){
image=malloc(sizeof(TDrawImage));
unsigned error = lodepng_decode32_file(
&image->data,
(unsigned*)&image->w,
(unsigned*)&image->h,
filename);
if(error){
printf("Draw_LoadImage: PNG decoder error %u: %s\n", error, lodepng_error_text(error));
return(NULL);
}
image->x=-(int)(image->w/2);
image->y=-(int)(image->h/2);
image->tex=-1;
return (DrawImg)image;
}
// Create the image container
image=malloc(sizeof(DrawImage));
image->surf=surf;
image->tex=Draw_UploadGLTexture(surf);
//image->x=0;
//image->y=0;
image->x=-(surf->w/2);
image->y=-(surf->h/2);
return((DrawImg)image);
printf("Draw_LoadImage: Image type not supported: %s\n",filename);
return(NULL);
}
@@ -348,11 +328,11 @@ DrawImg Draw_LoadImage(char *filename){
//
// Gets the image size.
void Draw_GetSize(DrawImg img,int *w,int *h){
DrawImage *image=img;
DrawImage image=img;
// Gets the image size
*w=image->surf->w;
*h=image->surf->h;
*w=image->w;
*h=image->h;
}
@@ -362,14 +342,14 @@ void Draw_GetSize(DrawImg img,int *w,int *h){
//
// Sets and Gets the image offset.
void Draw_SetOffset(DrawImg img,int x,int y){
DrawImage *image=img;
DrawImage image=img;
// Sets the image offset
image->x=x;
image->y=y;
}
void Draw_GetOffset(DrawImg img,int *x,int *y){
DrawImage *image=img;
DrawImage image=img;
// Gets the image offset
*x=image->x;
@@ -382,9 +362,15 @@ void Draw_GetOffset(DrawImg img,int *x,int *y){
//
// Performs all the queued draw actions.
void Draw_Flush(){
if(_currentImg==NULL){
return;
}
if(_currentImg->tex==-1){
_currentImg->tex=Draw_UploadGLTexture(_currentImg->w, _currentImg->h, _currentImg->data);
}
// Draw the quad array
glBindTexture(GL_TEXTURE_2D, _tex);
glBindTexture(GL_TEXTURE_2D, _currentImg->tex);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
@@ -402,7 +388,6 @@ void Draw_Flush(){
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
// Empty it
QuadArray2D_Clean(_quadArray);
}
@@ -413,19 +398,19 @@ void Draw_Flush(){
//
// Draws an image.
void Draw_DrawImg(DrawImg img,int x,int y){
DrawImage *image=img;
DrawImage image=img;
float x1,x2,y1,y2;
// Prepare
x1=x+image->x;
y1=_height-(y+image->y);
x2=(x+image->x)+image->surf->w;
y2=_height-((y+image->y)+image->surf->h);
x2=(x+image->x)+image->w;
y2=_height-((y+image->y)+image->h);
// Draw a quad
if(_tex!=image->tex){
if(_currentImg!=image){
Draw_Flush();
_tex=image->tex;
_currentImg=image;
}
QuadArray2D_AddQuad(_quadArray,
x1,y1,0.0f,0.0f,
@@ -439,7 +424,7 @@ void Draw_DrawImg(DrawImg img,int x,int y){
//
// Draws an image, resizing.
void Draw_DrawImgResized(DrawImg img,int x,int y,float w,float h){
DrawImage *image=img;
DrawImage image=img;
int x1,x2,y1,y2;
// Prepare
@@ -449,9 +434,9 @@ void Draw_DrawImgResized(DrawImg img,int x,int y,float w,float h){
y2=_height-((y+image->y)+h);
// Draw a quad
if(_tex!=image->tex){
if(_currentImg!=image){
Draw_Flush();
_tex=image->tex;
_currentImg=image;
}
QuadArray2D_AddQuad(_quadArray,
x1,y1,0.0f,0.0f,
@@ -466,7 +451,7 @@ void Draw_DrawImgResized(DrawImg img,int x,int y,float w,float h){
//
// Draws an image part.
void Draw_DrawImgPart(DrawImg img,int x,int y,int w,int i){
DrawImage *image=img;
DrawImage image=img;
int x1,x2,y1,y2;
float us,u1,u2;
@@ -474,15 +459,15 @@ void Draw_DrawImgPart(DrawImg img,int x,int y,int w,int i){
x1=x+image->x;
y1=_height-(y+image->y);
x2=(x+image->x)+w;
y2=_height-((y+image->y)+image->surf->h);
us=1.0f/image->surf->w;
y2=_height-((y+image->y)+image->h);
us=1.0f/image->w;
u1=us*i*w;
u2=u1+us*w;
// Draw a quad
if(_tex!=image->tex){
if(_currentImg!=image){
Draw_Flush();
_tex=image->tex;
_currentImg=image;
}
QuadArray2D_AddQuad(_quadArray,
x1,y1,u1,0.0f,
@@ -516,51 +501,41 @@ typedef struct {
/////////////////////////////
// Draw_DefaultFont
// Draw_DefaultImage
//
// Creates a surface with the default font.
// Creates a image with the default font.
#include "FontData.h"
SDL_Surface *Draw_DefaultFontSurface(
DrawImage Draw_DefaultFontImage(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a)
{
SDL_Surface *surf;
DrawImage img;
int x,y,c;
Uint32 color,color2;
// Create the surface
surf = SDL_CreateRGBSurface(SDL_SWSURFACE,
8*256, 8, 32,0,0,0,0);
surf->format->Amask=0xFF000000;
surf->format->Ashift=24;
SDL_SetAlpha(surf, SDL_SRCALPHA, 255);
// HACK: Set the colors in BGR order
color =SDL_MapRGBA(surf->format,b,g,r,a);
color2=SDL_MapRGBA(surf->format,b,g,r,0);
// Create the image and colors
img=Draw_CreateImage(8*256,8);
// Draw the font
//SDL_LockSurface(surf);
for(c=0;c<256;c++){
for(y=0;y<8;y++){
for(x=0;x<8;x++){
int offset=((c*8+x)+(8*256*y))*4;
img->data[offset+0]=r;
img->data[offset+1]=g;
img->data[offset+2]=b;
if(((fontdata_8x8[c*8+y]>>(7-x)) & 0x01)==1){
//Imagen_PutPixel(dest,c*8+x,y,color);
((Uint32 *)surf->pixels)[(c*8+x)+(8*256*y)]=
color;
img->data[offset+3]=0xFF;
}else{
//Imagen_PutPixel(dest,c*8+x,y,color2);
((Uint32 *)surf->pixels)[(c*8+x)+(8*256*y)]=
color2;
img->data[offset+3]=0x00;
}
}
}
}
//SDL_UnlockSurface(surf);
return(surf);
return(img);
}
@@ -578,10 +553,7 @@ DrawFnt Draw_DefaultFont(
// Create the default font
font=malloc(sizeof(DrawFont));
font->img.surf=Draw_DefaultFontSurface(r,g,b,a);
font->img.tex=Draw_UploadGLTexture(font->img.surf);
font->img.x=0;
font->img.y=0;
font->img=Draw_DefaultFontImage(r,g,b,a);
font->w=8;
font->h=8;
font->min=0;
@@ -599,12 +571,9 @@ DrawFnt Draw_LoadFont(char *fichero,int min,int max){
// Create the font form the image
font=malloc(sizeof(DrawFont));
font->img.surf=Draw_LoadSurface(fichero);
font->img.tex=Draw_UploadGLTexture(font->img.surf);
font->img.x=0;
font->img.y=0;
font->w=font->img.surf->w/(max-min);
font->h=font->img.surf->h;
font->img=Draw_LoadImage(fichero);
font->w=font->img->w/(max-min);
font->h=font->img->h;
font->min=min;
font->max=max;
@@ -624,7 +593,7 @@ void Draw_DrawText(DrawFnt f,char *text,int x,int y){
ptr=text;
while(*ptr){
if((*ptr)<font->max){
Draw_DrawImgPart((DrawImg)&font->img,x,y,font->w,(*ptr)-font->min);
Draw_DrawImgPart(font->img,x,y,font->w,(*ptr)-font->min);
}
x+=font->w;
ptr++;

View File

@@ -34,6 +34,7 @@ void Draw_Clean(
// Performs all the queued draw actions.
void Draw_Flush();
////////////////////////////////////////////////
// DrawImg //
/////////////
@@ -41,6 +42,12 @@ void Draw_Flush();
typedef void *DrawImg;
/////////////////////////////
// Draw_CreateImage
//
DrawImg Draw_CreateImage(int w,int h);
/////////////////////////////
// Draw_LoadImage
//

View File

@@ -152,10 +152,10 @@ CollisionInfo CollisionInfo_New(int responseType,Entity ent1,Entity ent2,float t
/////////////////////////////
// CollisionInfo_Free
// CollisionInfo_Destroy
//
//
void CollisionInfo_Free(CollisionInfo *collInfoRef);
void CollisionInfo_Destroy(CollisionInfo *collInfoRef);
/////////////////////////////

View File

@@ -200,3 +200,17 @@ float fabsmod(float v,int d){
/////////////////////////////
// EndsWith
//
int EndsWith(char *str, char *suffix){
if (!str || !suffix)
return 0;
int lenStr = strlen(str);
int lenSuffix = strlen(suffix);
if (lenSuffix > lenStr)
return 0;
return strncmp(str+lenStr-lenSuffix, suffix, lenSuffix)==0;
}

View File

@@ -37,6 +37,7 @@ float vec2_norm(vec2 v);
// Intersection between a ray and a Unit Circle.
int Intersec_RayUnitCircle(vec2 orig,vec2 vel,vec2 center,float *t);
/////////////////////////////
// Intersect_CircleCircle
//
@@ -46,6 +47,7 @@ int Colision_CircleCircle(
vec2 cb,float rb,
float *t,vec2 n);
/////////////////////////////
// Intersect_RayEdge
//
@@ -56,7 +58,6 @@ int Intersect_RayEdge(
float *t);
/////////////////////////////
// absmod
//
@@ -64,4 +65,11 @@ int absmod(int v,int d);
float fabsmod(float v,int d);
/////////////////////////////
// EndsWith
//
int EndsWith(char *str, char *suffix);
#endif

6285
GameLib/lodepng.c Normal file

File diff suppressed because it is too large Load Diff

1710
GameLib/lodepng.h Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
data/block.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/bunny_left.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/bunny_right.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/A.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/B.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/C.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/D.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/E.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/earth/F.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

BIN
data/flower_left.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

BIN
data/flower_right.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

BIN
data/heaven.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
data/magikball.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/platform.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/player.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/rock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

BIN
data/soldier.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/spider_left.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/spider_right.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
data/spike_left.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
data/spike_right.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
data/spikedbush.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

BIN
data/wizard_left.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

BIN
data/wizard_right.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

2
main.c
View File

@@ -69,7 +69,7 @@ int main(int argc,char *argv[]){
font=Draw_DefaultFont(255,255,255,255);
font_shad=Draw_DefaultFont(0,0,0,127);
img_background=Draw_LoadImage("data/heaven.bmp");
img_background=Draw_LoadImage("data/heaven.png");
Draw_SetOffset(img_background,0,0);
GameEnts_Init();