mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-08 11:05:28 +01:00
Irrlicht: remove some dead code
This commit is contained in:
@@ -25,8 +25,7 @@
|
||||
#include "fast_atof.h"
|
||||
|
||||
// constructor
|
||||
COSOperator::COSOperator(const core::stringc &osVersion) :
|
||||
OperatingSystem(osVersion)
|
||||
COSOperator::COSOperator()
|
||||
{}
|
||||
|
||||
COSOperator::~COSOperator()
|
||||
@@ -37,12 +36,6 @@ COSOperator::~COSOperator()
|
||||
#endif
|
||||
}
|
||||
|
||||
//! returns the current operating system version as string.
|
||||
const core::stringc &COSOperator::getOperatingSystemVersion() const
|
||||
{
|
||||
return OperatingSystem;
|
||||
}
|
||||
|
||||
//! copies text to the clipboard
|
||||
void COSOperator::copyToClipboard(const c8 *text) const
|
||||
{
|
||||
@@ -97,52 +90,3 @@ const c8 *COSOperator::getTextFromPrimarySelection() const
|
||||
#endif
|
||||
}
|
||||
|
||||
bool COSOperator::getSystemMemory(u32 *Total, u32 *Avail) const
|
||||
{
|
||||
#if defined(_IRR_WINDOWS_API_)
|
||||
|
||||
MEMORYSTATUSEX MemoryStatusEx;
|
||||
MemoryStatusEx.dwLength = sizeof(MEMORYSTATUSEX);
|
||||
|
||||
// cannot fail
|
||||
GlobalMemoryStatusEx(&MemoryStatusEx);
|
||||
|
||||
if (Total)
|
||||
*Total = (u32)(MemoryStatusEx.ullTotalPhys >> 10);
|
||||
if (Avail)
|
||||
*Avail = (u32)(MemoryStatusEx.ullAvailPhys >> 10);
|
||||
return true;
|
||||
|
||||
#elif defined(_IRR_POSIX_API_) && defined(_SC_PHYS_PAGES) && defined(_SC_AVPHYS_PAGES)
|
||||
long ps = sysconf(_SC_PAGESIZE);
|
||||
long pp = sysconf(_SC_PHYS_PAGES);
|
||||
long ap = sysconf(_SC_AVPHYS_PAGES);
|
||||
|
||||
if (ps == -1 || (Total && pp == -1) || (Avail && ap == -1))
|
||||
return false;
|
||||
|
||||
if (Total)
|
||||
*Total = (u32)((pp >> 10) * ps);
|
||||
if (Avail)
|
||||
*Avail = (u32)((ap >> 10) * ps);
|
||||
return true;
|
||||
#elif defined(_IRR_OSX_PLATFORM_)
|
||||
int mib[2];
|
||||
int64_t physical_memory;
|
||||
size_t length;
|
||||
|
||||
// Get the Physical memory size
|
||||
mib[0] = CTL_HW;
|
||||
mib[1] = HW_MEMSIZE;
|
||||
length = sizeof(int64_t);
|
||||
sysctl(mib, 2, &physical_memory, &length, NULL, 0);
|
||||
|
||||
if (Total)
|
||||
*Total = (u32)(physical_memory >> 10);
|
||||
if (Avail)
|
||||
*Avail = (u32)(physical_memory >> 10); // we don't know better
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user