Skip to content

Commit

Permalink
changed addq and drawq to add and draw respectively
Browse files Browse the repository at this point in the history
  • Loading branch information
NimbusBP1729 committed Jan 28, 2014
1 parent be8b942 commit 00ff6de
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 36 deletions.
8 changes: 4 additions & 4 deletions src/blackjackgame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ function state:draw()
)

--dealer stack
love.graphics.drawq( self.cardSprite, self.cardback, self.dealer_stack_x, self.dealer_stack_y )
love.graphics.draw( self.cardSprite, self.cardback, self.dealer_stack_x, self.dealer_stack_y )

if self.dealerHand[1] then
for i,n in pairs( self.dealerHand[1].cards ) do
Expand Down Expand Up @@ -700,7 +700,7 @@ function state:draw()
-- draw full stacks first
for s = 1, math.floor( count / 5 ), 1 do
for i = 0, 4, 1 do
love.graphics.drawq( self.chipSprite, self.chips[ color ], self.chip_x + cx - i, self.chip_y + cy - i )
love.graphics.draw( self.chipSprite, self.chips[ color ], self.chip_x + cx - i, self.chip_y + cy - i )
end
-- change the coords
if s % 2 == 0 then --even
Expand All @@ -711,7 +711,7 @@ function state:draw()
end
end
for i = 0, count % 5 - 1, 1 do
love.graphics.drawq( self.chipSprite, self.chips[ color ], self.chip_x + cx - i, self.chip_y + cy - i )
love.graphics.draw( self.chipSprite, self.chips[ color ], self.chip_x + cx - i, self.chip_y + cy - i )
end

-- shift the drawpoint left for the next stack
Expand Down Expand Up @@ -831,7 +831,7 @@ function state:drawCard( card, suit, flip, x, y, overlay )
end

