Exemplo n.º 1
0
	void Agent::SetID(int id)
	{
		m_AgentID = id;
		m_CrowdAgent = m_NavMesh->Crowd()->getAgent(m_AgentID);
		SyncPosition();
		SyncVelocity();
	}
Exemplo n.º 2
0
void CWFView::ApplyTool(CPoint point,BOOL JustPressed)
{
	static SDWORD LastSelected = -1;
	static SDWORD LastSelTexture = -1;
	static SDWORD LastSelType = -1;

	CBTEditDoc* pDoc = GetDocument();
	D3DVECTOR CameraPosition,CameraRotation;
	CPoint ScrollPos = GetScrollPosition();
	ScrollPos.x -= pDoc->GetTextureWidth()*OVERSCAN;
	ScrollPos.y -= pDoc->GetTextureHeight()*OVERSCAN;

	int Selected;

	CHeightMap *HeightMap = pDoc->GetHeightMap();

	if(pDoc->InLocator(m_MouseX,m_MouseY)) {
		pDoc->GetCamera(CameraRotation,CameraPosition);
		CameraPosition.x = (float)(( ((SLONG)(m_MouseX-OVERSCAN)/pDoc->GetRadarScale()) -((SLONG)pDoc->GetMapWidth()/2)) * (SLONG)pDoc->GetTileWidth());
		CameraPosition.z = -(float)(( ((SLONG)(m_MouseY-OVERSCAN)/pDoc->GetRadarScale()) -((SLONG)pDoc->GetMapHeight()/2)) * (SLONG)pDoc->GetTileHeight());
		if(pDoc->GetCameraMode() == MCAM_ISOMETRIC) {
//			CameraPosition.y = pDoc->GetHeightAt(CameraPosition)+CAM_HEIGHT;
			CameraPosition.y = (float)CAM_HEIGHT;
		}
		SyncPosition(CameraPosition);
		UpdateAndValidate();

		if(pDoc->GetAutoSync()) {
			pDoc->RegisterCamera(CameraRotation,CameraPosition);	// Bind views.
			pDoc->Invalidate3D();
		}

		return;
	}

	if(pDoc->InLocatorBorder(m_MouseX,m_MouseY)) {
		return;
	}

	Selected = pDoc->Select2DFace(point.x,point.y,ScrollPos.x,ScrollPos.y);

	DWORD EditTool = pDoc->GetEditTool();

	if((EditTool >= ET_TYPESFIRST) && (EditTool <= ET_TYPESLAST)) {
		if(Selected >= 0) {
			if( (Selected != LastSelected) ||
				((SDWORD)pDoc->m_SelType  != LastSelType) ) {

				LastSelected = Selected;
				LastSelTexture = -1;
				LastSelType = pDoc->m_SelType;

  				g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));

				HeightMap->SetTileType(Selected,pDoc->GetSelectedType());
				UpdateAndValidate();
			}
		}
	} else {
		switch(EditTool) {
			case ET_GET:
				if(Selected >= 0) {
					pDoc->m_SelTexture = HeightMap->GetTextureID(Selected);
					pDoc->GetTextureSelector()->SetSelectedTexture(pDoc->m_SelTexture);
					pDoc->UpdateTextureView();
				}
				break;

			case ET_PAINT:
   				if(Selected >= 0) {
					AutoScroll(point);
					if(pDoc->m_SelIsTexture) {
						if( (Selected != LastSelected) || (JustPressed) ||
							((SDWORD)pDoc->m_SelTexture != LastSelTexture) ||
							((SDWORD)pDoc->m_SelType  != LastSelType) ) {

							LastSelected = Selected;
							LastSelTexture = pDoc->m_SelTexture;
							LastSelType = pDoc->m_SelType;

							if(pDoc->m_SelType == TF_TYPEWATER) {
								if(pDoc->GetAutoHeight()) {
									g_UndoRedo->BeginGroup();
								}
								g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));
								HeightMap->SetTextureID(Selected,pDoc->m_SelTexture);
								HeightMap->SetTileType(Selected,pDoc->m_SelType);

								HeightMap->ApplyRandomness(Selected,pDoc->m_SelFlags);

//								DWORD Flags = HeightMap->GetTileFlags(Selected);
//								Flags &= TF_GEOMETRYMASK | TF_TYPEMASK;
//								Flags |= pDoc->m_SelFlags;
//								HeightMap->SetTileFlags(Selected,Flags);

								if(pDoc->GetAutoHeight()) {
									HeightMap->SetTileHeightUndo(Selected,(float)HeightMap->GetSeaLevel());
									g_UndoRedo->EndGroup();
									m_HeightsChanged = TRUE;
								}
								pDoc->Invalidate3D();
							} else {
								g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));
								HeightMap->SetTextureID(Selected,pDoc->m_SelTexture);
								HeightMap->SetTileType(Selected,pDoc->m_SelType);

								HeightMap->ApplyRandomness(Selected,pDoc->m_SelFlags);

//								DWORD Flags = HeightMap->GetTileFlags(Selected);
//								Flags &= TF_GEOMETRYMASK | TF_TYPEMASK;
//								Flags |= pDoc->m_SelFlags;
//								HeightMap->SetTileFlags(Selected,Flags);

								pDoc->RedrawFace(Selected);
							}
							UpdateAndValidate();
						}
					}
  				}
				break;

			case ET_EDGEPAINT:
				if(Selected >= 0) {
					AutoScroll(point);
					if(Selected != LastSelected) {
						LastSelected = Selected;

						int mw = pDoc->GetMapWidth();
						int y = Selected / mw;
						int x = Selected - (y*mw);
						if(pDoc->GetEdgeBrush()->Paint(x,y,pDoc->GetAutoHeight())) {
							m_HeightsChanged = TRUE;
						}

						UpdateAndValidate();
						pDoc->Invalidate3D();
					}
				}
				break;

			case ET_EDGEFILL:
   				if(Selected >= 0) {
					pDoc->GetEdgeBrush()->FillMap(Selected,pDoc->m_SelTexture,pDoc->m_SelType,pDoc->m_SelFlags);
					m_HeightsChanged = TRUE;
					UpdateAndValidate();
					pDoc->Invalidate3D();
				}
				break;

			case ET_BRUSHPAINT:
				break;

			case ET_HIDETILE:
				if(Selected >= 0) {
					if(Selected != LastSelected) {
						LastSelected = Selected;

						g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));
						AutoScroll(point);
   						pDoc->GetHeightMap()->SetTileVisible(Selected,TF_HIDE);
						UpdateAndValidate();
						pDoc->Invalidate3D();
					}
  				}
				break;

			case ET_SHOWTILE:
   				if(Selected >= 0) {
					if(Selected != LastSelected) {
						LastSelected = Selected;

						g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));
						AutoScroll(point);
   						pDoc->GetHeightMap()->SetTileVisible(Selected,TF_SHOW);
						UpdateAndValidate();
						pDoc->Invalidate3D();
					}
  				}
				break;

			case ET_FILL:
   				if(Selected >= 0) {
					g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));
					if(pDoc->m_SelIsTexture) {
   						pDoc->FillMap(Selected,pDoc->m_SelTexture,pDoc->m_SelType,pDoc->m_SelFlags);
						UpdateAndValidate();
						pDoc->Invalidate3D();
					}
   				}
				break;

			case ET_COPYRECT:
				switch(CopyRectCorners) {
					case	0:
					case	2:
		   				CopyRect0 = pDoc->Select2DFace(point.x,point.y,ScrollPos.x,ScrollPos.y);
						CopyRectCorners=1;
						break;
					case	1:
						AutoScroll(point);
		   				CopyRect1 = pDoc->Select2DFace(point.x,point.y,ScrollPos.x,ScrollPos.y);
						pDoc->Update2DView(-1,CopyRect0,CopyRect1);
						ValidateRect(NULL);
						break;
				}
				break;

			case ET_MARKRECT:
				switch(MarkRectCorners) {
					case	0:
					case	2:
		   				MarkRect0 = pDoc->Select2DFace(point.x,point.y,ScrollPos.x,ScrollPos.y);
						HeightMap->SetSelectionBox0(MarkRect0);
						MarkRectCorners=1;
						break;
					case	1:
						AutoScroll(point);
		   				MarkRect1 = pDoc->Select2DFace(point.x,point.y,ScrollPos.x,ScrollPos.y);
						HeightMap->SetSelectionBox1(MarkRect1);
						UpdateAndValidate();
//						pDoc->Update2DView(-1,MarkRect0,MarkRect1);
//						ValidateRect(NULL);
						break;
				}
				break;

