Exemplo n.º 1
0
void HealthManager::Shutdown()
{
	SAFE_SHUTDOWN(this->m_HealthBar);
	SAFE_SHUTDOWN(this->m_LivesNumber);
	SAFE_SHUTDOWN(this->m_LivesCount);

	for (GameObject* healthIndicator : this->m_HealthIndicators)
	{
		SAFE_SHUTDOWN(healthIndicator);
	}
	this->m_HealthIndicators.clear();
}
Exemplo n.º 2
0
void Score::Shutdown()
{
	for (GameObject* number : this->m_Numbers)
	{
		SAFE_SHUTDOWN(number);
	}
	this->m_Numbers.clear();
}
Exemplo n.º 3
0
void Game::Shutdown()
{
 	SAFE_SHUTDOWN(this->m_Fighter);
 	SAFE_SHUTDOWN(this->m_FighterFlame);
 	SAFE_SHUTDOWN(this->m_Bullets);
 	SAFE_SHUTDOWN(this->m_Stars);
	SAFE_SHUTDOWN(this->m_Mines);
	SAFE_SHUTDOWN(this->m_HealthManager);
	SAFE_SHUTDOWN(this->m_Score);
	SAFE_SHUTDOWN(this->m_ExhaustManager);
}
Exemplo n.º 4
0
//
//  FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
//  PURPOSE:  Processes messages for the main window.
//
//  WM_COMMAND	- process the application menu
//  WM_PAINT	- Paint the main window
//  WM_DESTROY	- post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;
	PAINTSTRUCT ps;
	HDC hdc;

	switch (message)
	{
	case WM_COMMAND:
		wmId = LOWORD(wParam);
		wmEvent = HIWORD(wParam);
		// Parse the menu selections:
		switch (wmId)
		{
		case IDM_ABOUT:
			DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
			break;
		case IDM_EXIT:
			DestroyWindow(hWnd);
			break;
		default:
			return DefWindowProc(hWnd, message, wParam, lParam);
		}
		break;
	case WM_GETTITLEBARINFOEX:
		GetTitleBarInfo(hWnd, &title_info);
		break;
	case WM_SETTEXT:
		//SetWindowText(hWnd, fps_string.c_str());
		DefWindowProc(hWnd, WM_SETTEXT, wParam, lParam);
		break;
	case WM_CLOSE:
		Running = false;
		DestroyWindow(hWnd);
		break;
	case WM_NULL:
		break;
	case WM_PAINT:
		hdc = BeginPaint(hWnd, &ps);
		//// TODO: Add any drawing code here...
		EndPaint(hWnd, &ps);
		break;
	case WM_QUIT:
		Running = false;
		SAFE_SHUTDOWN(pCoreApp);
		SendMessage(hWnd, WM_CLOSE, NULL, NULL);
		break;
	case WM_DESTROY:
		Running = false;
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return 0;
}
Exemplo n.º 5
0
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
	_In_opt_ HINSTANCE hPrevInstance,
	_In_ LPTSTR    lpCmdLine,
	_In_ int       nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);

	// TODO: Place code here.

	//Seed Rand
	srand(UINT(time(nullptr)));
	MSG msg;
	msg.hwnd = hWnd;
	HACCEL hAccelTable;

	// Initialize global strings
	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
	LoadString(hInstance, IDC_SOURCE, szWindowClass, MAX_LOADSTRING);
	MyRegisterClass(hInstance);

	// Perform application initialization:
	if (!InitInstance(hInstance, nCmdShow))
	{
		return FALSE;
	}

	hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SOURCE));

	pCoreApp = new Core;
	if (!pCoreApp->Initialize(hWnd, hInst, WINDOW_WIDTH, WINDOW_HEIGHT, true))
	{
		pCoreApp->Shutdown();
		delete pCoreApp;
		pCoreApp = nullptr;

		//Initialize did not work properly
		msg.wParam = -1;
		Running = false;
	}

	// Main message loop:
	while (Running)
	{
		//if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
		if (PeekMessageW(&msg, hWnd, 0, 0, PM_REMOVE))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}

		if (pCoreApp)
		{
			pCoreApp->Update();
			FPS_FUNC(hInst);
		}
	}

	SAFE_SHUTDOWN(pCoreApp);

	return (int)msg.wParam;
}
Exemplo n.º 6
0
void PauseState::Shutdown()
{
    SAFE_SHUTDOWN(_savedState);
}
Exemplo n.º 7
0
void GameOverState::Shutdown()
{
	SAFE_SHUTDOWN(_savedState);
}
Exemplo n.º 8
0
void GameObject::Shutdown()
{
    SAFE_SHUTDOWN(this->m_Sprite);
    SAFE_SHUTDOWN(this->m_Collider);
    SAFE_DELETE(this->m_Timer);
}