Update C sources

This commit is contained in:
Milan Nikolic 2017-02-01 15:56:27 +01:00
parent aba5226027
commit e257f040ea
8 changed files with 415 additions and 415 deletions

View file

@ -330,7 +330,7 @@ static void *GamepadThread(void *arg); // Mouse reading thread
// Initialize Window and Graphics Context (OpenGL) // Initialize Window and Graphics Context (OpenGL)
void InitWindow(int width, int height, const char *title) void InitWindow(int width, int height, const char *title)
{ {
TraceLog(INFO, "Initializing raylib (v1.6.0)"); TraceLog(INFO, "Initializing raylib (v1.7.0)");
// Store window title (could be useful...) // Store window title (could be useful...)
windowTitle = title; windowTitle = title;
@ -387,7 +387,7 @@ void InitWindow(int width, int height, const char *title)
// Android activity initialization // Android activity initialization
void InitWindow(int width, int height, void *state) void InitWindow(int width, int height, void *state)
{ {
TraceLog(INFO, "Initializing raylib (v1.6.0)"); TraceLog(INFO, "Initializing raylib (v1.7.0)");
app_dummy(); app_dummy();

View file

@ -65,17 +65,17 @@
// Gestures type // Gestures type
// NOTE: It could be used as flags to enable only some gestures // NOTE: It could be used as flags to enable only some gestures
typedef enum { typedef enum {
GESTURE_NONE = 1, GESTURE_NONE = 0,
GESTURE_TAP = 2, GESTURE_TAP = 1,
GESTURE_DOUBLETAP = 4, GESTURE_DOUBLETAP = 2,
GESTURE_HOLD = 8, GESTURE_HOLD = 4,
GESTURE_DRAG = 16, GESTURE_DRAG = 8,
GESTURE_SWIPE_RIGHT = 32, GESTURE_SWIPE_RIGHT = 16,
GESTURE_SWIPE_LEFT = 64, GESTURE_SWIPE_LEFT = 32,
GESTURE_SWIPE_UP = 128, GESTURE_SWIPE_UP = 64,
GESTURE_SWIPE_DOWN = 256, GESTURE_SWIPE_DOWN = 128,
GESTURE_PINCH_IN = 512, GESTURE_PINCH_IN = 256,
GESTURE_PINCH_OUT = 1024 GESTURE_PINCH_OUT = 512
} Gestures; } Gestures;
#endif #endif

View file

@ -57,7 +57,7 @@ func GetDroppedFiles(count *int32) []string {
ccount := (*C.int)(unsafe.Pointer(count)) ccount := (*C.int)(unsafe.Pointer(count))
ret := C.GetDroppedFiles(ccount) ret := C.GetDroppedFiles(ccount)
tmpslice := (*[1 << 30]*C.char)(unsafe.Pointer(ret))[:*count:*count] tmpslice := (*[1 << 24]*C.char)(unsafe.Pointer(ret))[:*count:*count]
gostrings := make([]string, *count) gostrings := make([]string, *count)
for i, s := range tmpslice { for i, s := range tmpslice {
gostrings[i] = C.GoString(s) gostrings[i] = C.GoString(s)

View file

@ -1,6 +1,6 @@
/********************************************************************************************** /**********************************************************************************************
* *
* raylib 1.6.0 (www.raylib.com) * raylib 1.7.0 (www.raylib.com)
* *
* A simple and easy-to-use library to learn videogames programming * A simple and easy-to-use library to learn videogames programming
* *

View file

@ -2198,7 +2198,7 @@ void rlglUnloadMesh(Mesh *mesh)
// Read screen pixel data (color buffer) // Read screen pixel data (color buffer)
unsigned char *rlglReadScreenPixels(int width, int height) unsigned char *rlglReadScreenPixels(int width, int height)
{ {
unsigned char *screenData = (unsigned char *)malloc(width*height*sizeof(unsigned char)*4); unsigned char *screenData = (unsigned char *)calloc(width*height*4, sizeof(unsigned char));
// NOTE: glReadPixels returns image flipped vertically -> (0,0) is the bottom left corner of the framebuffer // NOTE: glReadPixels returns image flipped vertically -> (0,0) is the bottom left corner of the framebuffer
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, screenData); glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, screenData);