TempSheet.cpp
上传用户:hkb425
上传日期:2007-06-16
资源大小:34191k
文件大小:2k
- // TempSheet.cpp: implementation of the CTempSheet class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "TempSheet.h"
- #include "gamesetting.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CTempSheet::CTempSheet()
- {
- }
- CTempSheet::~CTempSheet()
- {
- }
- bool CTempSheet::InitSheet()
- {
- RECT rect;
- rect.left=280;
- rect.right=520;
- for(int i=0;i<5;i++)
- {
- rect.top=150+67*i;
- rect.bottom=180+67*i;
- m_cButton[i].SetButtonRect(rect);
- }
- m_cButton[0].SetButtonText("Continue");
- m_cButton[1].SetButtonText("Save Game");
- m_cButton[2].SetButtonText("Load Game");
- m_cButton[3].SetButtonText("Game Setting");
- m_cButton[4].SetButtonText("End Mission");
- m_cButton[1].SetButtonState(BUTTON_DEAD);
- m_cButton[2].SetButtonState(BUTTON_DEAD);
- m_bActive=false;
- m_iSelect=-1;
- return true;
- }
- int CTempSheet::RenderSheet()
- {
- if(!m_bActive)return -1;
- if(CInput::m_keys[VK_ESCAPE])
- {
- CInput::m_keys[VK_ESCAPE]=false;
- CGameSetting::m_iGameState=GAME_MISSION;
- return -1;
- }
- for(int i=0;i<5;i++)
- {
- m_cButton[i].RenderButton();
- }
- for(i=0;i<5;i++)
- {
- if(m_cButton[i].m_bSelected)
- {
- m_cButton[i].m_bSelected=false;
- m_iSelect=i;
- return i;
- }
- }
- glColor3f(0.5f,0.5f,0.5f);
- CImgText::PrintString(10,10,"Base on 3dExplorer Engine (new) !");
- CImgText::PrintString(670,560,"Version 1.0");
- CImgText::PrintString(670,580,"2002.8");
- return -1;
- }