コード例 #1
0
/**
 * Writes a structure's raw byte data to the given buffer
 */
template <typename T> char* compileStructure(char* buffer, const char* endOfBuffer, va_list args_in, va_list* args_out)
{
  if (!buffer || (buffer + sizeof(T) > endOfBuffer)) return 0;
  T value = *(T*)args_in;
  memcpy_s(buffer, endOfBuffer - buffer, (const void*)(&value), sizeof(T));
  *args_out = args_in + _INTSIZEOF(T);
  return buffer + sizeof(T);
}
コード例 #2
0
ファイル: jass.cpp プロジェクト: hjhong/YDWE
	uintptr_t  call(const char* name, ...)
	{
		func_value const* nf = jass_func(name);

		if (!nf) 
		{
			nf = japi_func(name); 
			if (!nf)
			{
				return 0;
			}
		}

		return call(nf->get_address(), (const uintptr_t*)((va_list)_ADDRESSOF(name) + _INTSIZEOF(name)), nf->get_param().size());
	}
コード例 #3
0
void Drawing::drawString(unsigned long font, bool shouldCenter, int x, int y, Color color, const char* text, ...)
{
	if (!text)
		return;

	char buffer[MAX_PATH];

	vsprintf_s(buffer, text, (char*)&text + _INTSIZEOF(text));

	if (shouldCenter)
		x -= getWidth(font, buffer) / 2;

	interfaces::surface->DrawSetTextColor(color.r(), color.g(), color.b(), color.a());
	interfaces::surface->DrawSetTextFont(font);
	interfaces::surface->DrawSetTextPos(x, y);

	std::wstring wide = getWide(std::string(buffer));
	interfaces::surface->DrawPrintText(wide.c_str(), wide.length());
}
コード例 #4
0
//====================================================================================
void MWTHISCALL CAnimation::__ChangeAnimGroup(BYTE AnimGroup, long AnimType, long Unkn00, long Unkn01)
{
 MORROWIND::PCObjREFR ObjectRef = ((MORROWIND::PCObjREFR*)(((char*)_ADDRESSOF(Unkn01))+_INTSIZEOF(Unkn01)))[0]; 
 this->_ChangeAnimGroup(AnimGroup, AnimType, Unkn00, Unkn01);
}