Engine: fixed gfx initialization for custom resolution

Was broken by ff53a215489fdc2b6e7a336b873363a3a8d6630d