Petit ajout de choix de bloc avec la wheel de souris.
This commit is contained in:
		| @@ -193,8 +193,19 @@ void Engine::Render(float elapsedTime) { | |||||||
| 	m_player.ApplyTransformation(skybox, false); // Version d'ApplyTransformation qui ne tient compte que de la rotation  | 	m_player.ApplyTransformation(skybox, false); // Version d'ApplyTransformation qui ne tient compte que de la rotation  | ||||||
| 												// (donc l'objet ne bouge pas relativement au joueur, ce qui est pratique pour une skybox!). | 												// (donc l'objet ne bouge pas relativement au joueur, ce qui est pratique pour une skybox!). | ||||||
| 	 | 	 | ||||||
|  | 	static BlockType bloc = 1; | ||||||
|  |  | ||||||
|  | 	if (m_mouseWU) bloc++; | ||||||
|  | 	else if (m_mouseWD) bloc--; | ||||||
|  | 	if (bloc == BTYPE_LAST) | ||||||
|  | 		bloc = BTYPE_DIRT; | ||||||
|  | 	else if (bloc == BTYPE_AIR) | ||||||
|  | 		bloc = BTYPE_LAST - 1; | ||||||
|  |  | ||||||
|  | 	m_mouseWU = m_mouseWD = false; | ||||||
|  |  | ||||||
| 	if (m_mouseL) | 	if (m_mouseL) | ||||||
| 		m_world.ChangeBlockAtCursor(BTYPE_DIRT, m_player, m_block); | 		m_world.ChangeBlockAtCursor(bloc, m_player, m_block); | ||||||
| 	else if (m_mouseR) | 	else if (m_mouseR) | ||||||
| 		m_world.ChangeBlockAtCursor(BTYPE_AIR, m_player, m_block); | 		m_world.ChangeBlockAtCursor(BTYPE_AIR, m_player, m_block); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user