Reviewed some TODO
This commit is contained in:
parent
51b147cd32
commit
83b3478fe4
9 changed files with 41 additions and 33 deletions
|
@ -193,7 +193,7 @@ typedef struct tagBITMAPINFOHEADER {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SUPPORT_FILEFORMAT_OGG)
|
#if defined(SUPPORT_FILEFORMAT_OGG)
|
||||||
// TODO: Remap malloc()/free() calls to RL_MALLOC/RL_FREE
|
// TODO: Remap stb_vorbis malloc()/free() calls to RL_MALLOC/RL_FREE
|
||||||
|
|
||||||
#define STB_VORBIS_IMPLEMENTATION
|
#define STB_VORBIS_IMPLEMENTATION
|
||||||
#include "external/stb_vorbis.h" // OGG loading functions
|
#include "external/stb_vorbis.h" // OGG loading functions
|
||||||
|
@ -405,8 +405,6 @@ void UntrackAudioBuffer(AudioBuffer *buffer);
|
||||||
// Initialize audio device
|
// Initialize audio device
|
||||||
void InitAudioDevice(void)
|
void InitAudioDevice(void)
|
||||||
{
|
{
|
||||||
// TODO: Load AUDIO context memory dynamically?
|
|
||||||
|
|
||||||
// Init audio context
|
// Init audio context
|
||||||
ma_context_config ctxConfig = ma_context_config_init();
|
ma_context_config ctxConfig = ma_context_config_init();
|
||||||
ctxConfig.logCallback = OnLog;
|
ctxConfig.logCallback = OnLog;
|
||||||
|
|
|
@ -279,7 +279,6 @@ void SetCameraMode(Camera camera, int mode)
|
||||||
// System: EnableCursor(), DisableCursor()
|
// System: EnableCursor(), DisableCursor()
|
||||||
// Mouse: IsMouseButtonDown(), GetMousePosition(), GetMouseWheelMove()
|
// Mouse: IsMouseButtonDown(), GetMousePosition(), GetMouseWheelMove()
|
||||||
// Keys: IsKeyDown()
|
// Keys: IsKeyDown()
|
||||||
// TODO: Port to quaternion-based camera (?)
|
|
||||||
void UpdateCamera(Camera *camera)
|
void UpdateCamera(Camera *camera)
|
||||||
{
|
{
|
||||||
static int swingCounter = 0; // Used for 1st person swinging movement
|
static int swingCounter = 0; // Used for 1st person swinging movement
|
||||||
|
@ -532,7 +531,6 @@ void UpdateCamera(Camera *camera)
|
||||||
// Camera distance clamp
|
// Camera distance clamp
|
||||||
if (CAMERA.targetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) CAMERA.targetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP;
|
if (CAMERA.targetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) CAMERA.targetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP;
|
||||||
|
|
||||||
// TODO: It seems camera->position is not correctly updated or some rounding issue makes the camera move straight to camera->target...
|
|
||||||
camera->position.x = sinf(CAMERA.angle.x)*CAMERA.targetDistance*cosf(CAMERA.angle.y) + camera->target.x;
|
camera->position.x = sinf(CAMERA.angle.x)*CAMERA.targetDistance*cosf(CAMERA.angle.y) + camera->target.x;
|
||||||
|
|
||||||
if (CAMERA.angle.y <= 0.0f) camera->position.y = sinf(CAMERA.angle.y)*CAMERA.targetDistance*sinf(CAMERA.angle.y) + camera->target.y;
|
if (CAMERA.angle.y <= 0.0f) camera->position.y = sinf(CAMERA.angle.y)*CAMERA.targetDistance*sinf(CAMERA.angle.y) + camera->target.y;
|
||||||
|
|
17
src/rcore.c
17
src/rcore.c
|
@ -680,11 +680,11 @@ void android_main(struct android_app *app)
|
||||||
char arg0[] = "raylib"; // NOTE: argv[] are mutable
|
char arg0[] = "raylib"; // NOTE: argv[] are mutable
|
||||||
CORE.Android.app = app;
|
CORE.Android.app = app;
|
||||||
|
|
||||||
// TODO: Should we maybe report != 0 return codes somewhere?
|
// NOTE: Return codes != 0 are skipped
|
||||||
(void)main(1, (char *[]) { arg0, NULL });
|
(void)main(1, (char *[]) { arg0, NULL });
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Add this to header (if apps really need it)
|
// NOTE: Add this to header (if apps really need it)
|
||||||
struct android_app *GetAndroidApp(void)
|
struct android_app *GetAndroidApp(void)
|
||||||
{
|
{
|
||||||
return CORE.Android.app;
|
return CORE.Android.app;
|
||||||
|
@ -1519,7 +1519,6 @@ void SetWindowMinSize(int width, int height)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set window dimensions
|
// Set window dimensions
|
||||||
// TODO: Issues on HighDPI scaling
|
|
||||||
void SetWindowSize(int width, int height)
|
void SetWindowSize(int width, int height)
|
||||||
{
|
{
|
||||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||||
|
@ -1528,8 +1527,7 @@ void SetWindowSize(int width, int height)
|
||||||
#if defined(PLATFORM_WEB)
|
#if defined(PLATFORM_WEB)
|
||||||
//emscripten_set_canvas_size(width, height); // DEPRECATED!
|
//emscripten_set_canvas_size(width, height); // DEPRECATED!
|
||||||
|
|
||||||
// TODO: Below functions should be used to replace previous one but
|
// TODO: Below functions should be used to replace previous one but they do not seem to work properly
|
||||||
// they do not seem to work properly
|
|
||||||
//emscripten_set_canvas_element_size("canvas", width, height);
|
//emscripten_set_canvas_element_size("canvas", width, height);
|
||||||
//emscripten_set_element_css_size("canvas", width, height);
|
//emscripten_set_element_css_size("canvas", width, height);
|
||||||
#endif
|
#endif
|
||||||
|
@ -2677,7 +2675,6 @@ void TakeScreenshot(const char *fileName)
|
||||||
emscripten_run_script(TextFormat("saveFileFromMEMFSToDisk('%s','%s')", GetFileName(path), GetFileName(path)));
|
emscripten_run_script(TextFormat("saveFileFromMEMFSToDisk('%s','%s')", GetFileName(path), GetFileName(path)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: Verification required for log
|
|
||||||
TRACELOG(LOG_INFO, "SYSTEM: [%s] Screenshot taken successfully", path);
|
TRACELOG(LOG_INFO, "SYSTEM: [%s] Screenshot taken successfully", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3593,8 +3590,6 @@ Vector2 GetTouchPosition(int index)
|
||||||
#if defined(PLATFORM_WEB) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM)
|
#if defined(PLATFORM_WEB) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM)
|
||||||
if (index < MAX_TOUCH_POINTS) position = CORE.Input.Touch.position[index];
|
if (index < MAX_TOUCH_POINTS) position = CORE.Input.Touch.position[index];
|
||||||
else TRACELOG(LOG_WARNING, "INPUT: Required touch point out of range (Max touch points: %i)", MAX_TOUCH_POINTS);
|
else TRACELOG(LOG_WARNING, "INPUT: Required touch point out of range (Max touch points: %i)", MAX_TOUCH_POINTS);
|
||||||
|
|
||||||
// TODO: Touch position scaling required?
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return position;
|
return position;
|
||||||
|
@ -5473,8 +5468,6 @@ static EM_BOOL EmscriptenGamepadCallback(int eventType, const EmscriptenGamepadE
|
||||||
}
|
}
|
||||||
else CORE.Input.Gamepad.ready[gamepadEvent->index] = false;
|
else CORE.Input.Gamepad.ready[gamepadEvent->index] = false;
|
||||||
|
|
||||||
// TODO: Test gamepadEvent->index
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -5539,7 +5532,6 @@ static void RestoreKeyboard(void)
|
||||||
|
|
||||||
#if defined(SUPPORT_SSH_KEYBOARD_RPI)
|
#if defined(SUPPORT_SSH_KEYBOARD_RPI)
|
||||||
// Process keyboard inputs
|
// Process keyboard inputs
|
||||||
// TODO: Most probably input reading and processing should be in a separate thread
|
|
||||||
static void ProcessKeyboard(void)
|
static void ProcessKeyboard(void)
|
||||||
{
|
{
|
||||||
#define MAX_KEYBUFFER_SIZE 32 // Max size in bytes to read
|
#define MAX_KEYBUFFER_SIZE 32 // Max size in bytes to read
|
||||||
|
@ -5894,7 +5886,7 @@ static void ConfigureEvdevDevice(char *device)
|
||||||
static void PollKeyboardEvents(void)
|
static void PollKeyboardEvents(void)
|
||||||
{
|
{
|
||||||
// Scancode to keycode mapping for US keyboards
|
// Scancode to keycode mapping for US keyboards
|
||||||
// TODO: Probably replace this with a keymap from the X11 to get the correct regional map for the keyboard:
|
// TODO: Replace this with a keymap from the X11 to get the correct regional map for the keyboard:
|
||||||
// Currently non US keyboards will have the wrong mapping for some keys
|
// Currently non US keyboards will have the wrong mapping for some keys
|
||||||
static const int keymapUS[] = {
|
static const int keymapUS[] = {
|
||||||
0, 256, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 45, 61, 259, 258, 81, 87, 69, 82, 84,
|
0, 256, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 45, 61, 259, 258, 81, 87, 69, 82, 84,
|
||||||
|
@ -6380,7 +6372,6 @@ static void LoadAutomationEvents(const char *fileName)
|
||||||
// Export recorded events into a file
|
// Export recorded events into a file
|
||||||
static void ExportAutomationEvents(const char *fileName)
|
static void ExportAutomationEvents(const char *fileName)
|
||||||
{
|
{
|
||||||
// TODO: eventCount is required -> header? -> rAEL
|
|
||||||
unsigned char fileId[4] = "rEP ";
|
unsigned char fileId[4] = "rEP ";
|
||||||
|
|
||||||
// Save as binary
|
// Save as binary
|
||||||
|
|
|
@ -412,7 +412,7 @@ void ProcessGestureEvent(GestureEvent event)
|
||||||
}
|
}
|
||||||
else if (GESTURES.Touch.pointCount > 2) // More than two touch points
|
else if (GESTURES.Touch.pointCount > 2) // More than two touch points
|
||||||
{
|
{
|
||||||
// TODO.
|
// TODO: Process gesture events for more than two points
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,6 @@
|
||||||
#include "external/glfw/src/x11_monitor.c"
|
#include "external/glfw/src/x11_monitor.c"
|
||||||
#include "external/glfw/src/x11_window.c"
|
#include "external/glfw/src/x11_window.c"
|
||||||
#include "external/glfw/src/xkb_unicode.c"
|
#include "external/glfw/src/xkb_unicode.c"
|
||||||
// TODO: Joystick implementation
|
|
||||||
#include "external/glfw/src/null_joystick.c"
|
#include "external/glfw/src/null_joystick.c"
|
||||||
#include "external/glfw/src/posix_time.c"
|
#include "external/glfw/src/posix_time.c"
|
||||||
#include "external/glfw/src/posix_thread.c"
|
#include "external/glfw/src/posix_thread.c"
|
||||||
|
|
|
@ -1294,8 +1294,8 @@ void rlVertex3f(float x, float y, float z)
|
||||||
RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].texcoords[2*RLGL.State.vertexCounter] = RLGL.State.texcoordx;
|
RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].texcoords[2*RLGL.State.vertexCounter] = RLGL.State.texcoordx;
|
||||||
RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].texcoords[2*RLGL.State.vertexCounter + 1] = RLGL.State.texcoordy;
|
RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].texcoords[2*RLGL.State.vertexCounter + 1] = RLGL.State.texcoordy;
|
||||||
|
|
||||||
// Add current normal
|
// TODO: Add current normal
|
||||||
// TODO.
|
// By default rlVertexBuffer type does not store normals
|
||||||
|
|
||||||
// Add current color
|
// Add current color
|
||||||
RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.State.vertexCounter] = RLGL.State.colorr;
|
RLGL.currentBatch->vertexBuffer[RLGL.currentBatch->currentBuffer].colors[4*RLGL.State.vertexCounter] = RLGL.State.colorr;
|
||||||
|
|
|
@ -775,8 +775,6 @@ Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **charRecs, int glyphC
|
||||||
RL_FREE(context);
|
RL_FREE(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Crop image if required for smaller size
|
|
||||||
|
|
||||||
// Convert image data from GRAYSCALE to GRAY_ALPHA
|
// Convert image data from GRAYSCALE to GRAY_ALPHA
|
||||||
unsigned char *dataGrayAlpha = (unsigned char *)RL_MALLOC(atlas.width*atlas.height*sizeof(unsigned char)*2); // Two channels
|
unsigned char *dataGrayAlpha = (unsigned char *)RL_MALLOC(atlas.width*atlas.height*sizeof(unsigned char)*2); // Two channels
|
||||||
|
|
||||||
|
@ -1352,7 +1350,7 @@ const char *TextToUpper(const char *text)
|
||||||
buffer[i] = (char)toupper(text[i]);
|
buffer[i] = (char)toupper(text[i]);
|
||||||
//if ((text[i] >= 'a') && (text[i] <= 'z')) buffer[i] = text[i] - 32;
|
//if ((text[i] >= 'a') && (text[i] <= 'z')) buffer[i] = text[i] - 32;
|
||||||
|
|
||||||
// TODO: Support UTF-8 diacritics!
|
// TODO: Support UTF-8 diacritics to upper-case
|
||||||
//if ((text[i] >= 'à') && (text[i] <= 'ý')) buffer[i] = text[i] - 32;
|
//if ((text[i] >= 'à') && (text[i] <= 'ý')) buffer[i] = text[i] - 32;
|
||||||
}
|
}
|
||||||
else { buffer[i] = '\0'; break; }
|
else { buffer[i] = '\0'; break; }
|
||||||
|
|
|
@ -279,7 +279,7 @@ Image LoadImageAnim(const char *fileName, int *frames)
|
||||||
#endif
|
#endif
|
||||||
else image = LoadImage(fileName);
|
else image = LoadImage(fileName);
|
||||||
|
|
||||||
// TODO: Support APNG animated images?
|
// TODO: Support APNG animated images
|
||||||
|
|
||||||
*frames = frameCount;
|
*frames = frameCount;
|
||||||
return image;
|
return image;
|
||||||
|
@ -1481,7 +1481,7 @@ void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, i
|
||||||
int bytesPerPixel = GetPixelDataSize(1, 1, image->format);
|
int bytesPerPixel = GetPixelDataSize(1, 1, image->format);
|
||||||
unsigned char *resizedData = (unsigned char *)RL_CALLOC(newWidth*newHeight*bytesPerPixel, 1);
|
unsigned char *resizedData = (unsigned char *)RL_CALLOC(newWidth*newHeight*bytesPerPixel, 1);
|
||||||
|
|
||||||
// TODO: Fill resizedData with fill color (must be formatted to image->format)
|
// TODO: Fill resized canvas with fill color (must be formatted to image->format)
|
||||||
|
|
||||||
int dstOffsetSize = ((int)dstPos.y*newWidth + (int)dstPos.x)*bytesPerPixel;
|
int dstOffsetSize = ((int)dstPos.y*newWidth + (int)dstPos.x)*bytesPerPixel;
|
||||||
|
|
||||||
|
@ -2893,7 +2893,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layout)
|
||||||
faces = GenImageColor(size, size*6, MAGENTA);
|
faces = GenImageColor(size, size*6, MAGENTA);
|
||||||
ImageFormat(&faces, image.format);
|
ImageFormat(&faces, image.format);
|
||||||
|
|
||||||
// TODO: Image formating does not work with compressed textures!
|
// NOTE: Image formating does not work with compressed textures
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++) ImageDraw(&faces, image, faceRecs[i], (Rectangle){ 0, (float)size*i, (float)size, (float)size }, WHITE);
|
for (int i = 0; i < 6; i++) ImageDraw(&faces, image, faceRecs[i], (Rectangle){ 0, (float)size*i, (float)size, (float)size }, WHITE);
|
||||||
|
@ -3818,9 +3818,33 @@ Color GetPixelColor(void *srcPtr, int format)
|
||||||
} break;
|
} break;
|
||||||
case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: color = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[1], ((unsigned char *)srcPtr)[2], ((unsigned char *)srcPtr)[3] }; break;
|
case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: color = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[1], ((unsigned char *)srcPtr)[2], ((unsigned char *)srcPtr)[3] }; break;
|
||||||
case PIXELFORMAT_UNCOMPRESSED_R8G8B8: color = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[1], ((unsigned char *)srcPtr)[2], 255 }; break;
|
case PIXELFORMAT_UNCOMPRESSED_R8G8B8: color = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[1], ((unsigned char *)srcPtr)[2], 255 }; break;
|
||||||
// TODO: case PIXELFORMAT_UNCOMPRESSED_R32: break;
|
case PIXELFORMAT_UNCOMPRESSED_R32:
|
||||||
// TODO: case PIXELFORMAT_UNCOMPRESSED_R32G32B32: break;
|
{
|
||||||
// TODO: case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: break;
|
// NOTE: Pixel normalized float value is converted to [0..255]
|
||||||
|
color.r = (unsigned char)(((float *)srcPtr)[0]*255.0f);
|
||||||
|
color.g = (unsigned char)(((float *)srcPtr)[0]*255.0f);
|
||||||
|
color.b = (unsigned char)(((float *)srcPtr)[0]*255.0f);
|
||||||
|
color.a = 255;
|
||||||
|
|
||||||
|
} break;
|
||||||
|
case PIXELFORMAT_UNCOMPRESSED_R32G32B32:
|
||||||
|
{
|
||||||
|
// NOTE: Pixel normalized float value is converted to [0..255]
|
||||||
|
color.r = (unsigned char)(((float *)srcPtr)[0]*255.0f);
|
||||||
|
color.g = (unsigned char)(((float *)srcPtr)[1]*255.0f);
|
||||||
|
color.b = (unsigned char)(((float *)srcPtr)[2]*255.0f);
|
||||||
|
color.a = 255;
|
||||||
|
|
||||||
|
} break;
|
||||||
|
case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32:
|
||||||
|
{
|
||||||
|
// NOTE: Pixel normalized float value is converted to [0..255]
|
||||||
|
color.r = (unsigned char)(((float *)srcPtr)[0]*255.0f);
|
||||||
|
color.g = (unsigned char)(((float *)srcPtr)[1]*255.0f);
|
||||||
|
color.b = (unsigned char)(((float *)srcPtr)[2]*255.0f);
|
||||||
|
color.a = (unsigned char)(((float *)srcPtr)[3]*255.0f);
|
||||||
|
|
||||||
|
} break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -375,8 +375,8 @@ FILE *android_fopen(const char *fileName, const char *mode)
|
||||||
{
|
{
|
||||||
if (mode[0] == 'w')
|
if (mode[0] == 'w')
|
||||||
{
|
{
|
||||||
// TODO: fopen() is mapped to android_fopen() that only grants read access
|
// fopen() is mapped to android_fopen() that only grants read access to
|
||||||
// to assets directory through AAssetManager but we want to also be able to
|
// assets directory through AAssetManager but we want to also be able to
|
||||||
// write data when required using the standard stdio FILE access functions
|
// write data when required using the standard stdio FILE access functions
|
||||||
// Ref: https://stackoverflow.com/questions/11294487/android-writing-saving-files-from-native-code-only
|
// Ref: https://stackoverflow.com/questions/11294487/android-writing-saving-files-from-native-code-only
|
||||||
#undef fopen
|
#undef fopen
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue