void ScriptOverlay::Remove() { int overlayIndex = find_overlay_of_type(overlayId); if (overlayIndex < 0) { quit("ScriptOverlay::Remove: overlay is not there!"); } remove_screen_overlay_index(overlayIndex); overlayId = -1; }
// [DEPRECATED] but still used by Character_SayBackground, might merge since there are no other instances int DisplaySpeechBackground(int charid, const char*speel) { // remove any previous background speech for this character int cc; for (cc = 0; cc < numscreenover; cc++) { if (screenover[cc].bgSpeechForChar == charid) { remove_screen_overlay_index(cc); cc--; } } int ovrl=CreateTextOverlay(OVR_AUTOPLACE,charid,play.viewport.GetWidth()/2,FONT_SPEECH, -game.chars[charid].talkcolor, get_translation(speel)); int scid = find_overlay_of_type(ovrl); screenover[scid].bgSpeechForChar = charid; screenover[scid].timeout = GetTextDisplayTime(speel, 1); return ovrl; }
int ScriptOverlay::Dispose(const char *address, bool force) { // since the managed object is being deleted, remove the // reference so it doesn't try and dispose something else // with that handle later int overlayIndex = find_overlay_of_type(overlayId); if (overlayIndex >= 0) { screenover[overlayIndex].associatedOverlayHandle = 0; } // if this is being removed voluntarily (ie. pointer out of // scope) then remove the associateed overlay // Otherwise, it's a Restre Game or something so don't if ((!force) && (!isBackgroundSpeech) && (Overlay_GetValid(this))) { Remove(); } delete this; return 1; }