SWORD25: Optimize graphics drawing code