mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Toss old RAM functions
If we really care about system RAM, we should reimplement this in a less obsolete way--and hopefully update the RAM tiers ;)
This commit is contained in:
@ -588,32 +588,6 @@ int hsRemove(const char * fname)
|
||||
return remove(fname);
|
||||
}
|
||||
|
||||
uint32_t hsPhysicalMemory()
|
||||
{
|
||||
#define HS_ONE_MEGABYTE 1048576 // 1024 * 1024
|
||||
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
MEMORYSTATUS ms;
|
||||
GlobalMemoryStatus(&ms);
|
||||
return (ms.dwTotalPhys / HS_ONE_MEGABYTE);
|
||||
#endif
|
||||
}
|
||||
|
||||
MemSpec hsMemorySpec()
|
||||
{
|
||||
uint32_t mem = hsPhysicalMemory();
|
||||
|
||||
// Currently adding a little margin of error here
|
||||
// due to the fact that Windows doesn't seem to
|
||||
// be totally accurate in it's calculations.
|
||||
if (mem < 127)
|
||||
return kBlows;
|
||||
else if (mem < 255)
|
||||
return kAcceptable;
|
||||
else
|
||||
return kOptimal;
|
||||
}
|
||||
|
||||
//
|
||||
// Microsoft SAMPLE CODE
|
||||
// returns array of allocated version info strings or nil
|
||||
|
@ -535,19 +535,6 @@ inline float hsRadiansToDegrees(float rad) { return float(rad * (180 / M_PI)); }
|
||||
# define ALIGN(n) __atribute__(aligned(n))
|
||||
#endif
|
||||
|
||||
/////////////////////////////
|
||||
// Physical memory functions
|
||||
/////////////////////////////
|
||||
enum MemSpec
|
||||
{
|
||||
kBlows = 0, // Less than 128
|
||||
kAcceptable, // Less than 256
|
||||
kOptimal // 256 or greater
|
||||
};
|
||||
|
||||
uint32_t hsPhysicalMemory();
|
||||
MemSpec hsMemorySpec();
|
||||
|
||||
inline int hsRandMax() { return 32767; }
|
||||
inline float hsRandNorm() { return 1.f / 32767.f; } // multiply by hsRand to get randoms ranged [0..1]
|
||||
int hsRand(void);
|
||||
|
Reference in New Issue
Block a user