1. NEIL HELP NEEDED!

I'm still desperately needing help with these items:

Using NEIL.E:

1. There's no rotate_bitmap() function, it seems. How do I ROTATE a
graphic?! Even if I could just get the 2-d bitmap sequence from memory,
rotate it, then return it... But I don't know how to use the handle to grab
the bitmap sequence. I've looked at the docs but I'm yet clueless.

2. How do I load a bitmap then extract individual bitmaps from it? (For
instance, I have 15 64x64 tiles in the one bitmap file, and I want to
extract all of them to a tiles[] sequence.)

THANKS!
ck

new topic     » topic index » view message » categorize

2. Re: NEIL HELP NEEDED!

WATCHA SAY?!?

..you ignorant lil a**holes.. ..won't answer my questions...

just kidding :)

The reason to why I haven't answered your questions about Neil is that I
don't know anything about Neil. The best thing for you would probably be to
ask Pete himself, though I guess he can be kinda hard to get hold of.



_____________________________________________________________________________________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: NEIL HELP NEEDED!

On Tue, 28 Nov 2000 17:10:29 -0000, mic _ <stabmaster_ at HOTMAIL.COM> wrote:

>WATCHA SAY?!?
>
>..you ignorant lil a**holes.. ..won't answer my questions...

HAHA. no, i haven't said that, yet... out loud. <cough>

>The reason to why I haven't answered your questions about Neil is that I
>don't know anything about Neil. The best thing for you would probably be to
>ask Pete himself, though I guess he can be kinda hard to get hold of.

Yeah, but I figured there were some gurus on here! Where'd they go all of a
sudden when I need them most?

I have contacted Pete via email, but he still hasn't gotten back to me.

I guess I could consider using another graphics package, but neil seemed to
fit my requirements well and was displaying bitmaps quicker than my initial
attempts with jiri's widgets. (jiri, if you'd be willing to help out,
there's a free PC game with your name on it!). I'm a hop-skip-n-a-jump away
from a Windows and Linux version, so it won't be crucial, but in
development, I'd like to display things properly! smile

Thanks anyway,

<\<

new topic     » goto parent     » topic index » view message » categorize

4. Re: NEIL HELP NEEDED!

Hi ck,

>1. There's no rotate_bitmap() function, it seems. How do I ROTATE a
>graphic?! Even if I could just get the 2-d bitmap sequence from memory,
>rotate it, then return it... But I don't know how to use the handle to grab
>the bitmap sequence. I've looked at the docs but I'm yet clueless.

One method which *maybe* an option if you don't need to many variations
is to use a graphics program to rotate your images and save each frame.
Obviously it uses more Hard Disk space but depending on how many images
you have and how many rotations you need it might be an option.

...and as always ... if you wait euAllegro has a rotate_sprite option!

Ray Smith

new topic     » goto parent     » topic index » view message » categorize

5. Re: NEIL HELP NEEDED!

On Tue, 28 Nov 2000 17:10:09 -0500, Ray Smith <smithr at IX.NET.AU> wrote:

>One method which *maybe* an option if you don't need to many variations
>is to use a graphics program to rotate your images and save each frame.
>Obviously it uses more Hard Disk space but depending on how many images
>you have and how many rotations you need it might be an option.

Yeah, I've actually done this with one set of tiles, but I was hoping to
get on-the-fly rotation. Oh well! No big deal, since this is just for
development.

>...and as always ... if you wait euAllegro has a rotate_sprite option!

Sounds like a bargain! I'm going to need a 2-d graphics package for Windows
soon... and my far-future plans include 3-d!

Thanks for the help!
ck

new topic     » goto parent     » topic index » view message » categorize

6. Re: NEIL HELP NEEDED!

ck wrote:

>1. How do I load a bitmap then extract individual bitmaps from it?
>(For instance, I have 15 64x64 tiles in the one bitmap file, and I
>want to extract all of them to a tiles[] sequence.)

For 8-bit bitmaps it is pretty trivial, just follow the bloody manual.
You can use the standard read_bitmap function. If the read is
successful, you will get a two element sequence. The first element is
the palette, and the second is a 2-d sequence of pixels colors. Each
row represents a line of pixels in the image.

