local conv={
	grass="g",
	dirt="d",
	gravel="R",
	sand="S",
	log_1="u",
	log_2="v",
	log_3="w",
	leaf_1="l",
	leaf_2="L",
	bush="b",
	flower_1="1",
	flower_2="2",
	flower_3="3",
	mushroom_1="4",
	mushroom_2="5",
	cactus="6",
	cloud_block="@",
	
	stone="s",
	coal="c",
	iron="i",
	aluminium="a",
	amazonite="e",
	sapphire="A",
	ruby="r",
	gold="G",
	diamond="D",
	
	ladder="f",
	glass="C",
	wood="U",
	cobblestone="t",
	brick="k",
	iron_block="J",
	aluminium_block="z",
	amazonite_block="E",
	sapphire_block="H",
	ruby_block="p",
	gold_block="B",
	diamond_block="P",
	door_open="*",
	door_close="/",
	trap_door_open="+",
	trap_door_close="-",
	tnt="T",
	
	water="W",
	lava="V"
}
-- reserved charecters: a A b B c C d D e E g G H i J k l L p P r R s S t T u U v V w W z 1 2 3 4 5 6 + -

local dir=pge.dir.open("pix/"..theme)
local temp3 = pge.dir.read(dir)
pge.dir.close(dir)
for t=1,#temp3 do
	local temp4=string.sub(string.lower(temp3[t].name),1,-5)
	if conv[temp4] then
		temp4=conv[temp4]
	end
	pix[temp4] = pge.texture.load("pix/"..theme.."/"..temp3[t].name)
end
local dir=pge.dir.open("pix/"..theme.."/vram")
local temp3 = pge.dir.read(dir)
pge.dir.close(dir)
if temp3 then
	for t=1,#temp3 do
		local temp4=string.sub(string.lower(temp3[t].name),1,-5)
		if conv[temp4] then
			temp4=conv[temp4]
		end
		pix[temp4] = pge.texture.load("pix/"..theme.."/vram/"..temp3[t].name, PGE_VRAM)
	end
end

pix[""]=pix["bedrock"]
pix["bedrock"]=nil

font_1=pge.font.load("fonts/verdana.ttf",18)
font_2=pge.font.load("fonts/verdana.ttf",12)

dofile("controls.lua")