mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:50:06 +00:00 
			
		
		
		
	added marker_types code for dealing with new marker icons
This commit is contained in:
		
							parent
							
								
									875fb8a8c9
								
							
						
					
					
						commit
						7ed89fdd5d
					
				
					 3 changed files with 61 additions and 1 deletions
				
			
		
							
								
								
									
										34
									
								
								scwx-qt/source/scwx/qt/types/marker_types.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								scwx-qt/source/scwx/qt/types/marker_types.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,34 @@ | |||
| #include <scwx/qt/types/marker_types.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace types | ||||
| { | ||||
| 
 | ||||
| const std::vector<MarkerIconInfo>& getMarkerIcons() | ||||
| { | ||||
|    static std::vector<MarkerIconInfo> markerIcons = {}; | ||||
|    if (markerIcons.size() == 0) | ||||
|    { | ||||
|       markerIcons = { | ||||
|          MarkerIconInfo(types::ImageTexture::LocationMarker, -1, -1), | ||||
|          MarkerIconInfo(types::ImageTexture::LocationPin, 6, 16), | ||||
|          MarkerIconInfo(types::ImageTexture::LocationCrosshair, -1, -1), | ||||
|          MarkerIconInfo(types::ImageTexture::LocationStar, -1, -1), | ||||
|          MarkerIconInfo(types::ImageTexture::LocationBriefcase, -1, -1), | ||||
|          MarkerIconInfo(types::ImageTexture::LocationBuildingColumns, -1, -1), | ||||
|          MarkerIconInfo(types::ImageTexture::LocationBuilding, -1, -1), | ||||
|          MarkerIconInfo(types::ImageTexture::LocationCaravan, -1, -1), | ||||
|          MarkerIconInfo(types::ImageTexture::LocationHouse, -1, -1), | ||||
|          MarkerIconInfo(types::ImageTexture::LocationTent, -1, -1), | ||||
|       }; | ||||
|    } | ||||
| 
 | ||||
|    return markerIcons; | ||||
| } | ||||
| 
 | ||||
| } // namespace types
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
|  | @ -1,8 +1,12 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/qt/types/texture_types.hpp> | ||||
| 
 | ||||
| #include <string> | ||||
| #include <cstdint> | ||||
| 
 | ||||
| #include <QIcon> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
|  | @ -24,6 +28,27 @@ struct MarkerInfo | |||
|    double      longitude; | ||||
| }; | ||||
| 
 | ||||
| struct MarkerIconInfo { | ||||
|    explicit MarkerIconInfo(types::ImageTexture texture, | ||||
|                            std::int32_t        hotX, | ||||
|                            std::int32_t        hotY) : | ||||
|       name{types::GetTextureName(texture)}, | ||||
|       path{types::GetTexturePath(texture)}, | ||||
|       hotX{hotX}, | ||||
|       hotY{hotY}, | ||||
|       qIcon{QIcon(QString::fromStdString(path))} | ||||
|    { | ||||
|    } | ||||
| 
 | ||||
|    std::string name; | ||||
|    std::string path; | ||||
|    std::int32_t hotX; | ||||
|    std::int32_t hotY; | ||||
|    QIcon qIcon; | ||||
| }; | ||||
| 
 | ||||
| const std::vector<MarkerIconInfo>& getMarkerIcons(); | ||||
| 
 | ||||
| } // namespace types
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak