aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-02-12 12:22:56 +0100
committerraysan5 <raysan5@gmail.com>2016-02-12 12:22:56 +0100
commit823abf666e09e96ccbf5230c96f2d3a61ff60895 (patch)
tree2fc8e05491b466b1dd6855ef63038f691dfe7ed5
parent685273675bc9247e215c213939c017e506296a70 (diff)
downloadraylib-823abf666e09e96ccbf5230c96f2d3a61ff60895.tar.gz
raylib-823abf666e09e96ccbf5230c96f2d3a61ff60895.zip
Reviewed code TODOs
-rw-r--r--src/audio.c2
-rw-r--r--src/camera.c2
-rw-r--r--src/core.c17
-rw-r--r--src/models.c1
-rw-r--r--src/rlgl.c10
-rw-r--r--src/text.c2
-rw-r--r--src/textures.c10
7 files changed, 19 insertions, 25 deletions
diff --git a/src/audio.c b/src/audio.c
index e40fdd41..260f6778 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -280,9 +280,9 @@ Sound LoadSoundFromWave(Wave wave)
}
// Load sound to memory from rRES file (raylib Resource)
+// TODO: Maybe rresName could be directly a char array with all the data?
Sound LoadSoundFromRES(const char *rresName, int resId)
{
- // NOTE: rresName could be directly a char array with all the data!!! --> TODO
Sound sound = { 0 };
#if defined(AUDIO_STANDALONE)
diff --git a/src/camera.c b/src/camera.c
index 6539da5f..517e4a2b 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -375,7 +375,7 @@ static void ProcessCamera(Camera *camera, Vector3 *playerPosition)
}
// Focus to center
- // TODO: Move this function out of the module?
+ // TODO: Move this function out of this module?
if (IsKeyDown('Z')) camera->target = (Vector3){ 0.0f, 0.0f, 0.0f };
// Camera position update
diff --git a/src/core.c b/src/core.c
index 05ec0c0a..413006e4 100644
--- a/src/core.c
+++ b/src/core.c
@@ -359,7 +359,7 @@ void InitWindow(int width, int height, struct android_app *state)
if (orientation == ACONFIGURATION_ORIENTATION_PORT) TraceLog(INFO, "PORTRAIT window orientation");
else if (orientation == ACONFIGURATION_ORIENTATION_LAND) TraceLog(INFO, "LANDSCAPE window orientation");
- // TODO: Review, it doesn't work...
+ // TODO: Automatic orientation doesn't seem to work
if (width <= height)
{
AConfiguration_setOrientation(app->config, ACONFIGURATION_ORIENTATION_PORT);
@@ -1246,7 +1246,7 @@ int GetTouchY(void)
}
// Returns touch position XY
-// TODO: touch position should be scaled depending on display size and render size
+// TODO: Touch position should be scaled depending on display size and render size
Vector2 GetTouchPosition(int index)
{
Vector2 position = { -1.0f, -1.0f };
@@ -1257,7 +1257,7 @@ Vector2 GetTouchPosition(int index)
if ((screenWidth > displayWidth) || (screenHeight > displayHeight))
{
- // TODO: Seems to work ok but... review!
+ // TODO: Review touch position scaling for screenSize vs displaySize
position.x = position.x*((float)screenWidth/(float)(displayWidth - renderOffsetX)) - renderOffsetX/2;
position.y = position.y*((float)screenHeight/(float)(displayHeight - renderOffsetY)) - renderOffsetY/2;
}
@@ -1668,8 +1668,7 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i
#endif
else currentKeyState[key] = action;
- // HACK for GuiTextBox, to deteck back key
- // TODO: Review...
+ // TODO: Review (and remove) this HACK for GuiTextBox, to deteck back key
if ((key == 259) && (action == GLFW_PRESS)) lastKeyPressed = 3;
}
@@ -1678,8 +1677,6 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int
{
currentMouseState[button] = action;
- // TODO: Test mouse gestures
-
#define ENABLE_MOUSE_GESTURES
#if defined(ENABLE_MOUSE_GESTURES)
// Process mouse events as touches to be able to use mouse-gestures
@@ -2046,7 +2043,7 @@ static bool GetKeyStatus(int key)
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
return glfwGetKey(window, key);
#elif defined(PLATFORM_ANDROID)
- // TODO: Check virtual keyboard (?)
+ // TODO: Check for virtual keyboard
return false;
#elif defined(PLATFORM_RPI)
// NOTE: Keys states are filled in PollInputEvents()
@@ -2061,7 +2058,7 @@ static bool GetMouseButtonStatus(int button)
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
return glfwGetMouseButton(window, button);
#elif defined(PLATFORM_ANDROID)
- // TODO: Check virtual keyboard (?)
+ // TODO: Check for virtual keyboard
return false;
#elif defined(PLATFORM_RPI)
// NOTE: mouse buttons array is filled on PollInputEvents()
@@ -2382,7 +2379,7 @@ static void RestoreKeyboard(void)
// Init gamepad system
static void InitGamepad(void)
{
- // TODO: Gamepad support
+ // TODO: Add Gamepad support
if ((gamepadStream = open(DEFAULT_GAMEPAD_DEV, O_RDONLY|O_NONBLOCK)) < 0) TraceLog(WARNING, "Gamepad device could not be opened, no gamepad available");
else TraceLog(INFO, "Gamepad device initialized successfully");
}
diff --git a/src/models.c b/src/models.c
index 94e61d84..8a36c279 100644
--- a/src/models.c
+++ b/src/models.c
@@ -704,7 +704,6 @@ Model LoadHeightmap(Image heightmap, Vector3 size)
// TODO: Calculate normals in an efficient way
nCounter += 18; // 6 vertex, 18 floats
-
trisCounter += 2;
}
}
diff --git a/src/rlgl.c b/src/rlgl.c
index 2ea06e1c..5f8a5ea1 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -171,7 +171,7 @@ typedef struct {
typedef struct {
GLuint textureId;
int vertexCount;
- // TODO: DrawState state -> Blending mode, shader
+ // TODO: Store draw state -> blending mode, shader
} DrawCall;
// pixel type (same as Color type)
@@ -1475,11 +1475,7 @@ void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float ro
// Calculate model-view-projection matrix (MVP)
Matrix matMVP = MatrixMultiply(matModelView, matProjection); // Transform to screen-space coordinates
- // NOTE: Drawing in OpenGL 3.3+, matrices are passed to shader
- // TODO: Reduce number of matrices passed to shaders, use only matMVP
- //glUniformMatrix4fv(model.material.shader.modelLoc, 1, false, MatrixToFloat(matModel));
- //glUniformMatrix4fv(model.material.shader.viewLoc, 1, false, MatrixToFloat(matView));
-
+ // Send combined model-view-projection matrix to shader
glUniformMatrix4fv(model.shader.mvpLoc, 1, false, MatrixToFloat(matMVP));
// Apply color tinting to model
@@ -1900,7 +1896,7 @@ void rlglGenerateMipmaps(Texture2D texture)
int mipmapCount = GenerateMipmaps(data, texture.width, texture.height);
// TODO: Adjust mipmap size depending on texture format!
- int size = texture.width*texture.height*4;
+ int size = texture.width*texture.height*4; // RGBA 32bit only
int offset = size;
int mipWidth = texture.width/2;
diff --git a/src/text.c b/src/text.c
index 3755932d..e4c7bbf3 100644
--- a/src/text.c
+++ b/src/text.c
@@ -346,7 +346,7 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, int f
for(int i = 0; i < length; i++)
{
- // TODO: Right now we are supposing characters follow a continous order and start at FONT_FIRST_CHAR,
+ // TODO: Right now we are supposing characters that follow a continous order and start at FONT_FIRST_CHAR,
// this sytem can be improved to support any characters order and init value...
// An intermediate table could be created to link char values with predefined char position index in chars rectangle array
diff --git a/src/textures.c b/src/textures.c
index f03d2d9a..36819daf 100644
--- a/src/textures.c
+++ b/src/textures.c
@@ -712,7 +712,7 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp)
{
oldpixel = pixels[y*image->width + x];
- // TODO: New pixel obtained by bits truncate, it would be better to round values (check ImageFormat())
+ // NOTE: New pixel obtained by bits truncate, it would be better to round values (check ImageFormat())
newpixel.r = oldpixel.r>>(8 - rBpp); // R bits
newpixel.g = oldpixel.g>>(8 - gBpp); // G bits
newpixel.b = oldpixel.b>>(8 - bBpp); // B bits
@@ -769,7 +769,7 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp)
}
// Convert image to POT (power-of-two)
-// NOTE: Requirement on OpenGL ES 2.0 (RPI, HTML5)
+// NOTE: It could be useful on OpenGL ES 2.0 (RPI, HTML5)
void ImageToPOT(Image *image, Color fillColor)
{
Color *pixels = GetImageData(*image); // Get pixels data
@@ -784,7 +784,7 @@ void ImageToPOT(Image *image, Color fillColor)
Color *pixelsPOT = NULL;
// Generate POT array from NPOT data
- pixelsPOT = (Color *)malloc(potWidth * potHeight * sizeof(Color));
+ pixelsPOT = (Color *)malloc(potWidth*potHeight*sizeof(Color));
for (int j = 0; j < potHeight; j++)
{
@@ -896,7 +896,9 @@ void ImageCrop(Image *image, Rectangle crop)
}
// Resize and image to new size
-// NOTE: Uses stb default scaling filter
+// NOTE: Uses stb default scaling filters (both bicubic):
+// STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_CATMULLROM
+// STBIR_DEFAULT_FILTER_DOWNSAMPLE STBIR_FILTER_MITCHELL (high-quality Catmull-Rom)
void ImageResize(Image *image, int newWidth, int newHeight)
{
// Get data as Color pixels array to work with it