Obviously, if you want to extract individual images from a combined
one, you have to know, how they are stored. If you are not sure, just
use any old graphics program, or load it into a simple euphoria
program and display it using display_image.

If the images are stored sequentially, vertically, then your combined
image will have most likely 15*64 sequences, each lot of 64 containing
one individual image. Just chop it up.

On the other hand, if the images are stored in parallel, horizontally,
the you will have just 64 very long sequences that you will have to
slice each into 15 subsequences of 64 pixels. Each such subsequence
belongs to a different individual image. All you have to do is to
accumulate them (using append) in appropriate containers (in elements
of your tile sequence for instance).

If the color depth of your images is more than 8 bits, I am sorry, I
cannot help you. Being colorblind, 256 colors is more than I can
really handle anyway.

>2. There's no rotate_bitmap() function, it seems. How do I ROTATE a
>graphic?! Even if I could just get the 2-d sequence using the handle,
>then I could rotate that and replace it...

I dug out a routine I wrote some time ago. It is attached at the
bottom of this message. It is not particularly fast, but it will give
you 20 to 50 frames per second with a smallish image on a modern
machine. You can probably optimize it a little without too much
effort, but to get anything much faster, you have to be a masochist
and dirty your hands with a bit of assembly.

Just one more, final remark. I think you mentioned Neil on a Win2k
machine. I haven't got Win2k, but if it's a descendant of NT, just
forget
it. I believe the system will not allow you to fiddle with it at the
low level Neil does.

Best of luck. jiri


--  file   : rotate.e
--  author : jiri babor
--  date   : 99-03-07
--  email  : jbabor at paradise.net.nz
--  topic  : image rotation

constant  d2r=0.01745329    -- degrees to radians (pi/180)

global function rotate(
    sequence s,     -- rotated image, 2-d sequence
    atom a,         -- angle of rotation, clockwise, in degrees
    integer c       -- background, unused fill color
    )
    -- rotate image in its own space about its cetre

    sequence rs,xca,xsa,yca,ysa
    atom ca,sa,xc,yc,x,y
    integer w,h

    h=length(s)     -- image height
    w=length(s[1])  -- image width
    rs=repeat(repeat(c,w),h)
    xc=(w+1)/2
    yc=(h+1)/2
    a=d2r*a         -- degrees to radians
    sa=sin(a)
    ca=cos(a)

    xca=repeat(ca,w)
    xsa=repeat(sa,w)
    for i=1 to w do
        xca[i]*=i-xc
        xsa[i]*=i-xc
    end for
    yca=repeat(ca,h)
    ysa=repeat(sa,h)
    for i=1 to h do
        yca[i]*=i-yc
        ysa[i]*=i-yc
    end for
    for i=1 to h do
        for j=1 to w do
            x=xca[j]+ysa[i]+xc+0.0001   -- (optional) compensation
            y=-xsa[j]+yca[i]+yc+0.0001  -- for ugly rounding errors
--            x=xca[j]+ysa[i]+xc
--            y=-xsa[j]+yca[i]+yc
            if x>1 and x<w+1 and y>1 and y<h+1 then
                rs[i][j]=s[y][x]
            end if
        end for
    end for
    return rs
end function

new topic     » goto parent     » topic index » view message » categorize

7. Re: NEIL HELP NEEDED!

jiri babor <jbabor at PARADISE.NET.NZ> wrote:

>>1. How do I load a bitmap then extract individual bitmaps from it?
>>(For instance, I have 15 64x64 tiles in the one bitmap file, and I
>>want to extract all of them to a tiles[] sequence.)
>
>For 8-bit bitmaps it is pretty trivial, just follow the bloody manual.
>You can use the standard read_bitmap function.

It's my understanding that you CANNOT use graphics.e with neil.e, and
neil.e DOES NOT (cannot?) use the standard read_bitmap function! I checked
the neil.doc and cannot find any reference to a "read_bitmap" function.

When you use neil, you have to use a "load_bitmap" function which returns a
handle to the bitmap and its size.

