*/}}
Browse Source

copyright and optimizations

YimingWu 1 year ago
parent
commit
21427ae9b6
8 changed files with 61 additions and 8 deletions
  1. 15 0
      CMakeLists.txt
  2. 23 0
      README
  3. BIN
      default_brushes.udf
  4. 1 1
      ournodes.c
  5. 10 4
      ouroperations.c
  6. 1 1
      ourpaint.c
  7. 10 1
      ourpaint.h
  8. 1 1
      ourtranslations.c

+ 15 - 0
CMakeLists.txt

@@ -42,6 +42,21 @@ file(GLOB_RECURSE OurPaintFiles
 
 add_executable(OurPaint ${OurPaintFiles})
 
+execute_process(
+    COMMAND git rev-parse --abbrev-ref HEAD
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+    OUTPUT_VARIABLE OURPAINT_GIT_BRANCH
+	OUTPUT_STRIP_TRAILING_WHITESPACE)
+	
+execute_process(
+    COMMAND git rev-parse HEAD
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+    OUTPUT_VARIABLE OURPAINT_GIT_HASH
+	OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+target_compile_definitions(OurPaint PRIVATE "-DOURPAINT_GIT_BRANCH=\"${OURPAINT_GIT_BRANCH}\"")
+target_compile_definitions(OurPaint PRIVATE "-DOURPAINT_GIT_HASH=\"${OURPAINT_GIT_HASH}\"")
+
 target_link_libraries(OurPaint
     ${LAGUI_SHARED_LIBS}
     ${PNG_LIBRARY}

+ 23 - 0
README

@@ -0,0 +1,23 @@
+# 好得涂
+
+好得涂是一款绘画软件。
+
+版权所有 (C) 2022-2023 吴奕茗
+
+了解更多: https://ChengduLittleA.com/ourpaint
+
+好得涂 采用 GNU GPL v3 许可证,Noto 字体采用 SIL Open Font 许可证
+您将在源代码文件夹找到许可证的具体信息。
+
+-----------------
+
+# Our Paint
+
+Our Paint is a painting application.
+
+Copyright (C) 2022-2023 Wu Yiming
+
+Learn more about LaGUI: https://ChengduLittleA.com/lagui
+
+Our Paint is licensed with GNU GPL v3, and Noto fonts are licensed with SIL Open Font license.
+You should be able to find details about the license in the source code directory.

BIN
default_brushes.udf


+ 1 - 1
ournodes.c

@@ -1,6 +1,6 @@
 /*
 * Our Paint: A light weight GPU powered painting program.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 10 - 4
ouroperations.c

@@ -1,6 +1,6 @@
 /*
 * Our Paint: A light weight GPU powered painting program.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -371,6 +371,10 @@ void ourui_AboutVersion(laUiList *uil, laPropPack *This, laPropPack *DetachedPro
     gu = g->Page;{
         gc = laFirstColumn(gu); char buf[128]; sprintf(buf,"Our Paint %d.%d",OUR_VERSION_MAJOR,OUR_VERSION_MINOR);
         laShowLabel(gu,gc,buf,0,0)->Flags|=LA_TEXT_MONO;
+        laShowLabel(gu, gc, OURPAINT_GIT_BRANCH,0,0)->Flags|=LA_TEXT_MONO;
+#ifdef OURPAINT_GIT_HASH
+        laShowLabel(gu, gc, OURPAINT_GIT_HASH,0,0)->Flags|=LA_TEXT_MONO;
+#endif
         laShowLabel(gu, gc, "Single canvas implementation.", 0, 0)->Flags|=LA_TEXT_MONO|LA_TEXT_LINE_WRAP;
     }
 }
@@ -508,21 +512,23 @@ void our_CanvasDrawInit(laUiItem* ui){
     ocd->Base.AdaptiveLineWidth = 1;
     ocd->Base.ClearBackground = 1;
 
+    logPrintNew("Our Paint initialization:\n");
+
     int work_grp_cnt[3];
     glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 0, &work_grp_cnt[0]);
     glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 1, &work_grp_cnt[1]);
     glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 2, &work_grp_cnt[2]);
-    printf("max global (total) work group counts x:%i y:%i z:%i\n", work_grp_cnt[0], work_grp_cnt[1], work_grp_cnt[2]);
+    logPrint("GPU max global (total) work group counts x:%i y:%i z:%i\n", work_grp_cnt[0], work_grp_cnt[1], work_grp_cnt[2]);
 
     int work_grp_size[3];
     glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 0, &work_grp_size[0]);
     glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 1, &work_grp_size[1]);
     glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 2, &work_grp_size[2]);
-    printf("max local (in one shader) work group sizes x:%i y:%i z:%i\n", work_grp_size[0], work_grp_size[1], work_grp_size[2]);
+    logPrint("GPU max local (in one shader) work group sizes x:%i y:%i z:%i\n", work_grp_size[0], work_grp_size[1], work_grp_size[2]);
 
     int work_grp_inv;
     glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, &work_grp_inv);
-    printf("max local work group invocations %i\n", work_grp_inv);
+    logPrint("GPU max local work group invocations %i\n", work_grp_inv);
 }
 void our_CanvasDrawCanvas(laBoxedTheme *bt, OurPaint *unused_c, laUiItem* ui){
     OurCanvasDraw* ocd=ui->Extra; OurPaint* oc=ui->PP.EndInstance; laCanvasExtra*e=&ocd->Base;

+ 1 - 1
ourpaint.c

@@ -1,6 +1,6 @@
 /*
 * Our Paint: A light weight GPU powered painting program.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 10 - 1
ourpaint.h

@@ -1,6 +1,6 @@
 /*
 * Our Paint: A light weight GPU powered painting program.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -18,6 +18,15 @@
 
 #include "la_5.h"
 
+#ifndef OURPAINT_GIT_BRANCH
+#define OURPAINT_GIT_BRANCH "Release 1"
+#endif
+
+// No need to show hash when not compiled from git repo.
+//#ifndef OURPAINT_GIT_HASH
+//#define OURPAINT_GIT_HASH "?"
+//#endif
+
 extern unsigned char DATA_SPLASH[];
 extern unsigned char DATA_SPLASH_HIGHDPI[];
 

+ 1 - 1
ourtranslations.c

@@ -1,6 +1,6 @@
 /*
 * Our Paint: A light weight GPU powered painting program.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by