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 - Kitty Hello

Pages: [1] 2 3 ... 699
1
GLBasic - en / Re: Android Studio new beta
« on: 2020-Mar-26 »
Is the link in 1st post the most current one? I'll try to merge and release it then.

2
Announcements / Re: The Outhouse
« on: 2020-Mar-26 »
I'm amazed by what you do with a few pixels. Everything you touch starts to bloom.
Great work.
For the controls - that's always very tricks - move and shoot in another direction. Too much for me.
I'd prefer mouse movment, and when you hold the button, you can aim in a fire direction with the mouse - but hey, I'm not a good gamer ;)

3
GLBasic - en / Re: X_SPRITE scaling
« on: 2020-Mar-26 »
IIRC - it's quite some time - the top coordinate for X_SPRITE is the top center of the sprite. Sort of - like the 2D SPRITE commands, but X centered.

4
GLBasic - en / Re: water effect
« on: 2020-Mar-26 »
Cool thing. Are you planning anything where you willl use this?

5
GLBasic - en / Re: usb serial on Android?
« on: 2020-Feb-25 »
Do the serial port commands somewhere on te forum work? Otherwise, there is an Bluetooth library, that might be more "state of the art"?

6
GLBasic - en / Re: Compiling to html5?
« on: 2020-Feb-11 »
Yes. Do the installers still exist?

7
Announcements / Re: 2600 shooter
« on: 2019-Dec-31 »
cool. Someone on retroremakes once wrote an algorithm to create space invaders-style pixel images. But I can't find it anymore...

8
GLBasic - en / Re: How to create UTF-8 file?
« on: 2019-Dec-31 »
I think, the TTF routines should go into GLBasic directly, and then we might be able to render TTF fonts using UTF-8 charset. But it's quite some work. Alternatively we might add a TTF library wrapper...

9
GLBasic - en / Re: console program - on exit?
« on: 2019-Dec-10 »
Here's a minimal example that works for me. It might NOT work for x64 builds, yet. The problem is the atexit(int) argument.
Code: (glbasic) [Select]
IMPORT "C" void atexit(int)

atexit(ADDRESSOF(OnConsoleExit))


FUNCTION OnConsoleExit%:
STDOUT "Wohoo\n"
KEYWAIT
ENDSUB


10
GLBasic - en / Re: How to create UTF-8 file?
« on: 2019-Dec-10 »
Sorry for the delay ;)
I wrote a tiny library that can convert to/from utf-8:
http://www.glbasic.com/forum/index.php?topic=11367.0

11
Code Snippets / UTF-8 (UTF8) utilities
« on: 2019-Dec-10 »
Here's how to deal with UTF-8 strings in GLBasic. It can convert to and from ISO 8895-1 (Latin-1), so you can "PRINT" UTF-8 strings, and write UTF-8 file from latin encodings.
Code: (glbasic) [Select]
// --------------------------------- //
// Project: UTF8- Routines
// --------------------------------- //

//! Copyvert an ansi text with codepage latin-1 (ISO 8895-1) to a UTF-8 string.
//! Prefix the UTF8_BOM$() at the start of a file when you write it to disk.
FUNCTION UTF8_fromLatin1$: latin2$
LOCAL out$
// https://stackoverflow.com/a/7904190/2721136
FOR i% = 0 TO LEN(latin2$)-1
// https://de.wikipedia.org/wiki/ISO_8859-1
LOCAL cha = ASC(latin2$, i)
IF cha < 0x80
INC out$, CHR$(cha)
ELSE
// all 11 bit codepoints (0x0 -- 0x7ff)
// fit within a 2byte utf8 char
// firstbyte = 110 +xxxxx := 0xc0 + (char>>6) MSB
// second    = 10 +xxxxxx := 0x80 + (char& 63) LSB
INC out$,  CHR$(bOR(0xc0, bAND(ASR(cha,6), 0x1f))) // 2+1+5 bits
INC out$,  CHR$(bOR(0x80, bAND(cha, 0x3f))) // 1+1+6 bits
ENDIF
NEXT

RETURN out$
ENDFUNCTION

INLINE
void Latin8FromUtf8(char* str, int slen) {
    int i = 0;

    char* dest = str;

    const char* pStrC = str;
    const char* pEnd = str + slen;
    // *pStrC != '\0' &&
    while(pStrC < pEnd) {
        const wchar_t c = wchar_t(static_cast<unsigned char>(*pStrC++));

        // U-0 to U-7F
        if((c & 0x80) == 0x00) {
            *dest++=char(c);
            continue;
        }
        // U-80 to U-7FF
        if((c & 0xE0) == 0xC0) {
            if(i<slen) {
                wchar_t d = static_cast<wchar_t>(*pStrC++);
                *dest++=(char((c&0x1f)<<6 | (d&0x3f)));
                continue;
            }
        }

        // U-800 to U-FFFF
        if((c & 0xF0) == 0xE0) {
            if(i+1<slen) {
                const wchar_t d = static_cast<wchar_t>(*pStrC++);
                const wchar_t e = static_cast<wchar_t>(*pStrC++);
                *dest++=(char((c&0x0f)<<12 | (d&0x3f)<<6 | (e&0x3f)));
                continue;
            }
        }
        // three continuation (U-10000 to U-10ffff)
        if((c & 0xF8) == 0xF0) {
            if(i+2<slen) {
                const wchar_t d = static_cast<wchar_t>(*pStrC++);
                const wchar_t e = static_cast<wchar_t>(*pStrC++);
                const wchar_t f = static_cast<wchar_t>(*pStrC++);
                *dest++=(char((((c&0x0f)<<18 | (d&0x3f)<<12 | (e&0x3f)<<6 | (f&0x3f)) + 655536)  & 0x000000ff));
                continue;
            }
        }
    }
    *dest = '\0';
}
ENDINLINE


//! Convert the utf8$ string to a Latin-1 (ISO 8895-1) string. Use this to 'PRINT' an UTF-8 string.
FUNCTION UTF8_toLatin1$: utf8$
LOCAL copy$ = utf8$
INLINE
char* str = copy_Str.getbuffer(1);
Latin8FromUtf8(str, LEN(copy_Str));
copy_Str.releasebuffer();
ENDINLINE
RETURN copy$

ENDFUNCTION


//! Return the 3 byte UTF-8 BOM (byte order mask).
//! That is the first 3 bytes of an UTF-8 text file.
FUNCTION UTF8_BOM$:
RETURN CHR$(0xef) + CHR$(0xbb) + CHR$(0xbf)
ENDFUNCTION

13
I allowed number of screens equal to number of sprites.
Also, the bug with the wrong 3D viewport on a surface is fixed. I hope to update soon.

14
GLBasic - en / Re: Compiling to html5?
« on: 2019-Nov-29 »
Oh. I should do that. I'm sorry.

15
GLBasic - en / Re: Compiling to html5?
« on: 2019-Nov-28 »
V16 does a good job for me. GACK compiles and runs fine.

Pages: [1] 2 3 ... 699