|
@@ -284,7 +284,10 @@ void ourui_ToolsPanel(laUiList *uil, laPropPack *This, laPropPack *DetachedProps
|
|
|
laShowItem(uil,c,0,"our.tool")->Flags|=LA_UI_FLAGS_EXPAND;
|
|
|
laUiItem* bt=laOnConditionThat(uil,c,laEqual(laPropExpression(0,"our.tool"),laIntExpression(OUR_TOOL_PAINT)));{
|
|
|
laUiItem* b=laOnConditionThat(uil,c,laPropExpression(&cb->PP,0));{
|
|
|
- laShowLabel(uil,cl,"Mode:",0,0);laShowItem(uil,cr,0,"our.erasing");
|
|
|
+ b1=laBeginRow(uil,c,1,0);
|
|
|
+ laShowItem(uil,c,0,"our.erasing"); laShowItem(uil,c,0,"our.brush_lock")->Flags|=LA_UI_FLAGS_EXPAND;
|
|
|
+ laEndRow(uil,b1);
|
|
|
+ laShowLabel(uil,c,"Brush Settings:",0,0);
|
|
|
laShowItem(uil,c,&cb->PP,"name");
|
|
|
laShowItem(uil,cl,&cb->PP,"use_nodes");
|
|
|
|
|
@@ -1627,6 +1630,7 @@ void our_PaintDoDabsWithSmudgeSegments(OurLayer* l,int tl, int tr, int tu, int t
|
|
|
|
|
|
glUseProgram(Our->CanvasProgram);
|
|
|
glUniform1i(Our->uBrushErasing,Our->Erasing);
|
|
|
+ glUniform1i(Our->uBrushLock,Our->BrushLock);
|
|
|
uniforms[Our->uBrushRoutineSelection]=Our->RoutineDoDabs;
|
|
|
uniforms[Our->uMixRoutineSelection]=Our->SpectralMode?Our->RoutineDoMixSpectral:Our->RoutineDoMixNormal;
|
|
|
glUniformSubroutinesuiv(GL_COMPUTE_SHADER,2,uniforms);
|
|
@@ -2625,6 +2629,7 @@ void ourui_ToolExtras(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColu
|
|
|
laColumn *c = laFirstColumn(uil);
|
|
|
laShowItemFull(uil,c,0,"our.tool",0,0,0,0)->Flags|=LA_UI_FLAGS_EXPAND|LA_UI_FLAGS_ICON;
|
|
|
laShowItemFull(uil,c,0,"our.erasing",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0);
|
|
|
+ laShowItem(uil,c,0,"our.brush_lock")->Flags|=LA_UI_FLAGS_EXPAND|LA_UI_FLAGS_ICON;
|
|
|
char str[100]; sprintf(str,"text=%s",MAIN.MenuProgramName);
|
|
|
laShowItemFull(uil,c,0,"OUR_show_splash",0,str,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_TOOLTIP|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
|
|
|
laShowSeparator(uil,c)->Expand=1;
|
|
@@ -2771,6 +2776,10 @@ void ourRegisterEverything(){
|
|
|
p=laAddEnumProperty(pc,"erasing","Erasing","Is in erasing mode",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0,0,offsetof(OurPaint,Erasing),0,0,0,0,0,0,0,0,0,0);
|
|
|
laAddEnumItemAs(p,"FALSE","Draw","Is drawing mode",0,0);
|
|
|
laAddEnumItemAs(p,"TRUE","Erase","Is erasing mode",1,0);
|
|
|
+ p=laAddEnumProperty(pc,"brush_lock","Lock values","Lock pixel values when applying brush dabs",0,0,0,0,0,offsetof(OurPaint,BrushLock),0,0,0,0,0,0,0,0,0,0);
|
|
|
+ laAddEnumItemAs(p,"NONE","Normal","Brush operates normally",0,U'🖌');
|
|
|
+ laAddEnumItemAs(p,"ALPHA","Alpha","Locks alpha channel",1,U'⮻');
|
|
|
+ laAddEnumItemAs(p,"TINT","Tint","Locks alpha channel and the brightness of the color",2,U'🌈');
|
|
|
p=laAddEnumProperty(pc, "brush_page","Brush Page","Show brushes in pages",0,0,0,0,0,offsetof(OurPaint,BrushPage),0,ourset_BrushPage,0,0,0,0,0,0,0,0);
|
|
|
laAddEnumItemAs(p,"ALL","~","Show all brushes",0,'~');
|
|
|
laAddEnumItemAs(p,"P1","1","Show brush page 1",1,'1');
|
|
@@ -3047,11 +3056,13 @@ int ourInit(){
|
|
|
|
|
|
Our->CanvasShader = glCreateShader(GL_COMPUTE_SHADER);
|
|
|
const GLchar* source1 = OUR_CANVAS_SHADER;
|
|
|
- glShaderSource(Our->CanvasShader, 1, &source1, NULL); glCompileShader(Our->CanvasShader);
|
|
|
+ char* UseContent=tnsEnsureShaderCommoms(source1,0,0);
|
|
|
+ glShaderSource(Our->CanvasShader, 1, &UseContent, NULL); glCompileShader(Our->CanvasShader);
|
|
|
glGetShaderiv(Our->CanvasShader, GL_COMPILE_STATUS, &status);
|
|
|
if (status == GL_FALSE){
|
|
|
glGetShaderInfoLog(Our->CanvasShader, sizeof(error), 0, error); printf("Canvas shader error:\n%s", error); glDeleteShader(Our->CanvasShader); return 0;
|
|
|
}
|
|
|
+ if(UseContent){ free(UseContent); }
|
|
|
|
|
|
Our->CanvasProgram = glCreateProgram();
|
|
|
glAttachShader(Our->CanvasProgram, Our->CanvasShader); glLinkProgram(Our->CanvasProgram);
|
|
@@ -3092,6 +3103,7 @@ int ourInit(){
|
|
|
Our->uBrushForce=glGetUniformLocation(Our->CanvasProgram,"uBrushForce");
|
|
|
Our->uBrushGunkyness=glGetUniformLocation(Our->CanvasProgram,"uBrushGunkyness");
|
|
|
Our->uBrushErasing=glGetUniformLocation(Our->CanvasProgram,"uBrushErasing");
|
|
|
+ Our->uBrushLock=glGetUniformLocation(Our->CanvasProgram,"uBrushLock");
|
|
|
|
|
|
Our->uBrushRoutineSelection=glGetSubroutineUniformLocation(Our->CanvasProgram, GL_COMPUTE_SHADER, "uBrushRoutineSelection");
|
|
|
Our->RoutineDoDabs=glGetSubroutineIndex(Our->CanvasProgram, GL_COMPUTE_SHADER, "DoDabs");
|