Minor tweaks
This commit is contained in:
parent
add4da8fb3
commit
266fba1111
3 changed files with 12 additions and 8 deletions
|
@ -1741,7 +1741,7 @@ static void ErrorCallback(int error, const char *description)
|
|||
}
|
||||
|
||||
// GLFW3 WindowSize Callback, runs when window is resizedLastFrame
|
||||
// NOTE: Window resizing not allowed by default
|
||||
// NOTE: Window resizing not enabled by default, use SetConfigFlags()
|
||||
static void WindowSizeCallback(GLFWwindow *window, int width, int height)
|
||||
{
|
||||
// Reset viewport and projection matrix for new size
|
||||
|
@ -1760,11 +1760,15 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
|
|||
height = (int)(height/GetWindowScaleDPI().y);
|
||||
}
|
||||
|
||||
// Set render size
|
||||
CORE.Window.render.width = width;
|
||||
CORE.Window.render.height = height;
|
||||
|
||||
// Set current screen size
|
||||
CORE.Window.screen.width = width;
|
||||
CORE.Window.screen.height = height;
|
||||
|
||||
// NOTE: Postprocessing texture is not scaled to new size
|
||||
// WARNING: If using a render texture, it is not scaled to new size
|
||||
}
|
||||
static void WindowPosCallback(GLFWwindow* window, int x, int y)
|
||||
{
|
||||
|
|
|
@ -1119,7 +1119,7 @@ void BeginTextureMode(RenderTexture2D target)
|
|||
//rlScalef(0.0f, -1.0f, 0.0f); // Flip Y-drawing (?)
|
||||
|
||||
// Setup current width/height for proper aspect ratio
|
||||
// calculation when using BeginMode3D()
|
||||
// calculation when using BeginTextureMode()
|
||||
CORE.Window.currentFbo.width = target.texture.width;
|
||||
CORE.Window.currentFbo.height = target.texture.height;
|
||||
CORE.Window.usingFbo = true;
|
||||
|
|
|
@ -2239,7 +2239,7 @@ bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2
|
|||
// NOTE: Based on http://jeffreythompson.org/collision-detection/poly-point.php
|
||||
bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount)
|
||||
{
|
||||
bool inside = false;
|
||||
bool collision = false;
|
||||
|
||||
if (pointCount > 2)
|
||||
{
|
||||
|
@ -2248,12 +2248,12 @@ bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCoun
|
|||
if ((points[i].y > point.y) != (points[j].y > point.y) &&
|
||||
(point.x < (points[j].x - points[i].x)*(point.y - points[i].y)/(points[j].y - points[i].y) + points[i].x))
|
||||
{
|
||||
inside = !inside;
|
||||
collision = !collision;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return inside;
|
||||
return collision;
|
||||
}
|
||||
|
||||
// Check collision between two rectangles
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue