artwork = {}

local full = {
   type = 'fixed',
   fixed = {-1, -.5, -1, 1, -.45, 1},
}

local landscape = {
   type = 'fixed',
   fixed = {-1, -.5, -.75, 1, -.45, .75},
}

local portrait = {
   type = 'fixed',
   fixed = {-.75, -.5, -1, .75, -.45, 1},
}

function artwork.register_full(name, desc)
   minetest.register_node('artwork:'..name, {
      description = desc,
      drawtype = 'mesh',
      mesh = 'artwork_full.obj',
      param = 'light',
      paramtype2 = 'wallmounted',
      tiles = {name..'.png'},
      inventory_image = name..'.png',
      wield_image = name..'.png',
      selection_box = full,
      collision_box = full,
      groups = {breakable=1}
   })
end

function artwork.register_landscape(name, desc)
   minetest.register_node('artwork:'..name, {
      description = desc,
      drawtype = 'mesh',
      mesh = 'artwork_landscape.obj',
      param = 'light',
      paramtype2 = 'wallmounted',
      tiles = {name..'.png'},
      inventory_image = name..'.png',
      wield_image = name..'.png',
      selection_box = landscape,
      collision_box = landscape,
      groups = {breakable=1}
   })
end

function artwork.register_portrait(name, desc)
   minetest.register_node('artwork:'..name, {
      description = desc,
      drawtype = 'mesh',
      mesh = 'artwork_portrait.obj',
      param = 'light',
      paramtype2 = 'wallmounted',
      tiles = {name..'.png'},
      inventory_image = name..'.png',
      wield_image = name..'.png',
      selection_box = portrait,
      collision_box = portrait,
      groups = {breakable=1}
   })
end

dofile(minetest.get_modpath('artwork')..'/registrations.lua')
