mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
Add Mtx, float, and mk64 Factories (#43)
* Create MtxFactory.cpp * Add mtx factory * Implement mtx output * Changed implementation * Update comment * Finish Mtx factory * Add float factory * Add runtime error for untested code * Add DrivingBehaviour factory & fix bug * Remove limit * Add mk64 graphics * Changes * fix * Update * Improve error checking
This commit is contained in:
@@ -509,7 +509,7 @@ rgba* png2rgba(unsigned char* png_input, int size_input, int* width, int* height
|
||||
}
|
||||
|
||||
rgb* png2rgb(unsigned char* png_input, int size_input, int* width, int* height) {
|
||||
rgba* img = NULL;
|
||||
rgb* img = NULL;
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
int channels = 0;
|
||||
@@ -538,11 +538,6 @@ rgb* png2rgb(unsigned char* png_input, int size_input, int* width, int* height)
|
||||
img[idx].red = data[channels * idx];
|
||||
img[idx].green = data[channels * idx + 1];
|
||||
img[idx].blue = data[channels * idx + 2];
|
||||
if (channels == 4) {
|
||||
img[idx].alpha = data[channels * idx + 3];
|
||||
} else {
|
||||
img[idx].alpha = 0xFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user