MCPcopy Create free account
hub / github.com/DentonW/DevIL / encput

Function encput

DevIL/src-IL/src/il_pcx.cpp:665–683  ·  view source on GitHub ↗

Routine used from ZSoft's pcx documentation

Source from the content-addressed store, hash-verified

663
664// Routine used from ZSoft's pcx documentation
665ILuint encput(ILubyte byt, ILubyte cnt)
666{
667 if (cnt) {
668 if ((cnt == 1) && (0xC0 != (0xC0 & byt))) {
669 if (IL_EOF == iputc(byt))
670 return(0); /* disk write error (probably full) */
671 return(1);
672 }
673 else {
674 if (IL_EOF == iputc((ILubyte)((ILuint)0xC0 | cnt)))
675 return (0); /* disk write error */
676 if (IL_EOF == iputc(byt))
677 return (0); /* disk write error */
678 return (2);
679 }
680 }
681
682 return (0);
683}
684
685// This subroutine encodes one scanline and writes it to a file.
686// It returns number of bytes written into outBuff, 0 if failed.

Callers 1

encLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected