GET PIXEL

Forum for alternative clients, mods & discussions on the same.

GET PIXEL

Postby aghmed » Sun Jan 03, 2016 6:22 pm

THIS METHOD:
Code: Select all
    public void getpixel(final Coord c, final Callback<Color> cb) {
   gl.bglSubmit(new BGL.Request() {
      public void run(GL2 gl) {
          byte[] buf = new byte[4];
          gl.glReadPixels(c.x + tx.x, root.sz.y - c.y - tx.y, 1, 1, GL.GL_RGBA, GL2.GL_UNSIGNED_BYTE, ByteBuffer.wrap(buf));
          checkerr();
          cb.done(new Color(((int)buf[0]) & 0xff, ((int)buf[1]) & 0xff, ((int)buf[2]) & 0xff));
      }
       });
    }

says "get a pixel"
is void
if you remove it you won't be able to move
WHYYYYYY

And now seriously.
Anyone knows how to change screen coord in to map coord (old s2m)
Last edited by aghmed on Sun Jan 03, 2016 6:49 pm, edited 1 time in total.
public static class StupidJavaCodeContainer {
/* oh, i love swing. */
class checkOutMyPathfinder{
Image
}}
User avatar
aghmed
 
Posts: 238
Joined: Fri Sep 07, 2012 7:20 pm
Location: between London and third part of LSD

Re: GET PIXEL

Postby shubla » Sun Jan 03, 2016 6:33 pm

This is why I think you are never going to get your C client ready.
Its so hard to read loftars code.
You could put your code inside codebrackets
Code: Select all
Like this

for easier reading.
Image
I'm not sure that I have a strong argument against sketch colors - Jorb, November 2019
http://i.imgur.com/CRrirds.png?1
Join the moderated unofficial discord for the game! https://discord.gg/2TAbGj2
Purus Pasta, The Best Client
User avatar
shubla
 
Posts: 13043
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

Re: GET PIXEL

Postby aghmed » Sun Jan 03, 2016 6:55 pm

i'm not writing a C client... hell no :D
public static class StupidJavaCodeContainer {
/* oh, i love swing. */
class checkOutMyPathfinder{
Image
}}
User avatar
aghmed
 
Posts: 238
Joined: Fri Sep 07, 2012 7:20 pm
Location: between London and third part of LSD

Re: GET PIXEL

Postby APXEOLOG » Mon Jan 04, 2016 10:27 am

aghmed wrote:THIS METHOD:
says "get a pixel"
is void

It accepts callback as last argument. It's kinda async programming :)

aghmed wrote:if you remove it you won't be able to move
WHYYYYYY

Because all clicks invokes hittest (there is no need for this with left click, but loftar ignores this :D). Hittest invokes getpixel.

aghmed wrote:And now seriously.
Anyone knows how to change screen coord in to map coord (old s2m)

This is now done via Camera. There is some math with projections. Check code.
W10 Meme Plot | W9 Mantis Garden | W8 Core | W7 Ofir | W6 the City of Dis | W5 Vitterstad | W4 A.D. | W3 Mirniy
jorb wrote:All your characters will be deleted, and I will level every village any one of them were ever members of.
User avatar
APXEOLOG
 
Posts: 1267
Joined: Fri Apr 23, 2010 7:58 am
Location: Somewhere on Earth

Re: GET PIXEL

Postby aghmed » Fri Jan 08, 2016 9:22 pm

But really could anyone write me 2 small methods:
s2m and m2s (screen to map and map to screen) for coords

Would really appreciate
public static class StupidJavaCodeContainer {
/* oh, i love swing. */
class checkOutMyPathfinder{
Image
}}
User avatar
aghmed
 
Posts: 238
Joined: Fri Sep 07, 2012 7:20 pm
Location: between London and third part of LSD


Return to The Wizards' Tower

Who is online

Users browsing this forum: Semrush [Bot] and 99 guests