*/}}
Browse Source

fixes, flush limit on android, menu f16 etc

YimingWu 2 months ago
parent
commit
59f5e9bb66
5 changed files with 15 additions and 8 deletions
  1. 2 1
      la_interface.h
  2. 3 1
      la_kernel.c
  3. 7 3
      la_tns_kernel.c
  4. 0 2
      resources/la_properties.c
  5. 3 1
      resources/la_widgets.c

+ 2 - 1
la_interface.h

@@ -816,7 +816,7 @@ STRUCTURE(laUiList){
     short HeightCoeff;
     char ScrollerShownV;
     char ScrollerShownH;
-    uint32_t IconID;
+    uint32_t Flags;
     int AllowScale;
     real Scale; real SaveScale;
 };
@@ -1229,6 +1229,7 @@ STRUCTURE(laWidget){
 #define LA_UI_COLLECTION_SIMPLE_SELECTOR LA_UI_FLAGS_CYCLE
 #define LA_UI_FLAGS_WARNING    (LA_UI_FLAGS_CYCLE)
 #define LA_TEXT_SHADOW         LA_UI_FLAGS_NO_OVERLAY
+#define LA_UI_FLAGS_MENU_FLOAT16 LA_UI_FLAGS_NO_SCROLL_INACTIVE
 
 #define LA_UI_FLAGS_INT_ICON  (LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT|LA_UI_FLAGS_ICON)
 #define LA_UI_FLAGS_PLAIN     (LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT)

+ 3 - 1
la_kernel.c

@@ -2614,6 +2614,7 @@ void la_PanelDrawToOffsceen(laPanel *p, laUiList *uil){
     if (p->OffScr){ tnsEnsureOffscreenStatus(p->OffScr, p->W,p->H); }
     else{
         int GLFormat=(p->PanelTemplate&&p->PanelTemplate->DefaultGLFormat)?p->PanelTemplate->DefaultGLFormat:LA_PANEL_DEFAULT_GL_FORMAT;
+        if(p->MenuRefer && (p->MenuRefer->Flags&LA_UI_FLAGS_MENU_FLOAT16)){ GLFormat=GL_RGBA16F; }
         p->OffScr = tnsCreate2DOffscreen(GLFormat, p->W, p->H, MAIN.PanelMultisample, 0,0);
     }
     tnsDrawToOffscreen(p->OffScr, 1, 0);
@@ -5300,7 +5301,8 @@ laUiList* laMakeMenuPageEx(laUiList* uil, laColumn* c, const char* Title, int fl
     ui->C = c;
     ui->Flags|=flags;
     lstAppendItem(&uil->UiItems, ui);
-
+    
+    muil->Flags|=flags;
     lstAppendItem(&ui->Subs, muil);
 
     return muil;

+ 7 - 3
la_tns_kernel.c

@@ -2435,6 +2435,10 @@ void tnsPackAs(GLenum Mode){
     nc->ColorBegin = nc->ColorEnd = c->ColorEnd;
     nc->TexCoordBegin = nc->TexCoordEnd = c->TexCoordEnd;
     nc->IndexBegin = nc->IndexEnd = c->IndexEnd;
+
+#ifdef LAGUI_ANDROID
+    if(T->NextVert > 255){ tnsFlush(); }
+#endif
 }
 void tnsFlush(){
     tnsShader *cs = T->CurrentShader;
@@ -2459,10 +2463,10 @@ void tnsFlush(){
     }
 
     for (int i=0;i<T->NextCommand;i++){ c=&T->DrawingCommand[i];
-        if (c->LineWidth!=T->SetLineWidth){ glLineWidth(c->LineWidth); T->SetLineWidth=c->LineWidth; }
-        if (c->PointSize!=T->SetPointSize){
+        if (c->LineWidth && c->LineWidth!=T->SetLineWidth){ glLineWidth(c->LineWidth); T->SetLineWidth=c->LineWidth; }
+        if (c->LineWidth && c->PointSize!=T->SetPointSize){
             glPointSize(c->PointSize); T->SetPointSize=c->PointSize;
-            }
+        }
         if (c->ReplaceShader && c->ReplaceShader != T->CurrentShader){
             tnsEnableShaderv(c->ReplaceShader); cs = c->ReplaceShader;
             if (!cs) continue;

+ 0 - 2
resources/la_properties.c

@@ -1943,8 +1943,6 @@ void la_RegisterInternalProps(){
 
             laAddIntProperty(p, "height_coeff", "Height Coefficiency", "How many rows a ui should take or reserve", 0,0,"Rows", 0,0,1, 0,0,offsetof(laUiList, HeightCoeff), 0,0,0,0,0,0,0,0,0,0,0)
                 ->ElementBytes = 2;
-            laAddIntProperty(p, "icon_id", "Icon ID", "Icon id for this ui list", 0,0,"#", 1800,32, 1, 0,0,offsetof(laUiList, IconID), 0,0,0,0,0,0,0,0,0,0,0)
-                ->ElementBytes = 2;
         }
         p = laAddPropertyContainer("ui_instance", "Instance", "Uilist instance entry", U'🗇', 0,sizeof(laColumn), 0,0,0);{
             //nothing needed

+ 3 - 1
resources/la_widgets.c

@@ -1254,6 +1254,8 @@ void la_ColorCircleDrawHCY(laUiItem *ui, int h){
 
     tnsFlush();
 
+    tnsUniformColorMode(T->immShader,1); tnsUniformHCYGamma(T->immShader,MAIN.ColorPickerGamma);
+
     int IsClay=ui->Flags&LA_UI_FLAGS_COLOR_SPACE_CLAY;
     int IsP3=ui->Flags&LA_UI_FLAGS_COLOR_SPACE_D65_P3;
     int ShowInfo=0;
@@ -1283,8 +1285,8 @@ void la_ColorCircleDrawHCY(laUiItem *ui, int h){
     tnsVertexArray2d(verts, 146);
     tnsPackAs(GL_TRIANGLE_STRIP);
 
-    tnsUniformColorMode(T->immShader,1); tnsUniformHCYGamma(T->immShader,MAIN.ColorPickerGamma);
     tnsFlush();
+    
     tnsUniformColorMode(T->immShader,0);
 
     tnsColor4dv(laThemeColor(bt,LA_BT_BORDER));