123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- /*
- THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
- SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
- END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
- ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
- IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
- SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
- FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
- CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
- AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
- COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
- */
- /*
- * $Source: f:/miner/source/ui/rcs/ui.c $
- * $Revision: 1.9 $
- * $Author: john $
- * $Date: 1994/11/13 15:37:18 $
- *
- * UI init and close functions.
- *
- * $Log: ui.c $
- * Revision 1.9 1994/11/13 15:37:18 john
- * Made ui_close not close key and mouse.
- *
- * Revision 1.8 1994/10/27 09:58:53 john
- * *** empty log message ***
- *
- * Revision 1.7 1994/10/27 09:43:00 john
- * Fixed colors after removing gr_inverse_table.
- *
- * Revision 1.6 1994/09/23 14:57:41 john
- * Took out calls to init_mouse and init_keyboard.
- *
- * Revision 1.5 1993/12/10 14:16:45 john
- * made buttons have 2 user-functions.
- *
- * Revision 1.4 1993/12/07 12:31:32 john
- * new version.
- *
- * Revision 1.3 1993/10/26 13:46:12 john
- * *** empty log message ***
- *
- * Revision 1.2 1993/10/05 17:31:55 john
- * *** empty log message ***
- *
- * Revision 1.1 1993/09/20 10:35:49 john
- * Initial revision
- *
- *
- */
- #pragma off (unreferenced)
- static char rcsid[] = "$Id: ui.c 1.9 1994/11/13 15:37:18 john Exp $";
- #pragma on (unreferenced)
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdarg.h>
- #include <string.h>
- #include <dos.h>
- #include "fix.h"
- #include "types.h"
- #include "gr.h"
- #include "key.h"
- #include "ui.h"
- #include "mouse.h"
- #include "mono.h"
- extern void InstallErrorHandler();
- static int Initialized = 0;
- unsigned char CBLACK,CGREY,CWHITE,CBRIGHT,CRED;
- grs_font * ui_small_font = NULL;
- void ui_init()
- {
- grs_font * org_font;
- if (Initialized) return;
- Initialized = 1;
- org_font = grd_curcanv->cv_font;
- ui_small_font = gr_init_font( "pc6x8.fnt" );
- grd_curcanv->cv_font =org_font;
- CBLACK = gr_find_closest_color( 1, 1, 1 );
- CGREY = gr_find_closest_color( 45, 45, 45 );
- CWHITE = gr_find_closest_color( 50, 50, 50 );
- CBRIGHT = gr_find_closest_color( 58, 58, 58 );
- CRED = gr_find_closest_color( 63, 0, 0 );
- //key_init();
- ui_mouse_init();
- gr_set_fontcolor( CBLACK, CWHITE );
- CurWindow = NULL;
- InstallErrorHandler();
- ui_pad_init();
-
- atexit(ui_close );
- }
- void ui_close()
- {
- if (Initialized)
- {
- Initialized = 0;
- ui_pad_close();
- ui_mouse_close();
- // mouse_close();
- // key_close();
- _harderr( NULL );
- gr_close_font( ui_small_font );
- }
- return;
- }
|