This does give me a clue, however, as he says when creating a virtual
screen (which load_bitmap does), it is just a memory address and the
graphic is linear... meaning stored in sequence, one bit after the other...
right? So, I could grab that memory, put it into a sequence, rotate it
using your function, then spit it back out to that memory location. Right?

>I dug out a routine I wrote some time ago.

I actually have your rotate.e ready to be used... I just need the sequence
on which to use it, and up 'til now didn't have a clue.

I have already created a large bitmap holding the rotating bitmap. I'll
just use load_bitmap then sub_screen the turned images.

>I haven't got Win2k, but if it's a descendant of NT, just forget
>it. I believe the system will not allow you to fiddle with it at the
>low level Neil does.

Yes, Win2K is the wicked spawn of NT, and Brian Broker said the same thing
regarding the "no low-level tinkering." Hmmmm. So, does that mean no hires
DOS graphics on an NT box? Just for my notes...

Thanks!
<\<

new topic     » goto parent     » topic index » view message » categorize

8. Re: NEIL HELP NEEDED!

>This does give me a clue, however, as he says when creating a virtual
>screen (which load_bitmap does), it is just a memory address and the
>graphic is linear... meaning stored in sequence, one bit after the other...
>right? So, I could grab that memory, put it into a sequence, rotate it
>using your function, then spit it back out to that memory location. Right?


Right.
A bitmap-grabber could be done something like this:
(bitmap_width/height/pointer should be filled out by you)


sequence s

procedure grab()
integer src_index, row

s = repeat(0, bitmap_width*bitmap_height)
src_index = 0
row = 0

for i = 1 to bitmap_height do
  for j = 1 to bitmap_width do
    if bytes_per_pixel=1 then
      s[row + j] = peek(bitmap_pointer + src_index)
      src_index += 1
    elsif bytes_per_pixel=2 then
      s[row + j] = peek(bitmap_pointer + src_index)+
                   (peek(bitmap_pointer + src_index+1)*256)
      src_index += 2
    elsif bytes_per_pixel=3 then
      s[row + j] = peek(bitmap_pointer + src_index)+
                   (peek(bitmap_pointer + src_index+1)*256)+
                   (peek(bitmap_pointer + src_index+2)*65536)
      src_index += 3
    end if
  end for
  row += bitmap_width
end for

end procedure


_____________________________________________________________________________________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

new topic     » goto parent     » topic index » view message » categorize

9. Re: NEIL HELP NEEDED!

ck,

Do you want to rotate bitmaps in 90 degree increments?  Clockwise or
counterclockwise?

Colin Taylor

----- Original Message -----
From: Ck Lester <cklester at YAHOO.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Tuesday, November 28, 2000 9:58 AM
Subject: NEIL HELP NEEDED!


> I'm still desperately needing help with these items:
>
> Using NEIL.E:
>
> 1. There's no rotate_bitmap() function, it seems. How do I ROTATE a
> graphic?! Even if I could just get the 2-d bitmap sequence from memory,
> rotate it, then return it... But I don't know how to use the handle to
grab
> the bitmap sequence. I've looked at the docs but I'm yet clueless.
>
> 2. How do I load a bitmap then extract individual bitmaps from it? (For
> instance, I have 15 64x64 tiles in the one bitmap file, and I want to
> extract all of them to a tiles[] sequence.)
>
> THANKS!
> ck

new topic     » goto parent     » topic index » view message » categorize

10. Re: NEIL HELP NEEDED!

On Wed, 29 Nov 2000 10:08:36 -0500, Colin Taylor <ctaylor at RACSA.CO.CR>
wrote:

>ck,
>
>Do you want to rotate bitmaps in 90 degree increments?  Clockwise or
>counterclockwise?
>
>Colin Taylor

The game I'm developing is a turn-based game, where the pieces need to face
in one of the four compass points. So, for now just rotating right (or
left) in 90-degree increments will suffice. I have gone a step further,
however, and am animating the turning of the piece in 5-degree increments.
But this is just for show- not required functionally.

Anyway, I think I'm coming to grips with it all. I just need to get rle
sprites working (that is, displaying) from neil.

Thanks!
ck

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu