Go to the source code of this file.
Compounds | |
| struct | SAL_REGION |
| struct | SAL_RGB32 |
| struct | SAL_WINAREA |
Defines | |
| #define | SAL_VERSION "1.00" |
| #define | SAL_VERSION_DATE "23-May-96" |
| #define | SALEXPORT WINAPI |
| #define | DXDEC |
| #define | DXDEF |
| #define | YES 1 |
| #define | NO 0 |
| #define | TRUE 1 |
| #define | FALSE 0 |
| #define | SAL_FULLSCREEN 0 |
| #define | SAL_WINDOW 1 |
| #define | SAL_TRY_FULLSCREEN 2 |
| #define | SAL_FRONT_SURFACE 0 |
| #define | SAL_BACK_SURFACE 1 |
| #define | SAL_ALLOW_FRONT_LOCK 0 |
| #define | DEFAULT_AFL NO |
| #define | SAL_BUFFER_IF_NO_LFB 1 |
| #define | DEFAULT_BINL YES |
| #define | SAL_DOS_MONO_DEBUG 2 |
| #define | DEFAULT_DMD YES |
| #define | SAL_MAX_VIDEO_PAGES 3 |
| #define | DEFAULT_MVP 3 |
| #define | SAL_ALLOW_WINDOW_RESIZE 4 |
| #define | DEFAULT_AWR YES |
| #define | SAL_PREVENT_ALT_MENU_POPUP 5 |
| #define | DEFAULT_PAMP YES |
| #define | SAL_ALWAYS_ON_TOP 6 |
| #define | DEFAULT_SAOT NO |
| #define | SAL_MAXIMIZE_TO_FULLSCREEN 7 |
| #define | DEFAULT_MTF YES |
| #define | N_SAL_PREFS 8 |
Typedefs | |
| typedef unsigned char | U8 |
| typedef unsigned short | U16 |
| typedef unsigned long | U32 |
| typedef char | C8 |
| typedef signed char | S8 |
| typedef signed short | S16 |
| typedef signed long | S32 |
Functions | |
| typedef | void (SALEXPORT *SALFOCUSCB)(S32 status) |
| DXDEC void __cdecl | SAL_debug_printf (char *fmt,...) |
| DXDEC S32 WINAPI | SAL_get_preference (U32 number) |
| DXDEC S32 WINAPI | SAL_set_preference (U32 number, S32 value) |
| DXDEC void WINAPI | SAL_set_palette_entry (S32 index, SAL_RGB32 *entry, S32 wait_flag) |
| DXDEC void WINAPI | SAL_get_palette_entry (S32 index, SAL_RGB32 *entry) |
| DXDEC void WINAPI | SAL_set_palette_range (S32 index, S32 num_entries, SAL_RGB32 *entry_list, S32 wait_flag) |
| DXDEC void WINAPI | SAL_get_palette_range (S32 index, S32 num_entries, SAL_RGB32 *entry_list) |
| DXDEC void WINAPI | SAL_get_pixel_format (S32 *pixel_pitch, S32 *bytes_per_pixel, S32 *R_shift, U32 *R_mask, S32 *R_width, S32 *G_shift, U32 *G_mask, S32 *G_width, S32 *B_shift, U32 *B_mask, S32 *B_width) |
| DXDEC void WINAPI | SAL_flip_surface (void) |
| DXDEF void WINAPI | SAL_blit_surface (void) |
| DXDEC void WINAPI | SAL_wipe_surface (S32 surface, U32 color) |
| DXDEC void WINAPI | SAL_lock_surface (S32 surface, U8 **ptr, S32 *pitch) |
| DXDEC void WINAPI | SAL_release_surface (S32 surface, S32 perform_flip) |
| DXDEC void WINAPI | SAL_lock_region (S32 surface, SAL_REGION region, U8 **ptr, S32 *pitch) |
| DXDEC void WINAPI | SAL_release_region (S32 surface, SAL_REGION region) |
| DXDEC void WINAPI | SAL_show_system_mouse (void) |
| DXDEC void WINAPI | SAL_hide_system_mouse (void) |
| DXDEC void WINAPI | SAL_constrain_mouse (void) |
| DXDEC void WINAPI | SAL_unconstrain_mouse (void) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 121 of file SAL.H. Referenced by BeginScene(), DIB_shutdown(), and EndScene(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 116 of file SAL.H. Referenced by SAL_serve_message_queue(), SAL_set_display_mode(), and SAL_startup(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 118 of file SAL.H. Referenced by SAL_set_display_mode(). |
|
|
|
|
|
|
|
|
Definition at line 117 of file SAL.H. Referenced by DrvInit(), SAL_serve_message_queue(), and SAL_set_display_mode(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 820 of file W32SAL.CPP. References DIB_flip_surface(), and DXDEF. Referenced by EndScene().
00821 {
00822 DIB_flip_surface();
00823 }
|
|
|
Definition at line 1687 of file W32SAL.CPP. References constrain_request, constrain_state, DIB_active, and DXDEF.
01688 {
01689 constrain_state = 1;
01690
01691 if (DIB_active)
01692 {
01693 constrain_request = 1;
01694 }
01695 }
|
|
||||||||||||
|
Definition at line 1033 of file W32SAL.CPP. References debug_log_filename, DXDEF, log_to_file, and NULL. Referenced by DIB_startup(), SAL_error_box(), and SAL_serve_message_queue().
01034 {
01035 static char work_string[4096];
01036 FILE *log;
01037
01038 if ((fmt == NULL) || (strlen(fmt) > sizeof(work_string)))
01039 {
01040 strcpy(work_string, "(String missing or too large)");
01041 }
01042 else
01043 {
01044 va_list ap;
01045
01046 va_start(ap,
01047 fmt);
01048
01049 vsprintf(work_string,
01050 fmt,
01051 ap);
01052
01053 va_end (ap);
01054 }
01055
01056 if (log_to_file)
01057 {
01058 log = fopen(debug_log_filename,"a+t");
01059
01060 if (log != NULL)
01061 {
01062 fprintf(log,"%s\n",work_string);
01063 fclose(log);
01064 }
01065 }
01066
01067 OutputDebugString(work_string);
01068 }
|
|
|
Definition at line 1548 of file W32SAL.CPP. References DIB_active, DIB_flip_surface(), and DXDEF. Referenced by DIB_release_surface(), and DIB_shutdown().
01549 {
01550 if (DIB_active)
01551 {
01552 DIB_flip_surface();
01553 }
01554 }
|
|
||||||||||||
|
Definition at line 1462 of file W32SAL.CPP. References DXDEF, and palette_state.
01464 {
01465 *entry = palette_state[index];
01466 }
|
|
||||||||||||||||
|
Definition at line 1532 of file W32SAL.CPP. References DXDEF, and palette_state.
01535 {
01536 for (int i=0; i < num_entries; i++)
01537 {
01538 entry_list[i] = palette_state[index+i];
01539 }
01540 }
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Definition at line 1722 of file W32SAL.CPP. References current_bpp, DIB_active, DIB_B_bitmask, DIB_G_bitmask, DIB_R_bitmask, DXDEF, NULL, S32, and U32. Referenced by SysInit().
01734 {
01735 S32 red_shift;
01736 U32 red_mask;
01737 S32 red_width;
01738 S32 grn_shift;
01739 U32 grn_mask;
01740 S32 grn_width;
01741 S32 blu_shift;
01742 U32 blu_mask;
01743 S32 blu_width;
01744 S32 i;
01745
01746 //
01747 // Handle palettized (8 BPP) modes
01748 //
01749 // Write 8-bit pixel pitch and visible bytes/pixel fields
01750 // If we're in 8BPP mode, exit without altering RGB fields
01751 //
01752
01753 if (current_bpp == 8)
01754 {
01755 if (pixel_pitch != NULL) *pixel_pitch = 1;
01756 if (bytes_per_pixel != NULL) *bytes_per_pixel = 1;
01757
01758 return;
01759 }
01760
01761 //
01762 // Handle hi-color (16+ BPP) modes
01763 //
01764 // If using DirectDraw, do a GetPixelFormat() call
01765 //
01766 // If using CreateDIBSection(), return mask values used to create DIB
01767 //
01768
01769 if (DIB_active)
01770 {
01771 if (pixel_pitch != NULL) *pixel_pitch = (current_bpp / 8);
01772 if (bytes_per_pixel != NULL) *bytes_per_pixel = (current_bpp / 8);
01773
01774 red_mask = DIB_R_bitmask;
01775 grn_mask = DIB_G_bitmask;
01776 blu_mask = DIB_B_bitmask;
01777 }
01778
01779 //
01780 // Derive shift, width values from masks
01781 //
01782
01783 for (i=31; i >= 0; i--)
01784 {
01785 if (red_mask & (1 << i))
01786 {
01787 red_shift = i;
01788 }
01789
01790 if (grn_mask & (1 << i))
01791 {
01792 grn_shift = i;
01793 }
01794
01795 if (blu_mask & (1 << i))
01796 {
01797 blu_shift = i;
01798 }
01799 }
01800
01801 for (i=0; i <= 31; i++)
01802 {
01803 if (red_mask & (1 << i))
01804 {
01805 red_width = i - red_shift + 1;
01806 }
01807
01808 if (grn_mask & (1 << i))
01809 {
01810 grn_width = i - grn_shift + 1;
01811 }
01812
01813 if (blu_mask & (1 << i))
01814 {
01815 blu_width = i - blu_shift + 1;
01816 }
01817 }
01818 //
01819 // Pass all requested values back to the caller
01820 //
01821
01822 if (R_shift != NULL) *R_shift = red_shift;
01823 if (G_shift != NULL) *G_shift = grn_shift;
01824 if (B_shift != NULL) *B_shift = blu_shift;
01825
01826 if (R_mask != NULL) *R_mask = red_mask;
01827 if (G_mask != NULL) *G_mask = grn_mask;
01828 if (B_mask != NULL) *B_mask = blu_mask;
01829
01830 if (R_width != NULL) *R_width = red_width;
01831 if (G_width != NULL) *G_width = grn_width;
01832 if (B_width != NULL) *B_width = blu_width;
01833 }
|
|
|
Definition at line 1020 of file W32SAL.CPP. References DXDEF, S32, and SAL_preference.
01021 {
01022 return SAL_preference[number];
01023 }
|
|
|
Definition at line 1660 of file W32SAL.CPP. References cursor_state, DXDEF, and show_count.
01661 {
01662 --show_count;
01663
01664 if (show_count == 0)
01665 {
01666 //
01667 // Show count has become 0, so hide mouse cursor if it's currently
01668 // visible
01669 //
01670
01671 if (cursor_state)
01672 {
01673 cursor_state = 0;
01674 #ifndef DISABLED_BEHAVIOR
01675 ShowCursor(0);
01676 #endif
01677 }
01678 }
01679 }
|
|
||||||||||||||||||||
|
Definition at line 1608 of file W32SAL.CPP. References DXDEF.
01612 {
01613
01614 }
|
|
||||||||||||||||
|
Definition at line 1577 of file W32SAL.CPP. References DIB_active, DIB_lock_surface(), and DXDEF. Referenced by BeginScene().
01580 {
01581 if (DIB_active)
01582 {
01583 DIB_lock_surface(surface, ptr, pitch);
01584 }
01585 }
|
|
||||||||||||
|
Definition at line 1622 of file W32SAL.CPP. References DXDEF.
01624 {
01625 }
|
|
||||||||||||
|
Definition at line 1593 of file W32SAL.CPP. References DIB_active, DIB_release_surface(), and DXDEF. Referenced by EndScene().
01595 {
01596 if (DIB_active)
01597 {
01598 DIB_release_surface(surface, perform_flip);
01599 }
01600 }
|
|
||||||||||||||||
|
Definition at line 1414 of file W32SAL.CPP. References current_bpp, DIB_active, DXDEF, hPalette, NULL, palette_change_request, palette_state, pbmi, pLogPal, and TRUE.
01417 {
01418 //
01419 // If we're not in 8BPP mode, bail out
01420 //
01421
01422 if (current_bpp != 8)
01423 {
01424 return;
01425 }
01426
01427 //
01428 // Update global palette state
01429 //
01430
01431 palette_state[index] = *entry;
01432
01433 pLogPal->palPalEntry[index].peRed = pbmi->bmiColors[index].rgbRed = (unsigned char) entry->r;
01434 pLogPal->palPalEntry[index].peGreen = pbmi->bmiColors[index].rgbGreen = (unsigned char) entry->g;
01435 pLogPal->palPalEntry[index].peBlue = pbmi->bmiColors[index].rgbBlue = (unsigned char) entry->b;
01436 pLogPal->palPalEntry[index].peFlags = NULL;
01437
01438 //
01439 // Update DirectDraw palette, if appropriate
01440 //
01441
01442
01443 if (DIB_active)
01444 {
01445 if (hPalette != NULL)
01446 {
01447 DeleteObject(hPalette);
01448 }
01449
01450 hPalette = CreatePalette(pLogPal);
01451
01452 palette_change_request = TRUE;
01453 }
01454 }
|
|
||||||||||||||||||||
|
Definition at line 1474 of file W32SAL.CPP. References SAL_RGB32::b, current_bpp, DIB_active, DXDEF, SAL_RGB32::g, hPalette, NULL, palette_change_request, palette_state, pbmi, pLogPal, SAL_RGB32::r, S32, and TRUE.
01478 {
01479 S32 i;
01480 S32 j;
01481
01482 //
01483 // If we're not in 8BPP mode, bail out
01484 //
01485
01486 if (current_bpp != 8)
01487 {
01488 return;
01489 }
01490
01491 //
01492 // Update global palette state
01493 //
01494
01495 for (i=0; i < num_entries; i++)
01496 {
01497 palette_state[index+i] = entry_list[i];
01498 }
01499
01500 for (i=0, j=index; i < num_entries; i++, j++)
01501 {
01502 pLogPal->palPalEntry[j].peRed = pbmi->bmiColors[j].rgbRed = (unsigned char) entry_list[i].r;
01503 pLogPal->palPalEntry[j].peGreen = pbmi->bmiColors[j].rgbGreen = (unsigned char) entry_list[i].g;
01504 pLogPal->palPalEntry[j].peBlue = pbmi->bmiColors[j].rgbBlue = (unsigned char) entry_list[i].b;
01505 pLogPal->palPalEntry[j].peFlags = NULL;
01506 }
01507
01508 //
01509 // Update DirectDraw palette, if appropriate
01510 //
01511
01512
01513 if (DIB_active)
01514 {
01515 if (hPalette != NULL)
01516 {
01517 DeleteObject(hPalette);
01518 }
01519
01520 hPalette = CreatePalette(pLogPal);
01521
01522 palette_change_request = TRUE;
01523 }
01524 }
|
|
||||||||||||
|
Definition at line 1003 of file W32SAL.CPP. References DXDEF, S32, and SAL_preference.
01004 {
01005 S32 old;
01006
01007 old = SAL_preference[number];
01008
01009 SAL_preference[number] = value;
01010
01011 return old;
01012 }
|
|
|
Definition at line 1633 of file W32SAL.CPP. References cursor_state, DXDEF, and show_count.
01634 {
01635 ++show_count;
01636
01637 if (show_count == 1)
01638 {
01639 //
01640 // Show count has become 1, so show mouse cursor if it's currently
01641 // hidden
01642 //
01643
01644 if (!cursor_state)
01645 {
01646 cursor_state = 1;
01647 #ifndef DISABLED_BEHAVIOR
01648 ShowCursor(1);
01649 #endif
01650 }
01651 }
01652 }
|
|
|
Definition at line 1703 of file W32SAL.CPP. References constrain_request, constrain_state, DIB_active, DXDEF, and unconstrained_rect.
01704 {
01705 constrain_state = 0;
01706
01707 if (DIB_active)
01708 {
01709 #ifndef DISABLED_BEHAVIOR
01710 ClipCursor(&unconstrained_rect);
01711 #endif
01712 constrain_request = 0;
01713 }
01714 }
|
|
||||||||||||
|
Definition at line 1562 of file W32SAL.CPP. References DIB_active, DIB_wipe_surface(), and DXDEF. Referenced by BeginScene(), and DIB_shutdown().
01564 {
01565 if (DIB_active)
01566 {
01567 DIB_wipe_surface(surface, color);
01568 }
01569 }
|
|
|
|
1.3.2