|
Wing Commander II
Reconstructed Win32 source (1996)
|
DirectDraw DIB display, frame timing and palettes. More...
#include "game.h"Go to the source code of this file.
Macros | |
| #define | CINTERFACE |
| #define | DIB_C |
DirectDraw DIB display, frame timing and palettes.
Definition in file dib.cpp.
| void CachePaletteEntryFromWords | ( | short | index, |
| unsigned short * | rgb ) |
Definition at line 812 of file dib.cpp.
References CachePaletteEntryFromWords(), g_3_abColourShadow, and g_ausPaletteWords.
Referenced by CachePaletteEntryFromWords(), and UpdateShipTurretGuns().
| int DIBcascade | ( | int | mode, |
| int * | reportedResult ) |
Definition at line 314 of file dib.cpp.
References DIBcascade(), DIBerror(), g_nDisplayModeCascade, g_pDirectDraw2, g_pDirectDrawPalette, g_pPrimarySurface, g_pSecondarySurface, and WriteDebugString().
Referenced by DIBcascade(), DIBinstall(), DIBreInstall(), and UpdateShipTurretGuns().
Definition at line 503 of file dib.cpp.
References DIBdestroyDIB(), DIBerror(), g_101_nDibOffsetY, g_11_abFrameBackingStore, g_18_pDisplayPixelBuffer, g_28_nDisplayRowBytes, g_38_nDibOriginX, g_38_nSurfaceHeight, g_nDisplayModeCascade, g_pPrimarySurface, and g_pSecondarySurface.
Referenced by DIBdestroyDIB(), DIBunInstall(), and UpdateShipTurretGuns().
| void DIBerror | ( | const char * | tag, |
| int | hr ) |
Definition at line 221 of file dib.cpp.
References COM_RELEASE, DIBerror(), g_2_hFrameHwnd, g_pDirectDraw2, g_pPrimarySurface, g_pSecondarySurface, g_szFrameErrorMessage, and WriteDebugString().
Referenced by DIBcascade(), DIBdestroyDIB(), DIBerror(), DIBinstall(), DIBmakeDIB(), DIBramPalette(), DIBreInstall(), DIBsetPalette(), DIBslamReal(), DIBupdate(), DIBwholePaletteFromTriplets(), DIBwholePaletteFromWords(), and UpdateShipTurretGuns().
| void DIBinstall | ( | HWND | window | ) |
Definition at line 272 of file dib.cpp.
References DIBcascade(), DIBerror(), DIBinstall(), DIBmakeDIB(), g_11_abFrameBackingStore, g_2_hFrameHwnd, g_3_abColourShadow, g_4_bScreenStale, g_4_nDibShowCount, g_bConfigQuickModeEnabled, g_nDisplayModeCascade, g_pDirectDraw2, and IID_IDirectDraw2.
Referenced by CreateMainWindow(), DIBinstall(), and UpdateShipTurretGuns().
Definition at line 435 of file dib.cpp.
References Viewport::allocation, DIBerror(), DIBmakeDIB(), g_101_nDibOffsetY, g_101_stScrViewInfo, g_11_abFrameBackingStore, g_18_pDisplayPixelBuffer, g_28_nDisplayRowBytes, g_36_nDibBitsEachPx, g_38_nDibOriginX, g_38_nSurfaceHeight, g_3_abColourShadow, g_bUseHardwarePalette, g_nDisplayModeCascade, g_pDirectDraw2, g_pDirectDrawPalette, g_pPrimarySurface, g_pSecondarySurface, GetDIBPixelBuffer(), and Viewport::pixels.
Referenced by DIBinstall(), DIBmakeDIB(), and UpdateShipTurretGuns().
Definition at line 786 of file dib.cpp.
References DIBpixelBufferHook().
Referenced by DIBpixelBufferHook(), and UpdateShipTurretGuns().
Definition at line 243 of file dib.cpp.
References COM_RELEASE, DIBpositionWindow(), g_2_hFrameHwnd, g_pDirectDraw2, g_pPrimarySurface, and g_pSecondarySurface.
Referenced by DIBpositionWindow(), ShowNoticeMessageBox(), and UpdateShipTurretGuns().
Definition at line 830 of file dib.cpp.
References DIBerror(), DIBramPalette(), g_3_abColourShadow, g_bUseHardwarePalette, and g_pDirectDrawPalette.
Referenced by DIBramPalette(), and UpdateShipTurretGuns().
Definition at line 254 of file dib.cpp.
References DIBcascade(), DIBerror(), DIBreInstall(), g_2_hFrameHwnd, g_bConfigQuickModeEnabled, g_nDisplayModeCascade, and g_pDirectDraw2.
Referenced by DIBreInstall(), MainWindowProc(), and UpdateShipTurretGuns().
| void DIBsetPalette | ( | short | index, |
| short * | rgb ) |
Definition at line 854 of file dib.cpp.
References DIBerror(), DIBsetPalette(), g_3_abColourShadow, g_ausPaletteWords, g_bUseHardwarePalette, g_pDirectDrawPalette, and g_pPrimarySurface.
Referenced by DIBsetPalette(), DIBsetPalette(), SetPaletteEntry(), SetPaletteEntryFromTriplet(), and UpdateShipTurretGuns().
Definition at line 562 of file dib.cpp.
References CaptureMouseCursorBackground(), DIBerror(), DIBslamReal(), DrawMouseCursor(), g_10_dwLastSurfaceSlamRealNoticeTick, g_18_pDisplayPixelBuffer, g_28_nDisplayRowBytes, g_2_hFrameHwnd, g_38_nSurfaceHeight, g_3_szDibSlamRealDebugBuf, g_4_bScreenStale, g_4_nDibShowCount, g_8_nDibFlipRealCount, g_bDibSlamEnabled, g_nDisplayModeCascade, g_pDirectDraw2, g_pPrimarySurface, g_pSecondarySurface, GetDC(), ReleaseDC(), RestoreMouseCursorBackground(), ServiceSoundSystem(), ThrottleFrameAndDrawFps(), and UpdateStreamerStoppedFlag().
Referenced by CalibrateJoystickInteractive(), CopyViewportContents(), DIBslamReal(), DrawModalTextPanel(), InflightComputer(), ReadPersonnelTextField(), ReadTextInput(), RefreshMemoryStatusOverlay(), ReleaseModalTextPanel(), RestoreModalTextPanel(), RunCutsceneScript(), RunCutsceneWipeTransition(), RunSpaceFlight(), RunTitleScreen(), ShowModalTextPanel(), UpdateShipTurretGuns(), and visit_the_cinema().
Definition at line 424 of file dib.cpp.
References COM_RELEASE, DIBdestroyDIB(), DIBunInstall(), g_pDirectDraw2, g_pPrimarySurface, and g_pSecondarySurface.
Referenced by DIBunInstall(), ShutdownGameWindow(), UpdateShipTurretGuns(), and WinMain().
| void DIBupdate | ( | int | left, |
| int | top, | ||
| int | right, | ||
| int | bottom ) |
Definition at line 708 of file dib.cpp.
References DIBerror(), DIBupdate(), g_18_pDisplayPixelBuffer, g_28_nDisplayRowBytes, g_nDisplayModeCascade, g_pDirectDraw2, and g_pPrimarySurface.
Referenced by DIBupdate(), DisableMouseCursorDrawing(), EnableMouseCursorDrawing(), RefreshMouseCursorDisplay(), ResumeMouseCursorHook(), and UpdateShipTurretGuns().
Definition at line 988 of file dib.cpp.
References DIBwaitForVerticalBlank(), and g_pDirectDraw2.
Referenced by DIBwaitForVerticalBlank(), UpdateShipTurretGuns(), and WaitForVerticalBlankThunk().
| void DIBwholePaletteFromTriplets | ( | unsigned char * | palette | ) |
Definition at line 908 of file dib.cpp.
References DIBerror(), DIBwholePaletteFromTriplets(), g_3_abColourShadow, g_bUseHardwarePalette, g_pDirectDraw2, g_pDirectDrawPalette, and g_pPrimarySurface.
Referenced by DIBwholePaletteFromTriplets(), SetWholePaletteFromTriplets(), and UpdateShipTurretGuns().
| void DIBwholePaletteFromWords | ( | unsigned short * | palette | ) |
Definition at line 948 of file dib.cpp.
References DIBerror(), DIBwholePaletteFromWords(), g_3_abColourShadow, g_bUseHardwarePalette, g_pDirectDraw2, g_pDirectDrawPalette, and g_pPrimarySurface.
Referenced by DIBwholePaletteFromWords(), and UpdateShipTurretGuns().
Definition at line 556 of file dib.cpp.
References DisableDibSlam(), and g_bDibSlamEnabled.
Referenced by DisableDibSlam(), and UpdateShipTurretGuns().
Definition at line 550 of file dib.cpp.
References EnableDibSlam(), and g_bDibSlamEnabled.
Referenced by EnableDibSlam(), and UpdateShipTurretGuns().
| unsigned int GetDIBHeight | ( | void | ) |
Definition at line 806 of file dib.cpp.
References g_38_nSurfaceHeight, and GetDIBHeight().
Referenced by GetDIBHeight(), and UpdateShipTurretGuns().
| unsigned char * GetDIBPixelBuffer | ( | void | ) |
Definition at line 779 of file dib.cpp.
References g_18_pDisplayPixelBuffer, and GetDIBPixelBuffer().
Referenced by CopyViewportContents(), DIBmakeDIB(), GetDIBPixelBuffer(), InitializeDIBScreenViewport(), ReleaseCutsceneViewport(), and UpdateShipTurretGuns().
| unsigned int GetDIBWidth | ( | void | ) |
Definition at line 800 of file dib.cpp.
References g_28_nDisplayRowBytes, and GetDIBWidth().
Referenced by GetDIBWidth(), and UpdateShipTurretGuns().
| HWND GetDIBWindowHandle | ( | void | ) |
Definition at line 793 of file dib.cpp.
References g_2_hFrameHwnd, and GetDIBWindowHandle().
Referenced by GetDIBWindowHandle(), and UpdateShipTurretGuns().
| void GetPaletteEntryAsWords | ( | short | i, |
| unsigned short * | rgb ) |
Definition at line 900 of file dib.cpp.
References g_3_abColourShadow, and GetPaletteEntryAsWords().
Referenced by GetPaletteEntry(), GetPaletteEntryAsWords(), and UpdateShipTurretGuns().
Definition at line 532 of file dib.cpp.
References g_2_szDibDebugScratch, g_4_bScreenStale, g_dwLastDibDirtyReportTime, g_nDibDirtyHitTotal, and MarkDibDirty().
Referenced by AppendFormattedText(), CopyViewportContents(), CopyViewportRuns(), DrawFormattedText(), DrawModalTextPanel(), DrawSpriteTransformed(), DrawViewportEllipse(), DrawViewportEllipseShadow(), FillPolygon(), FillViewportEllipse(), fizzle_fade(), FormatTextBufferFromStart(), InflightComputer(), MarkDibDirty(), ReadPersonnelTextField(), ReadTextInput(), RefreshMemoryStatusOverlay(), ReleaseModalTextPanel(), RestoreModalTextPanel(), RestoreSpriteBackground(), RunCutsceneScript(), RunCutsceneWipeTransition(), RunSpaceFlight(), RunTitleScreen(), shaded_triangle(), shadow_draw(), ShowModalTextPanel(), snow_viewport(), triangle(), UpdateShipTurretGuns(), ValidateViewportBounds(), and visit_the_cinema().
| void ReportSpaceFlightMaxFps | ( | float | adjustment | ) |
Definition at line 176 of file dib.cpp.
References g_18_szSpaceFlightBestFpsMessage, g_fSpaceFlightFrameRate, g_nFrameTimingMode, ReportSpaceFlightMaxFps(), SetHudMessageText(), and SetSpaceFlightFrameTiming().
Referenced by MainWindowProc(), ReportSpaceFlightMaxFps(), and UpdateShipTurretGuns().
| void SetCinematicFrameTiming | ( | float | frameRate | ) |
Definition at line 212 of file dib.cpp.
References g_17_nFramePeriodMillis, g_bFrameTimingInitialized, g_dwNextFrameDeadline, g_nFrameTimingMode, and SetCinematicFrameTiming().
Referenced by PlayRawSpeechBuffer(), ServiceSoundSystem(), SetCinematicFrameTiming(), and UpdateShipTurretGuns().
Definition at line 202 of file dib.cpp.
References g_17_nFramePeriodMillis, g_1_fPreviousFrameSpeed, g_bFrameTimingInitialized, g_dwNextFrameDeadline, g_nFrameTimingMode, and SetDefaultFrameTiming().
Referenced by RunSpaceFlight(), SetDefaultFrameTiming(), ThrottleFrameAndDrawFps(), and UpdateShipTurretGuns().
| void SetHudMessageText | ( | char * | text, |
| unsigned short | colour, | ||
| unsigned short | duration ) |
Definition at line 192 of file dib.cpp.
References g_17_nFramePeriodMillis, g_bFrameTimingInitialized, g_dwNextFrameDeadline, g_fSpaceFlightFrameRate, g_nFrameTimingMode, and SetSpaceFlightFrameTiming().
Referenced by ReportSpaceFlightMaxFps(), RunSpaceFlight(), SetSpaceFlightFrameTiming(), and UpdateShipTurretGuns().
| void ThrottleFrameAndDrawFps | ( | HDC | dc | ) |
Definition at line 133 of file dib.cpp.
References g_16_stEventQueuePointerData, g_17_nFramePeriodMillis, g_18_pDisplayPixelBuffer, g_59_szFrameFrequencyString, g_bFrameTimingInitialized, g_bShowFrameRate, g_dwNextFrameDeadline, g_fMeasuredFrameRate, g_lPreviousFrameTick, Viewport::pixels, RefreshMouseCursorDisplay(), SetDefaultFrameTiming(), TextOutA(), ThrottleFrameAndDrawFps(), and QueuedMouseState::viewport.
Referenced by DIBslamReal(), ThrottleFrameAndDrawFps(), and UpdateShipTurretGuns().
| const GUID CLSID_DirectDraw |
| const GUID CLSID_DirectDrawClipper |
| unsigned int g_101_nDibOffsetY |
Definition at line 100 of file dib.cpp.
Referenced by DIBdestroyDIB(), and DIBmakeDIB().
| unsigned int g_10_dwLastSurfaceSlamRealNoticeTick |
Definition at line 115 of file dib.cpp.
Referenced by DIBslamReal().
| unsigned char g_11_abFrameBackingStore[0xfa00] |
Definition at line 104 of file dib.cpp.
Referenced by DIBdestroyDIB(), DIBinstall(), and DIBmakeDIB().
| long g_17_nFramePeriodMillis |
Definition at line 20 of file dib.cpp.
Referenced by SetCinematicFrameTiming(), SetDefaultFrameTiming(), SetSpaceFlightFrameTiming(), and ThrottleFrameAndDrawFps().
| unsigned char* g_18_pDisplayPixelBuffer |
Definition at line 101 of file dib.cpp.
Referenced by DIBdestroyDIB(), DIBmakeDIB(), DIBslamReal(), DIBupdate(), GetDIBPixelBuffer(), and ThrottleFrameAndDrawFps().
| char g_18_szSpaceFlightBestFpsMessage[0x80] |
Definition at line 116 of file dib.cpp.
Referenced by ReportSpaceFlightMaxFps().
| float g_1_fPreviousFrameSpeed |
Definition at line 23 of file dib.cpp.
Referenced by SetDefaultFrameTiming().
| unsigned int g_28_nDisplayRowBytes |
Definition at line 102 of file dib.cpp.
Referenced by DIBdestroyDIB(), DIBmakeDIB(), DIBslamReal(), DIBupdate(), and GetDIBWidth().
| HWND g_2_hFrameHwnd |
Definition at line 107 of file dib.cpp.
Referenced by DIBerror(), DIBinstall(), DIBpositionWindow(), DIBreInstall(), DIBslamReal(), and GetDIBWindowHandle().
| char g_2_szDibDebugScratch[260] |
Definition at line 112 of file dib.cpp.
Referenced by MarkDibDirty().
| int g_36_nDibBitsEachPx |
Definition at line 105 of file dib.cpp.
Referenced by DIBmakeDIB().
| unsigned int g_38_nDibOriginX |
Definition at line 99 of file dib.cpp.
Referenced by DIBdestroyDIB(), and DIBmakeDIB().
| unsigned int g_38_nSurfaceHeight |
Definition at line 103 of file dib.cpp.
Referenced by DIBdestroyDIB(), DIBmakeDIB(), DIBslamReal(), and GetDIBHeight().
| unsigned char g_3_abColourShadow[1024] |
Definition at line 110 of file dib.cpp.
Referenced by CachePaletteEntryFromWords(), DIBinstall(), DIBmakeDIB(), DIBramPalette(), DIBsetPalette(), DIBwholePaletteFromTriplets(), DIBwholePaletteFromWords(), and GetPaletteEntryAsWords().
| char g_3_szDibSlamRealDebugBuf[256] |
Definition at line 118 of file dib.cpp.
Referenced by DIBslamReal().
| int g_4_bScreenStale |
Definition at line 113 of file dib.cpp.
Referenced by DIBinstall(), DIBslamReal(), and MarkDibDirty().
| int g_4_nDibShowCount |
Definition at line 106 of file dib.cpp.
Referenced by DIBinstall(), and DIBslamReal().
| char g_59_szFrameFrequencyString[32] |
Definition at line 98 of file dib.cpp.
Referenced by ThrottleFrameAndDrawFps().
| int g_8_nDibFlipRealCount |
Definition at line 114 of file dib.cpp.
Referenced by DIBslamReal().
| int g_bDibSlamEnabled = 1 |
Definition at line 94 of file dib.cpp.
Referenced by DIBslamReal(), DisableDibSlam(), and EnableDibSlam().
| int g_bFrameTimingInitialized = 0 |
Definition at line 92 of file dib.cpp.
Referenced by SetCinematicFrameTiming(), SetDefaultFrameTiming(), SetSpaceFlightFrameTiming(), and ThrottleFrameAndDrawFps().
| unsigned int g_dwLastDibDirtyReportTime |
Definition at line 117 of file dib.cpp.
Referenced by MarkDibDirty().
| DWORD g_dwNextFrameDeadline = 0 |
Definition at line 80 of file dib.cpp.
Referenced by SetCinematicFrameTiming(), SetDefaultFrameTiming(), SetSpaceFlightFrameTiming(), and ThrottleFrameAndDrawFps().
| float g_fMeasuredFrameRate |
Definition at line 111 of file dib.cpp.
Referenced by ThrottleFrameAndDrawFps().
| float g_fSpaceFlightFrameRate = 20.0f |
Definition at line 88 of file dib.cpp.
Referenced by ReportSpaceFlightMaxFps(), and SetSpaceFlightFrameTiming().
| long g_lPreviousFrameTick = 0 |
Definition at line 84 of file dib.cpp.
Referenced by ThrottleFrameAndDrawFps().
| int g_nDibDirtyHitTotal |
Definition at line 108 of file dib.cpp.
Referenced by MarkDibDirty().
| int g_nDisplayModeCascade = -1 |
Definition at line 78 of file dib.cpp.
Referenced by DIBcascade(), DIBdestroyDIB(), DIBinstall(), DIBmakeDIB(), DIBreInstall(), DIBslamReal(), and DIBupdate().
| int g_nFrameTimingMode = 0 |
Definition at line 86 of file dib.cpp.
Referenced by ReportSpaceFlightMaxFps(), SetCinematicFrameTiming(), SetDefaultFrameTiming(), and SetSpaceFlightFrameTiming().
| LPDIRECTDRAW2 g_pDirectDraw2 = 0 |
Definition at line 70 of file dib.cpp.
Referenced by DIBcascade(), DIBerror(), DIBinstall(), DIBmakeDIB(), DIBpositionWindow(), DIBreInstall(), DIBslamReal(), DIBunInstall(), DIBupdate(), DIBwaitForVerticalBlank(), DIBwholePaletteFromTriplets(), and DIBwholePaletteFromWords().
| LPDIRECTDRAWPALETTE g_pDirectDrawPalette = 0 |
Definition at line 76 of file dib.cpp.
Referenced by DIBcascade(), DIBmakeDIB(), DIBramPalette(), DIBsetPalette(), DIBwholePaletteFromTriplets(), and DIBwholePaletteFromWords().
| LPDIRECTDRAWSURFACE g_pPrimarySurface = 0 |
Definition at line 72 of file dib.cpp.
Referenced by DIBcascade(), DIBdestroyDIB(), DIBerror(), DIBmakeDIB(), DIBpositionWindow(), DIBsetPalette(), DIBslamReal(), DIBunInstall(), DIBupdate(), DIBwholePaletteFromTriplets(), and DIBwholePaletteFromWords().
| LPDIRECTDRAWSURFACE g_pSecondarySurface = 0 |
Definition at line 74 of file dib.cpp.
Referenced by DIBcascade(), DIBdestroyDIB(), DIBerror(), DIBmakeDIB(), DIBpositionWindow(), DIBslamReal(), and DIBunInstall().
| char g_szFrameErrorMessage[0x8c] |
Definition at line 109 of file dib.cpp.
Referenced by DIBerror().
| const GUID IID_IDirectDraw |
| const GUID IID_IDirectDraw2 |
Definition at line 45 of file dib.cpp.
Referenced by DIBinstall().
| const GUID IID_IDirectDrawClipper |
| const GUID IID_IDirectDrawPalette |
| const GUID IID_IDirectDrawSurface |