fix typo in texels flip

add support to create a cube in TinyRenderer (quick test)
This commit is contained in:
Erwin Coumans
2016-04-28 12:28:04 -07:00
parent a3767193ce
commit 615effa4d9
7 changed files with 115 additions and 15 deletions

View File

@@ -246,7 +246,7 @@ bool TGAImage::unload_rle_data(std::ofstream &out) {
TGAColor TGAImage::get(int x, int y) {
if (!data || x<0 || y<0 || x>=width || y>=height) {
return TGAColor();
return TGAColor(128.f,128.f,128.f,255.f);
}
return TGAColor(data+(x+y*width)*bytespp, bytespp);
}