too much things to enumerate...

This commit is contained in:
Andre Leiradella 2016-06-14 21:37:09 -03:00
parent c2443374e4
commit 3bbe3424cd
13 changed files with 592 additions and 566 deletions

9
.gitignore vendored
View File

@ -2,6 +2,15 @@
*.exe *.exe
*.dll *.dll
*.so *.so
*.png
*.tmx
*.tsx
*~ *~
rl_version.c rl_version.c
boot_lua.h boot_lua.h
bounce.h
sketch008.h
smile.h
GPATH
GRTAGS
GTAGS

View File

@ -4,7 +4,7 @@ DEFINES=-DOUTSIDE_SPEEX -DRANDOM_PREFIX=speex -DEXPORT= -DFIXED_POINT
#CFLAGS=-O3 --std=c99 -Wall $(INCLUDES) $(DEFINES) -fPIC #CFLAGS=-O3 --std=c99 -Wall $(INCLUDES) $(DEFINES) -fPIC
CFLAGS=-O0 -g --std=c99 -Wall $(INCLUDES) $(DEFINES) -fPIC CFLAGS=-O0 -g --std=c99 -Wall $(INCLUDES) $(DEFINES) -fPIC
OBJS=rl_backgrnd.o rl_base64.o rl_config.o rl_image.o rl_imgdata.o rl_pack.o rl_rand.o rl_resample.o rl_sound.o rl_snddata.o rl_sprite.o rl_version.o rl_xml.o external/resample.o OBJS=rl_backgrnd.o rl_base64.o rl_config.o rl_image.o rl_imgdata.o rl_pack.o rl_rand.o rl_resample.o rl_sound.o rl_snddata.o rl_sprite.o rl_tiled.o rl_version.o rl_xml.o external/resample.o
%.o: %.c %.o: %.c
gcc $(CFLAGS) -c $< -o $@ gcc $(CFLAGS) -c $< -o $@

View File

@ -7,7 +7,8 @@
//#define RL_BACKGRND_STRETCH 1 //#define RL_BACKGRND_STRETCH 1
//#define RL_BACKGRND_EXPAND 2 //#define RL_BACKGRND_EXPAND 2
#define RL_COLOR( r, g, b ) ( ( r * 32 / 256 ) << 11 | ( g * 64 / 256 ) << 5 | ( b * 32 / 256 ) ) #define RL_COLOR( r, g, b ) ( ( ( r ) * 32 / 256 ) << 11 | ( ( g ) * 64 / 256 ) << 5 | ( ( b ) * 32 / 256 ) )
#define RL_COLOR_2( rgb ) RL_COLOR( ( rgb >> 16 ) & 255, ( rgb >> 8 ) & 255, rgb & 255 )
int rl_backgrnd_create( int width, int height, int aspect ); int rl_backgrnd_create( int width, int height, int aspect );
void rl_backgrnd_destroy( void ); void rl_backgrnd_destroy( void );

View File

@ -10,3 +10,16 @@ static inline uint32_t djb2( const char* str )
return hash; return hash;
} }
static inline uint32_t djb2_length( const char* str, size_t length )
{
const unsigned char* aux = (const unsigned char*)str;
uint32_t hash = 5381;
while ( length-- )
{
hash = ( hash << 5 ) + hash + *aux++;
}
return hash;
}

View File

@ -5,6 +5,7 @@
#include <rl_imgdata.h> #include <rl_imgdata.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h>
/* /*
An image with RLE-encoded pixels and per-pixel alpha of 0, 25, 50, 75 and 100%. An image with RLE-encoded pixels and per-pixel alpha of 0, 25, 50, 75 and 100%.

View File

@ -5,6 +5,7 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h>
typedef struct typedef struct
{ {

View File

@ -6,6 +6,7 @@
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include <stdlib.h>
/* Reasons passed to the stop callback. */ /* Reasons passed to the stop callback. */
#define RL_SOUND_FINISHED 0 #define RL_SOUND_FINISHED 0