Home » Archimedes archive » Acorn User » AU 1997-01 B.adf » Features » Arcade/!Popcorn/c/Outside

Arcade/!Popcorn/c/Outside

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1997-01 B.adf » Features
Filename: Arcade/!Popcorn/c/Outside
Read OK:
File size: 011D bytes
Load address: 0000
Exec address: 0000
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
#include "DeskLib:h.Core"

#include "Popcorn:h.Popcorn"

BOOL Popcorn_Outside(struct game_object *obj, struct window *win)
{
  if ((obj->x>>12) < win->x0 || (obj->x>>12) > win->x1) return(TRUE);
  if ((obj->y>>12) < win->y0 || (obj->y>>12) > win->y1) return(TRUE);
  return(FALSE);
}

00000000  23 69 6e 63 6c 75 64 65  20 22 44 65 73 6b 4c 69  |#include "DeskLi|
00000010  62 3a 68 2e 43 6f 72 65  22 0a 0a 23 69 6e 63 6c  |b:h.Core"..#incl|
00000020  75 64 65 20 22 50 6f 70  63 6f 72 6e 3a 68 2e 50  |ude "Popcorn:h.P|
00000030  6f 70 63 6f 72 6e 22 0a  0a 42 4f 4f 4c 20 50 6f  |opcorn"..BOOL Po|
00000040  70 63 6f 72 6e 5f 4f 75  74 73 69 64 65 28 73 74  |pcorn_Outside(st|
00000050  72 75 63 74 20 67 61 6d  65 5f 6f 62 6a 65 63 74  |ruct game_object|
00000060  20 2a 6f 62 6a 2c 20 73  74 72 75 63 74 20 77 69  | *obj, struct wi|
00000070  6e 64 6f 77 20 2a 77 69  6e 29 0a 7b 0a 20 20 69  |ndow *win).{.  i|
00000080  66 20 28 28 6f 62 6a 2d  3e 78 3e 3e 31 32 29 20  |f ((obj->x>>12) |
00000090  3c 20 77 69 6e 2d 3e 78  30 20 7c 7c 20 28 6f 62  |< win->x0 || (ob|
000000a0  6a 2d 3e 78 3e 3e 31 32  29 20 3e 20 77 69 6e 2d  |j->x>>12) > win-|
000000b0  3e 78 31 29 20 72 65 74  75 72 6e 28 54 52 55 45  |>x1) return(TRUE|
000000c0  29 3b 0a 20 20 69 66 20  28 28 6f 62 6a 2d 3e 79  |);.  if ((obj->y|
000000d0  3e 3e 31 32 29 20 3c 20  77 69 6e 2d 3e 79 30 20  |>>12) < win->y0 |
000000e0  7c 7c 20 28 6f 62 6a 2d  3e 79 3e 3e 31 32 29 20  ||| (obj->y>>12) |
000000f0  3e 20 77 69 6e 2d 3e 79  31 29 20 72 65 74 75 72  |> win->y1) retur|
00000100  6e 28 54 52 55 45 29 3b  0a 20 20 72 65 74 75 72  |n(TRUE);.  retur|
00000110  6e 28 46 41 4c 53 45 29  3b 0a 7d 0a 0a           |n(FALSE);.}..|
0000011d