home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************\
-
- File: demo crash.c
-
- Purpose: This module handles crashing your machine with grace and
- style.
-
-
- MSG Demo -- graphic effects demonstration program
- Copyright (C) 1992-4 Mark Pilgrim & Dave Blumenthal
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program in a file named "GNU General Public License".
- If not, write to the Free Software Foundation, 675 Mass Ave,
- Cambridge, MA 02139, USA.
-
- \**********************************************************************/
-
- #include "demo crash.h"
- #include "demo.h"
- #include "msg sounds.h"
- #include "msg environment.h"
- #include "msg main.h"
-
- void RestoreScreen(int oldMenuHeight)
- {
- TextFont(0);
- TextSize(0);
- TextMode(srcOr);
- FlushEvents(mDownMask+mUpMask+keyDownMask+keyUpMask+autoKeyMask, 0L);
- MBarHeight=oldMenuHeight;
- DrawMenuBar();
- PaintOne(0L,GrayRgn);
- PaintBehind(WindowList,GrayRgn);
- ShowCursor();
- ObscureCursor();
- }
-
- void CrashAndBurn(int whichSystemError)
- {
- int oldMenuHeight;
- int whichWipe;
-
- DoSound(sound_crash, FALSE);
-
- ShutDownEnvironment(); /* If you have to crash a computer, */
- /* it costs nothing to be polite. */
- SysError(whichSystemError);
-
- /* in case the user manages to continue, we’ll do neat stuff here */
- whichWipe=1+(TickCount()&0x7fffffff)%32;
- DoFullScreenFade(whichWipe, FALSE);
-
- gDone=TRUE; /* we can’t actually continue with the program, */
- /* since, after all, the computer thinks we’ve crashed */
- }
-