void UGAAbilityBase::InitAbility() { //still want to initialize, as Spec is used in multiple places. DefaultContext = UGABlueprintLibrary::MakeContext(this, POwner, AvatarActor, this, FHitResult(ForceInit)).GetRef(); ActivationEffect.InitializeIfNotInitialized(POwner, this); CooldownEffect.InitializeIfNotInitialized(POwner, this); for (int32 Idx = 0; Idx < AttributeCost.Num(); Idx++) { AttributeCost[Idx].InitializeIfNotInitialized(POwner, this); } AttributeCostHandle.AddZeroed(AttributeCost.Num()); for (int32 Idx = 0; Idx < AbilityAttributeCost.Num(); Idx++) { AbilityAttributeCost[Idx].InitializeIfNotInitialized(POwner, this); } AbilityAttributeCostHandle.AddZeroed(AbilityAttributeCost.Num()); if (AbilityComponent) { World = AbilityComponent->GetWorld(); } if (!AbilityComponent) { AbilityComponent = GetAbilityComp(); } if (GetAttributes()) { GetAttributes()->InitializeAttributes(GetAbilityComp()); GetAttributes()->InitializeAttributesFromTable(); } ENetRole role = AbilityComponent->GetOwnerRole(); ENetMode mode = AbilityComponent->GetOwner()->GetNetMode(); { FAFOnAttributeReady Delegate = FAFOnAttributeReady::CreateUObject(this, &UGAAbilityBase::OnAttributeSetReplicated); AbilityComponent->RepAttributes.RegisterAttributeRepEvent(AbilityTag, Delegate); } //AbilityComponent->RepAttributes.AttributeMap.Add(AbilityTag, Attributes); if (role == ENetRole::ROLE_Authority || mode == ENetMode::NM_Standalone) { if (AbilityComponent && GetAttributes()) { UGAAttributesBase* NewAttributes = AbilityComponent->AddAddtionalAttributes(AbilityTag, GetAttributes());; SetAttributes(nullptr); SetAttributes(NewAttributes); } } if (!OwnerCamera) { OwnerCamera = POwner->FindComponentByClass<UCameraComponent>(); } OnAbilityInited(); }
bool SetSendingAttributes(HCOSE hMsg, const cn_cbor * pIn, int base) { bool f = false; if (!SetAttributes(hMsg, cn_cbor_mapget_string(pIn, "protected"), COSE_PROTECT_ONLY, base, true)) goto returnError; if (!SetAttributes(hMsg, cn_cbor_mapget_string(pIn, "unprotected"), COSE_UNPROTECT_ONLY, base, true)) goto returnError; if (!SetAttributes(hMsg, cn_cbor_mapget_string(pIn, "unsent"), COSE_DONT_SEND, base, false)) goto returnError; cn_cbor * pExternal = cn_cbor_mapget_string(pIn, "external"); if (pExternal != NULL) { cn_cbor * pcn = cn_cbor_clone(pExternal, CBOR_CONTEXT_PARAM_COMMA NULL); if (pcn == NULL) goto returnError; switch (base) { #if INCLUDE_ENCRYPT0 case Attributes_Encrypt_protected: if (!COSE_Encrypt_SetExternal((HCOSE_ENCRYPT)hMsg, FromHex(pcn->v.str, (int)pcn->length), pcn->length / 2, NULL)) goto returnError; break; #endif #if INCLUDE_ENCRYPT case Attributes_Enveloped_protected: if (!COSE_Enveloped_SetExternal((HCOSE_ENVELOPED)hMsg, FromHex(pcn->v.str, (int)pcn->length), pcn->length / 2, NULL)) goto returnError; break; #endif #if INCLUDE_MAC case Attributes_MAC_protected: if (!COSE_Mac_SetExternal((HCOSE_MAC)hMsg, FromHex(pcn->v.str, (int)pcn->length), pcn->length / 2, NULL)) goto returnError; break; #endif #if INCLUDE_MAC0 case Attributes_MAC0_protected: if (!COSE_Mac0_SetExternal((HCOSE_MAC0)hMsg, FromHex(pcn->v.str, (int)pcn->length), pcn->length / 2, NULL)) goto returnError; break; #endif #if INCLUDE_SIGN case Attributes_Signer_protected: if (!COSE_Signer_SetExternal((HCOSE_SIGNER)hMsg, FromHex(pcn->v.str, (int)pcn->length), pcn->length / 2, NULL)) goto returnError; break; #endif #if INCLUDE_SIGN0 case Attributes_Sign0_protected: if (!COSE_Sign0_SetExternal((HCOSE_SIGN0)hMsg, FromHex(pcn->v.str, (int)pcn->length), pcn->length / 2, NULL)) goto returnError; break; #endif } } f = true; returnError: return f; }
void Mesh::Render(Renderer &renderer, bool ignore_material, size_t instances) { SetAttributes(vbo_, format_, static_cast<int>(vertex_size_), nullptr); for (auto it = indices_.begin(); it != indices_.end(); ++it) { if (!ignore_material) it->mat->Set(renderer); GL_CALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, it->ibo)); DrawElement(renderer, it->count, static_cast<int32_t>(instances)); } UnSetAttributes(format_); }
void UGAAbilityBase::OnAttributeSetReplicated(class UGAAttributesBase* ReplicatedAttributes) { SetAttributes(ReplicatedAttributes); if (GetAttributes()) { GetAttributes()->InitializeAttributes(GetAbilityComp()); GetAttributes()->InitializeAttributesFromTable(); } }
//--------------------------------------------------------------------------- // set the paragraph indent (in points?) from the left margin // void __fastcall TTaeParaAttributes::SetLeftIndent(int Value) { TParaFormat Paragraph; InitPara(Paragraph); Paragraph.dwMask = PFM_OFFSET; Paragraph.dxOffset = Value * 20; SetAttributes(Paragraph); }
//--------------------------------------------------------------------------- // set the indent from the right margin (in points?) // void __fastcall TTaeParaAttributes::SetRightIndent(int Value) { TParaFormat Paragraph; InitPara(Paragraph); Paragraph.dwMask = PFM_RIGHTINDENT; Paragraph.dxRightIndent = Value * 20; SetAttributes(Paragraph); }
//--------------------------------------------------------------------------- // set the first line indent (in points?) from the left margin // void __fastcall TTaeParaAttributes::SetFirstIndent(int Value) { TParaFormat Paragraph; InitPara(Paragraph); Paragraph.dwMask = PFM_STARTINDENT; Paragraph.dxStartIndent = Value * 20; SetAttributes(Paragraph); }
//--------------------------------------------------------------------------- // set the paragraph alignment for the text // void __fastcall TTaeParaAttributes::SetAlignment(TAlignment Value) { TParaFormat Paragraph; InitPara(Paragraph); Paragraph.dwMask = PFM_ALIGNMENT; Paragraph.wAlignment = (WORD) (Value + 1); SetAttributes(Paragraph); }
//--------------------------------------------------------------------------- // set the character set of the font // void __fastcall TTaeTextAttributes::SetCharset(TFontCharset Value) { TCharFormat Format; InitFormat(Format); Format.dwMask = CFM_CHARSET; Format.bCharSet = Value; SetAttributes(Format); }
//--------------------------------------------------------------------------- // set the text size in points // void __fastcall TTaeTextAttributes::SetSize(int Value) { TCharFormat Format; InitFormat(Format); Format.dwMask = CFM_SIZE; Format.yHeight = Value * 20; SetAttributes(Format); }
PUBLIC VOID HostEnd() { #ifdef SUN ioctl(0,TCSETS,&OrgMode); #endif #ifdef HELIOS SetAttributes( InputStream, &CurAttributes ); #endif }
//--------------------------------------------------------------------------- // set the number of tabs recognized by the control // void __fastcall TTaeParaAttributes::SetTabCount(int Value) { TParaFormat Paragraph; GetAttributes(Paragraph); Paragraph.dwMask = PFM_TABSTOPS; Paragraph.cTabCount = (char) Value; SetAttributes(Paragraph); }
//--------------------------------------------------------------------------- // set or clear the protected state of the text // void __fastcall TTaeTextAttributes::SetProtected(bool Value) { TCharFormat Format; InitFormat(Format); Format.dwMask = CFM_PROTECTED; if (Value) Format.dwEffects = CFE_PROTECTED; SetAttributes(Format); }
//--------------------------------------------------------------------------- // set the nth tab position of the paragraph(s) in points (?) // void __fastcall TTaeParaAttributes::SetTab(BYTE Index, int Value) { TParaFormat Paragraph; GetAttributes(Paragraph); Paragraph.rgxTabs[Index] = Value * 20; Paragraph.dwMask = PFM_TABSTOPS; if (Paragraph.cTabCount < Index) Paragraph.cTabCount = Index; SetAttributes(Paragraph); }
//--------------------------------------------------------------------------- // set the text font by font name // void __fastcall TTaeTextAttributes::SetName(TFontName Value) { TCharFormat Format; InitFormat(Format); Format.dwMask = CFM_FACE; ::strncpy(Format.szFaceName, Value.c_str(), LF_FACESIZE); SetAttributes(Format); }
//--------------------------------------------------------------------------- // set the text color to the value (or auto-color if the value is the // same as normal text) // void __fastcall TTaeTextAttributes::SetColor(TColor Value) { TCharFormat Format; InitFormat(Format); Format.dwMask = CFM_COLOR; if (Value == clWindowText) Format.dwEffects = CFE_AUTOCOLOR; else Format.crTextColor = ColorToRGB(Value); SetAttributes(Format); }
int main(void) { Attributes attr; WORD result; printf("\f\t\tANSI Terminal Emulation Test\n"); printf( "\t\t============================\n\n\n"); setvbuf(stdin, NULL, _IONBF, 0); if ((result = GetAttributes(Heliosno(stdout), &attr)) < 0) { printf("Failed to get stdout attributes : %lx. Exiting.\n", result); exit((int)result); } printf("Window size : %d rows, %d columns.\n\n", attr.Min, attr.Time); rows = attr.Min; cols = attr.Time; AddAttribute(&attr, ConsoleRawOutput); RemoveAttribute(&attr, ConsolePause); RemoveAttribute(&attr, ConsoleEcho); if ((result = SetAttributes(Heliosno(stdout), &attr)) < 0) { printf("Failed to set stdout attributes : %lx. Exiting.\n", result); exit((int)result); } if ((result = GetAttributes(Heliosno(stdin), &attr)) < 0) { printf("Failed to get stdin attributes : %lx. Exiting.\n", result); exit((int)result); } AddAttribute(&attr, ConsoleRawInput); RemoveAttribute(&attr, ConsolePause); RemoveAttribute(&attr, ConsoleEcho); if ((result = SetAttributes(Heliosno(stdin), &attr)) < 0) { printf("Failed to set stdin attributes : %lx. Exiting.\n", result); exit((int) result); } wait_for_user(); main_menu(); printf("\r\n\n\n"); }
XMLEntity::XMLEntity(const char *name, const char **atts) { _parent = NULL; _children = new vector<XMLEntity *>; _name = strdup(name); _atts = NULL; _character_data = NULL; _is_complete = false; SetAttributes(atts); }
void Mesh::RenderArray(Primitive primitive, int index_count, const Attribute *format, int vertex_size, const void *vertices, const unsigned short *indices) { SetAttributes(0, format, vertex_size, reinterpret_cast<const char *>(vertices)); GL_CALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0)); auto gl_primitive = primitive == kLines ? GL_LINES : GL_TRIANGLES; GL_CALL( glDrawElements(gl_primitive, index_count, GL_UNSIGNED_SHORT, indices)); UnSetAttributes(format); }
//--------------------------------------------------------------------------- // set the style attributes of the text // // warning: I spent days trying to isolate a problem that turned out to be // in this method. the problem was with the original signature, // SetStyle(TFontStyles Value). Sets (TFontStyles is of type Set) // do not always correctly pass unless passed by reference? // // note that this is an inconsistent problem. elsewhere in this project, // passing sets by value works just fine. it may have something to do with // the way TFont works (TFont manages the font resource in a rather odd way). // void __fastcall TTaeTextAttributes::SetStyle(TFontStyles& Value) { TCharFormat Format; InitFormat(Format); Format.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT; if (Value.Contains(fsBold)) Format.dwEffects |= CFE_BOLD; if (Value.Contains(fsItalic)) Format.dwEffects |= CFE_ITALIC; if (Value.Contains(fsUnderline)) Format.dwEffects |= CFE_UNDERLINE; if (Value.Contains(fsStrikeOut)) Format.dwEffects |= CFE_STRIKEOUT; SetAttributes(Format); }
bool CPhotoManager::SetAllAttributes(bool bOn) { // This function sets the attributes for all the elements in the list PMELEMENTLIST::iterator itr; itr = m_ElementList.begin(); while (itr != m_ElementList.end()) { SetAttributes(*itr, bOn); itr++; } return true; }
/****************************************************** Name: console_control Input parameters: channel #, termios args Output parameters: - Description: Handle ioctl request *****************************************************/ rtems_device_driver console_control( rtems_device_major_number major, rtems_device_minor_number minor, void * arg ) { rtems_libio_ioctl_args_t *args = arg; if (args->command == RTEMS_IO_SET_ATTRIBUTES) SetAttributes (minor, (struct termios *)args->buffer); return rtems_termios_ioctl (arg); }
void Graphics::SetBuffers(bool solid, bool allowInstancing) { VertexBuffer* vBuffer = activeMesh_->GetVertexBuffer(); if (has_vertex_array_object_ext_ && !vBuffer->IsDynamic()) { auto vao = VertexArrayObj::GetOrCreate(VAOKey{allowInstancing, activeProgram_, activeMesh_, solid}); vao->Use(); } else { SetVertexBuffer(vBuffer); SetAttributes(nullptr); if (allowInstancing && activeProgram_->GetMaterial()->IsBatched() && !vBuffer->IsDynamic()) SetInstanceAttrPointers(activeProgram_); SetIndexBuffer(activeMesh_->GetIndexBuffer(solid)); } }
PUBLIC VOID ResetTerminal() { #ifdef SUN if ( TermMode != ORG_MODE ) { ioctl(0, TCSETS, &OrgMode); TermMode = ORG_MODE; } #endif #ifdef HELIOS if ( TermMode != ORG_MODE ) { SetAttributes( InputStream, &OrgAttributes ); TermMode = ORG_MODE; } #endif }
//--------------------------------------------------------------------------- // set the font pitch (default, fixed, or variable) // void __fastcall TTaeTextAttributes::SetPitch(TFontPitch Value) { TCharFormat Format; InitFormat(Format); switch (Value) { case fpVariable: Format.bPitchAndFamily = VARIABLE_PITCH; break; case fpFixed: Format.bPitchAndFamily = FIXED_PITCH; break; default: Format.bPitchAndFamily = DEFAULT_PITCH; break; } SetAttributes(Format); }
PUBLIC BYTE GetAKey() { BYTE c; #ifdef SUN if ( TermMode == ORG_MODE ) { CurMode.c_iflag &= ~ICRNL; CurMode.c_lflag &= ~(ICANON | ECHO); CurMode.c_cc[VTIME] = 0; CurMode.c_cc[VMIN] = 1; ioctl( 0, TCSETS, &CurMode ); TermMode = GET_MODE; } else if ( TermMode == POLL_MODE ) { CurMode.c_cc[VTIME] = 0; CurMode.c_cc[VMIN] = 1; ioctl( 0, TCSETS, &CurMode ); TermMode = GET_MODE; } (void)read(0, &c, 1); #endif #ifdef MSC c = getch(); #endif #ifdef HELIOS if ( TermMode == ORG_MODE ) { RemoveAttribute(&CurAttributes,ConsoleEcho); AddAttribute(&CurAttributes,ConsoleRawInput); SetAttributes(InputStream,&CurAttributes); TermMode = GET_MODE; } (void)Read(InputStream, &c, 1, -1); #endif #ifdef VMS (void)SYS$QIOW(0, InputChan, (IO$_READVBLK | IO$M_NOECHO | IO$M_NOFILTR ), &iosb_desc, 0, 0, &c, 1, 0, 0L, 0, 0); #endif return(c); }
//--------------------------------------------------------------------------- // set the numbering style for the paragraphs // void __fastcall TTaeParaAttributes::SetNumbering(TNumberingStyle Value) { TParaFormat Paragraph; switch (Value) { case nsBullet: if (LeftIndent < 10) LeftIndent = 10; break; case nsNone: LeftIndent = 0; break; } InitPara(Paragraph); Paragraph.dwMask = PFM_NUMBERING; Paragraph.wNumbering = Value; SetAttributes(Paragraph); }
int UDPSocket::Listen(unsigned short _port) { struct sockaddr_in sin; if (m_sock != INVALID_SOCKET) return CC_ERR_NOT_SOCKET; memset(&sin, 0, sizeof(sin)); sin.sin_family = PF_INET; sin.sin_addr.s_addr = INADDR_ANY; sin.sin_port = htons(_port); m_sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); if (m_sock == INVALID_SOCKET) return GetError(); SetAttributes(m_sock); #if 0 unsigned long arg = 1; #if defined (TARGET_OS_WINDOWS) ioctlsocket(m_sock, FIONBIO, &arg); #else ioctl(m_sock, FIONBIO, &arg); #endif #endif if (bind(m_sock, (sockaddr *)&sin, sizeof(sin)) != 0) { int err = GetError(); /* Close the connection, it failed. */ #ifdef TARGET_OS_WINDOWS closesocket(m_sock); #else close(m_sock); #endif return err; } return CC_ERR_NONE; }
void CItem::UpdateLastChange() { ZeroMemory(&m_lastChange, sizeof(m_lastChange)); if (GetType() == IT_DIRECTORY || GetType() == IT_FILE) { CString path = GetPath(); int i = path.ReverseFind(_T('\\')); CString basename = path.Mid(i + 1); CString pattern; pattern.Format(_T("%s\\..\\%s"), path, basename); CFileFindWDS finder; BOOL b = finder.FindFile(pattern); if (!b) return; // no chance finder.FindNextFile(); finder.GetLastWriteTime(&m_lastChange); SetAttributes(finder.GetAttributes()); } }
void Mesh::RenderStereo(Renderer &renderer, const Shader *shader, const vec4i *viewport, const mat4 *mvp, const vec3 *camera_position, bool ignore_material, size_t instances) { SetAttributes(vbo_, format_, static_cast<int>(vertex_size_), nullptr); for (auto it = indices_.begin(); it != indices_.end(); ++it) { if (!ignore_material) it->mat->Set(renderer); GL_CALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, it->ibo)); for (auto i = 0; i < 2; ++i) { renderer.set_camera_pos(camera_position[i]); renderer.set_model_view_projection(mvp[i]); shader->Set(renderer); auto vp = viewport[i]; glViewport(vp.x(), vp.y(), vp.z(), vp.w()); DrawElement(renderer, it->count, static_cast<int32_t>(instances)); } } UnSetAttributes(format_); }