From 28992223aebe4afcf7c627ea816c79200a18f09e Mon Sep 17 00:00:00 2001 From: Noah Haasis Date: Sat, 1 Sep 2018 06:51:30 +0200 Subject: [PATCH] Change all occurences of getPixelScale to getDPIScale --- pong-1/push.lua | 4 ++-- pong-10/push.lua | 4 ++-- pong-11/push.lua | 4 ++-- pong-12/push.lua | 4 ++-- pong-2/push.lua | 4 ++-- pong-3/push.lua | 4 ++-- pong-4/push.lua | 4 ++-- pong-5/push.lua | 4 ++-- pong-6/push.lua | 4 ++-- pong-7/push.lua | 4 ++-- pong-8/push.lua | 4 ++-- pong-9/push.lua | 4 ++-- pong-final/push.lua | 2 +- pong-final/push_old.lua | 4 ++-- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/pong-1/push.lua b/pong-1/push.lua index 0e0709a..026fcb2 100644 --- a/pong-1/push.lua +++ b/pong-1/push.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h diff --git a/pong-10/push.lua b/pong-10/push.lua index 0e0709a..026fcb2 100644 --- a/pong-10/push.lua +++ b/pong-10/push.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h diff --git a/pong-11/push.lua b/pong-11/push.lua index 0e0709a..026fcb2 100644 --- a/pong-11/push.lua +++ b/pong-11/push.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h diff --git a/pong-12/push.lua b/pong-12/push.lua index 0e0709a..026fcb2 100644 --- a/pong-12/push.lua +++ b/pong-12/push.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h diff --git a/pong-2/push.lua b/pong-2/push.lua index 0e0709a..026fcb2 100644 --- a/pong-2/push.lua +++ b/pong-2/push.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h diff --git a/pong-3/push.lua b/pong-3/push.lua index 0e0709a..026fcb2 100644 --- a/pong-3/push.lua +++ b/pong-3/push.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h diff --git a/pong-4/push.lua b/pong-4/push.lua index 0e0709a..026fcb2 100644 --- a/pong-4/push.lua +++ b/pong-4/push.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h diff --git a/pong-5/push.lua b/pong-5/push.lua index 0e0709a..026fcb2 100644 --- a/pong-5/push.lua +++ b/pong-5/push.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h diff --git a/pong-6/push.lua b/pong-6/push.lua index 0e0709a..026fcb2 100644 --- a/pong-6/push.lua +++ b/pong-6/push.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h diff --git a/pong-7/push.lua b/pong-7/push.lua index 0e0709a..026fcb2 100644 --- a/pong-7/push.lua +++ b/pong-7/push.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h diff --git a/pong-8/push.lua b/pong-8/push.lua index 0e0709a..026fcb2 100644 --- a/pong-8/push.lua +++ b/pong-8/push.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h diff --git a/pong-9/push.lua b/pong-9/push.lua index 0e0709a..026fcb2 100644 --- a/pong-9/push.lua +++ b/pong-9/push.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h diff --git a/pong-final/push.lua b/pong-final/push.lua index 723eb26..c9f2aa8 100644 --- a/pong-final/push.lua +++ b/pong-final/push.lua @@ -6,7 +6,7 @@ -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. local love11 = love.getVersion() == 11 -local getDPI = love11 and love.window.getDPIScale or love.window.getPixelScale +local getDPI = love11 and love.window.getDPIScale or love.window.getDPIScale local push = { diff --git a/pong-final/push_old.lua b/pong-final/push_old.lua index 0e0709a..026fcb2 100644 --- a/pong-final/push_old.lua +++ b/pong-final/push_old.lua @@ -98,7 +98,7 @@ function push:setShader(name, shader) end function push:initValues() - self._PSCALE = self._highdpi and love.window.getPixelScale() or 1 + self._PSCALE = self._highdpi and love.window.getDPIScale() or 1 self._SCALE = { x = self._RWIDTH/self._WWIDTH * self._PSCALE, @@ -218,7 +218,7 @@ function push:switchFullscreen(winw, winh) end function push:resize(w, h) - local pixelScale = love.window.getPixelScale() + local pixelScale = love.window.getDPIScale() if self._highdpi then w, h = w / pixelScale, h / pixelScale end self._RWIDTH = w self._RHEIGHT = h