MCPcopy Create free account
hub / github.com/diasurgical/devilution / MakeLightTable

Function MakeLightTable

Source/lighting.cpp:799–978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

797}
798
799void MakeLightTable()
800{
801 int i, j, k, l, lights, shade, l1, l2, cnt, rem, div;
802 double fs, fa;
803 BYTE col, max;
804 BYTE *tbl, *trn;
805 BYTE blood[16];
806
807 tbl = pLightTbl;
808 shade = 0;
809
810 if (light4flag) {
811 lights = 3;
812 } else {
813 lights = 15;
814 }
815
816 for (i = 0; i < lights; i++) {
817 *tbl++ = 0;
818 for (j = 0; j < 8; j++) {
819 col = 16 * j + shade;
820 max = 16 * j + 15;
821 for (k = 0; k < 16; k++) {
822 if (k != 0 || j != 0) {
823 *tbl++ = col;
824 }
825 if (col < max) {
826 col++;
827 } else {
828 max = 0;
829 col = 0;
830 }
831 }
832 }
833 for (j = 16; j < 20; j++) {
834 col = 8 * j + (shade >> 1);
835 max = 8 * j + 7;
836 for (k = 0; k < 8; k++) {
837 *tbl++ = col;
838 if (col < max) {
839 col++;
840 } else {
841 max = 0;
842 col = 0;
843 }
844 }
845 }
846 for (j = 10; j < 16; j++) {
847 col = 16 * j + shade;
848 max = 16 * j + 15;
849 for (k = 0; k < 16; k++) {
850 *tbl++ = col;
851 if (col < max) {
852 col++;
853 } else {
854 max = 0;
855 col = 0;
856 }

Callers 1

LoadGameLevelFunction · 0.85

Calls 2

LoadFileInMemFunction · 0.85
mem_free_dbgFunction · 0.85

Tested by

no test coverage detected