QB64 has been successfully ported to Google Android
http://www.qb64.net/forum/index.php?topic=10919.msg91805#msg91805
OPEN command$ for BINARY as #1
OPEN "output.c" for output as #2
print #2, "char file_array[] = {"
DIM c as _unsigned _BYTE
DO
get #1, , c
if flag <> 0 then print #2, ", "; else flag = -1
print #2, "0x"; hex$(c);
count = count + 1
if count = 20 then
count = 0
print #2, ""
end if
loop until eof(1)
print #2, "};";
close #1
Actually, loading all frames into memory and displaying each frame one by one is faster than reading from disk and decompressing the frame data. However, its obviously stupid to use that method. I mean, who makes a video player that consumes 80% of your system's memory?Yeah, it's logical.
The only problem this MVF video format suffers from is 'sound gapping' because it needs to read a lot of frame data from the disk due to its poor frame compression ratio compared to other video formats such as DivX, H.263, and MPEG. The gapping happens when the program that plays the video can't read data from the disk fast enough to achieve a nearly perfect 30FPS frame rate. The problem could be due to the OS or the disk cache.
I'd much rather add support for being able to embed any type of image you want instead of just allowing embedding icons and then probably added another separate command for everything else later on (Though, if icon's have to be embedded in a bit different manner, then that's a different story).I have converted images to icons to use them as resources. Just _LOADIMAGE any image and scan it as you would a bitmap. Add the icon header and the AND map for transparency.
#include <stdio.h>
int main() {
if (1 == (sizeof 'a')) {
printf("This program was compiled as C++.\n");
} else {
printf("This program was compiled as C.\n");
}
return 0;
}
C:\tools\New Folder\bin>g++ -Wall -o delme.exe delme.cpp
C:\tools\New Folder\bin>delme
This program was compiled as C++.
C:\tools\New Folder\bin>g++ -Wall -o delme.exe delme.c
C:\tools\New Folder\bin>delme
This program was compiled as C++.
C:\tools\New Folder\bin>gcc -Wall -o delme.exe delme.cpp
C:\tools\New Folder\bin>delme
This program was compiled as C++.
C:\tools\New Folder\bin>gcc -Wall -o delme.exe delme.c
C:\tools\New Folder\bin>delme
This program was compiled as C.
C:\tools\New Folder\bin>g++ --version
g++ (GCC) 4.8.1 20130328 (prerelease)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.