/* global.cpp - Don Yang (uguu.org) 12/22/00 */ #include"global.h" // Globals int ActualFPS[4] = {0, 0, 0, 0}; // Measured frames per second int ActualFPSindex = 0; // Frame per second index BOOL AppActive = FALSE; // Application has focus HINSTANCE AppInstance = NULL; // Current application instance BOOL AppPaused = FALSE; // User paused state HWND AppWindow = NULL; // Application window handle BYTE *BGImage = NULL; // Background image pixels int BlockT0 = 0; // Block tile type (bottom) int BlockT1 = 0; // Block tile type (top) int BlockX = 0; // Block position (horizontal) int BlockY = 0; // Block position (vertical, bottom cell) PlayerEntry CurrentPlayer; // Current player scores DWORD DDPitch = 0; // Bytes per screen scanline BOOL DDReady = FALSE; // DirectDraw init state DWORD ExecCount = 1; // Executation count int ExpectedFPS = 60; // Frames per second (calibrated) int FixColumn = -1; // Fix next block start location BOOL FixSpecial = FALSE; // Force special cell to appear int FrameCount = 0; // Frame counter (game timer) int GameLevel = 0; // Current level (drop delay factor) DWORD GameOptions = OPTION_DEFAULT; // Game options int GameState = SYS_STATE_INIT; // Game DFA state int GameStateTime = 60; // Game DFA delay timer int Grid[32][32]; // Game grid BOOL JoystickAvailable = TRUE; // Joystick availability BOOL JoystickCaptured = FALSE; // Joystick status UINT JoystickID = 0; // Joystick ID PlayerEntry History[MAX_HISTORY_LENGTH]; // High score table int MaxFrames = 360000; // Maximum frames before timer reset int MouseB = 0; // Mouse button status int MouseX = 0; // Mouse position (absolute screen) int MouseY = 0; // Mouse position (absolute screen) int PixelFormat; // Pixel format (enumerated constant) BOOL RedrawAll = TRUE; // Complete refresh flag int ResumeState = SYS_STATE_INIT; // Resume state (When switch to terminal) int ScreenHeight = 0; // Screen height (absolute screen) int ScreenWidth = 0; // Screen width (absolute screen) BOOL ShiftState = FALSE; // Keyboard shift state DWORD SpriteOffset[32][32]; // Grid to screen offset table int WindowX = 0; // Window position int WindowY = 0; // Window position // Run time selected functions void (*AnimateBackground)(void); BOOL (*ClearScreen)(void); void (*InitBackground)(void); BOOL (*InitSprites)(void); void (*PaintBackground)(DWORD screen); void (*RenderBackground)(void); void (*RepaintBackground)(DWORD screen, int c, int r); void (*RepaintBackgroundA)(DWORD screen, int x, int y, int w, int h); /****************************************************************** NullFunc Null function, does absolutely nothing. */ void NullFunc(void) { } // NullFunc() char *GlobalObjTime = __TIME__ " " __DATE__; int GlobalObjLines = __LINE__;