Graphics Overview

by Dale M.A. Johnson


created 3/28/06


This document serves to give a quick and dirty explination of how the graphics in Fire Emblem Factory make their way to the screen.


Fire Emblem Factory will run in 32-bit color mode at 320x240 (if the system fails to setup a 32-bit color display, it will try 16-bit mode). No graphics are copied directly to the screen at first. Everything is displayed to mBuffer, an Allegro BITMAP object. Obviously, the first things to be copied to the buffer will appear to be on the bottom behind the things displayed later, so the order in which things are copied to the buffer is important.


Once the buffer is ready to be displayed, whatever function is currently handling graphics will call gfx.Screen() which will wait for the v-sync to refresh, then blit the buffer directly to the screen. Only gfx.Screen() should ever have access to the screen. Do not display to the screen with any other function!


Two other noteworthy functions are gfx.In(iSpeed) and gfx.Out(iSpeed) which will fade the screen in and out, repectively. int iSpeed is a number between 1 and 64 which determains how quickly the fade will take place. 64 is the fasted fade speed, where as 1 is the slowest.


Because of the variety of tasks the engine needs to handle, there are no plans for a "central" graphics function which will handle all the graphic displays. Graphics will be handled at the function level, depending on the situation and need.