Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infos before next pull-request. #1

Closed
fredvs opened this issue Nov 11, 2018 · 10 comments
Closed

Infos before next pull-request. #1

fredvs opened this issue Nov 11, 2018 · 10 comments

Comments

@fredvs
Copy link
Contributor

fredvs commented Nov 11, 2018

Hello Roland.

Before to propose a pull-request, here the modifs done.

There was still problems with the Pascal mode.
Is it a reason why you need Delphi mode as default?

Because using other code, like BgrabBitmap or fpGui that use {$mode objfpc}, may create conflicts.

{$mode delphi} is more tolerant about assignation of pointer of pointer ( ^^ ) for example.

If you agree, in next pull-request I will use {$mode objfpc} in all your code.

Other thing, with BGRAfpGUIBitmap.pas, I get a error message compiling on Linux:

bgrafpguibitmap.pas(51,14) Error: (3058) There is no method in an ancestor class to be overridden: "LoadFromDevice(LongInt;TRect);"
bgrafpguibitmap.pas(57,1) Fatal: (10026) There were 2 errors compiling module, stopping
Fatal: (1018) Compilation aborted

So I disabled those 2 methods in BGRAfpGUIBitmap.pas for Linux (maybe a bug report would be welcome).

In image.pas was changed all "" with "directoryseparator" to be Unix compatible.

Last thing, Linux is case-sensitive so, I did change {$R eschecs.res}.

Now all compile ok.

[EDIT] and runs OK.
https://sites.google.com/site/fredvsbinaries/eschecs_linux.png

Fre;D

@fredvs
Copy link
Contributor Author

fredvs commented Nov 11, 2018

In previous post please read:
(because editor of GitHub is not working ok, changes are not saved here!??)

In image.pas was changed all "" with "directoryseparator" to be Unix compatible.
Please read

In image.pas was changed all \ with directoryseparator to be Unix compatible.

The changes, ready to a pull-request, are here:
https://github.com/fredvs/eschecs

Fre;D

@rchastain
Copy link
Owner

Hello Fred! Thank you for your work and for the informations.

I agree with using ObjFPC mode everywhere, and with the other modifications.

I am very glad that you could compile and run Eschecs under Linux. I hope we will be able to make a release soon.

I will look at your modifications today.

Best regards.

Roland

@rchastain
Copy link
Owner

The big question is: does the Linux version of Eschecs work in "human versus engine" mode?
If it works in "human versus human" mode, it's already a great news. But I can't wait to know if the communication with engines will also works. :)

I am wondering what we are going to do with the engines.json file. Maybe we could create two files, something like windows-engines.json and linux-engines.json? And the application would select automatically the good file.

@rchastain
Copy link
Owner

To test the communication with the engine, you could use Moustique (1) and, for example, Fruit 2.1, which is available for Linux here:
http://arctrix.com/nas/chess/fruit/

(1) I suggest to compile Moustique with -dDEBUG, so it will produces a log file.

@fredvs
Copy link
Contributor Author

fredvs commented Nov 12, 2018

Hello Roland.
I did change the .json file to load moustique compiled under Linux but without luck, the engine is grayed (not enabled). I surely miss something with the .json file but even trying with the full path of moustique, still not enabled.

The big question is: does the Linux version of Eschecs work in "human versus engine" mode?

Huh, it must work (if I am able to enable moustique).

I have done a pull request.

Fre;D

@fredvs
Copy link
Contributor Author

fredvs commented Nov 12, 2018

Hello.
Yep, I get it: ---->
https://sites.google.com/site/fredvsbinaries/eschecs_linux.mp4

Tested for Windows too.

Maybe we could create two files, something like windows-engines.json and linux-engines.json?

Maybe you could keep only one Json file and add some items.
And in code

Something like this:

{
   "commandnix" : "moustique",
   "commandwin" : "moustique.exe",
   "name" : "Moustique",
   "protocol" : "uci",
   "workingDirectoryWin" : "\\engines\\moustique01\\"
   "workingDirectoryNix" : "/engines/moustique/01/"
 }  

and in engines.pas do something like this:

with vEngines[i] do
      begin
        vCommand := vData.Items[i].FindPath({$IFDEF UNIX}'commandnix'{$else}'commandwin'{endif}).AsString;
        vName := vData.Items[i].FindPath('name').AsString;
        vDirectory := ExtractFileDir(ParamStr(0)) + vData.Items[i].FindPath({$IFDEF UNIX}'workingDirectoryNix'{$else}'workingDirectoryWin'{endif}).AsString;
        vExists := FileExists(Concat(vDirectory, vCommand));
      end;

Fre;D

@rchastain
Copy link
Owner

Hello Fred! I am so glad that the whole application works! Thank you very much for that great contribution.

By the way, you could compile with -dOPT_HIGHLIGHT to enable the square highlighting (not sure that it is the right english word, but you will understand what it is if you try it).

Your idea about the JSON file is interesting.

Have a good night!

Best regards.

Roland

@fredvs
Copy link
Contributor Author

fredvs commented Nov 13, 2018

Happy that you are happy.

Fre;D

@fredvs fredvs closed this as completed Nov 13, 2018
@circular17
Copy link

On Linux, programs have kind of predefined paths. So we could put those in the Json file or autodetect them in the code.

@rchastain
Copy link
Owner

@circular17
Thank you for your contribution. For me, I don't really see what you mean, but probably Fred will understand. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants