void Init(HWND hWnd) { // Set our global window handle to our main window g_hWnd = hWnd; // Create our double buffering for each window g_Buffer.CreateDoubleBuffering(hWnd); g_ToolBuffer.CreateDoubleBuffering(g_hWndTool); // Set the map to default g_Map.SetDefault(); // Load the tiles into the global lists and then get the scroll bar max scroll position g_ScrollInfo.nMax = LoadTiles(); // By default set the current tile type to map tiles g_Map.SetCurrentType(TILE_TYPE); // Set our current map to .... our current map :) g_pCurrentMap = &g_Map; // Initialize the scroll bar information g_ScrollInfo.cbSize = sizeof(SCROLLINFO); g_ScrollInfo.nMin = 0; g_ScrollInfo.nPage = 1; g_ScrollInfo.fMask = SIF_PAGE | SIF_RANGE; SetScrollInfo(g_hWndTool, SB_VERT, &g_ScrollInfo, FALSE); //////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** //////////////////// // Here we initialize our open file information g_OpenInfo.lStructSize = sizeof(OPENFILENAME); // Set the size of the structure g_OpenInfo.nMaxFile = MAX_PATH; // Set the max characters for a file name g_OpenInfo.lpstrFile = g_szFileName; // Give a string to store the file name g_OpenInfo.lpstrFilter = "Map Files (*.map)\0*.map"; // Only accept .map files to load g_OpenInfo.hwndOwner = g_hWndTool; // Assign the window owner and give it desired flags g_OpenInfo.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR; //////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** //////////////////// // Here we set the current pen to red for drawing our exit rectangles g_Buffer.SetPen(PS_SOLID,2,RGB(255,0,0)); // Set the backbuffer to black first (This clears the backbuffer) g_Buffer.ClearScreen(BLACK_BRUSH); g_ToolBuffer.ClearScreen(BLACK_BRUSH); }
void Init(HWND hWnd) { // Set our global window handle to our main window g_hWnd = hWnd; // Create our double buffering for each window g_Buffer.CreateDoubleBuffering(hWnd); g_ToolBuffer.CreateDoubleBuffering(g_hWndTool); // Set the map to default g_Map.SetDefault(); // Load the tiles into the global lists and then get the scroll bar max scroll position g_ScrollInfo.nMax = LoadTiles(); // By default set the current tile type to map tiles g_Map.SetCurrentType(TILE_TYPE); // Set our current map to .... our current map :) g_pCurrentMap = &g_Map; // Initialize the scroll bar information g_ScrollInfo.cbSize = sizeof(SCROLLINFO); g_ScrollInfo.nMin = 0; g_ScrollInfo.nPage = 1; g_ScrollInfo.fMask = SIF_PAGE | SIF_RANGE; SetScrollInfo(g_hWndTool, SB_VERT, &g_ScrollInfo, FALSE); //////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** //////////////////// // Here we set the current pen to red for drawing our exit rectangles g_Buffer.SetPen(PS_SOLID,2,RGB(255,0,0)); //////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** //////////////////// // Set the backbuffer to black first (This clears the backbuffer) g_Buffer.ClearScreen(BLACK_BRUSH); g_ToolBuffer.ClearScreen(BLACK_BRUSH); }