Merge remote-tracking branch 'upstream/master'
Conflicts: project/src/text/Font.cpp
This commit is contained in:
@@ -167,7 +167,7 @@ namespace lime {
|
||||
|
||||
#define BUFFER_SIZE 4096
|
||||
|
||||
vorbis_info *pInfo = ov_info (&oggFile, -1);
|
||||
vorbis_info *pInfo = ov_info (&oggFile, -1);
|
||||
|
||||
if (pInfo == NULL) {
|
||||
|
||||
|
||||
@@ -53,17 +53,10 @@ namespace lime {
|
||||
|
||||
if (resource->path) {
|
||||
|
||||
//#ifdef ANDROID
|
||||
//FileInfo info = AndroidGetAssetFD (resource->path);
|
||||
//file = fdopen (info.fd, "rb");
|
||||
//lime::fseek (file, info.offset, 0);
|
||||
//#else
|
||||
file = lime::fopen (resource->path, "rb");
|
||||
//#endif
|
||||
|
||||
if (!file) {
|
||||
|
||||
//LOG_SOUND ("FAILED to read audio file, file pointer as null?\n");
|
||||
return false;
|
||||
|
||||
}
|
||||
@@ -72,7 +65,6 @@ namespace lime {
|
||||
|
||||
if ((riff_header.chunkID[0] != 'R' || riff_header.chunkID[1] != 'I' || riff_header.chunkID[2] != 'F' || riff_header.chunkID[3] != 'F') || (riff_header.format[0] != 'W' || riff_header.format[1] != 'A' || riff_header.format[2] != 'V' || riff_header.format[3] != 'E')) {
|
||||
|
||||
//LOG_SOUND ("Invalid RIFF or WAVE Header!\n");
|
||||
lime::fclose (file);
|
||||
return false;
|
||||
|
||||
@@ -106,12 +98,6 @@ namespace lime {
|
||||
|
||||
}
|
||||
|
||||
//if (wave_format.subChunkSize > 16) {
|
||||
//
|
||||
//lime::fseek (file, sizeof (short), SEEK_CUR);
|
||||
//
|
||||
//}
|
||||
|
||||
bool foundData = false;
|
||||
|
||||
while (!foundData) {
|
||||
@@ -162,7 +148,6 @@ namespace lime {
|
||||
|
||||
if ((riff_header.chunkID[0] != 'R' || riff_header.chunkID[1] != 'I' || riff_header.chunkID[2] != 'F' || riff_header.chunkID[3] != 'F') || (riff_header.format[0] != 'W' || riff_header.format[1] != 'A' || riff_header.format[2] != 'V' || riff_header.format[3] != 'E')) {
|
||||
|
||||
//LOG_SOUND ("Invalid RIFF or WAVE Header!\n");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@@ -135,6 +135,13 @@ namespace lime {
|
||||
ProcessGamepadEvent (event);
|
||||
break;
|
||||
|
||||
case SDL_FINGERMOTION:
|
||||
case SDL_FINGERDOWN:
|
||||
case SDL_FINGERUP:
|
||||
|
||||
ProcessTouchEvent (event);
|
||||
break;
|
||||
|
||||
case SDL_JOYAXISMOTION:
|
||||
case SDL_JOYBALLMOTION:
|
||||
case SDL_JOYBUTTONDOWN:
|
||||
@@ -159,13 +166,6 @@ namespace lime {
|
||||
|
||||
ProcessMouseEvent (event);
|
||||
break;
|
||||
|
||||
case SDL_FINGERMOTION:
|
||||
case SDL_FINGERDOWN:
|
||||
case SDL_FINGERUP:
|
||||
|
||||
ProcessTouchEvent (event);
|
||||
break;
|
||||
|
||||
case SDL_TEXTINPUT:
|
||||
case SDL_TEXTEDITING:
|
||||
@@ -319,6 +319,10 @@ namespace lime {
|
||||
|
||||
void SDLApplication::ProcessMouseEvent (SDL_Event* event) {
|
||||
|
||||
#ifdef IPHONEOS
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (MouseEvent::callback) {
|
||||
|
||||
switch (event->type) {
|
||||
@@ -394,39 +398,41 @@ namespace lime {
|
||||
|
||||
|
||||
void SDLApplication::ProcessTouchEvent (SDL_Event* event) {
|
||||
|
||||
|
||||
if (TouchEvent::callback) {
|
||||
|
||||
|
||||
switch (event->type) {
|
||||
|
||||
case SDL_FINGERMOTION:
|
||||
|
||||
|
||||
touchEvent.type = TOUCH_MOVE;
|
||||
touchEvent.x = event->tfinger.x;
|
||||
touchEvent.y = event->tfinger.y;
|
||||
touchEvent.id = event->tfinger.fingerId;
|
||||
break;
|
||||
|
||||
|
||||
case SDL_FINGERDOWN:
|
||||
|
||||
|
||||
touchEvent.type = TOUCH_START;
|
||||
touchEvent.x = event->tfinger.x;
|
||||
touchEvent.y = event->tfinger.y;
|
||||
touchEvent.id = event->tfinger.fingerId;
|
||||
break;
|
||||
|
||||
|
||||
case SDL_FINGERUP:
|
||||
|
||||
|
||||
touchEvent.type = TOUCH_END;
|
||||
touchEvent.x = event->tfinger.x;
|
||||
touchEvent.y = event->tfinger.y;
|
||||
touchEvent.id = event->tfinger.fingerId;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
TouchEvent::Dispatch (&touchEvent);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -853,7 +853,7 @@ namespace lime {
|
||||
|
||||
if (count > 0) {
|
||||
|
||||
*(uint32_t *)(bytes->Data ()) = count;
|
||||
*(uint32_t*)(bytes->Data ()) = count;
|
||||
|
||||
}
|
||||
|
||||
@@ -869,6 +869,7 @@ namespace lime {
|
||||
|
||||
FT_Set_Char_Size ((FT_Face)face, (int)(size*64), (int)(size*64), hdpi, vdpi);
|
||||
mSize = size;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -83,8 +83,8 @@ namespace lime {
|
||||
}
|
||||
|
||||
lime::fseek (file, 0, SEEK_END);
|
||||
|
||||
int size = lime::ftell (file);
|
||||
lime::fseek (file, 0, SEEK_SET);
|
||||
|
||||
if (size > 0) {
|
||||
|
||||
@@ -94,7 +94,6 @@ namespace lime {
|
||||
}
|
||||
|
||||
lime::fclose (file);
|
||||
delete file;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user