Skip to content

Commit

Permalink
Add support for setting glyph scale back to Display.
Browse files Browse the repository at this point in the history
It was tossed inadvertently, and instead of fixing it here, I apparently decided to update all of the demos to work withou it...
  • Loading branch information
paulofmandown committed Sep 7, 2016
1 parent a1f3f2f commit 833bdcd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions rotLove/rotLove.lua
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,13 @@ ROT.Display = class { }
-- @tparam[opt=false] boolean vsync Use vsync
-- @tparam[opt=0] int fsaa Number of fsaa passes
-- @return nil
function ROT.Display:__init(w, h, dfg, dbg, fullOrFlags, vsync, fsaa)
function ROT.Display:__init(w, h, scale, dfg, dbg, fullOrFlags, vsync, fsaa)
self.__name='Display'
self.widthInChars = w and w or 80
self.heightInChars= h and h or 24
self.charWidth=9
self.charHeight=16
self.scale=scale or 1
self.charWidth=9*self.scale
self.charHeight=16*self.scale
self.glyphs={}
self.chars={{}}
self.backgroundColors={{}}
Expand Down Expand Up @@ -595,7 +596,7 @@ function ROT.Display:draw()
if c~=32 and c~=255 then
local qd=self.glyphs[c]
self:_setColor(fg)
self.drawQ(self.glyphSprite, qd, px, py)
self.drawQ(self.glyphSprite, qd, px, py, nil, self.scale)
end

self.oldChars[x][y] = c
Expand Down
9 changes: 5 additions & 4 deletions src/display.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ Display.__name='Display'
-- @tparam[opt=false] boolean vsync Use vsync
-- @tparam[opt=0] int fsaa Number of fsaa passes
-- @return nil
function Display:__init(w, h, dfg, dbg, fullOrFlags, vsync, fsaa)
function Display:__init(w, h, scale, dfg, dbg, fullOrFlags, vsync, fsaa)
self.__name='Display'
self.widthInChars = w and w or 80
self.heightInChars= h and h or 24
self.charWidth=9
self.charHeight=16
self.scale=scale or 1
self.charWidth=9*self.scale
self.charHeight=16*self.scale
self.glyphs={}
self.chars={{}}
self.backgroundColors={{}}
Expand Down Expand Up @@ -94,7 +95,7 @@ function Display:draw()
if c~=32 and c~=255 then
local qd=self.glyphs[c]
self:_setColor(fg)
self.drawQ(self.glyphSprite, qd, px, py)
self.drawQ(self.glyphSprite, qd, px, py, nil, self.scale)
end

self.oldChars[x][y] = c
Expand Down

0 comments on commit 833bdcd

Please sign in to comment.