//			case ET_PASTERECT:
//				if(Selected != LastSelected) {
//					LastSelected = Selected;
//
//					AutoScroll(point);
//					pDoc->PasteTileRect(Selected);
//					m_HeightsChanged = TRUE;
//					UpdateAndValidate();
//  					pDoc->Invalidate3D();
//				}
//				break;
		}
	}
}
Exemplo n.º 3
0
BOOL CWFView::ApplyToolOnce(CPoint point)
{
	CBTEditDoc* pDoc = GetDocument();
	CHeightMap *HeightMap = pDoc->GetHeightMap();
	D3DVECTOR CameraPosition,CameraRotation;
	CPoint ScrollPos = GetScrollPosition();
	ScrollPos.x -= pDoc->GetTextureWidth()*OVERSCAN;
	ScrollPos.y -= pDoc->GetTextureHeight()*OVERSCAN;
	
	int Selected;


	if(pDoc->InLocator(m_MouseX,m_MouseY)) {
		pDoc->GetCamera(CameraRotation,CameraPosition);
		CameraPosition.x = (float)(( ((SLONG)(m_MouseX-OVERSCAN)/pDoc->GetRadarScale()) -((SLONG)pDoc->GetMapWidth()/2)) * (SLONG)pDoc->GetTileWidth());
		CameraPosition.z = -(float)(( ((SLONG)(m_MouseY-OVERSCAN)/pDoc->GetRadarScale()) -((SLONG)pDoc->GetMapHeight()/2)) * (SLONG)pDoc->GetTileHeight());
		if(pDoc->GetCameraMode() == MCAM_ISOMETRIC) {
//			CameraPosition.y = pDoc->GetHeightAt(CameraPosition)+CAM_HEIGHT;
			CameraPosition.y = (float)CAM_HEIGHT;
		}

		SyncPosition(CameraPosition);
		UpdateAndValidate();

		if(pDoc->GetAutoSync()) {
			pDoc->RegisterCamera(CameraRotation,CameraPosition);	// Bind views.
			pDoc->Invalidate3D();
		}

		return FALSE;
	}

	if(pDoc->InLocatorBorder(m_MouseX,m_MouseY)) {
		return FALSE;
	}

	BOOL DoneSomething = FALSE;

	switch(pDoc->GetEditTool()) {
		case ET_ROTATETILE:
   			Selected = pDoc->Select2DFace(point.x,point.y,ScrollPos.x,ScrollPos.y);
   			if(Selected >= 0) {

				g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));
				
				DWORD Rotate = pDoc->GetHeightMap()->GetTextureRotate(Selected);
				Rotate++;
				Rotate &= 3;
				pDoc->GetHeightMap()->SetTextureRotate(Selected,Rotate);
				UpdateAndValidate();
				DoneSomething = TRUE;
  			}
			break;

		case ET_XFLIPTILE:
   			Selected = pDoc->Select2DFace(point.x,point.y,ScrollPos.x,ScrollPos.y);
   			if(Selected >= 0) {

				g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));
				
				BOOL FlipX = pDoc->GetHeightMap()->GetTextureFlipX(Selected);
				BOOL FlipY = pDoc->GetHeightMap()->GetTextureFlipY(Selected);
				DWORD Rotate = pDoc->GetHeightMap()->GetTextureRotate(Selected);
				if(Rotate & 1) {
					pDoc->GetHeightMap()->SetTextureFlip(Selected,FlipX,!FlipY);
				} else {
					pDoc->GetHeightMap()->SetTextureFlip(Selected,!FlipX,FlipY);
				}
				UpdateAndValidate();
				DoneSomething = TRUE;
  			}
			break;

		case ET_YFLIPTILE:
   			Selected = pDoc->Select2DFace(point.x,point.y,ScrollPos.x,ScrollPos.y);
   			if(Selected >= 0) {

				g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));
				
				BOOL FlipX = pDoc->GetHeightMap()->GetTextureFlipX(Selected);
				BOOL FlipY = pDoc->GetHeightMap()->GetTextureFlipY(Selected);
				DWORD Rotate = pDoc->GetHeightMap()->GetTextureRotate(Selected);
				if(Rotate & 1) {
					pDoc->GetHeightMap()->SetTextureFlip(Selected,!FlipX,FlipY);
				} else {
					pDoc->GetHeightMap()->SetTextureFlip(Selected,FlipX,!FlipY);
				}
				UpdateAndValidate();
				DoneSomething = TRUE;
  			}
			break;

		case ET_GATEWAY:
   			Selected = pDoc->Select2DFace(point.x,point.y,ScrollPos.x,ScrollPos.y);
 			if(Selected >= 0) {
//				DebugPrint("%d,(%d %d)\n",Selected,Selected%pDoc->GetMapWidth(),Selected/pDoc->GetMapHeight());
				if(GateMode == GATE_POSEND) {
					GateX1 = Selected%pDoc->GetMapWidth();
					GateY1 = Selected/pDoc->GetMapWidth();

					if(pDoc->GetHeightMap()->CheckGatewayOverlap(GateIndex,GateX0,GateY0,GateX1,GateY1) == FALSE) {
						pDoc->GetHeightMap()->DeleteGateway(GateIndex);
						MessageBox( "Can't overlap gateways", "Error.", MB_OK );
					} else if((GateX0 == GateX1) && (GateY0 == GateY1)) {
						pDoc->GetHeightMap()->DeleteGateway(GateIndex);
						MessageBox( "Can't have gateways of length 1", "Error.", MB_OK );
					} else if(pDoc->GetHeightMap()->CheckGatewayBlockingTiles(GateIndex) == FALSE) {
						pDoc->GetHeightMap()->DeleteGateway(GateIndex);
						MessageBox( "Can't put it there", "Error.", MB_OK );
					} else {
						pDoc->GetHeightMap()->SetGateway(GateIndex,GateX0,GateY0,GateX1,GateY1);
					}

					GateMode = GATE_POSSTART;
					DoneSomething = TRUE;
					DebugPrint("End %d,(%d %d)\n",Selected,GateX1,GateY1);
					UpdateAndValidate();
				} else if(GateMode == GATE_POSSTART) {
					GateX0 = Selected%pDoc->GetMapWidth();
					GateY0 = Selected/pDoc->GetMapWidth();

					GateIndex = pDoc->GetHeightMap()->FindGateway(GateX0,GateY0);
					if(GateIndex >= 0) {
						pDoc->GetHeightMap()->DeleteGateway(GateIndex);
						UpdateAndValidate();
					} else {
						GateIndex = pDoc->GetHeightMap()->AddGateway(GateX0,GateY0,GateX0,GateY0);
						GateMode = GATE_POSEND;
						DoneSomething = TRUE;
						DebugPrint("Start %d,(%d %d)\n",Selected,GateX0,GateY0);
					}
				}
			}
			break;

		case ET_PAINT:
			if(!pDoc->m_SelIsTexture) {
				SLONG	wx = (SLONG)point.x;
				SLONG	wz = (SLONG)point.y;
				CPoint ScrollPos = GetScrollPosition();
				// Convert 2d view cursor position into world coordinate.
				ScrollPos.x -= pDoc->GetTextureWidth()*OVERSCAN;
				ScrollPos.y -= pDoc->GetTextureHeight()*OVERSCAN;
				pDoc->ConvertCoord2d3d(wx,wz,(SLONG)ScrollPos.x,(SLONG)ScrollPos.y);

				D3DVECTOR Rotation = {0.0F, 0.0F, 0.0F};
				D3DVECTOR Position = {0.0F, 0.0F, 0.0F};
				Position.x = (float)wx;
				Position.z = (float)-wz;
				Position.y = HeightMap->GetHeight(Position.x,-Position.z);

				DWORD ObjToAdd = pDoc->m_SelObject;
//				if(HeightMap->GetObjectType(ObjToAdd) == IMD_STRUCTURE) {
//					ObjToAdd += pDoc->GetCurrentPlayer();
//				}

				int ObjID = HeightMap->AddObject(ObjToAdd,Rotation,Position,pDoc->GetCurrentPlayer());
				HeightMap->SnapObject(ObjID);
				HeightMap->SetObjectTileFlags(ObjID,TF_HIDE);
				HeightMap->SetObjectTileHeights(ObjID);
				HeightMap->InitialiseSectors();

				pDoc->Invalidate3D();
				UpdateAndValidate();
				DoneSomething = TRUE;
			}
			break;

		case ET_PASTERECT:
			if( pDoc->ClipboardIsValid() ) {
				pDoc->PasteTileRect(HeightMap->GetSelectionBox0());
				pDoc->BuildRadarMap();
				pDoc->GetHeightMap()->InitialiseSectors();
				UpdateAndValidate();
				pDoc->Invalidate3D();
			}
			break;

		case ET_POINT:
			{
				HeightMap->DeSelectAll3DObjects();
				CPoint SPos = GetScrollPosition();
				int ObjID = HeightMap->FindObjectHit2D(SPos.x,SPos.y,point.x,point.y);
				if(ObjID >= 0) {
					HeightMap->Select3DObject(ObjID);
				}
				pDoc->Invalidate3D();
				UpdateAndValidate();
			}
			break;

		case ET_MOVE:
			{
				if(m_DragMode!=DM_DRAGOBJECT) {
					HeightMap->DeSelectAll3DObjects();
					CPoint SPos = GetScrollPosition();
					m_ObjectID = HeightMap->FindObjectHit2D(SPos.x,SPos.y,point.x,point.y);
					if(m_ObjectID >= 0) {
						HeightMap->Select3DObject(m_ObjectID);
						m_DragMode = DM_DRAGOBJECT;
						DebugPrint("StartDrag\n");
					}
					HeightMap->SetObjectTileFlags(TF_SHOW);
					pDoc->Invalidate3D();
					UpdateAndValidate();
				}
			}
			break;

		case ET_ROTATEOBJECT:
			{
				HeightMap->DeSelectAll3DObjects();
				CPoint SPos = GetScrollPosition();
				m_ObjectID = HeightMap->FindObjectHit2D(SPos.x,SPos.y,point.x,point.y);
				if(m_ObjectID >= 0) {
					if(HeightMap->GetObjectInstanceFlanged(m_ObjectID)) {

						HeightMap->Select3DObject(m_ObjectID);

						D3DVECTOR Rotation;
						HeightMap->Get3DObjectRotation(m_ObjectID,Rotation);
						Rotation.y += 90;
						if(Rotation.y >= 360.0F) {
							Rotation.y -= 360.0F;
						}
						HeightMap->Set3DObjectRotation(m_ObjectID,Rotation);
						pDoc->Invalidate3D();
						UpdateAndValidate();
					} else {
						if(m_DragMode!=DM_DRAGOBJECT) {
							HeightMap->Select3DObject(m_ObjectID);
							HeightMap->SetObjectTileFlags(TF_SHOW);
							m_DragMode = DM_DRAGOBJECT;
							pDoc->Invalidate3D();
							UpdateAndValidate();
							DebugPrint("StartDrag\n");
						}
					}
				}
			}
			break;
	}

	return DoneSomething;
}
Exemplo n.º 4
0
void CWFView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	m_KeyHandler->HandleKeyDown(nChar);

	CBTEditDoc* pDoc = GetDocument();

	if(pDoc->Get2DMode() == M2D_WORLD) {
		BOOL Changed = FALSE;	
// Adjust x position.
		if(m_KeyHandler->GetKeyState(VK_LEFT)) {
			m_ScrollX-=pDoc->GetTextureWidth();
			Changed = TRUE;
		} else {
			if(m_KeyHandler->GetKeyState(VK_RIGHT)) {
				m_ScrollX+=pDoc->GetTextureWidth();
				Changed = TRUE;
			}
		}

// Adjust y position
		if(m_KeyHandler->GetKeyState(VK_UP)) {
			m_ScrollY-=pDoc->GetTextureHeight();
			Changed = TRUE;
		} else {
			if(m_KeyHandler->GetKeyState(VK_DOWN)) {
				m_ScrollY+=pDoc->GetTextureHeight();
				Changed = TRUE;
			}
		}

// If things have changed then update views.
		if(Changed) {
			UpdateScrollPosition();
		}

		D3DVECTOR	CameraPos,CameraRot;
		CBTEditDoc* pDoc = GetDocument();
		CHeightMap* HeightMap = pDoc->GetHeightMap();
		int Selected;
		CPoint ScrollPos = GetScrollPosition();
		ScrollPos.x -= pDoc->GetTextureWidth()*OVERSCAN;
		ScrollPos.y -= pDoc->GetTextureHeight()*OVERSCAN;


		switch(nChar) {
			case	'S':		// Sync view positions.
				pDoc->GetCamera(CameraRot,CameraPos);
				SyncPosition(CameraPos);
				break;

			case	VK_DELETE:
				HeightMap->SetObjectTileFlags(TF_SHOW);
				HeightMap->DeleteSelected3DObjects();
				HeightMap->SetObjectTileFlags(TF_HIDE);
  				UpdateAndValidate();
  				pDoc->Invalidate3D();
				break;

			case	KEY_ROTATETILE:
   				Selected = pDoc->Select2DFace(m_MouseX,m_MouseY,ScrollPos.x,ScrollPos.y);
   				if(Selected >= 0) {

					g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));
					
					DWORD Rotate = pDoc->GetHeightMap()->GetTextureRotate(Selected);
					Rotate++;
					Rotate &= 3;
					pDoc->GetHeightMap()->SetTextureRotate(Selected,Rotate);
					UpdateAndValidate();
  				}
				break;

			case	KEY_ROTATETILE2:
   				Selected = pDoc->Select2DFace(m_MouseX,m_MouseY,ScrollPos.x,ScrollPos.y);
   				if(Selected >= 0) {

					g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));
					
					DWORD Rotate = pDoc->GetHeightMap()->GetTextureRotate(Selected);
					Rotate--;
					Rotate &= 3;
					pDoc->GetHeightMap()->SetTextureRotate(Selected,Rotate);
					UpdateAndValidate();
  				}
				break;

			case	KEY_XFLIPTILE:
   				Selected = pDoc->Select2DFace(m_MouseX,m_MouseY,ScrollPos.x,ScrollPos.y);
   				if(Selected >= 0) {

					g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));
					
					BOOL FlipX = pDoc->GetHeightMap()->GetTextureFlipX(Selected);
					BOOL FlipY = pDoc->GetHeightMap()->GetTextureFlipY(Selected);
					DWORD Rotate = pDoc->GetHeightMap()->GetTextureRotate(Selected);
					if(Rotate & 1) {
						pDoc->GetHeightMap()->SetTextureFlip(Selected,FlipX,!FlipY);
					} else {
						pDoc->GetHeightMap()->SetTextureFlip(Selected,!FlipX,FlipY);
					}
					UpdateAndValidate();
  				}
				break;

			case	KEY_YFLIPTILE:
   				Selected = pDoc->Select2DFace(m_MouseX,m_MouseY,ScrollPos.x,ScrollPos.y);
   				if(Selected >= 0) {

					g_UndoRedo->AddUndo(&(HeightMap->GetMapTiles()[Selected]));
					
					BOOL FlipX = pDoc->GetHeightMap()->GetTextureFlipX(Selected);
					BOOL FlipY = pDoc->GetHeightMap()->GetTextureFlipY(Selected);
					DWORD Rotate = pDoc->GetHeightMap()->GetTextureRotate(Selected);
					if(Rotate & 1) {
						pDoc->GetHeightMap()->SetTextureFlip(Selected,!FlipX,FlipY);
					} else {
						pDoc->GetHeightMap()->SetTextureFlip(Selected,FlipX,!FlipY);
					}
					UpdateAndValidate();
  				}
				break;
		}
	}


	CScrollView::OnKeyDown(nChar, nRepCnt, nFlags);
}