*/}}
YimingWu 5 ay önce
ebeveyn
işleme
b5441fa12f
2 değiştirilmiş dosya ile 7 ekleme ve 7 silme
  1. 2 2
      ouroperations.c
  2. 5 5
      ourshader.cpp

+ 2 - 2
ouroperations.c

@@ -1816,7 +1816,7 @@ int our_RenderThumbnail(uint8_t** buf, int* sizeof_buf){
     int bufsize=use_w*use_h*OUR_CANVAS_PIXEL_SIZE;
     Our->ImageBuffer=malloc(bufsize);
     tnsBindTexture(off->pColor[0]); glPixelStorei(GL_PACK_ALIGNMENT, 2);
-    tnsGet2DTextureSubImage(off->pColor[0], 0, 0, use_w, use_h, OUR_CANVAS_GL_FORMAT, OUR_CANVAS_DATA_FORMAT, bufsize, Our->ImageBuffer);
+    tnsGet2DTextureSubImage(off->pColor[0], 0, 0, use_w, use_h, GL_RGBA, GL_UNSIGNED_SHORT, bufsize, Our->ImageBuffer);
 
     tnsDrawToScreen();
     tnsDelete2DOffscreen(off);
@@ -2292,7 +2292,7 @@ int ourinv_Action(laOperator* a, laEvent* e){
     if(l->Hide || l->Transparency==1 || l->Lock || (l->AsSketch && Our->SketchMode==2)){ ex->HideBrushCircle=0; return LA_FINISHED; }
     Our->LockBackground=1; laNotifyUsers("our.lock_background");
     our_EnsureEraser(e->IsEraser);
-    //laHideCursor(); Our->ShowBrushName=0; Our->ShowBrushNumber=0;
+    laHideCursor(); Our->ShowBrushName=0; Our->ShowBrushNumber=0;
     return LA_RUNNING;
 }
 int ourmod_Paint(laOperator* a, laEvent* e){

+ 5 - 5
ourshader.cpp

@@ -69,14 +69,14 @@ uvec4 cpack(vec4 c){
 #define OurImageLoad(img, p) \
     (cunpack(imageLoad(img,p).x))
 #define OurImageStore(img, p, color) \
-    imageStore(img,p,cpack(color));
+    imageStore(img,p,cpack(color))
 
 #else
 
 #define OurImageLoad(img, p) \
     (vec4(imageLoad(img,p))/65535.)
 #define OurImageStore(img, p, color) \
-    imageStore(img,p,uvec4(color*65535.))
+    imageStore(img,p,uvec4(vec4(color)*65535.))
 
 #endif
 
@@ -169,7 +169,7 @@ float HEIGHT_CANVAS(float x,float y){
     return 1.;
 }
 float SampleCanvas(vec2 U, vec2 dir,float rfac, float force, float gunky){
-    if(uCanvasType==0 || abs(gunky-0.)<1.e-2){ return rfac; }
+    if(uCanvasType==0 || abs(gunky)<1.e-2){ return rfac; }
     U+=vec2(uImageOffset); U/=20.3; U.x=U.x+rand(U)/10.; U.y=U.y+rand(U)/10.;
 
     mat2 m = mat2(1.6,1.2,-1.2,1.6); vec2 _uv=U; _uv.x+=float(uCanvasRandom%65535)/174.41; _uv.y+=float(uCanvasRandom%65535)/439.87; _uv/=500.;
@@ -406,14 +406,14 @@ uint cpack(vec4 c){
 #define OurImageLoad(img, p) \
     (cunpack(imageLoad(img,p).x))
 #define OurImageStore(img, p, color) \
-    imageStore(img,p,uvec4(cpack(color)));
+    imageStore(img,p,cpack(color))
 
 #else
 
 #define OurImageLoad(img, p) \
     (vec4(imageLoad(img,p))/65535.)
 #define OurImageStore(img, p, color) \
-    imageStore(img,p,uvec4(color*65535.))
+    imageStore(img,p,uvec4(vec4(color)*65535.))
     
 #endif