BASIC

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Qedo

Pages: [1] 2 3 ... 11
1
2D-snippets / Re: C64-ize graphics
« on: 2019-Feb-11 »
Try with this file.

2
2D-snippets / Re: C64-ize graphics
« on: 2019-Feb-10 »
 Yes the file test.bmp is 24bit but inside there are only 16 colours.
Change the array to integer don't improve on my pc.

3
2D-snippets / Re: C64-ize graphics
« on: 2019-Feb-10 »
I enjoyed optimizing the no shader version.
On my pc 20 ms with standard programming

Code: GLBasic [Select]
SETFONT 0,2
GLOBAL pixels%[],id%=0
IF DOESFILEEXIST("test.png")
        LOADSPRITE "test.png",id
ENDIF
SPRITE2MEM (pixels[],id)
GETSPRITESIZE id, sx%, sy%
dtime% = GETTIMERALL()
C64ize()
MEM2SPRITE(pixels[],id,sx,sy)
dtime% = GETTIMERALL()-dtime%
DRAWSPRITE id,0,0
SAVESPRITE "test.bmp", id
PRINT dtime%,10,300
SHOWSCREEN
MOUSEWAIT
END

FUNCTION C64ize:
        // weighting of color components
LOCAL x%,y%,c%, r%,g%,b%, dr%,dg%,db%
LOCAL mindist, dist, ibest, i
LOCAL c64_pal[]
        DIMDATA c64_pal[], _
                        0x00    , 0x00  , 0x00, 0, _
                        0xff    , 0xff  , 0xff, 0, _
                        0x88    , 0x00  , 0x00, 0, _
                        0xaa    , 0xff  , 0xee, 0, _
                        0xcc    , 0x44  , 0xcc, 0, _
                        0x00    , 0xcc  , 0x55, 0, _
                        0x00    , 0x00  , 0xaa, 0, _
                        0xee    , 0xee  , 0x77, 0, _
                        0xdd    , 0x88  , 0x55, 0, _
                        0x66    , 0x44  , 0x00, 0, _
                        0xff    , 0x77  , 0x77, 0, _
                        0x33    , 0x33  , 0x33, 0, _
                        0x77    , 0x77  , 0x77, 0, _
                        0xaa    , 0xff  , 0x66, 0, _
                        0x00    , 0x88  , 0xff, 0, _
                        0xbb    , 0xbb  , 0xbb, 0

        FOR i=0 TO 15
                c64_pal[i*4+3] = RGB(c64_pal[i*4], c64_pal[i*4+1], c64_pal[i*4+2])
        NEXT

        FOR x=0 TO 319 STEP 2
                FOR y=0 TO 239
                                                ind=x+y*320
                        c = pixels[ind]
                                                c = BAND(c, 0xffffff)
                                            r=BAND(c, 0xff)/2
                                                g=BAND(ASR(c,8), 0xff)/2
                                                b=BAND(ASR(c,16), 0xff)/2
                        mindist=0
                        c = pixels[ind+1]
                                                c = BAND(c, 0xffffff)
                                            INC r,BAND(c, 0xff)/2
                                                INC g,BAND(ASR(c,8), 0xff)/2
                                                INC b,BAND(ASR(c,16), 0xff)/2
                        ibest=0
                        FOR i=0 TO 15
                                                                db=b - c64_pal[i*4+2]
                                                                dg=g - c64_pal[i*4+1]
                                                                dr=r - c64_pal[i*4  ]
                                dist=dr*dr+dg*dg+db*db
                                IF i=0 OR dist<mindist
                                        mindist=dist
                                        ibest=i
                                ENDIF
                        NEXT
                        fillcolour=BOR(c64_pal[ibest*4+3], ASL(255, 24))
                        pixels[ind]=fillcolour
                        pixels[ind+1]=fillcolour
                NEXT
        NEXT
ENDFUNCTION

 

4
Beta Tests / Re: Test 3D software
« on: 2019-Jan-29 »
I got 260 FPS

5
But you are sure? some examples?

6
But your commitment is welcome.
We always need to learn about the HTML world and understand how we GLB users can use it.
I thank you and I hope in your other projects.
HAPPY NEW YEAR TO EVERYONE

7
You did not understand, I'm saying the opposite and that GLB + HTLM5 works

8
In fact GLB + HTML5 works.
See this simple calculator for runners I wrote for testing

http://ebianchi.byethost32.com/STUFF/HTML5/MEDIA/media.html

HAPPY NEW YEAR TO EVERYONE

9
Great !!!

10
tried on win10 and it seems to work

11
while waiting debug try this workaround.

Code: GLBasic [Select]
f_fullscreen=TRUE
Nf_fullscreen=TRUE
CGLB_ON_RESUME=GETTIMERALL()

REPEAT
        IF Nf_fullscreen<>f_fullscreen
                f_fullscreen=Nf_fullscreen
                SETSCREEN 640, 480, f_fullscreen
                CGLB_ON_RESUME=GETTIMERALL()
        ENDIF
.......



........
UNTIL FALSE

SUB GLB_ON_PAUSE:
IF Nf_fullscreen=f_fullscreen
                CGLB_ON_RESUME=GETTIMERALL()-CGLB_ON_RESUME
                IF CGLB_ON_RESUME>1000
                        Nf_fullscreen=NOT Nf_fullscreen
                ENDIF
ENDIF
        CGLB_ON_RESUME=GETTIMERALL()

ENDSUB
SUB GLB_ON_RESUME:
IF Nf_fullscreen=f_fullscreen
                CGLB_ON_RESUME=GETTIMERALL()-CGLB_ON_RESUME
                IF CGLB_ON_RESUME>1000
                        Nf_fullscreen=NOT Nf_fullscreen
                ENDIF
ENDIF
CGLB_ON_RESUME=GETTIMERALL()
ENDSUB
 

12
ok now you often speak javascript and html but you noticed that from version GLB 12 onwards Html5 no longer works
The latest working version is GLBasic Version: 11.559
Is it only my problem?
Ciao

13
GLBasic - en / Re: Blur effect in real time
« on: 2018-Sep-22 »
I did not explain well.
I did not ask how to get the blur effect in real time but instead I showed how to get it.

14
GLBasic - en / Re: Blur effect in real time
« on: 2018-Sep-17 »
Did you try the program or saw the source?
Without using photoscop it does Glbasic

15
GLBasic - en / Blur effect in real time
« on: 2018-Sep-16 »
Blur effect in real time on sprite with transparent background (color 128,0,255).
Let me know.
Ciao


Pages: [1] 2 3 ... 11