DUDES.CPP
资源名称:tc3d.zip [点击查看]
上传用户:abcdshs
上传日期:2007-01-07
资源大小:1858k
文件大小:21k
源码类别:
游戏
开发平台:
Visual C++
- // dudes.cpp : Defines the class behaviors for the application.
- //
- #include "stdafx.h"
- #include "3dwrap.h"
- #include "dudes.h"
- #include "personal.h"
- #include "MainFrm.h"
- #include "dudeDoc.h"
- #include "dudeView.h"
- #include "editfile.h"
- #include "detail.h"
- #include "gateway.h"
- #include "dudehold.h"
- #include "weaphold.h"
- #include "levels.h"
- #include "teleport.h"
- /////////////////////////////////////////////////////////////////////////////
- // DudesApp
- #ifdef EDITOR
- BEGIN_MESSAGE_MAP(DudesApp, CWinApp)
- //{{AFX_MSG_MAP(DudesApp)
- ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
- ON_COMMAND(ID_PAUSE, OnPause)
- ON_COMMAND(ID_OPEN_FILE, OnOpenFile)
- ON_COMMAND(ID_SAVE, OnSave)
- ON_COMMAND(ID_SAVEAS, OnSaveas)
- ON_COMMAND(ID_EDIT, OnEdit)
- ON_COMMAND(ID_HELP, OnHelp)
- ON_COMMAND(ID_VIEW_AERIAL, OnViewAerial)
- ON_COMMAND(ID_VIEW_CIRCLING, OnViewCircling)
- ON_COMMAND(ID_VIEW_DUDEVIEW, OnViewDudeview)
- ON_COMMAND(ID_VIEW_LEFTSIDE, OnViewLeftside)
- ON_COMMAND(ID_VIEW_RIGHTSIDE, OnViewRightside)
- ON_COMMAND(ID_VIEW_HIGHANGLE, OnViewHighangle)
- ON_COMMAND(ID_DETAIL_CHANGEDETAIL, OnDetailChangedetail)
- ON_COMMAND(ID_EDIT_ADDSHAPE, OnEditAddshape)
- ON_COMMAND(ID_EDIT_SELECTCLOSESTSHAPE, OnEditSelectclosestshape)
- ON_COMMAND(ID_EDIT_MOVESELECTIONBACKWARD, OnEditMoveselectionbackward)
- ON_COMMAND(ID_EDIT_MOVESELECTIONDOWN, OnEditMoveselectiondown)
- ON_COMMAND(ID_EDIT_MOVESELECTIONFOWARD, OnEditMoveselectionfoward)
- ON_COMMAND(ID_EDIT_MOVESELECTIONLEFT, OnEditMoveselectionleft)
- ON_COMMAND(ID_EDIT_MOVESELECTIONRIGHT, OnEditMoveselectionright)
- ON_COMMAND(ID_EDIT_MOVESELECTIONUP, OnEditMoveselectionup)
- ON_COMMAND(ID_EDIT_ROTATESELECTION45DEGREESLEFT, OnEditRotateselection45degreesleft)
- ON_COMMAND(ID_EDIT_ROTATESELECTION45DEGREESRIGHT, OnEditRotateselection45degreesright)
- ON_COMMAND(ID_EDIT_ROTATESELECTION90DEGREESLEFT, OnEditRotateselection90degreesleft)
- ON_COMMAND(ID_EDIT_ROTATESELECTION90DEGREESRIGHT, OnEditRotateselection90degreesright)
- ON_COMMAND(ID_EDIT_DELETESELECTION, OnEditDeleteselection)
- ON_COMMAND(ID_FILE_OPENLANDSCAPE, OnFileOpenlandscape)
- ON_COMMAND(ID_FILE_SAVELANDSCAPE, OnFileSavelandscape)
- ON_COMMAND(ID_FILE_SAVELANDSCAPEAS, OnFileSavelandscapeas)
- ON_COMMAND(ID_EDIT_CHANGECOLORFORSELECTION, OnEditChangecolorforselection)
- ON_COMMAND(ID_EDIT_UNSELECTTHESELECTION, OnEditUnselecttheselection)
- ON_COMMAND(ID_EDIT_ADDNEWMAP, OnEditAddnewmap)
- ON_COMMAND(ID_VIEW_HIGHDUDEVIEW, OnViewHighdudeview)
- ON_COMMAND(ID_VIEW_LOWDUDEVIEW, OnViewLowdudeview)
- ON_COMMAND(ID_EDIT_ADDDUDE, OnEditAdddude)
- ON_COMMAND(ID_EDIT_ADDNEXTLEVELTELEPORTER, OnEditAddnextlevelteleporter)
- ON_COMMAND(ID_EDIT_ADDHANDHELDWEAPON_KNIFE, OnEditAddhandheldweaponKnife)
- ON_COMMAND(ID_EDIT_ADDHANDHELDWEAPON_SHIELD, OnEditAddhandheldweaponShield)
- ON_COMMAND(ID_EDIT_ADDHANDHELDWEAPON_SWORD, OnEditAddhandheldweaponSword)
- ON_COMMAND(ID_VIEW_BACKSIDE, OnViewBackside)
- ON_COMMAND(ID_VIEW_FRONTSIDE, OnViewFrontside)
- //}}AFX_MSG_MAP
- // Standard file based document commands
- ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
- ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
- END_MESSAGE_MAP()
- #else
- BEGIN_MESSAGE_MAP(DudesApp, CWinApp) //
- //{{AFX_MSG_MAP(DudesApp) //
- ON_COMMAND(ID_APP_ABOUT, OnAppAbout) //
- ON_COMMAND(ID_PAUSE, OnPause) //
- ON_COMMAND(ID_OPEN_FILE, OnOpenFile) //
- ON_COMMAND(ID_SAVE, OnSave) //
- ON_COMMAND(ID_SAVEAS, OnSaveas) //
- ON_COMMAND(ID_EDIT, OnEdit) //
- ON_COMMAND(ID_HELP, OnHelp) //
- ON_COMMAND(ID_VIEW_AERIAL, OnViewAerial) //
- ON_COMMAND(ID_VIEW_CIRCLING, OnViewCircling) //
- ON_COMMAND(ID_VIEW_DUDEVIEW, OnViewDudeview) //
- ON_COMMAND(ID_VIEW_LEFTSIDE, OnViewLeftside) //
- ON_COMMAND(ID_VIEW_RIGHTSIDE, OnViewRightside) //
- ON_COMMAND(ID_VIEW_HIGHANGLE, OnViewHighangle) //
- ON_COMMAND(ID_DETAIL_CHANGEDETAIL, OnDetailChangedetail) //
- ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) //
- ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen) //
- ON_COMMAND(ID_VIEW_BACKSIDE, OnViewBackside) //
- ON_COMMAND(ID_VIEW_FRONTSIDE, OnViewFrontside) //
- //}}AFX_MSG_MAP //
- // Standard file based document commands //
- ON_COMMAND(ID_VIEW_HIGHDUDEVIEW, OnViewHighdudeview) //
- ON_COMMAND(ID_VIEW_LOWDUDEVIEW, OnViewLowdudeview) //
- END_MESSAGE_MAP() //
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // DudesApp construction
- DudesApp::DudesApp()
- {
- srand((unsigned)time(NULL));
- }
- /////////////////////////////////////////////////////////////////////////////
- // The one and only DudesApp object
- DudesApp theApp;
- /////////////////////////////////////////////////////////////////////////////
- // DudesApp initialization
- BOOL DudesApp::InitInstance()
- {
- // Standard initialization
- // If you are not using these features and wish to reduce the size
- // of your final executable, you should remove from the following
- // the specific initialization routines you do not need.
- #ifdef _AFXDLL
- Enable3dControls(); // Call this when using MFC in a shared DLL
- #else
- Enable3dControlsStatic(); // Call this when linking to MFC statically
- #endif
- LoadStdProfileSettings(0); // Load standard INI file options (including MRU)
- // Register the application's document templates. Document templates
- // serve as the connection between documents, frame windows and views.
- CSingleDocTemplate* pDocTemplate;
- pDocTemplate = new CSingleDocTemplate(
- IDR_MAINFRAME,
- RUNTIME_CLASS(DudeDoc),
- RUNTIME_CLASS(MainFrm), // main SDI frame window
- RUNTIME_CLASS(DudeView));
- AddDocTemplate(pDocTemplate);
- // Parse command line for standard shell commands, DDE, file open
- CCommandLineInfo cmdInfo;
- ParseCommandLine(cmdInfo);
- // Dispatch commands specified on the command line
- if (!ProcessShellCommand(cmdInfo))
- return FALSE;
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CPauseDlg dialog used for App About
- class CPauseDlg : public CDialog
- {
- public:
- CPauseDlg();
- // Dialog Data
- //{{AFX_DATA(CPauseDlg)
- enum { IDD = IDD_PAUSE };
- //}}AFX_DATA
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CPauseDlg)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
- // Implementation
- protected:
- //{{AFX_MSG(CPauseDlg)
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- CPauseDlg::CPauseDlg() : CDialog(CPauseDlg::IDD)
- {
- //{{AFX_DATA_INIT(CPauseDlg)
- //}}AFX_DATA_INIT
- }
- void CPauseDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CPauseDlg)
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CPauseDlg, CDialog)
- //{{AFX_MSG_MAP(CPauseDlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- // App command to run the dialog
- void DudesApp::OnAppAbout()
- {
- CDialog aboutDlg(IDD_ABOUTBOX);
- aboutDlg.DoModal();
- }
- /////////////////////////////////////////////////////////////////////////////
- // DudesApp commands
- void DudesApp::OnPause()
- {
- CPauseDlg pauseDlg;
- Game->PauseOn();
- pauseDlg.DoModal();
- Game->PauseOff();
- }
- void DudesApp::OnOpenFile()
- {
- CFileDialog dialog(TRUE, "DUD", "dudes\*.dud",
- OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
- NULL, NULL);
- Game->PauseOn();
- dialog.m_ofn.Flags |= OFN_NOCHANGEDIR;
- if (dialog.DoModal() == IDOK)
- {
- Game->Hero()->load(dialog.GetPathName());
- Game->NewGame();
- }
- Game->PauseOff();
- }
- void DudesApp::OnSave()
- {
- Game->Hero()->save();
- }
- void DudesApp::OnSaveas()
- {
- CFileDialog dialog(FALSE, "DUD", Game->Hero()->filepath(),
- OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
- NULL, NULL);
- Game->PauseOn();
- dialog.m_ofn.Flags |= OFN_NOCHANGEDIR;
- if (dialog.DoModal() == IDOK)
- Game->Hero()->saveas(dialog.GetPathName());
- Game->PauseOff();
- }
- void DudesApp::OnEdit()
- {
- CEditFile dialog;
- Game->PauseOn();
- if (dialog.DoModal() == IDOK)
- {
- Game->SetHero(dialog.getvalues());
- Game->NewGame();
- }
- Game->PauseOff();
- }
- void DudesApp::OnHelp()
- {
- ::WinHelp(NULL, "3ddudes.hlp", HELP_FORCEFILE, 0);
- }
- void DudesApp::OnViewAerial()
- {
- Game->SetViewmode(AERIAL);
- }
- void DudesApp::OnViewCircling()
- {
- Game->SetViewmode(CIRCLING);
- }
- void DudesApp::OnViewDudeview()
- {
- Game->SetViewmode(DUDEVIEW);
- }
- void DudesApp::OnViewHighdudeview()
- {
- Game->SetViewmode(DUDEVIEWHIGH);
- }
- void DudesApp::OnViewLowdudeview()
- {
- Game->SetViewmode(DUDEVIEWLOW);
- }
- void DudesApp::OnViewLeftside()
- {
- Game->SetViewmode(LEFTSIDE);
- }
- void DudesApp::OnViewRightside()
- {
- Game->SetViewmode(RIGHTSIDE);
- }
- void DudesApp::OnViewHighangle()
- {
- Game->SetViewmode(HIGHANGLE);
- }
- void DudesApp::OnDetailChangedetail()
- {
- ChangeDetail dialog;
- Game->PauseOn();
- if (dialog.DoModal() == IDOK)
- Game->NewGame();
- Game->PauseOff();
- }
- void DudesApp::OnViewBackside()
- {
- Game->SetViewmode(BACKSIDE);
- }
- void DudesApp::OnViewFrontside()
- {
- Game->SetViewmode(FRONTSIDE);
- }
- #ifdef EDITOR
- void DudesApp::OnEditAddshape()
- {
- CFileDialog dialog(TRUE, "IMG", (CString)"landscpe\*.img",
- OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
- NULL, NULL);
- Game->PauseOn();
- dialog.m_ofn.Flags |= OFN_NOCHANGEDIR;
- if (dialog.DoModal() == IDOK)
- {
- if (Game->LevelPtr()->selection)
- {
- Game->LevelPtr()->selection->setcolor(Game->LevelPtr()->selectioncolor);
- Game->Landscapes()->AddLSEntry(Game->LevelPtr()->selection);
- Game->LevelPtr()->selection = 0;
- }
- Game->NewLandscape((CString) dialog.GetPathName());
- coordinate ctmp = Game->Aim();
- ctmp.sety(0.0f);
- Game->LastLandscape()->setto(ctmp);
- }
- Game->PauseOff();
- }
- void DudesApp::OnEditSelectclosestshape()
- {
- qentry *tmp;
- view tmploc;
- float tmpval;
- float tmpdist = 100.0f;
- qentry *newsel = 0;
- tmp = (qentry *) Game->DrawQueue()->first(LANDSCAPE |
- DUDEHOLDER |
- WEAPONHOLDER |
- TELEPORTER);
- if (Game->LevelPtr()->selection)
- {
- Game->LevelPtr()->selection->setcolor(Game->LevelPtr()->selectioncolor);
- Game->Landscapes()->AddLSEntry(Game->LevelPtr()->selection);
- Game->LevelPtr()->selection = 0;
- }
- while (tmp)
- {
- tmploc = ((landscape *)tmp)->location();
- tmpval = tmploc.distanceto(Game->Aim());
- if (tmpval < tmpdist)
- {
- tmpdist = tmpval;
- newsel = tmp;
- }
- tmp = (qentry *) Game->DrawQueue()->next(LANDSCAPE |
- DUDEHOLDER |
- WEAPONHOLDER |
- TELEPORTER);
- }
- if (newsel)
- {
- Game->LevelPtr()->selectioncolor = ((landscape *)newsel)->getcolor();
- Game->LevelPtr()->selection = (landscape *) newsel;
- Game->LevelPtr()->selection->RemoveLSEntry();
- }
- }
- void DudesApp::OnEditMoveselectionbackward()
- {
- if (!Game->LevelPtr()->selection)
- return;
- view tmp = Game->LevelPtr()->selection->location();
- tmp.setx(tmp.x()+tcsin(tmp.ydirection(),-Game->LevelPtr()->selectionstep));
- tmp.setz(tmp.z()+tccos(tmp.ydirection(),-Game->LevelPtr()->selectionstep));
- Game->LevelPtr()->selection->setto(tmp);
- }
- void DudesApp::OnEditMoveselectiondown()
- {
- if (!Game->LevelPtr()->selection)
- return;
- view tmp = Game->LevelPtr()->selection->location();
- tmp.sety(tmp.y()-Game->LevelPtr()->selectionstep);
- Game->LevelPtr()->selection->setto(tmp);
- }
- void DudesApp::OnEditMoveselectionfoward()
- {
- if (!Game->LevelPtr()->selection)
- return;
- view tmp = Game->LevelPtr()->selection->location();
- tmp.setx(tmp.x()+tcsin(tmp.ydirection(),Game->LevelPtr()->selectionstep));
- tmp.setz(tmp.z()+tccos(tmp.ydirection(),Game->LevelPtr()->selectionstep));
- Game->LevelPtr()->selection->setto(tmp);
- }
- void DudesApp::OnEditMoveselectionleft()
- {
- if (!Game->LevelPtr()->selection)
- return;
- view tmp = Game->LevelPtr()->selection->location();
- tmp.setx(tmp.x()+tcsin(tmp.ydirection()+(direction)TC_PI_2,Game->LevelPtr()->selectionstep));
- tmp.setz(tmp.z()+tccos(tmp.ydirection()+(direction)TC_PI_2,Game->LevelPtr()->selectionstep));
- Game->LevelPtr()->selection->setto(tmp);
- }
- void DudesApp::OnEditMoveselectionright()
- {
- if (!Game->LevelPtr()->selection)
- return;
- view tmp = Game->LevelPtr()->selection->location();
- tmp.setx(tmp.x()+tcsin(tmp.ydirection()-(direction)TC_PI_2,Game->LevelPtr()->selectionstep));
- tmp.setz(tmp.z()+tccos(tmp.ydirection()-(direction)TC_PI_2,Game->LevelPtr()->selectionstep));
- Game->LevelPtr()->selection->setto(tmp);
- }
- void DudesApp::OnEditChangecolorforselection()
- {
- if (!Game->LevelPtr()->selection)
- return;
- CColorDialog dialog(Game->LevelPtr()->selection->getcolor(), NULL, NULL);
- if (dialog.DoModal() == IDOK)
- {
- view tmploc = Game->LevelPtr()->selection->location();
- LSEntryType *tmpls = Game->Landscapes()->GetLSEntry(tmploc);
- Game->LevelPtr()->selectioncolor = dialog.GetColor();
- if (tmpls)
- tmpls->Color = dialog.GetColor();
- }
- }
- void DudesApp::OnEditMoveselectionup()
- {
- if (!Game->LevelPtr()->selection)
- return;
- view tmp = Game->LevelPtr()->selection->location();
- tmp.sety(tmp.y()+Game->LevelPtr()->selectionstep);
- Game->LevelPtr()->selection->setto(tmp);
- }
- void DudesApp::OnEditRotateselection45degreesleft()
- {
- if (!Game->LevelPtr()->selection)
- return;
- view tmp = Game->LevelPtr()->selection->location();
- tmp.setydir(tmp.ydirection()+(direction)TC_PI_4);
- Game->LevelPtr()->selection->setto(tmp);
- }
- void DudesApp::OnEditRotateselection45degreesright()
- {
- if (!Game->LevelPtr()->selection)
- return;
- view tmp = Game->LevelPtr()->selection->location();
- tmp.setydir(tmp.ydirection()-(direction)TC_PI_4);
- Game->LevelPtr()->selection->setto(tmp);
- }
- void DudesApp::OnEditRotateselection90degreesleft()
- {
- if (!Game->LevelPtr()->selection)
- return;
- view tmp = Game->LevelPtr()->selection->location();
- tmp.setydir(tmp.ydirection()+(direction)TC_PI_2);
- Game->LevelPtr()->selection->setto(tmp);
- }
- void DudesApp::OnEditRotateselection90degreesright()
- {
- if (!Game->LevelPtr()->selection)
- return;
- view tmp = Game->LevelPtr()->selection->location();
- tmp.setydir(tmp.ydirection()-(direction)TC_PI_2);
- Game->LevelPtr()->selection->setto(tmp);
- }
- void DudesApp::OnEditDeleteselection()
- {
- if (!Game->LevelPtr()->selection)
- return;
- Game->LevelPtr()->selection->DeleteEntryAlso();
- delete Game->LevelPtr()->selection;
- Game->LevelPtr()->selection = 0;
- }
- void DudesApp::OnFileOpenlandscape()
- {
- CFileDialog dialog(TRUE, "MAP", "*.map",
- OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
- NULL, NULL);
- Game->PauseOn();
- dialog.m_ofn.Flags |= OFN_NOCHANGEDIR;
- if (dialog.DoModal() == IDOK)
- {
- OnFileSavelandscape();
- Game->NewGame();
- Game->Landscapes()->load((CString)dialog.GetPathName());
- Game->LevelPtr()->selection = NULL;
- view ctmp = Game->Landscapes()->GeneralArea();
- Game->LevelPtr()->SetGuyTo(ctmp);
- }
- Game->PauseOff();
- }
- void DudesApp::OnFileSavelandscape()
- {
- OnEditUnselecttheselection();
- Game->Landscapes()->save();
- }
- void DudesApp::OnFileSavelandscapeas()
- {
- OnEditUnselecttheselection();
- CFileDialog dialog(FALSE, "MAP", getpath((CString)"landscpe.map"),
- OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
- NULL, NULL);
- Game->PauseOn();
- dialog.m_ofn.Flags |= OFN_NOCHANGEDIR;
- if (dialog.DoModal() == IDOK)
- {
- Game->LevelPtr()->landscapemap = (CString)dialog.GetPathName();
- OnFileSavelandscape();
- }
- Game->PauseOff();
- }
- void DudesApp::OnEditUnselecttheselection()
- {
- if (!Game->LevelPtr()->selection)
- return;
- Game->LevelPtr()->selection->setcolor(Game->LevelPtr()->selectioncolor);
- Game->Landscapes()->AddLSEntry(Game->LevelPtr()->selection);
- Game->LevelPtr()->selection = NULL;
- }
- void DudesApp::OnEditAddnewmap()
- {
- CFileDialog dialog(FALSE, "MAP", getpath((CString)"landscpe.map"),
- OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
- NULL, NULL);
- Game->PauseOn();
- dialog.m_ofn.Flags |= OFN_NOCHANGEDIR;
- if (dialog.DoModal() == IDOK)
- {
- if (Game->LevelPtr()->selection)
- {
- Game->LevelPtr()->selection->setcolor(Game->LevelPtr()->selectioncolor);
- Game->Landscapes()->AddLSEntry(Game->LevelPtr()->selection);
- Game->LevelPtr()->selection = 0;
- }
- Game->NewGateway((CString)dialog.GetPathName());
- coordinate ctmp = Game->Aim();
- ctmp.sety(0.0f);
- Game->LastLandscape()->setto(ctmp);
- }
- Game->PauseOff();
- }
- void DudesApp::OnEditAdddude()
- {
- CFileDialog dialog(TRUE, "DUD", (CString)"dudes\*.dud",
- OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
- NULL, NULL);
- Game->PauseOn();
- dialog.m_ofn.Flags |= OFN_NOCHANGEDIR;
- if (dialog.DoModal() == IDOK)
- {
- if (Game->LevelPtr()->selection)
- {
- Game->LevelPtr()->selection->setcolor(Game->LevelPtr()->selectioncolor);
- Game->Landscapes()->AddLSEntry(Game->LevelPtr()->selection);
- Game->LevelPtr()->selection = 0;
- }
- Game->NewDudeholder((CString)dialog.GetPathName());
- coordinate ctmp = Game->Aim();
- ctmp.sety(0.0f);
- Game->LastLandscape()->setto(ctmp);
- SpeedDiag dialog;
- if (dialog.DoModal() == IDOK)
- {
- short sptmp = (short)dialog.Position();
- sptmp = (short) (10.0f * ((float) sptmp / 100.0f));
- sptmp = (short) (10 - sptmp);
- personal ptmp;
- dudeholder *tmp = (dudeholder *) Game->LastLandscape();
- ptmp.load(tmp->dudename());
- if (ptmp.gender() == MALE)
- sptmp += 10;
- tmp->setspeed(sptmp);
- }
- }
- Game->PauseOff();
- }
- void DudesApp::OnEditAddnextlevelteleporter()
- {
- CTeleportDiag dialog;
- Game->PauseOn();
- if (dialog.DoModal() == IDOK)
- {
- if (Game->LevelPtr()->selection)
- {
- Game->LevelPtr()->selection->setcolor(Game->LevelPtr()->selectioncolor);
- Game->Landscapes()->AddLSEntry(Game->LevelPtr()->selection);
- Game->LevelPtr()->selection = 0;
- }
- Game->NewTeleporter((short)(dialog.m_LevelNum));
- coordinate ctmp = Game->Aim();
- ctmp.sety(0.0f);
- Game->LastLandscape()->setto(ctmp);
- }
- Game->PauseOff();
- }
- void DudesApp::OnEditAddhandheldweaponKnife()
- {
- if (Game->LevelPtr()->selection)
- {
- Game->LevelPtr()->selection->setcolor(Game->LevelPtr()->selectioncolor);
- Game->Landscapes()->AddLSEntry(Game->LevelPtr()->selection);
- Game->LevelPtr()->selection = 0;
- }
- Game->NewWeaponholder(KNIFE);
- coordinate ctmp = Game->Aim();
- ctmp.sety(0.0f);
- Game->LastLandscape()->setto(ctmp);
- }
- void DudesApp::OnEditAddhandheldweaponShield()
- {
- if (Game->LevelPtr()->selection)
- {
- Game->LevelPtr()->selection->setcolor(Game->LevelPtr()->selectioncolor);
- Game->Landscapes()->AddLSEntry(Game->LevelPtr()->selection);
- Game->LevelPtr()->selection = 0;
- }
- Game->NewWeaponholder(SHIELD);
- coordinate ctmp = Game->Aim();
- ctmp.sety(0.0f);
- Game->LastLandscape()->setto(ctmp);
- }
- void DudesApp::OnEditAddhandheldweaponSword()
- {
- if (Game->LevelPtr()->selection)
- {
- Game->LevelPtr()->selection->setcolor(Game->LevelPtr()->selectioncolor);
- Game->Landscapes()->AddLSEntry(Game->LevelPtr()->selection);
- Game->LevelPtr()->selection = 0;
- }
- Game->NewWeaponholder(SWORD);
- coordinate ctmp = Game->Aim();
- ctmp.sety(0.0f);
- Game->LastLandscape()->setto(ctmp);
- }
- #endif
- CWnd* DudesApp::GetMainWnd()
- {
- switch(keyboardcontrol)
- {
- case V1:
- OnViewCircling();
- break;
- case V2:
- OnViewDudeview();
- break;
- case V3:
- OnViewHighdudeview();
- break;
- case V4:
- OnViewLowdudeview();
- break;
- case V5:
- OnViewAerial();
- break;
- case V6:
- OnViewHighangle();
- break;
- case V7:
- OnViewRightside();
- break;
- case V8:
- OnViewLeftside();
- break;
- case V9:
- OnViewFrontside();
- break;
- case V0:
- OnViewBackside();
- break;
- }
- return CWinApp::GetMainWnd();
- }