From: Holger Schemel Date: Mon, 21 Mar 2016 08:08:12 +0000 (+0100) Subject: changed closing doors before fading screens when leaving level editor X-Git-Tag: 4.0.0.0-rc1~39 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c834d452858eb10b833fa4d4dc2dab17303b29e2;p=rocksndiamonds.git changed closing doors before fading screens when leaving level editor --- diff --git a/src/editor.c b/src/editor.c index 212e1f10..6682acf0 100644 --- a/src/editor.c +++ b/src/editor.c @@ -12265,7 +12265,26 @@ void RequestExitLevelEditor(boolean ask_if_level_has_changed, Request("Level has changed! Exit without saving?", REQ_ASK | REQ_STAY_OPEN)) { - SetDoorState(DOOR_CLOSE_2); + struct RectWithBorder *vp_door_1 = &viewport.door_1[GAME_MODE_MAIN]; + struct RectWithBorder *vp_door_2 = &viewport.door_2[GAME_MODE_MAIN]; + + /* draw normal door */ + UndrawSpecialEditorDoor(); + + // close editor doors if viewport definition is the same as in main menu + if (vp_door_1->x == DX && + vp_door_1->y == DY && + vp_door_1->width == DXSIZE && + vp_door_1->height == DYSIZE && + vp_door_2->x == VX && + vp_door_2->y == VY && + vp_door_2->width == VXSIZE && + vp_door_2->height == VYSIZE) + CloseDoor(DOOR_CLOSE_ALL | DOOR_NO_DELAY); + else + SetDoorState(DOOR_CLOSE_2); + + BackToFront(); if (quick_quit) FadeSkipNextFadeIn(); diff --git a/src/screens.c b/src/screens.c index 5752a49d..1f5d4230 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1444,9 +1444,6 @@ void DrawMainMenu() FadeOut(fade_mask); - /* needed if last screen was the editor screen */ - UndrawSpecialEditorDoor(); - SetDrawtoField(DRAW_BACKBUFFER); /* level_nr may have been set to value over handicap with level editor */