Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change all occurences of getPixelScale to getDPIScale #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pong-1/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pong-10/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pong-11/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pong-12/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pong-2/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pong-3/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pong-4/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pong-5/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pong-6/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pong-7/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pong-8/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pong-9/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pong-final/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {

Expand Down
4 changes: 2 additions & 2 deletions pong-final/push_old.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down