|
|
| version 1.21, 2005/05/14 19:38:59 | version 1.22, 2006/12/24 00:52:29 |
|---|---|
| Line 9 | Line 9 |
| #include "mousemng.h" | #include "mousemng.h" |
| #include "scrnmng.h" | #include "scrnmng.h" |
| #include "sysmng.h" | #include "sysmng.h" |
| #include "dclock.h" | |
| #include "menu.h" | #include "menu.h" |
| #include "np2class.h" | #include "np2class.h" |
| #include "pccore.h" | #include "pccore.h" |
| #include "scrndraw.h" | #include "scrndraw.h" |
| #include "palettes.h" | #include "palettes.h" |
| #if defined(SUPPORT_DCLOCK) | |
| #include "dclock.h" | |
| #endif | |
| extern WINLOCEX np2_winlocexallwin(HWND base); | extern WINLOCEX np2_winlocexallwin(HWND base); |
| Line 25 typedef struct { | Line 27 typedef struct { |
| LPDIRECTDRAW2 ddraw2; | LPDIRECTDRAW2 ddraw2; |
| LPDIRECTDRAWSURFACE primsurf; | LPDIRECTDRAWSURFACE primsurf; |
| LPDIRECTDRAWSURFACE backsurf; | LPDIRECTDRAWSURFACE backsurf; |
| #if defined(SUPPORT_DCLOCK) | |
| LPDIRECTDRAWSURFACE clocksurf; | LPDIRECTDRAWSURFACE clocksurf; |
| #endif | |
| LPDIRECTDRAWCLIPPER clipper; | LPDIRECTDRAWCLIPPER clipper; |
| LPDIRECTDRAWPALETTE palette; | LPDIRECTDRAWPALETTE palette; |
| UINT scrnmode; | UINT scrnmode; |
| Line 256 static void clearoutfullscreen(void) { | Line 260 static void clearoutfullscreen(void) { |
| base.right = ddraw.width; // (+ ddraw.extend) | base.right = ddraw.width; // (+ ddraw.extend) |
| base.bottom = ddraw.height; | base.bottom = ddraw.height; |
| clearoutofrect(&ddraw.scrn, &base); | clearoutofrect(&ddraw.scrn, &base); |
| #if defined(SUPPORT_DCLOCK) | |
| dclock_redraw(); | dclock_redraw(); |
| #endif | |
| } | } |
| static void paletteinit(void) { | static void paletteinit(void) { |
| Line 267 static void paletteinit(void) { | Line 273 static void paletteinit(void) { |
| hdc = GetDC(hWndMain); | hdc = GetDC(hWndMain); |
| GetSystemPaletteEntries(hdc, 0, 256, ddraw.pal); | GetSystemPaletteEntries(hdc, 0, 256, ddraw.pal); |
| ReleaseDC(hWndMain, hdc); | ReleaseDC(hWndMain, hdc); |
| #if defined(SUPPORT_DCLOCK) | |
| for (i=0; i<4; i++) { | for (i=0; i<4; i++) { |
| ddraw.pal[i+START_PALORG].peBlue = dclockpal.pal32[i].p.b; | ddraw.pal[i+START_PALORG].peBlue = dclockpal.pal32[i].p.b; |
| ddraw.pal[i+START_PALORG].peRed = dclockpal.pal32[i].p.r; | ddraw.pal[i+START_PALORG].peRed = dclockpal.pal32[i].p.r; |
| ddraw.pal[i+START_PALORG].peGreen = dclockpal.pal32[i].p.g; | ddraw.pal[i+START_PALORG].peGreen = dclockpal.pal32[i].p.g; |
| ddraw.pal[i+START_PALORG].peFlags = PC_RESERVED | PC_NOCOLLAPSE; | ddraw.pal[i+START_PALORG].peFlags = PC_RESERVED | PC_NOCOLLAPSE; |
| } | } |
| #endif | |
| for (i=0; i<NP2PAL_TOTAL; i++) { | for (i=0; i<NP2PAL_TOTAL; i++) { |
| ddraw.pal[i+START_PAL].peFlags = PC_RESERVED | PC_NOCOLLAPSE; | ddraw.pal[i+START_PAL].peFlags = PC_RESERVED | PC_NOCOLLAPSE; |
| } | } |
| Line 387 BRESULT scrnmng_create(UINT8 scrnmode) { | Line 395 BRESULT scrnmng_create(UINT8 scrnmode) { |
| ddraw.ddraw2 = ddraw2; | ddraw.ddraw2 = ddraw2; |
| if (scrnmode & SCRNMODE_FULLSCREEN) { | if (scrnmode & SCRNMODE_FULLSCREEN) { |
| #if defined(SUPPORT_DCLOCK) | |
| dclock_init(); | dclock_init(); |
| #endif | |
| ddraw2->SetCooperativeLevel(hWndMain, | ddraw2->SetCooperativeLevel(hWndMain, |
| DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); |
| height = (np2oscfg.force400)?400:480; | height = (np2oscfg.force400)?400:480; |
| Line 442 BRESULT scrnmng_create(UINT8 scrnmode) { | Line 452 BRESULT scrnmng_create(UINT8 scrnmode) { |
| else { | else { |
| goto scre_err; | goto scre_err; |
| } | } |
| #if defined(SUPPORT_DCLOCK) | |
| dclock_palset(bitcolor); | dclock_palset(bitcolor); |
| ZeroMemory(&ddsd, sizeof(ddsd)); | ZeroMemory(&ddsd, sizeof(ddsd)); |
| ddsd.dwSize = sizeof(ddsd); | ddsd.dwSize = sizeof(ddsd); |
| ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; | ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; |
| Line 452 BRESULT scrnmng_create(UINT8 scrnmode) { | Line 462 BRESULT scrnmng_create(UINT8 scrnmode) { |
| ddsd.dwHeight = DCLOCK_HEIGHT; | ddsd.dwHeight = DCLOCK_HEIGHT; |
| ddraw2->CreateSurface(&ddsd, &ddraw.clocksurf, NULL); | ddraw2->CreateSurface(&ddsd, &ddraw.clocksurf, NULL); |
| dclock_reset(); | dclock_reset(); |
| #endif | |
| } | } |
| else { | else { |
| ddraw2->SetCooperativeLevel(hWndMain, DDSCL_NORMAL); | ddraw2->SetCooperativeLevel(hWndMain, DDSCL_NORMAL); |
| Line 527 void scrnmng_destroy(void) { | Line 538 void scrnmng_destroy(void) { |
| if (scrnmng.flag & SCRNFLAG_FULLSCREEN) { | if (scrnmng.flag & SCRNFLAG_FULLSCREEN) { |
| np2class_enablemenu(hWndMain, (!np2oscfg.wintype)); | np2class_enablemenu(hWndMain, (!np2oscfg.wintype)); |
| } | } |
| #if defined(SUPPORT_DCLOCK) | |
| if (ddraw.clocksurf) { | if (ddraw.clocksurf) { |
| ddraw.clocksurf->Release(); | ddraw.clocksurf->Release(); |
| ddraw.clocksurf = NULL; | ddraw.clocksurf = NULL; |
| } | } |
| #endif | |
| if (ddraw.backsurf) { | if (ddraw.backsurf) { |
| ddraw.backsurf->Release(); | ddraw.backsurf->Release(); |
| ddraw.backsurf = NULL; | ddraw.backsurf = NULL; |
| Line 757 void scrnmng_setmultiple(int multiple) { | Line 770 void scrnmng_setmultiple(int multiple) { |
| } | } |
| } | } |
| // ---- | |
| #if defined(SUPPORT_DCLOCK) | |
| static const RECT rectclk = {0, 0, DCLOCK_WIDTH, DCLOCK_HEIGHT}; | static const RECT rectclk = {0, 0, DCLOCK_WIDTH, DCLOCK_HEIGHT}; |
| void scrnmng_dispclock(void) { | void scrnmng_dispclock(void) { |
| Line 793 void scrnmng_dispclock(void) { | Line 810 void scrnmng_dispclock(void) { |
| dclock_cntdown(np2oscfg.DRAW_SKIP); | dclock_cntdown(np2oscfg.DRAW_SKIP); |
| } | } |
| } | } |
| #endif | |
| // ---- | // ---- |