| # | Line 125 | Line 125 | check_decode_normals(NORMCODEC *ncp) | |
|---|---|---|
| 125 | int | |
| 126 | decode_normal_next(FVECT nrm, NORMCODEC *ncp) | |
| 127 | { | |
| 128 | + | int32 lastc; |
| 129 | + | FVECT lastv; |
| 130 | int32 c = getint(4, ncp->finp); | |
| 131 | ||
| 132 | if (c == EOF && feof(ncp->finp)) | |
| # | Line 132 | Line 134 | decode_normal_next(FVECT nrm, NORMCODEC *ncp) | |
| 134 | ||
| 135 | ncp->curpos += 4; | |
| 136 | ||
| 137 | < | decodedir(nrm, c); |
| 138 | < | |
| 137 | > | if (c == lastc) { /* optimization */ |
| 138 | > | VCOPY(nrm, lastv); |
| 139 | > | } else { |
| 140 | > | decodedir(nrm, c); |
| 141 | > | if (c) { |
| 142 | > | lastc = c; |
| 143 | > | VCOPY(lastv, nrm); |
| 144 | > | } |
| 145 | > | } |
| 146 | return (c != 0); | |
| 147 | } | |
| 148 | ||
| – | Removed lines |
| + | Added lines |
| < | Changed lines (old) |
| > | Changed lines (new) |