Skip to content

Commit

Permalink
upgrades from Homegirl Pro
Browse files Browse the repository at this point in the history
  • Loading branch information
poeticAndroid committed Nov 9, 2019
1 parent 14c7e5c commit af089af
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion source/machine.d
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import pixmap;
import image_loader;
import network;

const VERSION = "0.8.10"; /// version of the software
const VERSION = "0.9.0"; /// version of the software

/**
Class representing "the machine"!
Expand Down
4 changes: 4 additions & 0 deletions system_drive/cmd/copy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ function _init(args)
end
end
end
elseif fs.isdir(src) then
if not copydir(src, dest) then
return sys.exit(1)
end
else
if not copyfile(src, dest) then
return sys.exit(1)
Expand Down
23 changes: 14 additions & 9 deletions system_drive/cmd/show.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,22 @@ function _init(args)
width, height = image.size(anim[1])
print(args[1] .. ": " .. width .. " x " .. height .. " pixels")
scrnw, scrnh = view.size(scrn.rootvp)
while width > scrnw do
mode = mode + 5
scrnw = scrnw * 2
scrnh = scrnh * 2
if width > height then
while width > scrnw do
mode = mode + 5
scrnw = scrnw * 2
scrnh = scrnh * 2
end
else
while height > scrnh do
mode = mode + 5
scrnw = scrnw * 2
scrnh = scrnh * 2
end
end
if mode > 15 then
mode = 15
end
if height > scrnh then
mode = mode + 16
end
zoom(0)
f = 0
_lastbtn = 255
Expand Down Expand Up @@ -61,7 +66,7 @@ function _step(t)
zoom(-32)
end
if _lastbtn == 0 and btn & 32 > 0 then -- B
zoom(16)
zoom(5)
end
if _lastbtn == 0 and btn & 64 > 0 then -- X
zoom(1)
Expand Down Expand Up @@ -90,7 +95,7 @@ function zoom(amount)
mode = mode - 32
end
scrn:mode(mode, 8)
scrnw, scrnh = scrn:size()
scrnw, scrnh = view.size(scrn.rootvp)
image.copymode(0)
x = scrnw / 2 - width / 2
y = scrnh / 2 - height / 2
Expand Down
4 changes: 2 additions & 2 deletions system_drive/libs/object.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
local Object = {}
do
Object.__index = Object
function Object:_new()
function Object:constructor()
end
function Object:new(...)
local obj = setmetatable({}, self)
obj:_new(...)
obj:constructor(...)
return obj
end
function Object:extend()
Expand Down
2 changes: 1 addition & 1 deletion system_drive/libs/screen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local defaultfont = text.loadfont("Victoria.8b")

local Screen = Widget:extend()
do
function Screen:_new(title, mode, colorbits)
function Screen:constructor(title, mode, colorbits)
self.children = {}
self._mode = mode
self._colorbits = colorbits
Expand Down
2 changes: 1 addition & 1 deletion system_drive/libs/widget.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ do
Widget.parent = false
Widget.font = text.loadfont("Victoria.8b")

function Widget:_new(label)
function Widget:constructor(label)
self.label = label
end

Expand Down

0 comments on commit af089af

Please sign in to comment.