[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Eric Botcazou wrote:
Okay I just got the latest CVS Allegro and compiled it with my game Itana
and it works fine in Win2k now, except that my one RLE sprite doesn't draw
in 2k. It works fine under Linux and Windows not-2k. The test program
draws that test RLE sprite though so I can't really blame it on Allegro.
Weird !
Could you tell us more: when is your RLE sprite displayed ? At startup, only
one time, or many times during the game ?
What's its size ?
Do you have any other problem with this dat file under Win2k ?
Does this happen with other gfx drivers as well ?
I think I might be wrong. I think all of my non-clearing rects in the
non-changing areas don't draw. I have a status bar at the top of the screen,
which never gets drawn to because of clipping. The status bar is drawn only
once then will be cleared away. But because it is never redrawn to the
screen, it doesn't matter. This would break if in Win2k the clipping didn't
work but even still... I could modify the clearing routine to not clear that
top area, and therefore the status bar will remain on the backbuffer, but
theoritically that area would never be drawn to the screen again. If it does
redraw it for some reason, in 2k it would then work. I'll attempt to test
that out. See the code at the end of this message if you want to see what I do.
Here's a bit of code that tells you absolutely nothing about my problem,
unless you see something obviously wrong with this. Any general ideas on
the incompatability
Video::addNoClearRect(MAIN_BAR);
Your game uses dirty rectangles, doesn't it ?
What's exactly the purpose of Video::addNoClearRect() ?
Video::addNoClearRect adds a dirty rectangle to the graphics engine that
doesn't get carried over to the next frame for clearing, when normally they
are. This way my game logic code does not have to concern itsself with
remembering the previous position of the object to clear it. So, say I draw a
ship. This rectangle gets drawn in the current frame, then cleared, then
drawn in the next frame. The NoClearRect doesn't do this "carry over."
Gillius
Reference code:
void Video::update(Interface* statusbar, Radar* radar) {
//Draws the mouse cursor if shown and updates screen
drawEdges();
if (blitAll) { //blitAll is true on the first frame
acquire_screen();
if (prefs->vsync)
vsync();
updateAll(statusbar, radar);
release_screen();
} else {
//draw interface and radar
set_clip(buffer, 0, 0, buffer->w-1, buffer->h-1);
statusbar->draw(buffer, sprites); //statusbar is the top bar in question
radar->draw(buffer); //draws radar inside statusbar (appears properly)
set_clip(buffer, viewport.x, viewport.y, viewport.getRight(),
viewport.getBottom());
if (mouse)
drawMouse();
optimizeRects();
acquire_screen();
if (prefs->vsync)
vsync();
clearPixels(); //There are pixel particle effects and stars
updatePixels();//that these functions handle separately from rects.
updateNoClearRects();
updateOptRects();
release_screen();
doClears();
}
//reset new and opt rects, swap old and new
numOldRects = numNewRects;
numNewRects = numNoClearRects = 0;
optRects.Clear();
IntRect* temp = oldRects;
oldRects = newRects;
newRects = temp;
oldPixels.Swap(newPixels);
newPixels.Clear();
}
void Video::updateAll(Interface* statusbar, Radar* radar) {
if (mouse)
drawMouse();
set_clip(buffer, 0, 0, buffer->w-1, buffer->h-1);
statusbar->dirtyAll();
statusbar->draw(buffer, sprites);
radar->draw(buffer);
set_clip(screen, 0, 0, screen->w-1, screen->h-1);
blit(buffer, screen, 0, 0, 0, 0, scrx, scry);
//now clear the whole volatile part of the buffer
rectfill(buffer, viewport.x, viewport.y, viewport.getRight(),
viewport.getBottom(), 0);
set_clip(screen, viewport.x, viewport.y, viewport.getRight(),
viewport.getBottom());
set_clip(buffer, viewport.x, viewport.y, viewport.getRight(),
viewport.getBottom());
blitAll = false;
}