Merge branch 'master' into master
This commit is contained in:
commit
ff0a0173c3
21
src/Makefile
21
src/Makefile
|
|
@ -147,13 +147,12 @@ endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Emscripten required variables
|
# Emscripten required variables
|
||||||
EMSDK_PATH ?= C:/emsdk
|
EMSDK_PATH ?= C:/emsdk
|
||||||
EMSCRIPTEN_VERSION ?= 1.38.32
|
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/fastcomp/emscripten
|
||||||
CLANG_VERSION = e$(EMSCRIPTEN_VERSION)_64bit
|
CLANG_PATH = $(EMSDK_PATH)/fastcomp/bin
|
||||||
PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64
|
PYTHON_PATH = $(EMSDK_PATH)/python/2.7.13.1_64bit/python-2.7.13.amd64
|
||||||
NODE_VERSION = 8.9.1_64bit
|
NODE_PATH = $(EMSDK_PATH)/node/12.9.1_64bit/bin
|
||||||
export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH)
|
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:\raylib\MinGW\bin:$$(PATH)
|
||||||
EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
||||||
|
|
@ -278,7 +277,13 @@ endif
|
||||||
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
||||||
# -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers
|
# -Werror=pointer-arith catch unportable code that does direct arithmetic on void pointers
|
||||||
# -fno-strict-aliasing jar_xm.h does shady stuff (breaks strict aliasing)
|
# -fno-strict-aliasing jar_xm.h does shady stuff (breaks strict aliasing)
|
||||||
CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing
|
CFLAGS += -Wall -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing
|
||||||
|
|
||||||
|
ifeq ($(PLATFORM), PLATFORM_WEB)
|
||||||
|
CFLAGS += -std=gnu99
|
||||||
|
else
|
||||||
|
CFLAGS += -std=c99
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
CFLAGS += -fPIC
|
CFLAGS += -fPIC
|
||||||
|
|
|
||||||
|
|
@ -2056,15 +2056,15 @@ unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLe
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decompress data (DEFLATE algorythm)
|
// Decompress data (DEFLATE algorythm)
|
||||||
char *DecompressData(char *compData, int compDataLength, int *dataLength)
|
unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength)
|
||||||
{
|
{
|
||||||
char *data = NULL;
|
char *data = NULL;
|
||||||
|
|
||||||
#if defined(SUPPORT_COMPRESSION_API)
|
#if defined(SUPPORT_COMPRESSION_API)
|
||||||
data = stbi_zlib_decode_malloc(compData, compDataLength, dataLength);
|
data = stbi_zlib_decode_malloc((char *)compData, compDataLength, dataLength);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return data;
|
return (unsigned char *)data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save integer value to storage file (to defined position)
|
// Save integer value to storage file (to defined position)
|
||||||
|
|
@ -3960,7 +3960,7 @@ static void WindowIconifyCallback(GLFWwindow *window, int iconified)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GLFW3 Window Drop Callback, runs when drop files into window
|
// GLFW3 Window Drop Callback, runs when drop files into window
|
||||||
// NOTE: Paths are stored in dinamic memory for further retrieval
|
// NOTE: Paths are stored in dynamic memory for further retrieval
|
||||||
// Everytime new files are dropped, old ones are discarded
|
// Everytime new files are dropped, old ones are discarded
|
||||||
static void WindowDropCallback(GLFWwindow *window, int count, const char **paths)
|
static void WindowDropCallback(GLFWwindow *window, int count, const char **paths)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2800,8 +2800,8 @@ static Model LoadOBJ(const char *fileName)
|
||||||
model.materials = (Material *)RL_CALLOC(model.materialCount, sizeof(Material));
|
model.materials = (Material *)RL_CALLOC(model.materialCount, sizeof(Material));
|
||||||
|
|
||||||
}
|
}
|
||||||
model.meshMaterial = (int *)RL_CALLOC(model.meshCount, sizeof(int));
|
|
||||||
|
|
||||||
|
model.meshMaterial = (int *)RL_CALLOC(model.meshCount, sizeof(int));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Multiple meshes data reference
|
// Multiple meshes data reference
|
||||||
|
|
|
||||||
|
|
@ -956,8 +956,8 @@ RLAPI char **GetDroppedFiles(int *count); // Get dropped
|
||||||
RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory)
|
RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory)
|
||||||
RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time)
|
RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time)
|
||||||
|
|
||||||
RLAPI unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorythm)
|
RLAPI unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorythm)
|
||||||
RLAPI char *DecompressData(char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorythm)
|
RLAPI unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorythm)
|
||||||
|
|
||||||
// Persistent storage management
|
// Persistent storage management
|
||||||
RLAPI void StorageSaveValue(int position, int value); // Save integer value to storage file (to defined position)
|
RLAPI void StorageSaveValue(int position, int value); // Save integer value to storage file (to defined position)
|
||||||
|
|
|
||||||
|
|
@ -253,13 +253,10 @@ Image LoadImage(const char *fileName)
|
||||||
|
|
||||||
FILE *imFile = fopen(fileName, "rb");
|
FILE *imFile = fopen(fileName, "rb");
|
||||||
|
|
||||||
stbi_set_flip_vertically_on_load(true);
|
|
||||||
|
|
||||||
// Load 32 bit per channel floats data
|
// Load 32 bit per channel floats data
|
||||||
|
//stbi_set_flip_vertically_on_load(true);
|
||||||
image.data = stbi_loadf_from_file(imFile, &image.width, &image.height, &imgBpp, 0);
|
image.data = stbi_loadf_from_file(imFile, &image.width, &image.height, &imgBpp, 0);
|
||||||
|
|
||||||
stbi_set_flip_vertically_on_load(false);
|
|
||||||
|
|
||||||
fclose(imFile);
|
fclose(imFile);
|
||||||
|
|
||||||
image.mipmaps = 1;
|
image.mipmaps = 1;
|
||||||
|
|
@ -551,7 +548,7 @@ Color *GetImageData(Image image)
|
||||||
pixels[i].a = 255;
|
pixels[i].a = 255;
|
||||||
|
|
||||||
k += 3;
|
k += 3;
|
||||||
}
|
} break;
|
||||||
case UNCOMPRESSED_R32G32B32A32:
|
case UNCOMPRESSED_R32G32B32A32:
|
||||||
{
|
{
|
||||||
pixels[i].r = (unsigned char)(((float *)image.data)[k]*255.0f);
|
pixels[i].r = (unsigned char)(((float *)image.data)[k]*255.0f);
|
||||||
|
|
@ -560,7 +557,7 @@ Color *GetImageData(Image image)
|
||||||
pixels[i].a = (unsigned char)(((float *)image.data)[k]*255.0f);
|
pixels[i].a = (unsigned char)(((float *)image.data)[k]*255.0f);
|
||||||
|
|
||||||
k += 4;
|
k += 4;
|
||||||
}
|
} break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1826,7 +1823,9 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color
|
||||||
}
|
}
|
||||||
|
|
||||||
Image srcCopy = ImageCopy(src); // Make a copy of source image to work with it
|
Image srcCopy = ImageCopy(src); // Make a copy of source image to work with it
|
||||||
ImageCrop(&srcCopy, srcRec); // Crop source image to desired source rectangle
|
|
||||||
|
// Crop source image to desired source rectangle (if required)
|
||||||
|
if ((src.width != (int)srcRec.width) && (src.height != (int)srcRec.height)) ImageCrop(&srcCopy, srcRec);
|
||||||
|
|
||||||
// Scale source image in case destination rec size is different than source rec size
|
// Scale source image in case destination rec size is different than source rec size
|
||||||
if (((int)dstRec.width != (int)srcRec.width) || ((int)dstRec.height != (int)srcRec.height))
|
if (((int)dstRec.width != (int)srcRec.width) || ((int)dstRec.height != (int)srcRec.height))
|
||||||
|
|
@ -1856,7 +1855,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color
|
||||||
dstRec.y = 0;
|
dstRec.y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dstRec.y > (dst->height - dstRec.height))
|
if ((dstRec.y + dstRec.height) > dst->height)
|
||||||
{
|
{
|
||||||
ImageCrop(&srcCopy, (Rectangle) { 0, 0, dstRec.width, dst->height - dstRec.y });
|
ImageCrop(&srcCopy, (Rectangle) { 0, 0, dstRec.width, dst->height - dstRec.y });
|
||||||
dstRec.height = dst->height - dstRec.y;
|
dstRec.height = dst->height - dstRec.y;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user