1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-08-06 16:20:24 +00:00
Commit graph

93 commits

Author SHA1 Message Date
SteveMcNeill
1be3e366ac Final fixes to math stuff (I hope)
Fix to CONST with the math evaluator to toss a message and error with values out of acceptable range for ARCSEC and ARCCSC.

Tweak to _PI to add constexpr for speedier execution.

Fix to the math tests for the new (and unbuggy) values for ARCSEC and ARCCSC.
2023-10-31 11:32:22 -04:00
SteveMcNeill
64ba64f0bd rename math.h to extended_math.h 2023-10-31 08:45:10 -04:00
SteveMcNeill
01163fb9e9 Create math.h
Move the extended math functions out of libqb and qbx, and place them inside math.h.

Correct the formula for _ARCSEC and _ARCCSC.
2023-10-31 08:34:19 -04:00
Samuel Gomes
c82dd88ee2
Merge branch 'main' into game-controller-fixes-and-enhancements 2023-10-04 18:47:20 +05:30
Samuel Gomes
49aeccc486 Initial WoA64 and MingW-LLVM support 2023-10-01 08:08:58 +05:30
Samuel Gomes
b514da5b39 Add include guard to game_controller.h 2023-09-26 03:41:16 +05:30
Samuel Gomes
79c531f2bb Reorg. game controller and update libstem_gamepad 2023-09-26 02:01:35 +05:30
Samuel Gomes
87a99c3970 Make _MEMSOUND channel parameter optional 2023-09-22 19:14:30 +05:30
Samuel Gomes
586371dc77 Implement _SAVEIMAGE 2023-09-17 11:52:54 +05:30
Samuel Gomes
412b783efa Add QOI support 2023-09-15 21:05:41 +05:30
Samuel Gomes
3b1ca3a386 Fix fonts getting vertically misaligned 2023-06-19 07:06:49 +05:30
Samuel Gomes
3f16e3c9d1 Add volume, panning & waveform support for SOUND 2023-06-10 02:24:05 +05:30
Samuel Gomes
ef5d29e5fb Implement PSG class 2023-06-09 13:02:14 +05:30
Samuel Gomes
bd9a7b6f6f
Merge branch 'QB64-Phoenix-Edition:main' into audio-enhancements 2023-05-23 01:42:57 +05:30
Samuel Gomes
3fc585241a
Merge branch 'QB64-Phoenix-Edition:main' into audio-enhancements 2023-05-08 19:12:51 +05:30
Samuel Gomes
381e5ab0e9
Merge branch 'main' into ucharpos-enhancement 2023-05-08 18:04:22 +05:30
Samuel Gomes
47c3cac56a
Merge branch 'QB64-Phoenix-Edition:main' into dialog-fixes 2023-05-08 02:00:22 +05:30
Samuel Gomes
60a448fb54 Add _UCHARPOS() to get individual char pixel position 2023-05-07 22:12:47 +05:30
Samuel Gomes
df4c144b34
Merge branch 'QB64-Phoenix-Edition:main' into audio-enhancements 2023-05-07 09:07:26 +05:30
Samuel Gomes
c6b8524739 Improve dialog functions using #305 & make string options case insensitive 2023-05-02 00:19:33 +05:30
RainRat
3914037c0f fix typos 2023-04-30 15:20:42 -07:00
Samuel Gomes
67b95016fc
Merge branch 'QB64-Phoenix-Edition:main' into audio-enhancements 2023-04-30 03:27:55 +05:30
Samuel Gomes
f1bb16a6fe Changes per discussion in #335 2023-04-30 00:27:34 +05:30
Samuel Gomes
3dd439e625 Change function names 2023-04-26 22:36:24 +05:30
Samuel Gomes
c033c624ac Add support for _UPrint*() 2023-04-26 17:36:09 +05:30
Samuel Gomes
2da5b89a22 Improve ResizeBuffers() behavior and update comments 2023-04-21 00:02:40 +05:30
Samuel Gomes
e4b36ca8ad Add font load-from-memory support 2023-04-20 09:23:13 +05:30
Samuel Gomes
618e5117cd Add FontPrintWidthUTF32() and optimize chrwidth() 2023-04-19 09:30:38 +05:30
Samuel Gomes
492c8d0cf5 Remove unused out_x_pre_increment, out_x_post_increment 2023-04-19 08:39:56 +05:30
Samuel Gomes
ec723ed46b New FreeType cached font renderer 2023-04-19 07:49:02 +05:30
Samuel Gomes
ac6f6574a1 Update comments 2023-04-11 23:21:47 +05:30
Samuel Gomes
1c505561d6 Implement pending changes in #330 2023-04-09 03:37:44 +05:30
Samuel Gomes
d974c0b9a8 Tidy up font code 2023-04-04 17:51:17 +05:30
Samuel Gomes
6dd651f7cd Replace MinGW intrinsic zlib with miniz 2023-03-19 02:28:05 +05:30
Samuel Gomes
f86d566d7a Merge branch 'image-load-from-memory-support' of https://github.com/a740g/QB64pe into image-load-from-memory-support 2023-02-13 03:52:28 +05:30
Samuel Gomes
52d168ff00 Update to use #305 2023-02-13 03:52:16 +05:30
Samuel Gomes
18efb60cc3
Merge branch 'QB64-Phoenix-Edition:main' into image-load-from-memory-support 2023-02-07 18:32:03 +05:30
Matthew Kilgore
42bded9ba9 Fix build on MacOS High Sierra
Fairly simple, MacOS High Sierra's libcurl version is too old and not
have `CURLINFO_CONTENT_LENGTH_DOWNLOAD_T`. This adds a version check to
use the older version of that command which gives back a double instead.

