@@ -67,7 +67,6 @@ uint32_t Maps::batchFlushCount = 0;
6767 */
6868Maps::Maps () : fillPolygons(true )
6969{
70-
7170 ESP_LOGI (TAG, " Maps constructor completed" );
7271}
7372
@@ -84,7 +83,6 @@ Maps::Maps() : fillPolygons(true)
8483 */
8584uint16_t Maps::lon2posx (float f_lon, uint8_t zoom, uint16_t tileSize)
8685{
87- // Use direct calculation (more efficient than complex transformation matrices)
8886 return static_cast <uint16_t >(((f_lon + 180 .0f ) / 360 .0f * (1 << zoom) * tileSize)) % tileSize;
8987}
9088
@@ -101,7 +99,6 @@ uint16_t Maps::lon2posx(float f_lon, uint8_t zoom, uint16_t tileSize)
10199 */
102100uint16_t Maps::lat2posy (float f_lat, uint8_t zoom, uint16_t tileSize)
103101{
104- // Use direct calculation (more efficient than complex transformation matrices)
105102 float lat_rad = f_lat * static_cast <float >(M_PI) / 180 .0f ;
106103 float siny = tanf (lat_rad) + 1 .0f / cosf (lat_rad);
107104 float merc_n = logf (siny);
@@ -323,10 +320,7 @@ void Maps::initMap(uint16_t mapHeight, uint16_t mapWidth)
323320 // Initialize tile cache system
324321 initTileCache ();
325322
326- // Initialize background preload system
327-
328323 // Initialize polygon optimizations
329- // Initialize polygon optimization system
330324 polygonCullingEnabled = true ;
331325 optimizedScanlineEnabled = false ;
332326 polygonRenderCount = 0 ;
@@ -348,8 +342,6 @@ void Maps::deleteMapScrSprites()
348342
349343 // Clear tile cache to free memory
350344 clearTileCache ();
351-
352-
353345}
354346
355347/* *
@@ -816,7 +808,7 @@ bool Maps::loadPalette(const char* palettePath)
816808 {
817809 if (fread (rgb888, 3 , 1 , f) == 1 )
818810 {
819- // Convert RGB888 to RGB332 using same method as tile_generator.py hex_to_rgb332_direct
811+ // Convert RGB332 to RGB888
820812 uint8_t r332 = rgb888[0 ] & 0xE0 ; // Keep top 3 bits
821813 uint8_t g332 = (rgb888[1 ] & 0xE0 ) >> 3 ; // Keep top 3 bits, shift right
822814 uint8_t b332 = rgb888[2 ] >> 6 ; // Keep top 2 bits
@@ -1176,12 +1168,6 @@ void Maps::drawPolygonBorder(TFT_eSprite &map, const int *px, const int *py, con
11761168 }
11771169}
11781170
1179-
1180-
1181-
1182-
1183-
1184-
11851171/* *
11861172 * @brief Initialize tile cache system
11871173 *
@@ -1372,16 +1358,6 @@ size_t Maps::getCacheMemoryUsage()
13721358 return memoryUsage;
13731359}
13741360
1375-
1376-
1377-
1378-
1379-
1380-
1381-
1382-
1383-
1384-
13851361/* *
13861362* @brief Renders a map tile from a binary file onto a sprite.
13871363*
0 commit comments