|
@@ -3014,6 +3014,7 @@ void la_BlockDrawDropLocations(laBlock *b, int CH, real *BorderColor4dV, real *F
|
|
};
|
|
};
|
|
|
|
|
|
tnsUseNoTexture();
|
|
tnsUseNoTexture();
|
|
|
|
+ tnsLineWidth(LA_SEAM_W);
|
|
|
|
|
|
if (MAIN.CurrentWindow->CurrentLayout->DropToBlock == b){
|
|
if (MAIN.CurrentWindow->CurrentLayout->DropToBlock == b){
|
|
int Index[4];
|
|
int Index[4];
|
|
@@ -3050,9 +3051,8 @@ void la_BlockDrawDropLocations(laBlock *b, int CH, real *BorderColor4dV, real *F
|
|
tnsColor4dv(BorderColor4dV);
|
|
tnsColor4dv(BorderColor4dV);
|
|
tnsPackAs(GL_LINE_LOOP);
|
|
tnsPackAs(GL_LINE_LOOP);
|
|
|
|
|
|
- glLineWidth(LA_SEAM_W);
|
|
|
|
tnsFlush();
|
|
tnsFlush();
|
|
- glLineWidth(1);
|
|
|
|
|
|
+ tnsLineWidth(1);
|
|
}
|
|
}
|
|
void la_BlockDefDrawSelf(laBlock *b, int CH){
|
|
void la_BlockDefDrawSelf(laBlock *b, int CH){
|
|
laBoxedTheme *bt = _LA_THEME_TAB;
|
|
laBoxedTheme *bt = _LA_THEME_TAB;
|
|
@@ -5876,16 +5876,16 @@ void la_CalculateRowExpand(laRowInfo* ri, laUiItem* ui_end){
|
|
}
|
|
}
|
|
void la_RecordSocketRuntimePosition(laUiItem* ui){
|
|
void la_RecordSocketRuntimePosition(laUiItem* ui){
|
|
laProp* p=ui->PP.LastPs->p; laPropContainer* pc=la_EnsureSubTarget(p,0);
|
|
laProp* p=ui->PP.LastPs->p; laPropContainer* pc=la_EnsureSubTarget(p,0);
|
|
- int sl,sr,su,sb;
|
|
|
|
|
|
+ real sl,sr,su,sb;
|
|
if(ui->Flags&LA_UI_SOCKET_LABEL_N){ sl=ui->TL; sr=ui->TR; su=ui->TU+LA_RH; }
|
|
if(ui->Flags&LA_UI_SOCKET_LABEL_N){ sl=ui->TL; sr=ui->TR; su=ui->TU+LA_RH; }
|
|
elif(ui->Flags&LA_UI_SOCKET_LABEL_S){ sl=ui->TL; sr=ui->TR; su=ui->TU; }
|
|
elif(ui->Flags&LA_UI_SOCKET_LABEL_S){ sl=ui->TL; sr=ui->TR; su=ui->TU; }
|
|
elif(ui->Flags&LA_UI_SOCKET_LABEL_W){ sl=ui->TL+LA_2RH; sr=ui->TR; su=ui->TU; }
|
|
elif(ui->Flags&LA_UI_SOCKET_LABEL_W){ sl=ui->TL+LA_2RH; sr=ui->TR; su=ui->TU; }
|
|
elif(ui->Flags&LA_UI_SOCKET_LABEL_E){ sl=ui->TL; sr=ui->TR-LA_2RH; su=ui->TU; }
|
|
elif(ui->Flags&LA_UI_SOCKET_LABEL_E){ sl=ui->TL; sr=ui->TR-LA_2RH; su=ui->TU; }
|
|
else{ sl=ui->TL; su=ui->TU; sr=ui->TR; } sb=su+LA_RH;
|
|
else{ sl=ui->TL; su=ui->TU; sr=ui->TR; } sb=su+LA_RH;
|
|
if(pc==LA_PC_SOCKET_OUT){
|
|
if(pc==LA_PC_SOCKET_OUT){
|
|
- laNodeOutSocket* s=ui->PP.EndInstance; s->RuntimeX=(sl+sr)/2; s->RuntimeY=(su+sb)/2;
|
|
|
|
|
|
+ laNodeOutSocket* s=ui->PP.EndInstance; s->RuntimeX=(sl+sr)/2.0f; s->RuntimeY=(su+sb)/2.0f;
|
|
}else{
|
|
}else{
|
|
- laNodeInSocket* s=ui->PP.EndInstance; s->RuntimeX=(sl+sr)/2; s->RuntimeY=(su+sb)/2;
|
|
|
|
|
|
+ laNodeInSocket* s=ui->PP.EndInstance; s->RuntimeX=(sl+sr)/2.0f; s->RuntimeY=(su+sb)/2.0f;
|
|
laUseDataBlock(s, LA_PROP_SOCKET_SOURCE, MAIN.PropMatcherContextP->FrameDistinguish, MAIN.PropMatcherContextP, la_PropPanelUserRemover, 0);
|
|
laUseDataBlock(s, LA_PROP_SOCKET_SOURCE, MAIN.PropMatcherContextP->FrameDistinguish, MAIN.PropMatcherContextP, la_PropPanelUserRemover, 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -6084,6 +6084,9 @@ int la_UpdateUiListRecursive(laUiList *uil, int U, int L, int R, int B, int Fast
|
|
int CanGetTheme = laCanGetTheme(ui->PP.LastPs->p);laTheme* OriginalTheme=MAIN.CurrentTheme;
|
|
int CanGetTheme = laCanGetTheme(ui->PP.LastPs->p);laTheme* OriginalTheme=MAIN.CurrentTheme;
|
|
int CanGetGap= laCanGetGap(ui->PP.LastPs->p); int Gap=0;
|
|
int CanGetGap= laCanGetGap(ui->PP.LastPs->p); int Gap=0;
|
|
int CanGetCategory= laCanGetCategory(ui->PP.LastPs->p); char _cat[256]; char* cat=_cat; int GotCategory=0,FirstIn=1;
|
|
int CanGetCategory= laCanGetCategory(ui->PP.LastPs->p); char _cat[256]; char* cat=_cat; int GotCategory=0,FirstIn=1;
|
|
|
|
+ int BoxStyle=(*ui->Type->Theme)->BoxStyle; if(NoDecal) BoxStyle=0;
|
|
|
|
+ int MainDropOffset=BoxStyle>0?-LA_M:(BoxStyle<0?LA_M:0); Begin+=MainDropOffset;
|
|
|
|
+ int DropOffset=MainDropOffset;
|
|
|
|
|
|
if (!ElementLimit) RowPriority = 0;
|
|
if (!ElementLimit) RowPriority = 0;
|
|
|
|
|
|
@@ -6141,12 +6144,12 @@ int la_UpdateUiListRecursive(laUiList *uil, int U, int L, int R, int B, int Fast
|
|
la_AddInstancePage(ui, TInstance, 0); if(GotCategory){ strSafeSet(&ui->Page->TabName,cat); }
|
|
la_AddInstancePage(ui, TInstance, 0); if(GotCategory){ strSafeSet(&ui->Page->TabName,cat); }
|
|
la_CalcUiTopInfluence(&uil->Columns, ui);
|
|
la_CalcUiTopInfluence(&uil->Columns, ui);
|
|
if (Template) laMakeUiListFromTemplate(ui->Page, Template, &ParentPanel->PP, &ParentPanel->PropLinkPP, &ui->PP, 0, &uil->Columns, ui->TemplateContext);
|
|
if (Template) laMakeUiListFromTemplate(ui->Page, Template, &ParentPanel->PP, &ParentPanel->PropLinkPP, &ui->PP, 0, &uil->Columns, ui->TemplateContext);
|
|
- SubB = la_UpdateUiListRecursive(ui->Page, Gap+Begin, EL+(NoDecal?0:LA_M), ER-(NoDecal?0:LA_M), B, Fast, ParentPanel);
|
|
|
|
|
|
+ SubB = la_UpdateUiListRecursive(ui->Page, Gap+Begin, EL+(NoDecal?0:LA_M)+DropOffset, ER-(NoDecal?0:LA_M), B, Fast, ParentPanel);
|
|
ElementB = RowPriority ? (SubB > ElementB ? SubB : ElementB) : SubB;
|
|
ElementB = RowPriority ? (SubB > ElementB ? SubB : ElementB) : SubB;
|
|
iuil = ui->Page->Item.pNext;
|
|
iuil = ui->Page->Item.pNext;
|
|
}else{
|
|
}else{
|
|
la_CalcUiTopInfluence(&uil->Columns, ui); if(GotCategory){ strSafeSet(&iuil->TabName,cat); }
|
|
la_CalcUiTopInfluence(&uil->Columns, ui); if(GotCategory){ strSafeSet(&iuil->TabName,cat); }
|
|
- SubB = la_UpdateUiListRecursive(iuil, Gap+Begin, EL+(NoDecal?0:LA_M), ER-(NoDecal?0:LA_M), B, Fast, ParentPanel);
|
|
|
|
|
|
+ SubB = la_UpdateUiListRecursive(iuil, Gap+Begin, EL+(NoDecal?0:LA_M)+DropOffset, ER-(NoDecal?0:LA_M), B, Fast, ParentPanel);
|
|
ElementB = RowPriority ? (SubB > ElementB ? SubB : ElementB) : SubB;
|
|
ElementB = RowPriority ? (SubB > ElementB ? SubB : ElementB) : SubB;
|
|
la_CalcUiItemInfluence(&uil->Columns, ui);
|
|
la_CalcUiItemInfluence(&uil->Columns, ui);
|
|
iuil = iuil->Item.pNext;
|
|
iuil = iuil->Item.pNext;
|
|
@@ -6159,7 +6162,7 @@ int la_UpdateUiListRecursive(laUiList *uil, int U, int L, int R, int B, int Fast
|
|
if(CanGetTheme){ la_SwitchThemeQuick(0, OriginalTheme); }
|
|
if(CanGetTheme){ la_SwitchThemeQuick(0, OriginalTheme); }
|
|
|
|
|
|
if (RowPriority){
|
|
if (RowPriority){
|
|
- Col += 1;
|
|
|
|
|
|
+ Col += 1; DropOffset=0;
|
|
if (Col >= ElementLimit){
|
|
if (Col >= ElementLimit){
|
|
Col = 0;
|
|
Col = 0;
|
|
Row += 1;
|
|
Row += 1;
|
|
@@ -6179,7 +6182,7 @@ int la_UpdateUiListRecursive(laUiList *uil, int U, int L, int R, int B, int Fast
|
|
if (ElementLimit && Row >= ElementLimit){
|
|
if (ElementLimit && Row >= ElementLimit){
|
|
Row = 0;
|
|
Row = 0;
|
|
Col += 1;
|
|
Col += 1;
|
|
- Begin = ui->TU;
|
|
|
|
|
|
+ Begin = ui->TU+MainDropOffset;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ui->TB = ElementB;
|
|
ui->TB = ElementB;
|
|
@@ -6201,8 +6204,10 @@ int la_UpdateUiListRecursive(laUiList *uil, int U, int L, int R, int B, int Fast
|
|
if(!Template) Template=laui_SubPropInfoDefault;
|
|
if(!Template) Template=laui_SubPropInfoDefault;
|
|
//ui->Template = Template;
|
|
//ui->Template = Template;
|
|
int EraseWidth=(ui->Type == _LA_UI_COLLECTION_SELECTOR)?LA_RH:0;
|
|
int EraseWidth=(ui->Type == _LA_UI_COLLECTION_SELECTOR)?LA_RH:0;
|
|
- int TopPad = (ui->Type == _LA_UI_COLLECTION_SINGLE)?(NoDecal?0:LA_M):-LA_M;
|
|
|
|
- int SidePad = NoDecal?0:LA_M;
|
|
|
|
|
|
+ int BoxStyle=(*ui->Type->Theme)->BoxStyle;
|
|
|
|
+ int DropOffset=BoxStyle>0?-LA_M:(BoxStyle<0?LA_M:0);
|
|
|
|
+ int TopPad = (ui->Type == _LA_UI_COLLECTION_SINGLE)?(NoDecal?0:(LA_M+DropOffset)):(-LA_M+DropOffset);
|
|
|
|
+ int SidePad = NoDecal?0:(LA_M+DropOffset);
|
|
if (!ui->Subs.pFirst && TInstance){
|
|
if (!ui->Subs.pFirst && TInstance){
|
|
la_AddInstancePage(ui, TInstance, 0);
|
|
la_AddInstancePage(ui, TInstance, 0);
|
|
la_CalcUiTopInfluence(&uil->Columns, ui);
|
|
la_CalcUiTopInfluence(&uil->Columns, ui);
|
|
@@ -6244,10 +6249,13 @@ int la_UpdateUiListRecursive(laUiList *uil, int U, int L, int R, int B, int Fast
|
|
}else{
|
|
}else{
|
|
if (ui->Type != _LA_UI_COLLECTION && (ui->Subs.pFirst || ui->Page) && ui->Type != _LA_UI_MENU_ROOT){
|
|
if (ui->Type != _LA_UI_COLLECTION && (ui->Subs.pFirst || ui->Page) && ui->Type != _LA_UI_MENU_ROOT){
|
|
if (ui->Type != _LA_UI_CANVAS){
|
|
if (ui->Type != _LA_UI_CANVAS){
|
|
|
|
+ int BoxStyle=(*ui->Type->Theme)->BoxStyle;
|
|
|
|
+ int DropOffset=BoxStyle>0?-LA_M:(BoxStyle<0?LA_M:0);
|
|
int scrollw=ui->Page->ScrollerShownV?LA_M*2+LA_SCROLL_W:0;
|
|
int scrollw=ui->Page->ScrollerShownV?LA_M*2+LA_SCROLL_W:0;
|
|
la_CalcUiTopInfluence(&uil->Columns, ui); int first_in=((ui->Flags&LA_UI_FLAGS_PREFER_BOTTOM) && ui->Page->B==0);
|
|
la_CalcUiTopInfluence(&uil->Columns, ui); int first_in=((ui->Flags&LA_UI_FLAGS_PREFER_BOTTOM) && ui->Page->B==0);
|
|
SubB = la_UpdateUiListRecursive(ui->Page,
|
|
SubB = la_UpdateUiListRecursive(ui->Page,
|
|
- ui->TB + (ui->State == LA_UI_ACTIVE ? 0 : LA_RH)+(NoDecal?0:LA_M), ui->TL+(NoDecal?0:LA_M), ui->TR-(NoDecal?0:LA_M)-scrollw, B, Fast, ParentPanel);
|
|
|
|
|
|
+ ui->TB + (ui->State == LA_UI_ACTIVE ? 0 : LA_RH)+(NoDecal?0:(LA_M+DropOffset)),
|
|
|
|
+ ui->TL+(NoDecal?0:(LA_M+DropOffset)), ui->TR-(NoDecal?0:LA_M)-scrollw, B, Fast, ParentPanel);
|
|
ui->TB = (ui->Page->HeightCoeff > 0 ? ui->TU + ui->Page->HeightCoeff * LA_RH :
|
|
ui->TB = (ui->Page->HeightCoeff > 0 ? ui->TU + ui->Page->HeightCoeff * LA_RH :
|
|
(ui->Page->HeightCoeff < 0 ? B + (ui->Page->HeightCoeff+1) * LA_RH - (LA_M*2)+(ui->Page->HeightCoeff==-2?-LA_M:0) : SubB)) + (NoDecal?0:LA_M);
|
|
(ui->Page->HeightCoeff < 0 ? B + (ui->Page->HeightCoeff+1) * LA_RH - (LA_M*2)+(ui->Page->HeightCoeff==-2?-LA_M:0) : SubB)) + (NoDecal?0:LA_M);
|
|
ui->Page->LimH = ui->TB-ui->Page->TU - (NoDecal?0:LA_M);
|
|
ui->Page->LimH = ui->TB-ui->Page->TU - (NoDecal?0:LA_M);
|
|
@@ -6515,14 +6523,14 @@ void la_DrawUiListScrollerH(laUiList *uil, int DisplayOffset, int TotalW, int Di
|
|
}
|
|
}
|
|
void la_DrawInstanceBkg(laUiList *uil, real* color, int LP, int RP){
|
|
void la_DrawInstanceBkg(laUiList *uil, real* color, int LP, int RP){
|
|
tnsUseNoTexture(); tnsColor4dv(color);
|
|
tnsUseNoTexture(); tnsColor4dv(color);
|
|
- la_DrawBox(uil->L-LP,uil->R+RP,uil->U,uil->B);
|
|
|
|
|
|
+ la_DrawBox(uil->L-LP,uil->R+RP-1,uil->U,uil->B-1);
|
|
}
|
|
}
|
|
void la_InitSocketRecord(laUiListDraw* uild, laUiList* container){
|
|
void la_InitSocketRecord(laUiListDraw* uild, laUiList* container){
|
|
laSocketRecord* sr;
|
|
laSocketRecord* sr;
|
|
while(sr=lstPopItem(&uild->SocketRecord)){ memFree(sr); }
|
|
while(sr=lstPopItem(&uild->SocketRecord)){ memFree(sr); }
|
|
uild->WiresContainer=container;
|
|
uild->WiresContainer=container;
|
|
}
|
|
}
|
|
-void la_GetUiListOffsetUntil(laUiListDraw* uild, int* X, int* Y){
|
|
|
|
|
|
+void la_GetUiListOffsetUntil(laUiListDraw* uild, real* X, real* Y){
|
|
*X=*Y=0; for(laUiListDrawItem* lip=uild->Items.pLast;lip&&lip->Target;lip=lip->Item.pPrev){
|
|
*X=*Y=0; for(laUiListDrawItem* lip=uild->Items.pLast;lip&&lip->Target;lip=lip->Item.pPrev){
|
|
if(lip->Target==uild->WiresContainer) break;
|
|
if(lip->Target==uild->WiresContainer) break;
|
|
laUiList* uil=lip->Target; *X+=uil->PanX; *Y+=uil->PanY;
|
|
laUiList* uil=lip->Target; *X+=uil->PanX; *Y+=uil->PanY;
|
|
@@ -6530,7 +6538,6 @@ void la_GetUiListOffsetUntil(laUiListDraw* uild, int* X, int* Y){
|
|
}
|
|
}
|
|
void la_RecordSocket(laUiListDraw* uild, laUiList* uil, laUiItem* ui){
|
|
void la_RecordSocket(laUiListDraw* uild, laUiList* uil, laUiItem* ui){
|
|
laProp* p=ui->PP.LastPs->p; laPropContainer* pc=la_EnsureSubTarget(p,0);
|
|
laProp* p=ui->PP.LastPs->p; laPropContainer* pc=la_EnsureSubTarget(p,0);
|
|
- int PanX, PanY;
|
|
|
|
if(pc==LA_PC_SOCKET_OUT){
|
|
if(pc==LA_PC_SOCKET_OUT){
|
|
laNodeOutSocket* s=ui->PP.EndInstance;
|
|
laNodeOutSocket* s=ui->PP.EndInstance;
|
|
la_GetUiListOffsetUntil(uild, &s->RuntimePX, &s->RuntimePY);
|
|
la_GetUiListOffsetUntil(uild, &s->RuntimePX, &s->RuntimePY);
|
|
@@ -6550,7 +6557,7 @@ void la_RegenerateWireColors(){
|
|
tnsHSL2RGB(hsl, &MAIN.WireColorCache[i*4]); MAIN.WireColorCache[i*4+3]=t->WireTransparency;
|
|
tnsHSL2RGB(hsl, &MAIN.WireColorCache[i*4]); MAIN.WireColorCache[i*4+3]=t->WireTransparency;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-void la_SendWireVerts(real x1, real y1, real x2, real y2, real circle_r){
|
|
|
|
|
|
+void la_SendWireVerts(real x1, real y1, real x2, real y2, real circle_r, real line_width){
|
|
tnsVector2d v1,vi,v2,v1s,v2s; real dist=0;
|
|
tnsVector2d v1,vi,v2,v1s,v2s; real dist=0;
|
|
v1[0]=x1; v1[1]=y1; v2[0]=x2; v2[1]=y2;
|
|
v1[0]=x1; v1[1]=y1; v2[0]=x2; v2[1]=y2;
|
|
tnsInterpolate2dv(v1,v2,0.5,vi);
|
|
tnsInterpolate2dv(v1,v2,0.5,vi);
|
|
@@ -6559,15 +6566,39 @@ void la_SendWireVerts(real x1, real y1, real x2, real y2, real circle_r){
|
|
tnsVectorMinus2d(v2s,vi,v2); if(tnsLength2d(v2s)<1e-3){ v2s[0]=1; v2s[1]=0; }else{ tnsNormalizeSelf2d(v2s); } tnsVectorMultiSelf2d(v2s,circle_r);
|
|
tnsVectorMinus2d(v2s,vi,v2); if(tnsLength2d(v2s)<1e-3){ v2s[0]=1; v2s[1]=0; }else{ tnsNormalizeSelf2d(v2s); } tnsVectorMultiSelf2d(v2s,circle_r);
|
|
tnsVectorAccum2d(v1, v1s); tnsVectorAccum2d(v2, v2s);
|
|
tnsVectorAccum2d(v1, v1s); tnsVectorAccum2d(v2, v2s);
|
|
|
|
|
|
- if(MAIN.WireSaggyness<0.01){ tnsVertex2d(v1[0],v1[1]); tnsVertex2d(v2[0],v2[1]); return; }
|
|
|
|
|
|
+ //if(MAIN.WireSaggyness<0.01){ tnsVertex2d(v1[0],v1[1]); tnsVertex2d(v2[0],v2[1]); return; }
|
|
|
|
|
|
int seglen=3, steps=dist/seglen+1; real step=1.0f/steps;
|
|
int seglen=3, steps=dist/seglen+1; real step=1.0f/steps;
|
|
- tnsVertex2d(v1[0],v1[1]);
|
|
|
|
|
|
+ real* middle=malloc(sizeof(real)*2*(steps+1));
|
|
|
|
+ real* normal=malloc(sizeof(real)*2*(steps+1));
|
|
|
|
+ real* final=malloc(sizeof(real)*4*(steps+1));
|
|
|
|
+ real tangent[2];
|
|
|
|
+
|
|
|
|
+ tnsVectorSet2v(&middle[0],v1);
|
|
for(int i=1;i<=steps;i++){
|
|
for(int i=1;i<=steps;i++){
|
|
real ratio=i==steps?1.0f:step*i;
|
|
real ratio=i==steps?1.0f:step*i;
|
|
tnsInterpolateTripple2d(v1,vi,v2,ratio, v1s);
|
|
tnsInterpolateTripple2d(v1,vi,v2,ratio, v1s);
|
|
- tnsVertex2d(v1s[0],v1s[1]);
|
|
|
|
- }
|
|
|
|
|
|
+ tnsVectorSet2v(&middle[i*2],v1s);
|
|
|
|
+ }
|
|
|
|
+ for(int i=1;i<steps;i++){
|
|
|
|
+ tnsVectorMinus2d(tangent,&middle[(i+1)*2],&middle[(i-1)*2]);
|
|
|
|
+ LA_SWAP(real,tangent[0],tangent[1]); tangent[1]*=-1; tnsNormalizeSelf2d(tangent);
|
|
|
|
+ tnsVectorSet2v(&normal[i*2],tangent);
|
|
|
|
+ }
|
|
|
|
+ tnsVectorMinus2d(tangent,&middle[2],&middle[0]);
|
|
|
|
+ LA_SWAP(real,tangent[0],tangent[1]); tangent[1]*=-1; tnsNormalizeSelf2d(tangent);
|
|
|
|
+ tnsVectorSet2v(&normal[0],tangent);
|
|
|
|
+ tnsVectorMinus2d(tangent,&middle[steps*2],&middle[(steps-1)*2]);
|
|
|
|
+ LA_SWAP(real,tangent[0],tangent[1]); tangent[1]*=-1; tnsNormalizeSelf2d(tangent);
|
|
|
|
+ tnsVectorSet2v(&normal[steps*2],tangent);
|
|
|
|
+ real th=line_width;
|
|
|
|
+ for(int i=0;i<=steps;i++){
|
|
|
|
+ final[i*4]= middle[i*2] +normal[i*2] *th;
|
|
|
|
+ final[i*4+1]=middle[i*2+1]+normal[i*2+1]*th;
|
|
|
|
+ final[i*4+2]=middle[i*2] -normal[i*2] *th;
|
|
|
|
+ final[i*4+3]=middle[i*2+1]-normal[i*2+1]*th;
|
|
|
|
+ }
|
|
|
|
+ tnsVertexArray2d(final,(steps+1)*2); tnsPackAs(GL_TRIANGLE_STRIP);
|
|
}
|
|
}
|
|
void la_DrawNodeWires(laUiListDraw* uild){
|
|
void la_DrawNodeWires(laUiListDraw* uild){
|
|
if(!uild->SocketRecord.pFirst && !MAIN.tNodeIn->Source){ return; }
|
|
if(!uild->SocketRecord.pFirst && !MAIN.tNodeIn->Source){ return; }
|
|
@@ -6575,12 +6606,12 @@ void la_DrawNodeWires(laUiListDraw* uild){
|
|
|
|
|
|
tnsUseNoTexture();
|
|
tnsUseNoTexture();
|
|
#define _RSLICES 16
|
|
#define _RSLICES 16
|
|
- real v[_RSLICES*4]; int idx[_RSLICES*2+2]; real r=LA_RH2/TNS_MAX2(uild->WiresContainer->Scale,1);
|
|
|
|
|
|
+ real v[_RSLICES*4]; int idx[_RSLICES*2+2]; real r=LA_RH/2.0f/TNS_MAX2(uild->WiresContainer->Scale,1);
|
|
for(laSocketRecord*sr=uild->SocketRecord.pFirst;sr;sr=sr->Item.pNext){
|
|
for(laSocketRecord*sr=uild->SocketRecord.pFirst;sr;sr=sr->Item.pNext){
|
|
int cid=sr->In->ColorId%MAIN.WireColorSlices*4;
|
|
int cid=sr->In->ColorId%MAIN.WireColorSlices*4;
|
|
|
|
|
|
- int inx=sr->In->RuntimeX+sr->In->RuntimePX, iny=sr->In->RuntimeY+sr->In->RuntimePY;
|
|
|
|
- int outx=sr->Out->RuntimeX+sr->Out->RuntimePX, outy=sr->Out->RuntimeY+sr->Out->RuntimePY;
|
|
|
|
|
|
+ real inx=sr->In->RuntimeX+sr->In->RuntimePX, iny=sr->In->RuntimeY+sr->In->RuntimePY;
|
|
|
|
+ real outx=sr->Out->RuntimeX+sr->Out->RuntimePX, outy=sr->Out->RuntimeY+sr->Out->RuntimePY;
|
|
if(sr->Out==MAIN.tNodeOut){ outx=inx+MAIN.tNodeOut->RuntimeX+MAIN.tNodeOut->RuntimePX; outy=iny+MAIN.tNodeOut->RuntimeY+MAIN.tNodeOut->RuntimePY; }
|
|
if(sr->Out==MAIN.tNodeOut){ outx=inx+MAIN.tNodeOut->RuntimeX+MAIN.tNodeOut->RuntimePX; outy=iny+MAIN.tNodeOut->RuntimeY+MAIN.tNodeOut->RuntimePY; }
|
|
|
|
|
|
tnsMakeRing2d(v,idx,_RSLICES, inx, iny, r, r*0.6);
|
|
tnsMakeRing2d(v,idx,_RSLICES, inx, iny, r, r*0.6);
|
|
@@ -6595,8 +6626,8 @@ void la_DrawNodeWires(laUiListDraw* uild){
|
|
laNodeInSocket* ins=MAIN.tNodeIn; laNodeOutSocket* outs=ins->Source;
|
|
laNodeInSocket* ins=MAIN.tNodeIn; laNodeOutSocket* outs=ins->Source;
|
|
int cid=ins->ColorId%MAIN.WireColorSlices*4;
|
|
int cid=ins->ColorId%MAIN.WireColorSlices*4;
|
|
|
|
|
|
- int outx=outs->RuntimeX+outs->RuntimePX, outy=outs->RuntimeY+outs->RuntimePY;
|
|
|
|
- int inx=ins->RuntimeX+ins->RuntimePX+outx, iny=ins->RuntimeY+ins->RuntimePY+outy;
|
|
|
|
|
|
+ real outx=outs->RuntimeX+outs->RuntimePX, outy=outs->RuntimeY+outs->RuntimePY;
|
|
|
|
+ real inx=ins->RuntimeX+ins->RuntimePX+outx, iny=ins->RuntimeY+ins->RuntimePY+outy;
|
|
|
|
|
|
tnsMakeRing2d(v,idx,_RSLICES, inx, iny, r, r*0.6);
|
|
tnsMakeRing2d(v,idx,_RSLICES, inx, iny, r, r*0.6);
|
|
tnsVertexArray2d(v,_RSLICES*2); tnsIndexArray(idx, _RSLICES*2+2);
|
|
tnsVertexArray2d(v,_RSLICES*2); tnsIndexArray(idx, _RSLICES*2+2);
|
|
@@ -6610,28 +6641,26 @@ void la_DrawNodeWires(laUiListDraw* uild){
|
|
tnsFlush();
|
|
tnsFlush();
|
|
|
|
|
|
int ww=MAIN.WireThickness*TNS_MIN2(uild->WiresContainer->Scale,1);
|
|
int ww=MAIN.WireThickness*TNS_MIN2(uild->WiresContainer->Scale,1);
|
|
- glLineWidth(ww);
|
|
|
|
for(laSocketRecord*sr=uild->SocketRecord.pFirst;sr;sr=sr->Item.pNext){
|
|
for(laSocketRecord*sr=uild->SocketRecord.pFirst;sr;sr=sr->Item.pNext){
|
|
int cid=sr->In->ColorId%MAIN.WireColorSlices*4;
|
|
int cid=sr->In->ColorId%MAIN.WireColorSlices*4;
|
|
- int inx=sr->In->RuntimeX+sr->In->RuntimePX, iny=sr->In->RuntimeY+sr->In->RuntimePY;
|
|
|
|
- int outx=sr->Out->RuntimeX+sr->Out->RuntimePX, outy=sr->Out->RuntimeY+sr->Out->RuntimePY;
|
|
|
|
|
|
+ real inx=sr->In->RuntimeX+sr->In->RuntimePX, iny=sr->In->RuntimeY+sr->In->RuntimePY;
|
|
|
|
+ real outx=sr->Out->RuntimeX+sr->Out->RuntimePX, outy=sr->Out->RuntimeY+sr->Out->RuntimePY;
|
|
if(sr->Out==MAIN.tNodeOut){ outx=inx+MAIN.tNodeOut->RuntimeX+MAIN.tNodeOut->RuntimePX; outy=iny+MAIN.tNodeOut->RuntimeY+MAIN.tNodeOut->RuntimePY; }
|
|
if(sr->Out==MAIN.tNodeOut){ outx=inx+MAIN.tNodeOut->RuntimeX+MAIN.tNodeOut->RuntimePX; outy=iny+MAIN.tNodeOut->RuntimeY+MAIN.tNodeOut->RuntimePY; }
|
|
|
|
|
|
- la_SendWireVerts(inx, iny, outx, outy, r*0.9);
|
|
|
|
- tnsColor4dv(&MAIN.WireColorCache[cid]); tnsPackAs(GL_LINE_STRIP);
|
|
|
|
|
|
+ tnsColor4dv(&MAIN.WireColorCache[cid]);
|
|
|
|
+ la_SendWireVerts(inx, iny, outx, outy, r*0.9, ww);
|
|
}
|
|
}
|
|
if(MAIN.tNodeIn->Source){
|
|
if(MAIN.tNodeIn->Source){
|
|
laNodeInSocket* ins=MAIN.tNodeIn; laNodeOutSocket* outs=ins->Source;
|
|
laNodeInSocket* ins=MAIN.tNodeIn; laNodeOutSocket* outs=ins->Source;
|
|
int cid=ins->ColorId%MAIN.WireColorSlices*4;
|
|
int cid=ins->ColorId%MAIN.WireColorSlices*4;
|
|
|
|
|
|
- int outx=outs->RuntimeX+outs->RuntimePX, outy=outs->RuntimeY+outs->RuntimePY;
|
|
|
|
- int inx=ins->RuntimeX+ins->RuntimePX+outx, iny=ins->RuntimeY+ins->RuntimePY+outy;
|
|
|
|
|
|
+ real outx=outs->RuntimeX+outs->RuntimePX, outy=outs->RuntimeY+outs->RuntimePY;
|
|
|
|
+ real inx=ins->RuntimeX+ins->RuntimePX+outx, iny=ins->RuntimeY+ins->RuntimePY+outy;
|
|
|
|
|
|
- la_SendWireVerts(inx, iny, outx, outy, r*0.9);
|
|
|
|
- tnsColor4dv(&MAIN.WireColorCache[cid]); tnsPackAs(GL_LINE_STRIP);
|
|
|
|
|
|
+ tnsColor4dv(&MAIN.WireColorCache[cid]);
|
|
|
|
+ la_SendWireVerts(inx, iny, outx, outy, r*0.9, ww);
|
|
}
|
|
}
|
|
tnsFlush();
|
|
tnsFlush();
|
|
- glLineWidth(1);
|
|
|
|
|
|
|
|
la_InitSocketRecord(uild,0);
|
|
la_InitSocketRecord(uild,0);
|
|
}
|
|
}
|
|
@@ -6644,7 +6673,7 @@ int la_DrawUiListRecursive(laUiListDraw *uild, laUiList *uil, int L, int R, int
|
|
laBoxedTheme *bt;
|
|
laBoxedTheme *bt;
|
|
laUiList *sub;
|
|
laUiList *sub;
|
|
laUiListDrawItem *uildi;
|
|
laUiListDrawItem *uildi;
|
|
- int Ret = 0;
|
|
|
|
|
|
+ int Ret = 0, failed_matrix=0;
|
|
|
|
|
|
if (!uil) return 0;
|
|
if (!uil) return 0;
|
|
|
|
|
|
@@ -6652,7 +6681,9 @@ int la_DrawUiListRecursive(laUiListDraw *uild, laUiList *uil, int L, int R, int
|
|
|
|
|
|
ui = uil->UiItems.pFirst;
|
|
ui = uil->UiItems.pFirst;
|
|
if(uil->PanY<0){uil->PanY=0;}
|
|
if(uil->PanY<0){uil->PanY=0;}
|
|
- if (!la_SetUpUiListMatrix(uild, uil, L, R, LimH, B - U)) return 0;
|
|
|
|
|
|
+ if (!la_SetUpUiListMatrix(uild, uil, L, R-1, LimH, B - U)){
|
|
|
|
+ if(RegisterNodes){ failed_matrix=1; }else{ return 0; }
|
|
|
|
+ }
|
|
|
|
|
|
uil->SaveScale=MAIN.UiScale;
|
|
uil->SaveScale=MAIN.UiScale;
|
|
MAIN.UiScale*=uil->Scale;
|
|
MAIN.UiScale*=uil->Scale;
|
|
@@ -6697,7 +6728,7 @@ int la_DrawUiListRecursive(laUiListDraw *uild, laUiList *uil, int L, int R, int
|
|
if (ui->AnimationDistinguish != MAIN.CurrentPanel->FrameDistinguish) Ret = 1;
|
|
if (ui->AnimationDistinguish != MAIN.CurrentPanel->FrameDistinguish) Ret = 1;
|
|
|
|
|
|
int NeedDraw=0;
|
|
int NeedDraw=0;
|
|
- if (la_UiInBoundEx(ui, uild)){ NeedDraw=1; }
|
|
|
|
|
|
+ if (la_UiInBoundEx(ui, uild) && !failed_matrix){ NeedDraw=1; }
|
|
|
|
|
|
if(NeedDraw){
|
|
if(NeedDraw){
|
|
if (!ui->Type->Draw){ la_DrawEmptyUiItem(ui); tnsFlush();
|
|
if (!ui->Type->Draw){ la_DrawEmptyUiItem(ui); tnsFlush();
|
|
@@ -6816,7 +6847,9 @@ int la_DrawUiListRecursive(laUiListDraw *uild, laUiList *uil, int L, int R, int
|
|
|
|
|
|
if(uild->WiresContainer == uil){ la_DrawNodeWires(uild); }
|
|
if(uild->WiresContainer == uil){ la_DrawNodeWires(uild); }
|
|
|
|
|
|
- la_RestoreLastUiListMatrix(uild, B - U);
|
|
|
|
|
|
+ if(!failed_matrix){
|
|
|
|
+ la_RestoreLastUiListMatrix(uild, B - U);
|
|
|
|
+ }
|
|
|
|
|
|
MAIN.UiScale=uil->SaveScale;
|
|
MAIN.UiScale=uil->SaveScale;
|
|
MAIN.ScaledUiRowHeight=MAIN.UiRowHeight*MAIN.UiScale;
|
|
MAIN.ScaledUiRowHeight=MAIN.UiRowHeight*MAIN.UiScale;
|