mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 17:22:12 +00:00
Merge branch 'public_next'
# Conflicts: # src/sdl/i_system.c
This commit is contained in:
commit
61923f3b1f
3 changed files with 21 additions and 25 deletions
|
@ -839,8 +839,9 @@ boolean CON_Responder(event_t *ev)
|
|||
return true;
|
||||
}
|
||||
|
||||
// don't eat the key
|
||||
return false;
|
||||
// ...why shouldn't it eat the key? if it doesn't, it just means you
|
||||
// can control Sonic from the console, which is silly
|
||||
return true; //return false;
|
||||
}
|
||||
|
||||
// command completion forward (tab) and backward (shift-tab)
|
||||
|
@ -1039,7 +1040,7 @@ boolean CON_Responder(event_t *ev)
|
|||
|
||||
// enter a char into the command prompt
|
||||
if (key < 32 || key > 127)
|
||||
return false;
|
||||
return true; // even if key can't be printed, eat it anyway
|
||||
|
||||
// add key to cmd line here
|
||||
if (key >= 'A' && key <= 'Z' && !shiftdown) //this is only really necessary for dedicated servers
|
||||
|
|
|
@ -1819,7 +1819,6 @@ static void readframe(MYFILE *f, INT32 num)
|
|||
char *word1;
|
||||
char *word2 = NULL;
|
||||
char *tmp;
|
||||
INT32 j;
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -1834,16 +1833,6 @@ static void readframe(MYFILE *f, INT32 num)
|
|||
if (s == tmp)
|
||||
continue; // Skip comment lines, but don't break.
|
||||
|
||||
for (j = 0; s[j] != '\n'; j++)
|
||||
{
|
||||
if (s[j] == '=')
|
||||
{
|
||||
j += 2;
|
||||
j = atoi(&s[j]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
word1 = strtok(s, " ");
|
||||
if (word1)
|
||||
strupr(word1);
|
||||
|
|
|
@ -2693,7 +2693,7 @@ const char *I_LocateWad(void)
|
|||
return waddir;
|
||||
}
|
||||
|
||||
#if defined(LINUX) || defined(LINUX64)
|
||||
#ifdef __linux__
|
||||
#define MEMINFO_FILE "/proc/meminfo"
|
||||
#define MEMTOTAL "MemTotal:"
|
||||
#define MEMFREE "MemFree:"
|
||||
|
@ -2713,20 +2713,23 @@ UINT32 I_GetFreeMem(UINT32 *total)
|
|||
};
|
||||
if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
|
||||
{
|
||||
*total = 0L;
|
||||
if (total)
|
||||
*total = 0L;
|
||||
return 0;
|
||||
}
|
||||
if (kvm_nlist(kd, namelist) != 0)
|
||||
{
|
||||
kvm_close (kd);
|
||||
*total = 0L;
|
||||
if (total)
|
||||
*total = 0L;
|
||||
return 0;
|
||||
}
|
||||
if (kvm_read(kd, namelist[X_SUM].n_value, &sum,
|
||||
sizeof (sum)) != sizeof (sum))
|
||||
{
|
||||
kvm_close(kd);
|
||||
*total = 0L;
|
||||
if (total)
|
||||
*total = 0L;
|
||||
return 0;
|
||||
}
|
||||
kvm_close(kd);
|
||||
|
@ -2747,7 +2750,7 @@ UINT32 I_GetFreeMem(UINT32 *total)
|
|||
if (total)
|
||||
*total = (UINT32)info.dwTotalPhys;
|
||||
return (UINT32)info.dwAvailPhys;
|
||||
#elif defined (LINUX) || defined (LINUX64)
|
||||
#elif defined (__linux__)
|
||||
/* Linux */
|
||||
char buf[1024];
|
||||
char *memTag;
|
||||
|
@ -2763,25 +2766,28 @@ UINT32 I_GetFreeMem(UINT32 *total)
|
|||
if (n < 0)
|
||||
{
|
||||
// Error
|
||||
*total = 0L;
|
||||
if (total)
|
||||
*total = 0L;
|
||||
return 0;
|
||||
}
|
||||
|
||||
buf[n] = '\0';
|
||||
if (NULL == (memTag = strstr(buf, MEMTOTAL)))
|
||||
if ((memTag = strstr(buf, MEMTOTAL)) == NULL)
|
||||
{
|
||||
// Error
|
||||
*total = 0L;
|
||||
if (total)
|
||||
*total = 0L;
|
||||
return 0;
|
||||
}
|
||||
|
||||
memTag += sizeof (MEMTOTAL);
|
||||
totalKBytes = atoi(memTag);
|
||||
|
||||
if (NULL == (memTag = strstr(buf, MEMFREE)))
|
||||
if ((memTag = strstr(buf, MEMFREE)) == NULL)
|
||||
{
|
||||
// Error
|
||||
*total = 0L;
|
||||
if (total)
|
||||
*total = 0L;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2796,7 +2802,7 @@ UINT32 I_GetFreeMem(UINT32 *total)
|
|||
if (total)
|
||||
*total = 48<<20;
|
||||
return 48<<20;
|
||||
#endif /* LINUX */
|
||||
#endif
|
||||
}
|
||||
|
||||
const CPUInfoFlags *I_CPUInfo(void)
|
||||
|
|
Loading…
Reference in a new issue