CASW_EquipItem* CASW_EquipmentList::GetItemForSlot( int iWpnSlot, int index )
{
	if ( iWpnSlot > 1 )
		return GetExtra( index );
	else
		return GetRegular( index );
}
Beispiel #2
0
void DWENTRY DWBeginStruct(
    dw_client                   cli,
    dw_handle                   struct_hdl,
    dw_size_t                   size,
    const char *                name,
    dw_addr_offset              start_scope,
    uint                        flags )
{
    abbrev_code                 abbrev;
    dw_st                       kind;

    start_scope = start_scope;
    SetHandleLocation( cli, struct_hdl );
    kind = GetExtra( cli, struct_hdl )->structure.kind;
    abbrev = 0;
    switch( kind ){
    case DW_ST_CLASS:
        abbrev = AB_CLASS_TYPE;
        break;
    case DW_ST_STRUCT:
        abbrev = AB_STRUCT_TYPE;
        break;
    case DW_ST_UNION:
        abbrev = AB_UNION_TYPE;
        break;
    }
    DestroyExtra( cli, struct_hdl );
    abbrev |= AB_SIBLING | AB_START_REF;
    emitCommonTypeInfo( cli, abbrev , name, flags );
    /* AT_byte_size */
    InfoULEB128( cli, size );
    EndDIE( cli );
    StartChildren( cli );
}
Beispiel #3
0
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	g_hInstance = hInstance;
	Register( "Main", WndProc );
	HWND hWnd = CreateMain( "Main", "window" );
	Register( "CHILD", DefWindowProc );
	HWND hChild1 = CreateChild( "CHILD", "C1", hWnd );
	HWND hChild2 = CreateChild( "CHILD", "C2", hWnd );
	Display( hWnd );
	MoveWindow( hChild1, 300, 100, 200, 200, TRUE );
	MoveWindow( hChild2, 500, 100, 200, 200, TRUE );
	SetExtra( hChild1 );
	GetExtra( hChild2 );
	Message( );
	return 0;
}
void CASW_EquipmentList::LoadTextures()
{
	if (m_bLoadedTextures)
		return;

	m_bLoadedTextures = true;
	char buffer[256];
	for (int i=0;i<m_Regular.Count();i++)
	{
		int t = vgui::surface()->CreateNewTextureID();
		CASW_EquipItem* pItem = GetRegular(i);
		if (pItem)
		{
			CASW_WeaponInfo* pWeaponData = GetWeaponDataFor(pItem->m_EquipClass);
			gWR.LoadWeaponSprites(LookupWeaponInfoSlot(pItem->m_EquipClass));	// make sure we load in it's .txt + sprites now too
			Q_snprintf(buffer, 256, "vgui/%s", pWeaponData->szEquipIcon);
			vgui::surface()->DrawSetTextureFile( t, buffer, true, false);
		}
		else
		{
			// need to load an error texture?
		}
		m_iRegularTexture.AddToTail(t);
	}
	for (int i=0;i<m_Extra.Count();i++)
	{
		int t = vgui::surface()->CreateNewTextureID();
		CASW_EquipItem* pItem = GetExtra(i);
		if (pItem)
		{
			CASW_WeaponInfo* pWeaponData = GetWeaponDataFor(pItem->m_EquipClass);
			gWR.LoadWeaponSprites(LookupWeaponInfoSlot(pItem->m_EquipClass));	// make sure we load in it's .txt + sprites now too
			Q_snprintf(buffer, 256, "vgui/%s", pWeaponData->szEquipIcon);
			vgui::surface()->DrawSetTextureFile( t, buffer, true, false);
		}
		else
		{
			// need to load an error texture?
		}
		m_iExtraTexture.AddToTail(t);
	}
}
Beispiel #5
0
void CompStr::GetLog(LogCompStr& log) {
  FOOTMARK();
  log.dwCursorPos = dwCursorPos;
  log.dwDeltaStart = dwDeltaStart;
  log.comp_read_attr.assign(GetCompReadAttr(), GetCompReadAttr() + dwCompReadAttrLen);
  log.comp_read_clause.assign(GetCompReadClause(), GetCompReadClause() + dwCompReadClauseLen / sizeof(DWORD));
  log.comp_read_str.assign(GetCompReadStr(), dwCompReadStrLen);
  log.comp_attr.assign(GetCompAttr(), GetCompAttr() + dwCompAttrLen);
  log.comp_clause.assign(GetCompClause(), GetCompClause() + dwCompClauseLen / sizeof(DWORD));
  log.comp_str.assign(GetCompStr(), dwCompStrLen);
  log.result_read_clause.assign(GetResultReadClause(), GetResultReadClause() + dwResultReadClauseLen / sizeof(DWORD));
  log.result_read_str.assign(GetResultReadStr(), dwResultReadStrLen);
  log.result_clause.assign(GetResultClause(), GetResultClause() + dwResultClauseLen / sizeof(DWORD));
  log.result_str.assign(GetResultStr(), dwResultStrLen);
  COMPSTREXTRA *extra = GetExtra();
  if (extra && extra->dwSignature == 0xDEADFACE) {
    extra->GetLog(log.extra);
    log.fix();
  }
}
Beispiel #6
0
		char *GetComment() const { return GetExtra() + xtraLen; }