Search found 620 matches

by Ats
Fri Apr 30, 2021 3:18 pm
Forum: Bug reports
Topic: getSystemTime() gives different results on different devices
Replies: 12
Views: 13009

Re: getSystemTime() gives different results on different devices

All right, got it. I forgot the () after Now in my previous tests... program SystemTime; uses crt, SysUtils, DateUtils; var sysTime: TDateTime; begin sysTime := Now(); writeln(DateTimeToUnix(sysTime)); end. And it should work everywhere (only tested linux and android). Should we replace each and eve...
by Ats
Fri Apr 30, 2021 3:05 pm
Forum: Bug reports
Topic: getSystemTime() gives different results on different devices
Replies: 12
Views: 13009

Re: getSystemTime() gives different results on different devices

I wrote a little pascal test: program SystemTime; uses crt, SysUtils, DateUtils; var sysTime: TDateTime; timeStamp: TTimeStamp; begin sysTime := Date(); writeln(sysTime); writeln(DateTimeToUnix(sysTime)); writeln(Round(sysTime - 25569) * 86400); writeln(DateTimeToStr(Date)); timeStamp := DateTimeToT...
by Ats
Fri Apr 30, 2021 2:49 pm
Forum: Bug reports
Topic: [FIXED] Mouse cursor isn't showing up on Linux
Replies: 5
Views: 8014

Re: Mouse cursor isn't showing up on Linux

SDL_CreateCursor doesn't solve the problem: procedure Platform_ShowMouse(Visible : boolean); const vals : array[boolean] of integer = (0,1); var data: UInt8 = 150; p: ^UInt8; begin p := @data; SDL_CreateCursor(p, p, 4, 4, 0, 0); SDL_ShowCursor(vals[Visible]); writeln(SDL_GetError()); end; (but maybe...
by Ats
Fri Apr 30, 2021 1:19 pm
Forum: Bug reports
Topic: [FIXED] Mouse cursor isn't showing up on Linux
Replies: 5
Views: 8014

Re: Mouse cursor isn't showing up on Linux

Bug happens in windowed mode and full-screen. writeln(SDL_ShowCursor(vals[Visible])); returns 1 Is it possible that the mouse is showing before (and behind) the viewport? I already tried toying with the order of initialization inside procedure TZApplication.CreateWindow; Or maybe we need to create t...
by Ats
Fri Apr 30, 2021 9:29 am
Forum: Bug reports
Topic: getSystemTime() gives different results on different devices
Replies: 12
Views: 13009

Re: getSystemTime() gives different results on different devices

Code: Select all

uses SysUtils, DateUtils

...function Platform_GetSystemTime : longword;
var
  sysTime: TDateTime;
begin
  sysTime := Date();
  Result := DateTimeToUnix(sysTime);
end;
Is also returning 1619740800 on linux :roll:
I also tried with sysTime := Now;
by Ats
Fri Apr 30, 2021 9:11 am
Forum: Bug reports
Topic: [FIXED] Retrieving something from an Array crash on Linux
Replies: 18
Views: 16911

Re: Retrieving something from an Array crash on Linux

Nicely done. It's now working perfectly on Linux. Thanks :D
by Ats
Fri Apr 30, 2021 8:49 am
Forum: Bug reports
Topic: getSystemTime() gives different results on different devices
Replies: 12
Views: 13009

Re: getSystemTime() gives different results on different devices

I just tried this, which is working nicely on all systems: uses SysUtils ... function Platform_GetSystemTime : longword var sysTime: TDateTime; begin sysTime := Date(); Result := Round(sysTime - 25569) * 86400; end; From response n°2 (10x faster than dateutils version): https://stackoverflow.com/que...
by Ats
Fri Apr 30, 2021 7:51 am
Forum: Bug reports
Topic: [FIXED] Retrieving something from an Array crash on Linux
Replies: 18
Views: 16911

Re: Retrieving something from an Array crash on Linux

This is working. I found the array[string] bug because Omeganaut crashes when it needs to retrieve the Model cannons of a big spaceship in an array, or when it calls arrayNames[spaceship_number] to retrieve it's name. Otherwise, everything works. This is very specific...
by Ats
Fri Apr 30, 2021 7:15 am
Forum: Bug reports
Topic: getSystemTime() gives different results on different devices
Replies: 12
Views: 13009

Re: getSystemTime() gives different results on different devices

I took a better look at the code and the results on different platforms make sense :lol: Windows: function Platform_GetSystemTime : integer; var T : TSystemTime; begin GetLocalTime(T); Result := T.wHour * 3600 + T.wMinute * 60 + T.wSecond; end; SDL (Linux?): function Platform_GetSystemTime : integer...
by Ats
Thu Apr 29, 2021 3:48 pm
Forum: Bug reports
Topic: [FIXED] Retrieving something from an Array crash on Linux
Replies: 18
Views: 16911

Re: Retrieving something from an Array crash on Linux

I verified several times that I had everything right: - Clean download of recent ZGE code - Built Player_linux.bin for x86_64 debug Your previous test still gives the same result, but test with array full of strings doesn't return a line number. Just: An unhandled exception occurred at $000000000040...
by Ats
Thu Apr 29, 2021 2:39 pm
Forum: Bug reports
Topic: [FIXED] Retrieving something from an Array crash on Linux
Replies: 18
Views: 16911

Re: Retrieving something from an Array crash on Linux

I didn't know I could build a debug version of Player_linux.bin :o
So the fault is coming from line 2849 of ZExpressions.pas
by Ats
Thu Apr 29, 2021 1:31 pm
Forum: Bug reports
Topic: [FIXED] Retrieving something from an Array crash on Linux
Replies: 18
Views: 16911

Re: Retrieving something from an Array crash on Linux

Here's the result on linux x86_64:

Code: Select all

1506279808
1506279808
An unhandled exception occurred at $000000000042691D:
EAccessViolation: Access violation
  $000000000042691D
by Ats
Thu Apr 29, 2021 10:40 am
Forum: Bug reports
Topic: [FIXED] Retrieving something from an Array crash on Linux
Replies: 18
Views: 16911

Re: Retrieving something from an Array crash on Linux

I have the old i386 ready. It's working on it.

I can also test it on raspberry by flashing a new 32bits OS on a card, but I'll do that after lunch, as I need to setup everything.

(And I'll test on the same rasp with the 64bits OS too)
by Ats
Thu Apr 29, 2021 9:09 am
Forum: Bug reports
Topic: [FIXED] Retrieving something from an Array crash on Linux
Replies: 18
Views: 16911

Re: Retrieving something from an Array crash on Linux

<?xml version="1.0" encoding="iso-8859-1" ?> <ZApplication Name="App" Caption="ZGameEditor application" FileVersion="2"> <OnLoaded> <ZExpression> <Expression> <![CDATA[// ArrayFloat[0]= 0.123; ArrayFloat[1]= 0.456; ArrayInt[0]= 0; ArrayInt[1]= 1; Ar...
by Ats
Wed Apr 28, 2021 8:22 pm
Forum: Bug reports
Topic: [FIXED] Retrieving something from an Array crash on Linux
Replies: 18
Views: 16911

Re: Retrieving something from an Array crash on Linux

Array of float, byte and vec works too.
But array of model crashes.

I didn't try xptr and mat4.