Page 1 of 1
(Not really) f***ing allegro!
Posted: Mon Mar 24, 2014 1:26 pm
by cube
Allegro doesn't have support for clipboard operations ... this isn't that much of a problem on windows, but on linux it makes using the clipboard almost impossible.
That makes me sad.
</whining>
Re: f***ing allegro!
Posted: Mon Mar 24, 2014 1:35 pm
by AlexPhoenix
so, clipboard now works only on windows?
(i mean console copy/paste) or what?
Re: f***ing allegro!
Posted: Mon Mar 24, 2014 1:55 pm
by cube
Yeah, clipoard support for windows is written in Agui (the gui widget layer we use on top of Allegro), but only for Windows. There is a OSx version that is commented out for some reason.
It didn't matter too much yet, but now I'm working on the map exchange strings and without copying them ... it's almost useless. I will be at least writing them to console until we sort the clipboard thing out.
Re: f***ing allegro!
Posted: Mon Mar 24, 2014 4:10 pm
by LoSboccacc
Use words for your random string out of a big dictionary.
Can be language specific.
There is a lot of entropy in a four word phrase
horseflytotree
Easy to insert without copy paste, easy to share.
Re: f***ing allegro!
Posted: Mon Mar 24, 2014 4:26 pm
by cube
I really like that idea, but when I tried to roughly calculate number of characters it came out about twice as long as the current base64 solution.
Now the code is about 4 lines of a reasonably small text box, 8 lines would be too much in any coding. Imho even 4 lines as understandable words would be too much.
Re: f***ing allegro!
Posted: Mon Mar 24, 2014 4:35 pm
by muzzy
reduce the entropy. how many bits of random seed do you really need in there?
Re: f***ing allegro!
Posted: Mon Mar 24, 2014 4:40 pm
by cube
It's not just a seed

. It has a lis of all mods and their versions and map settings from the map generator dialog window. I will probably compress the code using zlib, though.
Re: f***ing allegro!
Posted: Mon Mar 24, 2014 4:46 pm
by LoSboccacc
I don't get your math.
If you get four words over a combination of 10000, you should be able to generate
10!/(10-4)!
different scenarios (using it as seed for the other variables)
Which according to wolfram alpha is about 9.9 X 10^15 unique permutations. Or 53 bit of entropy if you prefer.
Suggestion is to hash the sting after it's entered in the box to obtain 256bit of random stuff to seed the entropy of he repeatable rng of choice (i have one laying around if you want)
Re: f***ing allegro!
Posted: Mon Mar 24, 2014 5:05 pm
by AlexPhoenix
try to use compressing with base64, sometimes it works.
i'will look at clipboard on Linux on holydays, but my main platform is windows.
Re: f***ing allegro!
Posted: Mon Mar 24, 2014 5:57 pm
by LoSboccacc
cube wrote:It's not just a seed

. It has a lis of all mods and their versions and map settings from the map generator dialog window. I will probably compress the code using zlib, though.
Oh I see. Then it would be easier just to keep a save at game start and share around that
Usually it's the ither way around. You generate map parameters from seed, and at most you attach a crc of the mod data to check it's compatible. (You'd lose detailed informations of that)
Re: f***ing allegro!
Posted: Tue Mar 25, 2014 4:27 pm
by SilverWarior
cube wrote:Allegro doesn't have support for clipboard operations ...
Why are you searching for basic OS based functionality in Game library? To be honest I'm surprised that Allegro even has any clipboard handling capabilities built into it in the first place.
Re: f***ing allegro!
Posted: Wed Mar 26, 2014 8:24 am
by cube
SilverWarior wrote:cube wrote:Allegro doesn't have support for clipboard operations ...
Why are you searching for basic OS based functionality in Game library? To be honest I'm surprised that Allegro even has any clipboard handling capabilities built into it in the first place.
It doesn't

Problem is that on linux you need to modify the event loop to add them, not just use a few api calls like on windows or osx.
Re: f***ing allegro!
Posted: Wed Mar 26, 2014 9:17 am
by AlexPhoenix
cube wrote:SilverWarior wrote:cube wrote:Allegro doesn't have support for clipboard operations ...
Why are you searching for basic OS based functionality in Game library? To be honest I'm surprised that Allegro even has any clipboard handling capabilities built into it in the first place.
It doesn't

Problem is that on linux you need to modify the event loop to add them, not just use a few api calls like on windows or osx.
mainly what i saw that recomments to use xsel(or base on its sources)
Re: f***ing allegro!
Posted: Wed Mar 26, 2014 9:20 am
by cube
That is probably what we'll end up doing. I just don't like the fact that it is a dependency for such a basic functionality. I wouldn't expect clipboard to function only when I install some extra program

Re: f***ing allegro!
Posted: Wed Mar 26, 2014 9:29 am
by AlexPhoenix
cube wrote:That is probably what we'll end up doing. I just don't like the fact that it is a dependency for such a basic functionality. I wouldn't expect clipboard to function only when I install some extra program

yes, but it's possible to use it's sources.
Re: (Not really) f***ing allegro!
Posted: Thu Mar 27, 2014 10:29 pm
by MF-
I remember Spacechem (yeah:)) required an external utility "xclip" for clipboard operations
Re: (Not really) f***ing allegro!
Posted: Fri Mar 28, 2014 6:37 am
by AlexPhoenix
MF- wrote:I remember Spacechem (yeah:)) required an external utility "xclip" for clipboard operations
we already talk about this program itself:) and it sources.
Re: (Not really) f***ing allegro!
Posted: Fri Mar 28, 2014 2:05 pm
by cube
Yeah, requiring xclip ... that would work. If we included its sources, we would have to still run it as a separate binary ... not fun. What I've come up now is opening another X11 display connection, creating an invisible window and having a separate event loop running in a thread. Basically the same thing that xclip does, but without other binaries, licence problems and whatever. It almost works now

Re: (Not really) f***ing allegro!
Posted: Fri Mar 28, 2014 3:53 pm
by cube
If anyone ever needs this, it's possible we will be merging this back into agui, but meanwhile...
https://gist.github.com/bluecube/9835979
Re: (Not really) f***ing allegro!
Posted: Thu May 29, 2014 2:55 pm
by Pontiac
Copy/Paste may not be compatible, but, what about just exporting relevant data to a plain text file, instruct the user with a link in the UI to open the text file, similar to how MC and other apps do?
I sometimes dislike when a program automatically launches programs, but if I actively click the link, I'm the moron for letting the action happen.
