| version 1.9, 2003/11/04 15:44:59 | version 1.13, 2003/12/01 03:38:52 | 
| Line 5 | Line 5 | 
 | #endif | #endif | 
 | #include        "resource.h" | #include        "resource.h" | 
 | #include        "np2.h" | #include        "np2.h" | 
 |  | #include        "winloc.h" | 
 | #include        "mousemng.h" | #include        "mousemng.h" | 
 | #include        "scrnmng.h" | #include        "scrnmng.h" | 
 | #include        "sysmng.h" | #include        "sysmng.h" | 
| Line 16 | Line 17 | 
 | #include        "palettes.h" | #include        "palettes.h" | 
 |  |  | 
 |  |  | 
 |  | extern WINLOCEX np2_winlocexallwin(HWND base); | 
 |  |  | 
 |  |  | 
 | typedef struct { | typedef struct { | 
 | LPDIRECTDRAW            ddraw1; | LPDIRECTDRAW            ddraw1; | 
 | LPDIRECTDRAW2           ddraw2; | LPDIRECTDRAW2           ddraw2; | 
| Line 35  typedef struct { | Line 39  typedef struct { | 
 | BYTE                            l16g; | BYTE                            l16g; | 
 | BYTE                            menudisp; | BYTE                            menudisp; | 
 | int                                     menusize; | int                                     menusize; | 
 | //      HMENU                           menuhdl; |  | 
 | RECT                            scrn; | RECT                            scrn; | 
 | RECT                            rect; | RECT                            rect; | 
 | PALETTEENTRY            pal[256]; | PALETTEENTRY            pal[256]; | 
| Line 117  static void setwindowsize(HWND hWnd, int | Line 120  static void setwindowsize(HWND hWnd, int | 
 | } while(--cnt); | } while(--cnt); | 
 | } | } | 
 |  |  | 
| static void renewalclientsize(void) { | static void renewalclientsize(BOOL winloc) { | 
 |  |  | 
| int             width; | int                     width; | 
| int             height; | int                     height; | 
| int             extend; | int                     extend; | 
| int             multiple; | int                     multiple; | 
| int             scrnwidth; | int                     scrnwidth; | 
| int             scrnheight; | int                     scrnheight; | 
|  | WINLOCEX        wlex; | 
 |  |  | 
 | width = min(scrnstat.width, ddraw.width); | width = min(scrnstat.width, ddraw.width); | 
 | height = min(scrnstat.height, ddraw.height); | height = min(scrnstat.height, ddraw.height); | 
| Line 165  static void renewalclientsize(void) { | Line 169  static void renewalclientsize(void) { | 
 | } | } | 
 | ddraw.scrn.right = np2oscfg.paddingx + scrnwidth; | ddraw.scrn.right = np2oscfg.paddingx + scrnwidth; | 
 | ddraw.scrn.bottom = np2oscfg.paddingy + scrnheight; | ddraw.scrn.bottom = np2oscfg.paddingy + scrnheight; | 
 |  | wlex = NULL; | 
 |  | if (winloc) { | 
 |  | wlex = np2_winlocexallwin(hWndMain); | 
 |  | } | 
 |  | winlocex_setholdwnd(wlex, hWndMain); | 
 | setwindowsize(hWndMain, scrnwidth, scrnheight); | setwindowsize(hWndMain, scrnwidth, scrnheight); | 
 |  | winlocex_move(wlex); | 
 |  | winlocex_destroy(wlex); | 
 | } | } | 
 | scrnsurf.width = width; | scrnsurf.width = width; | 
 | scrnsurf.height = height; | scrnsurf.height = height; | 
| Line 238  static void clearoutscreen(void) { | Line 249  static void clearoutscreen(void) { | 
 |  |  | 
 | static void clearoutfullscreen(void) { | static void clearoutfullscreen(void) { | 
 |  |  | 
| RECT    r; | RECT    base; | 
 |  |  | 
| r.left = 0; | base.left = 0; | 
| r.top = (GetWindowLong(hWndMain, NP2GWL_HMENU))?0:ddraw.menusize; | base.top = (GetWindowLong(hWndMain, NP2GWL_HMENU))?0:ddraw.menusize; | 
| r.right = ddraw.width;                  // (+ ddraw.extend) | base.right = ddraw.width;                       // (+ ddraw.extend) | 
| r.bottom = ddraw.height; | base.bottom = ddraw.height; | 
| clearoutofrect(&ddraw.scrn, &r); | clearoutofrect(&ddraw.scrn, &base); | 
 | dclock_redraw(); | dclock_redraw(); | 
 | } | } | 
 |  |  | 
| Line 492  BOOL scrnmng_create(BYTE scrnmode) { | Line 503  BOOL scrnmng_create(BYTE scrnmode) { | 
 | ddraw.width = 640; | ddraw.width = 640; | 
 | ddraw.height = height; | ddraw.height = height; | 
 | ddraw.cliping = 0; | ddraw.cliping = 0; | 
| renewalclientsize(); | renewalclientsize(FALSE); | 
 | screenupdate = 3;                                       // update! | screenupdate = 3;                                       // update! | 
 | if (!(scrnmode & SCRNMODE_FULLSCREEN)) { |  | 
 | np2class_enablemenu(hWndMain, (!np2oscfg.wintype)); |  | 
 | } |  | 
 | return(SUCCESS); | return(SUCCESS); | 
 |  |  | 
 | scre_err: | scre_err: | 
| Line 506  scre_err: | Line 514  scre_err: | 
 |  |  | 
 | void scrnmng_destroy(void) { | void scrnmng_destroy(void) { | 
 |  |  | 
| //      np2class_enablemenu(hWndMain, TRUE); | if (scrnmng.flag & SCRNFLAG_FULLSCREEN) { | 
|  | np2class_enablemenu(hWndMain, (!np2oscfg.wintype)); | 
|  | } | 
 | if (ddraw.clocksurf) { | if (ddraw.clocksurf) { | 
 | ddraw.clocksurf->Release(); | ddraw.clocksurf->Release(); | 
 | ddraw.clocksurf = NULL; | ddraw.clocksurf = NULL; | 
| Line 604  void scrnmng_clearwinui(void) { | Line 614  void scrnmng_clearwinui(void) { | 
 | clearoutfullscreen(); | clearoutfullscreen(); | 
 | ddraw.menudisp = 0; | ddraw.menudisp = 0; | 
 | } | } | 
 |  | else { | 
 |  | if (np2oscfg.wintype) { | 
 |  | np2class_enablemenu(hWndMain, FALSE); | 
 |  | InvalidateRect(hWndMain, NULL, TRUE); | 
 |  | } | 
 |  | } | 
 | mousemng_enable(MOUSEPROC_WINUI); | mousemng_enable(MOUSEPROC_WINUI); | 
 | } | } | 
 |  |  | 
 | void scrnmng_setwidth(int posx, int width) { | void scrnmng_setwidth(int posx, int width) { | 
 |  |  | 
 | scrnstat.width = width; | scrnstat.width = width; | 
| renewalclientsize(); | renewalclientsize(TRUE); | 
 | } | } | 
 |  |  | 
 | void scrnmng_setextend(int extend) { | void scrnmng_setextend(int extend) { | 
 |  |  | 
 | scrnstat.extend = extend; | scrnstat.extend = extend; | 
| renewalclientsize(); | scrnmng.allflash = TRUE; | 
|  | renewalclientsize(TRUE); | 
 | } | } | 
 |  |  | 
 | void scrnmng_setheight(int posy, int height) { | void scrnmng_setheight(int posy, int height) { | 
 |  |  | 
 | scrnstat.height = height; | scrnstat.height = height; | 
| renewalclientsize(); | renewalclientsize(TRUE); | 
 | } | } | 
 |  |  | 
 | const SCRNSURF *scrnmng_surflock(void) { | const SCRNSURF *scrnmng_surflock(void) { | 
| Line 726  void scrnmng_setmultiple(int multiple) { | Line 743  void scrnmng_setmultiple(int multiple) { | 
 |  |  | 
 | if (scrnstat.multiple != multiple) { | if (scrnstat.multiple != multiple) { | 
 | scrnstat.multiple = multiple; | scrnstat.multiple = multiple; | 
| renewalclientsize(); | renewalclientsize(TRUE); | 
 | } | } | 
 | } | } | 
 |  |  |