fix some compile stuff

This commit is contained in:
Adam D. Ruppe 2011-11-09 10:57:25 -05:00
parent eaaf8cfeed
commit d6a27d2822
1 changed files with 4 additions and 0 deletions

4
png.d
View File

@ -92,6 +92,7 @@ PNG* pngFromImage(IndexedImage i) {
int shift = 0;
switch(h.depth) {
default: assert(0); break;
case 1: shift = 7; break;
case 2: shift = 6; break;
case 4: shift = 4; break;
@ -105,6 +106,7 @@ PNG* pngFromImage(IndexedImage i) {
datastream[dsp] |= i.data[dpos++] << shift;
switch(h.depth) {
default: assert(0); break;
case 1: shift-= 1; break;
case 2: shift-= 2; break;
case 4: shift-= 4; break;
@ -115,6 +117,7 @@ PNG* pngFromImage(IndexedImage i) {
if(shift < 0) {
dsp++;
switch(h.depth) {
default: assert(0); break;
case 1: shift = 7; break;
case 2: shift = 6; break;
case 4: shift = 4; break;
@ -125,6 +128,7 @@ PNG* pngFromImage(IndexedImage i) {
if(!justAdvanced)
dsp++;
switch(h.depth) {
default: assert(0); break;
case 1: shift = 7; break;
case 2: shift = 6; break;
case 4: shift = 4; break;