some performance optimization
Merge remote-tracking branch 'lars/master'

Conflicts:
	src/graphics.cpp
fixed some redundant calculations in graphics
fixed warnings