Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!snorkelwacker.mit.edu!mintaka!ogicse!orstcs!prism!mullerd From: mullerd@prism.cs.orst.edu (Douglas Muller) Newsgroups: comp.sys.mac.programmer Subject: Re: Problem with Think C and Polygons! Message-ID: <1991Jun14.150430.24662@lynx.CS.ORST.EDU> Date: 14 Jun 91 15:04:30 GMT Article-I.D.: lynx.1991Jun14.150430.24662 References: <13974.2857e2a1@ecs.umass.edu> Sender: @lynx.CS.ORST.EDU Organization: Oregon State University, Computer Science Dept. Lines: 43 Nntp-Posting-Host: prism.cs.orst.edu In article <13974.2857e2a1@ecs.umass.edu> farmer@ecs.umass.edu (THE MAD MUSKRAT) writes: >In Quickdraw.h the pascal function OpenPoly is defined, but the rest of the >polygon functions aren't. I realize that openpoly is the only function that >returns a value, but the other functions won't work. If I use ClosePoly to >end the polygon definition I get a compiler error: Invalid use of inline >function. What does that mean?? > >The code looks like: > >void LoadLevel (level, theWell) >int level; >PolyHandle theWell[]; >{ >int notDone = 1; >Handle res; >res = GetResource ('LEVL', level); >if (!res) exit(1); >for (segments=0; notDone; segments++) { > theWell[segments] = OpenPoly(); > MoveTo(*(*res+(8*segments)),*(*res+(8*segments+1))); > LineTo(*(*res+(8*segments+2)),*(*res+(8*segments+3))); > LineTo(*(*res+(8*segments+4)),*(*res+(8*segments+5))); > LineTo(*(*res+(8*segments+6)),*(*res+(8*segments+7))); > ClosePoly; > if (*(*res+(8*segments+4)) == 0 && *(*res+(8*segments+5)) == 0) notDone=0; > }; >} > I Don't know much about polygons but I do know that if you don't LOCK the handle to that resource you will be in big trouble. res = GetResource(...); hState = HGetState(res); HLock(res); your code HSetState(res, hState); I guaranty that it won't HURT! Stephen Roderick mullerd@prism.cs.orst.edu