MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / TelcomLoadHiLites

Function TelcomLoadHiLites

Descent3/TelCom.cpp:1961–1992  ·  view source on GitHub ↗

Loads the Hilites for a monitor

Source from the content-addressed store, hash-verified

1959
1960// Loads the Hilites for a monitor
1961void TelcomLoadHiLites(const char *filelist[], int monitor, int xoff, int yoff) {
1962 if (!filelist)
1963 return;
1964 ASSERT(monitor >= 0 && monitor < MAX_MONITOR);
1965
1966 TelcomHiLiteCount[monitor] = 0;
1967 while (filelist[TelcomHiLiteCount[monitor]])
1968 TelcomHiLiteCount[monitor]++;
1969
1970 if (!TelcomHiLiteCount[monitor])
1971 TelcomHiLites[monitor] = NULL;
1972
1973 TelcomHiLites[monitor] = (int *)mem_malloc(sizeof(int) * TelcomHiLiteCount[monitor]);
1974 if (!TelcomHiLites[monitor]) {
1975 mprintf(0, "Unable to allocate memory for hilights monitor=%d\n", monitor);
1976 TelcomHiLiteCount[monitor] = 0;
1977 return;
1978 }
1979
1980 int *HiLites;
1981 HiLites = TelcomHiLites[monitor];
1982 for (int i = 0; i < TelcomHiLiteCount[monitor]; i++) {
1983 HiLites[i] = FindTextureName(IGNORE_TABLE(filelist[i]));
1984 if (HiLites[i] == -1)
1985 HiLites[i] = BAD_BITMAP_HANDLE;
1986 else
1987 HiLites[i] = GetTextureBitmap(HiLites[i], 0);
1988 }
1989
1990 TelcomHiLiteOffset[monitor].x = xoff;
1991 TelcomHiLiteOffset[monitor].y = yoff;
1992}
1993
1994// Frees all the memory allocated for the hilites
1995void TelcomFreeHiLites(void) {

Callers 1

Calls 2

FindTextureNameFunction · 0.85
GetTextureBitmapFunction · 0.85

Tested by

no test coverage detected