Fixes: #287
2023-01-20 13:30:12 -05:00
Samuel Gomes
68234d4786 Fix ambiguous overload 2023-01-11 22:09:24 +05:30
Samuel Gomes
f0f0a9a420 Overload _LOADIMAGE to allow strings as the 2nd parameter 2023-01-11 16:18:43 +05:30
Matthew Kilgore
f21ce09e2d Replace time() with std::chrono, fix startup delay
Currently main() includes logic that is intended to sync time() with
GetTicks() for the purpose of using GetTicks() to get millisecond
accuracy with time(), which only has second accuracy. Unfortunately, the
'syncing' up of these time sources results in an average of a half
second delay in starting a QB64-PE program.

This logic is easly replaced with std::chrono, which provides a real
time clock which is also millisecond accurate. That removes the need to
use time() and GetTicks() together to get millisecond accuracy, and
means the delay syncing them is no longer necessary.

I also separated most of the "delay" and "time" related functions into
datetime.cpp, and included the new std::chrono code into that file.

Since I needed to call some of the rounding functions in datetime.cpp I
also moved that stuff out into its own .cpp and header files to clean
things up a bit.

Fixes: #282
2023-01-08 20:24:25 -05:00
Matthew Kilgore
f88960966b Fix use-after-free bug in buffer.cpp
Fairly simple, the finished entry is free'd and then removed from the
list, but that order results in us accessing the entry's next member
after it has been free'd. Swapping the order of the operations fixes the
issue.

Fixes: #281
2023-01-08 20:24:25 -05:00
Samuel Gomes
061bf6af3d Rename _NEWSOUND to _SNDNEW to align with _SND* APIs 2022-12-31 12:00:38 +05:30
Samuel Gomes
4c80f6bcea Implement feature request #28 2022-12-31 01:49:23 +05:30
Matthew Kilgore
7ac2eefcb8 Fix slowdown of _ScreenX and _ScreenY
The commands _ScreenX and _ScreenY got significantly slower due to the
need to wait for the GLUT thread to wake up and execute the glutGet()
command for them. We've already seen a few programs (including the IDE)
where this behavior completely grinds the program to a halt, so we
definitely can't keep it.

The simple solution here is to not call glutGet() on every _ScreenX/Y
command. Instead every time the idle/timer function runs we get the
current values for the relevant glutGet() variables and store them.
libqb_glut_get() then checks if the value being read is one of the ones
we read in the idle/timer functionand if so just returns the last read
value. By doing it this way the commands no longer has to wait on the
GLUT thread for the result.
2022-11-30 17:33:17 -05:00
Matthew Kilgore
f7fabda198 Fix random seg faults on exit
Fairly straightfowrad, programs were randomly seg faulting on exit. This
was happening due to GLUT registering a cleanup function via atexit(),
which then gets called when exit() is called.

The issue happens when exit() is called on a thread other than the GLUT
thread, which leads to the exit() call then attempting to cleanup GLUT
while the other thread is still using it, which randomly leads to seg
faults.

Fixing this is slightly annoying. We cannot stop the GLUT thread, as
the basic GLUT API (which is used on Mac OS) simply does not offer a way
to exit the glutMainLoop() call. Thus the simplest solution is to simply
make sure we call exit() on the GLUT thread, which we can fairly easily
due via the message queue.

That being the case, a new libqb_exit() API was added, which simply
regsiters the GLUT exit message and then waits for the program to end.
The atexit() handler then runs on the GLUT thread and everything works
out fine.

In the future we probably should redo the exit logic a bit so that all
the threads are actually stopped/joined to ensure the exit process is
consistent, however this is good enough for now. Also, there's plenty of
error states which call exit() which I did not address.
2022-11-29 20:04:54 -05:00
Matthew Kilgore
72193e34e5 Add GLUT command queue, processed on GLUT thread
This fixes all the code so that all the calls to glut functions
happen on the same thread that is running GLUT.

We achieve this by creating a queue of GLUT commands to execute.
Commands can be added to the queue anywhere in the code, and then the
queue is processed on the GLUT thread via it's idle func or timer func.
The command is run and if necessary the result is provided in the
message queue object. Each object contains a completion which can be
waited on to block until the GLUT thread has processed the command.

Fixes: #66
2022-11-29 20:04:54 -05:00
Matthew Kilgore
d678be717c Move GLUT initialization logic into separate .cpp file 2022-11-29 20:04:53 -05:00
Matthew Kilgore
12c9c35db5 Add _StatusCode command for HTTP handles
The _StatusCode command returns the status code on the HTTP response
when given a HTTP handle from _OpenClient().
2022-11-20 04:04:02 -05:00
Matthew Kilgore
45d52271da Add libqb_http API for HTTP connections
This adds the libqb_http API, which is designed to support HTTP and
HTTPS usage from QB64-PE source.

The design consists of a single thread which services all the HTTP(s)
connections. There are then various libqb_http APIs exposed that allow
interacting with this thread to create a new connection, query
connection status, read data, or close the connection.

Internally the thread makes use of the curl_multi interface to allow a
single thread to service multiple HTTP(s) connections in parallel. This
means you can _OPENCLIENT() multiple HTTP connection in a row and all of
them will be serviced at the same time in whatever order data is
available.

HTTP is optional and selected via a Makefile setting. A stub is swapped
in if HTTP support is not used, which avoids need to add another build
flag to libqb.cpp.
2022-11-19 15:13:26 -05:00