Something went wrong. Try again.
the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
Something went wrong. Try again.
1.2 kB · 72 lines
C++
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
#include "stdafx.h"
TLSStoragePS3* TLSStoragePS3::m_pInstance = NULL;
BOOL TLSStoragePS3::m_activeList[sc_maxSlots];__thread LPVOID TLSStoragePS3::m_values[sc_maxSlots];
TLSStoragePS3::TLSStoragePS3(){ for(int i=0;i<sc_maxSlots; i++) { m_activeList[i] = false; m_values[i] = NULL; }}
TLSStoragePS3* TLSStoragePS3::Instance(){ if ( m_pInstance == 0 ) // Is this the first time? { m_pInstance = new TLSStoragePS3; // Create the singleton instance. } return m_pInstance;}
int TLSStoragePS3::Alloc(){ for(int i=0; i<sc_maxSlots; i++) { if(m_activeList[i] == false) { m_activeList[i] = true; m_values[i] = NULL; return i; } } assert(0); // we've ran out of slots return -1;}
BOOL TLSStoragePS3::Free( DWORD _index ){ if(m_activeList[_index] == false) return false; // not been allocated
m_activeList[_index] = false; m_values[_index] = NULL; return true;}
BOOL TLSStoragePS3::SetValue( DWORD _index, LPVOID _val ){ if(m_activeList[_index] == false) return false; m_values[_index] = _val; return true;}
LPVOID TLSStoragePS3::GetValue( DWORD _index ){ if(m_activeList[_index] == false) return NULL; return m_values[_index];}