@@ -281,7 +281,7 @@ void TileGenerator::parseColorsStream(std::istream &in)
281
281
if (strlen (name) == 0 )
282
282
break ;
283
283
ColorEntry color = ColorEntry (r, g, b, a, t);
284
- m_colors [name] = color;
284
+ m_colorMap [name] = color;
285
285
}
286
286
}
287
287
@@ -365,14 +365,14 @@ void TileGenerator::renderMap()
365
365
}
366
366
367
367
for (int i = 0 ; i < 16 ; ++i) {
368
- m_readedPixels [i] = 0 ;
368
+ m_readPixels [i] = 0 ;
369
369
m_readInfo[i] = 0 ;
370
370
}
371
371
for (int i = 0 ; i < 16 ; i++) {
372
372
for (int j = 0 ; j < 16 ; j++) {
373
- m_col [i][j] = m_bgColor; // This will be drawn by renderMapBlockBottom() for y-rows with only 'air', 'ignore' or unknown nodes if --drawalpha is used
374
- m_col [i][j].a = 0 ; // ..but set alpha to 0 to tell renderMapBlock() not to use this color to mix a shade
375
- m_th [i][j] = 0 ;
373
+ m_color [i][j] = m_bgColor; // This will be drawn by renderMapBlockBottom() for y-rows with only 'air', 'ignore' or unknown nodes if --drawalpha is used
374
+ m_color [i][j].a = 0 ; // ..but set alpha to 0 to tell renderMapBlock() not to use this color to mix a shade
375
+ m_thickness [i][j] = 0 ;
376
376
}
377
377
}
378
378
@@ -464,23 +464,23 @@ void TileGenerator::renderMap()
464
464
465
465
renderMapBlock (mapData, pos, version);
466
466
467
- bool allReaded = true ;
467
+ bool allRead = true ;
468
468
for (int i = 0 ; i < 16 ; ++i) {
469
- if (m_readedPixels [i] != 0xffff ) {
470
- allReaded = false ;
469
+ if (m_readPixels [i] != 0xffff ) {
470
+ allRead = false ;
471
471
}
472
472
}
473
- if (allReaded ) {
473
+ if (allRead ) {
474
474
break ;
475
475
}
476
476
}
477
- bool allReaded = true ;
477
+ bool allRead = true ;
478
478
for (int i = 0 ; i < 16 ; ++i) {
479
- if (m_readedPixels [i] != 0xffff ) {
480
- allReaded = false ;
479
+ if (m_readPixels [i] != 0xffff ) {
480
+ allRead = false ;
481
481
}
482
482
}
483
- if (!allReaded ) {
483
+ if (!allRead ) {
484
484
renderMapBlockBottom (blockStack.begin ()->first );
485
485
}
486
486
}
@@ -499,7 +499,7 @@ inline void TileGenerator::renderMapBlock(const ustring &mapBlock, const BlockPo
499
499
for (int z = 0 ; z < 16 ; ++z) {
500
500
int imageY = getImageY (zBegin + 15 - z);
501
501
for (int x = 0 ; x < 16 ; ++x) {
502
- if (m_readedPixels [z] & (1 << x)) {
502
+ if (m_readPixels [z] & (1 << x)) {
503
503
continue ;
504
504
}
505
505
int imageX = getImageX (xBegin + x);
@@ -514,25 +514,25 @@ inline void TileGenerator::renderMapBlock(const ustring &mapBlock, const BlockPo
514
514
if (blockName == m_nameMap.end ())
515
515
continue ;
516
516
const string &name = blockName->second ;
517
- ColorMap::const_iterator color = m_colors .find (name);
518
- if (color != m_colors .end ()) {
517
+ ColorMap::const_iterator color = m_colorMap .find (name);
518
+ if (color != m_colorMap .end ()) {
519
519
const Color c = color->second .to_color ();
520
520
if (m_drawAlpha) {
521
- if (m_col [z][x].a == 0 )
522
- m_col [z][x] = c;
521
+ if (m_color [z][x].a == 0 )
522
+ m_color [z][x] = c;
523
523
else
524
- m_col [z][x] = mixColors (m_col [z][x], c);
525
- if (m_col [z][x].a == 0xFF ) {
526
- m_image->tpixels [imageY][imageX] = color2int (m_col [z][x]);
527
- m_readedPixels [z] |= (1 << x);
528
- m_blockPixelAttributes.attribute (15 - z, xBegin + x).thicken = m_th [z][x];
524
+ m_color [z][x] = mixColors (m_color [z][x], c);
525
+ if (m_color [z][x].a == 0xFF ) {
526
+ m_image->tpixels [imageY][imageX] = color2int (m_color [z][x]);
527
+ m_readPixels [z] |= (1 << x);
528
+ m_blockPixelAttributes.attribute (15 - z, xBegin + x).thickness = m_thickness [z][x];
529
529
} else {
530
- m_th [z][x] = (m_th [z][x] + color->second .t ) / 2.0 ;
530
+ m_thickness [z][x] = (m_thickness [z][x] + color->second .t ) / 2.0 ;
531
531
continue ;
532
532
}
533
533
} else {
534
534
m_image->tpixels [imageY][imageX] = color2int (c);
535
- m_readedPixels [z] |= (1 << x);
535
+ m_readPixels [z] |= (1 << x);
536
536
}
537
537
if (!(m_readInfo[z] & (1 << x))) {
538
538
m_blockPixelAttributes.attribute (15 - z, xBegin + x).height = pos.y * 16 + y;
@@ -555,15 +555,15 @@ inline void TileGenerator::renderMapBlockBottom(const BlockPos &pos)
555
555
for (int z = 0 ; z < 16 ; ++z) {
556
556
int imageY = getImageY (zBegin + 15 - z);
557
557
for (int x = 0 ; x < 16 ; ++x) {
558
- if (m_readedPixels [z] & (1 << x)) {
558
+ if (m_readPixels [z] & (1 << x)) {
559
559
continue ;
560
560
}
561
561
int imageX = getImageX (xBegin + x);
562
562
563
563
if (m_drawAlpha) {
564
- m_image->tpixels [imageY][imageX] = color2int (m_col [z][x]);
565
- m_readedPixels [z] |= (1 << x);
566
- m_blockPixelAttributes.attribute (15 - z, xBegin + x).thicken = m_th [z][x];
564
+ m_image->tpixels [imageY][imageX] = color2int (m_color [z][x]);
565
+ m_readPixels [z] |= (1 << x);
566
+ m_blockPixelAttributes.attribute (15 - z, xBegin + x).thickness = m_thickness [z][x];
567
567
}
568
568
}
569
569
}
@@ -591,7 +591,7 @@ inline void TileGenerator::renderShading(int zPos)
591
591
}
592
592
// more thickness -> less visible shadows: t=0 -> 100% visible, t=255 -> 0% visible
593
593
if (m_drawAlpha)
594
- d = d * ((0xFF - m_blockPixelAttributes.attribute (z, x).thicken ) / 255.0 );
594
+ d = d * ((0xFF - m_blockPixelAttributes.attribute (z, x).thickness ) / 255.0 );
595
595
int sourceColor = m_image->tpixels [imageY][getImageX (x)] & 0xffffff ;
596
596
uint8_t r = (sourceColor & 0xff0000 ) >> 16 ;
597
597
uint8_t g = (sourceColor & 0x00ff00 ) >> 8 ;
0 commit comments