acmvwinl.cpp

来自「空战游戏flacon源码」· C++ 代码 · 共 177 行

CPP
177
字号
#include "F4error.h"
#include "sim\include\misctemp.h"

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
// ACMIView inlines.

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline ACMITape *ACMIView::Tape() 
{
	return _tape; 
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline RViewPoint *ACMIView::Viewpoint() 
{
	return _viewPoint; 
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMIView::IncrementCameraObject(int inc) 
{ 
	int numEnt = _tape->NumEntities();
	int i;

	if ( inc > 0 )
	{
		for ( i = _currentCam + 1; i < numEnt; i++ )
		{
			if ( _entityUIMappings[ i ].listboxId != -1 )
			{
				_currentCam = i;
				return;
			}
		}
		for ( i = 0; i < _currentCam; i++ )
		{
			if ( _entityUIMappings[ i ].listboxId != -1 )
			{
				_currentCam = i;
				return;
			}
		}
	}
	else
	{
		for ( i = _currentCam - 1; i >= 0; i-- )
		{
			if ( _entityUIMappings[ i ].listboxId != -1 )
			{
				_currentCam = i;
				return;
			}
		}
		for ( i = numEnt - 1; i > _currentCam; i-- )
		{
			if ( _entityUIMappings[ i ].listboxId != -1 )
			{
				_currentCam = i;
				return;
			}
		}
	}

}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMIView::SetCameraObject(int theObject) 
{
	F4Assert(theObject >= 0);
	F4Assert(theObject < _tape->NumEntities() );

	_currentCam = theObject; 
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline int ACMIView::CameraObject() 
{ 
	return _currentCam;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMIView::IncrementTrackingObject(int inc) 
{ 
	int numEnt = _tape->NumEntities();
	int i;

	if ( inc > 0 )
	{
		for ( i = _currentEntityCam + 1; i < numEnt; i++ )
		{
			if ( _entityUIMappings[ i ].listboxId != -1 )
			{
				_currentEntityCam = i;
				return;
			}
		}
		for ( i = 0; i < _currentEntityCam; i++ )
		{
			if ( _entityUIMappings[ i ].listboxId != -1 )
			{
				_currentEntityCam = i;
				return;
			}
		}
	}
	else
	{
		for ( i = _currentEntityCam - 1; i >= 0; i-- )
		{
			if ( _entityUIMappings[ i ].listboxId != -1 )
			{
				_currentEntityCam = i;
				return;
			}
		}
		for ( i = numEnt - 1; i > _currentEntityCam; i-- )
		{
			if ( _entityUIMappings[ i ].listboxId != -1 )
			{
				_currentEntityCam = i;
				return;
			}
		}
	}
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMIView::SetTrackingObject(int theObject) 
{
	F4Assert(theObject >= 0);
	F4Assert(theObject < _tape->NumEntities() );

	_currentEntityCam = theObject;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline int ACMIView::TrackingObject()
{
	return _currentEntityCam;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?