love.graphics.setColor( darkness, darkness, darkness )
love.graphics.drawq(
love.graphics.draw(
self.cardSprite, _card, -- image, quad
x + utils.map( flip, 50, limit, w / 2, 0 ), -- offset for flip
utils.map( flip, 50, limit, y - ( ( sh - h ) / 2 ), y ), -- height offset
Expand Down
2 changes: 1 addition & 1 deletion src/brewing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function state:draw()
local firstcell_right = menu_right + 30
local firstcell_top = menu_top + 9

love.graphics.drawq(selectionSprite,
love.graphics.draw(selectionSprite,
love.graphics.newQuad(0,0,selectionSprite:getWidth(),selectionSprite:getHeight(),selectionSprite:getWidth(),selectionSprite:getHeight()),
firstcell_right, firstcell_top + ((self.selected-1) * 22))

Expand Down
2 changes: 1 addition & 1 deletion src/flyin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function flyin:drawCharacter(flyer, x, y, r, sx, sy, ox, oy)

local mask = self.masks[key]

love.graphics.drawq(image, mask, x, y, r, sx, sy, ox, oy)
love.graphics.draw(image, mask, x, y, r, sx, sy, ox, oy)
end


Expand Down
2 changes: 1 addition & 1 deletion src/frying.lua
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function state:draw()
local firstcell_right = menu_right + 30
local firstcell_top = menu_top + 9

love.graphics.drawq(selectionSprite,
love.graphics.draw(selectionSprite,
love.graphics.newQuad(0,0,selectionSprite:getWidth(),selectionSprite:getHeight(),selectionSprite:getWidth(),selectionSprite:getHeight()),
firstcell_right, firstcell_top + ((self.selected-1) * 22))

Expand Down
2 changes: 1 addition & 1 deletion src/hud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function HUD:draw( player )
local position = {x = self.x + 22, y = self.y + 22}
currentWeapon:draw(position, nil,false)
else
love.graphics.drawq(self.sheet, self.character_quad, self.x + 7, self.y + 17)
love.graphics.draw(self.sheet, self.character_quad, self.x + 7, self.y + 17)
end
love.graphics.setStencil()
love.graphics.draw(lens, self.x, self.y)
Expand Down
8 changes: 4 additions & 4 deletions src/inventory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ function Inventory:draw( playerPosition )

--Draw the white border around the currently selected slot
if self.cursorPos.x < 2 then --If the cursor is in the main inventory section, draw this way
love.graphics.drawq(selectionSprite,
love.graphics.draw(selectionSprite,
love.graphics.newQuad(0,0,selectionSprite:getWidth(),selectionSprite:getHeight(),selectionSprite:getWidth(),selectionSprite:getHeight()),
(ffPos.x-17) + self.cursorPos.x * 38, ffPos.y + self.cursorPos.y * 18)
else --Otherwise, we're in the crafting annex, so draw this way.
love.graphics.drawq(selectionCraftingSprite,
love.graphics.draw(selectionCraftingSprite,
love.graphics.newQuad(0,0,selectionCraftingSprite:getWidth(), selectionCraftingSprite:getHeight(), selectionCraftingSprite:getWidth(), selectionCraftingSprite:getHeight()),
ffPos.x + (self.cursorPos.x - 3) * 19 + 101, ffPos.y + 18)
end
Expand Down Expand Up @@ -267,7 +267,7 @@ function Inventory:draw( playerPosition )
local lowestVisibleIndex = (self.scrollbar - 1 )* 2 + 1
local weaponPosition = self.selectedWeaponIndex - lowestVisibleIndex
if self.selectedWeaponIndex >= lowestVisibleIndex and self.selectedWeaponIndex < lowestVisibleIndex + 8 then
love.graphics.drawq(curWeaponSelect,
love.graphics.draw(curWeaponSelect,
love.graphics.newQuad(0,0, curWeaponSelect:getWidth(), curWeaponSelect:getHeight(), curWeaponSelect:getWidth(), curWeaponSelect:getHeight()),
self:slotPosition(weaponPosition).x + ffPos.x - 2, self:slotPosition(weaponPosition).y + ffPos.y - 2)
end
Expand All @@ -277,7 +277,7 @@ function Inventory:draw( playerPosition )
local index = self.selectedWeaponIndex - self.pageLength
local scrollPosition = index - lowestVisibleIndex
if index >= lowestVisibleIndex and index < lowestVisibleIndex + 8 then
love.graphics.drawq(curWeaponSelect,
love.graphics.draw(curWeaponSelect,
love.graphics.newQuad(0,0, curWeaponSelect:getWidth(), curWeaponSelect:getHeight(), curWeaponSelect:getWidth(), curWeaponSelect:getHeight()),
self:slotPosition(scrollPosition).x + ffPos.x - 2, self:slotPosition(scrollPosition).y + ffPos.y - 2)
end
Expand Down
2 changes: 1 addition & 1 deletion src/items/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ end
-- @param position the location in the inventory
-- @return nil
function Item:draw(position, scrollIndex, hideAmount)
love.graphics.drawq(self.image, self.image_q, position.x, position.y)
love.graphics.draw(self.image, self.image_q, position.x, position.y)
if not hideAmount then
love.graphics.print("x" .. self.quantity, position.x + 4, position.y + 10,0, 0.5, 0.5)
end
Expand Down
2 changes: 1 addition & 1 deletion src/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function love.load(arg)
-- error("Love 0.8.0 is required")
-- end

-- The Mavericks builds of Love adds too many arguements
-- The Mavericks builds of Love adds too many arguments
arg = utils.cleanarg(arg)

local mixpanel = require 'vendor/mixpanel'
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/consumable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function Consumable:draw()
if not self.exists then
return
end
love.graphics.drawq(self.image, self.image_q, self.position.x, self.position.y)
love.graphics.draw(self.image, self.image_q, self.position.x, self.position.y)
end


Expand Down
4 changes: 2 additions & 2 deletions src/nodes/firealarm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ end

function Alarm:draw()
if self.broken then
love.graphics.drawq(image, broken_img, self.x, self.y)
love.graphics.draw(image, broken_img, self.x, self.y)
else
love.graphics.drawq(image, not_broken_img, self.x, self.y)
love.graphics.draw(image, not_broken_img, self.x, self.y)
end

love.graphics.draw(psPaint, self.x + 12, 40);
Expand Down
4 changes: 2 additions & 2 deletions src/nodes/hiddendoortrigger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ end

function HiddenDoorTrigger:draw()
if self.fixed then
love.graphics.drawq(self.image, self.fixed_img, self.x, self.y)
love.graphics.draw(self.image, self.fixed_img, self.x, self.y)
else
love.graphics.drawq(self.image, self.crooked_img, self.x, self.y)
love.graphics.draw(self.image, self.crooked_img, self.x, self.y)
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/key.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ end
-- Draws the key to the screen
-- @return nil
function Key:draw()
love.graphics.drawq(self.image, self.image_q, self.position.x, self.position.y)
love.graphics.draw(self.image, self.image_q, self.position.x, self.position.y)
end

function Key:keypressed( button, player )
Expand Down
4 changes: 2 additions & 2 deletions src/nodes/liquid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ end
function Liquid:draw()
love.graphics.setColor( 255, 255, 255, self.fade and 255 or utils.map( self.opacity, 0, 1, 0, 255 ) )
for i = 0, ( self.width / 24 ) - 1, 1 do
love.graphics.drawq(
love.graphics.draw(
self.image,
self.animation_top.frames[ ( ( self.animation_top.position + ( self.uniform and 0 or i ) ) % #self.animation_top.frames ) + 1 ],
self.position.x + ( i * 24 ),
Expand All @@ -166,7 +166,7 @@ function Liquid:draw()
0, 1, 0, 255
)
)
love.graphics.drawq(
love.graphics.draw(
self.image,
self.animation_bottom.frames[ ( ( self.animation_bottom.position + ( self.uniform and 0 or i ) ) % #self.animation_top.frames) + 1 ],
self.position.x + ( i * 24 ),
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/material.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Material:draw()
if not self.exists then
return
end
love.graphics.drawq(self.image, self.image_q, self.position.x, self.position.y)
love.graphics.draw(self.image, self.image_q, self.position.x, self.position.y)
end


Expand Down
2 changes: 1 addition & 1 deletion src/nodes/scroll.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ end

function Scroll:draw()
if self.dead then return end
love.graphics.drawq(self.sheet, self.thumbnail, math.floor(self.position.x), self.position.y)
love.graphics.draw(self.sheet, self.thumbnail, math.floor(self.position.x), self.position.y)
end

function Scroll:update(dt)
Expand Down
6 changes: 3 additions & 3 deletions src/nodes/splat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function Splat:draw()

love.graphics.setStencil( self.stencils.wall )
for _,s in pairs( self.splats ) do
love.graphics.drawq( splatters,
love.graphics.draw( splatters,
quads[s.index],
( s.position.x + s.width / 2 ) - splatterSize.width / 2 + ( s.flipX and splatterSize.width or 0 ),
( s.position.y + s.height / 2 ) - splatterSize.height / 2 + ( s.flipY and splatterSize.height or 0 ),
Expand All @@ -94,7 +94,7 @@ function Splat:draw()

love.graphics.setStencil( self.stencils.floor )
for _,s in pairs( self.splats ) do
love.graphics.drawq( splatters,
love.graphics.draw( splatters,
quads[s.index],
( s.position.x + s.width / 2 ) - splatterSize.width / 2 + ( s.flipX and splatterSize.width or 0 ),
( s.position.y + s.height / 2 ) - splatterSize.height / 2 + ( s.flipY and splatterSize.height or 0 ),
Expand All @@ -107,7 +107,7 @@ function Splat:draw()

love.graphics.setStencil( self.stencils.ceiling )
for _,s in pairs( self.splats ) do
love.graphics.drawq( splatters,
love.graphics.draw( splatters,
quads[s.index],
( s.position.x + s.width / 2 ) - splatterSize.width / 2 + ( s.flipX and splatterSize.width or 0 ),
( s.position.y + s.height / 2 ) - splatterSize.height / 2 + ( s.flipY and splatterSize.height or 0 ),
Expand Down
2 changes: 1 addition & 1 deletion src/overworld.lua
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ function state:draw()
for _,cloud in pairs(self.clouds) do
if cloud then
love.graphics.setColor( 255, 255, 255, cloud.o * 255 )
love.graphics.drawq(self.cloudpuffsprite, self.cloudquads[cloud.q], cloud.x, cloud.y )
love.graphics.draw(self.cloudpuffsprite, self.cloudquads[cloud.q], cloud.x, cloud.y )
love.graphics.setColor( 255, 255, 255, 255 )
end
end
Expand Down
8 changes: 4 additions & 4 deletions src/pokergame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ function state:draw()
love.graphics.draw( self.table, self.center_x - ( self.table:getWidth() / 2 ), self.center_y - ( self.table:getHeight() / 2 ) )

--dealer stack
love.graphics.drawq( self.cardSprite, self.cardback, self.dealer_stack_x, self.dealer_stack_y )
love.graphics.draw( self.cardSprite, self.cardback, self.dealer_stack_x, self.dealer_stack_y )

if self.dealer_cards then
for i,n in pairs( self.dealer_cards ) do
Expand Down Expand Up @@ -450,7 +450,7 @@ function state:draw()
for s = 1, math.floor( count / 5 ), 1 do
--print( color, s, s % 2 == 0 )
for i = 0, 4, 1 do
love.graphics.drawq( self.chipSprite, self.chips[ color ], self.chip_x + cx - i, self.chip_y + cy - i )
love.graphics.draw( self.chipSprite, self.chips[ color ], self.chip_x + cx - i, self.chip_y + cy - i )
end
-- change the coords
if s % 2 == 0 then --even
Expand All @@ -461,7 +461,7 @@ function state:draw()
end
end
for i = 0, count % 5 - 1, 1 do
love.graphics.drawq( self.chipSprite, self.chips[ color ], self.chip_x + cx - i, self.chip_y + cy - i )
love.graphics.draw( self.chipSprite, self.chips[ color ], self.chip_x + cx - i, self.chip_y + cy - i )
end
-- shift the drawpoint left for the next stack
if count > 0 then -- something was actually drawn
Expand Down Expand Up @@ -512,7 +512,7 @@ function state:draw_card( card, suit, flip, x, y, offset, overlay )
darkness = 150
end
love.graphics.setColor( darkness, darkness, darkness )
love.graphics.drawq(
love.graphics.draw(
self.cardSprite, _card, -- image, quad
x + utils.map( flip, 50, limit, w / 2, 0 ), -- offset for flip
utils.map( flip, 50, limit, y - ( ( sh - h ) / 2 ), y ) + offset, -- height offset
Expand Down
4 changes: 2 additions & 2 deletions src/select.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ function state:drawCharacter(name, x, y, offset)
end

if offset then
love.graphics.drawq(image, char.mask, x, y, 0, -1, 1)
love.graphics.draw(image, char.mask, x, y, 0, -1, 1)
else
love.graphics.drawq(image, char.mask, x, y)
love.graphics.draw(image, char.mask, x, y)
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/vendor/anim8.lua
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ end

function Animation:draw(image, x, y, r, sx, sy, ox, oy)
local frame = self.frames[self.position]
love.graphics.drawq(image, frame, x, y, r, sx, sy, ox, oy)
love.graphics.draw(image, frame, x, y, r, sx, sy, ox, oy)
end

-----------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/vendor/tmx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function tmx.load(level)

layer = tmx.getParallaxLayer( map, tilelayer )

layer.batch:addq(tiles[tile.id],
layer.batch:add(tiles[tile.id],
x * tilewidth + (tilewidth / 2),
y * tileheight + (tileheight / 2),
tile.flipDiagonal and math.pi * 1.5 or 0, --rotation
Expand Down

0 comments on commit 00ff6de

Please sign in to comment.