diff options
| author | victorfisac <[email protected]> | 2017-03-06 09:47:08 +0100 |
|---|---|---|
| committer | victorfisac <[email protected]> | 2017-03-06 09:47:08 +0100 |
| commit | f9277f216372179560c560427beccdd2e5c5d094 (patch) | |
| tree | 8d3858c978f2b36ea8912f25e3cbe6fa56952aff /src/utils.h | |
| parent | ce56fcb1eda06385b88c1a906f0968d742ff8130 (diff) | |
| parent | c05701253e0a4eda211a0d7ced74ae29d6585917 (diff) | |
| download | raylib-f9277f216372179560c560427beccdd2e5c5d094.tar.gz raylib-f9277f216372179560c560427beccdd2e5c5d094.zip | |
Merge remote-tracking branch 'refs/remotes/raysan5/master'
Diffstat (limited to 'src/utils.h')
| -rw-r--r-- | src/utils.h | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/src/utils.h b/src/utils.h index 77909ba6..3ffd025c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -2,9 +2,9 @@ * * raylib.utils * -* Some utility functions: rRES files data decompression +* Some utility functions * -* Copyright (c) 2014 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -27,15 +27,15 @@ #define UTILS_H #if defined(PLATFORM_ANDROID) - #include <stdio.h> // Defines FILE struct - #include <android/asset_manager.h> // defines AAssetManager struct + #include <stdio.h> // Required for: FILE + #include <android/asset_manager.h> // Required for: AAssetManager #endif +#include "rres.h" + //---------------------------------------------------------------------------------- // Some basic Defines //---------------------------------------------------------------------------------- -#define DO_NOT_TRACE_DEBUG_MSGS // Use this define to avoid DEBUG tracing - #if defined(PLATFORM_ANDROID) #define fopen(name, mode) android_fopen(name, mode) #endif @@ -43,19 +43,8 @@ //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- -typedef enum { IMAGE = 0, SOUND, MODEL, TEXT, RAW } DataType; - typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; -// One resource info header, every resource includes this header (8 byte) -typedef struct { - unsigned short id; // Resource unique identifier (2 byte) - unsigned char type; // Resource type (1 byte) - unsigned char comp; // Data Compression and Coding (1 byte) - unsigned int size; // Data size in .rres file (compressed or not, only DATA) (4 byte) - unsigned int srcSize; // Source data size (uncompressed, only DATA) -} ResInfoHeader; - #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif @@ -68,17 +57,14 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- -unsigned char *DecompressData(const unsigned char *data, unsigned long compSize, int uncompSize); +void TraceLog(int msgType, const char *text, ...); // Outputs a trace log message +const char *GetExtension(const char *fileName); // Returns extension of a filename #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) -void WriteBitmap(const char *fileName, unsigned char *imgData, int width, int height); -void WritePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize); +void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize); +void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize); #endif -void TraceLog(int msgType, const char *text, ...); // Outputs a trace log message -const char *GetExtension(const char *fileName); // Returns extension of a filename -int GetNextPOT(int num); // Calculate next power-of-two value for a given num - #if defined(PLATFORM_ANDROID) void InitAssetManager(AAssetManager *manager); // Initialize asset manager from android app FILE *android_fopen(const char *fileName, const char *mode); // Replacement for fopen() |
