mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Added high-dpi / retina support to the no-game screen; additional minor tweaks and cleanup.
This commit is contained in:
@@ -164,11 +164,9 @@ void GLBuffer::setMappedRangeModified(size_t offset, size_t modifiedsize)
|
||||
// a and b are marked as modified.
|
||||
|
||||
size_t old_range_end = modified_offset + modified_size;
|
||||
|
||||
modified_offset = std::min(modified_offset, offset);
|
||||
|
||||
size_t new_range_end = std::max(offset + modifiedsize, old_range_end);
|
||||
|
||||
modified_size = new_range_end - modified_offset;
|
||||
}
|
||||
|
||||
|
||||
@@ -708,7 +708,7 @@ Image *Graphics::newImage(const std::vector<love::image::CompressedImageData *>
|
||||
return new Image(cdata, flags);
|
||||
}
|
||||
|
||||
Quad *Graphics::newQuad(Quad::Viewport v, float sw, float sh)
|
||||
Quad *Graphics::newQuad(Quad::Viewport v, double sw, double sh)
|
||||
{
|
||||
return new Quad(v, sw, sh);
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
Image *newImage(const std::vector<love::image::ImageData *> &data, const Image::Flags &flags);
|
||||
Image *newImage(const std::vector<love::image::CompressedImageData *> &cdata, const Image::Flags &flags);
|
||||
|
||||
Quad *newQuad(Quad::Viewport v, float sw, float sh);
|
||||
Quad *newQuad(Quad::Viewport v, double sw, double sh);
|
||||
|
||||
/**
|
||||
* Creates a Font object.
|
||||
|
||||
@@ -368,13 +368,13 @@ int w_newImage(lua_State *L)
|
||||
int w_newQuad(lua_State *L)
|
||||
{
|
||||
Quad::Viewport v;
|
||||
v.x = (float) luaL_checknumber(L, 1);
|
||||
v.y = (float) luaL_checknumber(L, 2);
|
||||
v.w = (float) luaL_checknumber(L, 3);
|
||||
v.h = (float) luaL_checknumber(L, 4);
|
||||
v.x = luaL_checknumber(L, 1);
|
||||
v.y = luaL_checknumber(L, 2);
|
||||
v.w = luaL_checknumber(L, 3);
|
||||
v.h = luaL_checknumber(L, 4);
|
||||
|
||||
float sw = (float) luaL_checknumber(L, 5);
|
||||
float sh = (float) luaL_checknumber(L, 6);
|
||||
double sw = luaL_checknumber(L, 5);
|
||||
double sh = luaL_checknumber(L, 6);
|
||||
|
||||
Quad *quad = instance()->newQuad(v, sw, sh);
|
||||
luax_pushtype(L, GRAPHICS_QUAD_ID, quad);
|
||||
|
||||
@@ -159,7 +159,7 @@ precision mediump float;
|
||||
#endif
|
||||
|
||||
varying mediump vec4 VaryingTexCoord;
|
||||
varying lowp vec4 VaryingColor;
|
||||
varying mediump vec4 VaryingColor;
|
||||
|
||||
#define love_Canvases gl_FragData
|
||||
|
||||
@@ -307,7 +307,7 @@ vec4 position(mat4 transform_proj, vec4 vertpos) {
|
||||
return transform_proj * vertpos;
|
||||
}]],
|
||||
pixel = [[
|
||||
vec4 effect(lowp vec4 vcolor, Image tex, vec2 texcoord, vec2 pixcoord) {
|
||||
vec4 effect(mediump vec4 vcolor, Image tex, vec2 texcoord, vec2 pixcoord) {
|
||||
return Texel(tex, texcoord) * vcolor;
|
||||
}]]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user