Re: [AD] small demo patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Elias Pschernig wrote:
applied it

There's probably another change you should supply. The check for ALLEGRO_VRAM_SINGLE_SURFACE was applied like this:

#ifdef ALLEGRO_VRAM_SINGLE_SURFACE
   if (set_gfx_mode(c, w, h, w, h * 2) != 0) {
#else
   if (set_gfx_mode(c, w, h, 0, 0) != 0) {
#endif

However, that won't work if someone's trying to use triple buffering and it may improperly fail if someone's using dirt rectangles or double buffering. I think it should be changed to this:

#ifdef ALLEGRO_VRAM_SINGLE_SURFACE
   if (set_gfx_mode(c, w, h, w, h * 3) != 0 &&
       set_gfx_mode(c, w, h, w, h * 2) != 0 &&
       set_gfx_mode(c, w, h, w, h) != 0) {
#else
   if (set_gfx_mode(c, w, h, 0, 0) != 0) {
#endif

Forgive me for not supplying a diff, but I accidently overwrote my local CVS copy of demo.c. One more thing.. I personally think it's high-time someone removes the MIDI driver check hack. If you're gonna use the sample, use the sample, or else use the MIDI. You don't do something like this in normal games so doing it here is very bad design, IMO. Especially for those that try to learn by example.

- Kitty Cat




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/