Path: chuka.playstation.co.uk!news From: Developer Support Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: Texture Problems Again Date: Tue, 27 May 1997 09:37:17 +0100 Organization: Sony Computer Entertainment Europe Lines: 80 Message-ID: <338A9D3C.EA8@interactive.sony.com> References: <33889736.687B@cobradev.demon.co.uk> Reply-To: N/A-Use-Newsgroup NNTP-Posting-Host: 194.203.13.10 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (Win95; I) colin adams wrote: > > 1. I have located a Bug in my project, the offending code > Is appended. The symptom of this code is a complete Crash. > I would be extremely grateful if someone could examine this > code & tell me where I may be going wrong. > > 2. When Will the New version of RsdTool Arrive? > In a previous Mailing -: > Subject: RSDtool Bug Report. > Ref.: <3380E9D6.747D@cobradev.demon.co.uk> > <3380ACE6.14D5@interactive.sony.com> > I reported problems regarding Memory usage. > I am unable to use the tool, so I guess I will have to > remain texture less :-( > > 3. I have Just discovered why RSDV [file name] displays > files in monochrome (on my Scart Mitsubishi ). I had the > same problems in my code until I set the video mode to PAL. > > Thanks in Advance. > > Cobra > Don't know exactly when the next version of RSDtool will arrive, but probably one within the next fortnight. > /* Bugged Code */ > > #define FLTEX_ADDRESS 0x800c03BC // Floor Texture 64*64, 8 bit clut > void InitTexture (u_long *address);// texture in sytem memory > u_long *tptr; > > void main() > { > tptr =(u_long*)FLTEX_ADDRESS; > InitTexture (tptr); > } > > void InitTexture (u_long *address) > { > GsIMAGE *Info; // tim info ptr // POINTER ONLY > RECT rect; > > // +4 skip header of TIM file > address++; > GsGetTimInfo(address,Info); > rect.x = Info->px; > rect.y = info->py; > rect.w = Info->pw; > rect.h = Info->ph; > LoadImage(&rect,Info->pixel); > DrawSync(0); > > rect.x = Info->cx; > rect.y = Info->cy; > rect.w = Info->cw; > rect.h = Info->ch; > LoadImage(&rect,Info->clut); > DrawSync(0); > } I think the problem is that there is no memory allocated for your GsIMAGE* pointer to point to (GsGetTimInfo will NOT allocate it as far as I know). Hence, you cannot store and retrieve things successfully; I suspect the feed of bad values to LoadImage is what actually causes the total crash. Declare the GsIMAGE as full structure rather than variable, things should now work. Also, if you _ever_ need to refer to our use a TIM file more than once, it's very handy having a GsIMAGE structure with all the correct info available, so you can make GsIMAGE structures global for later reuse. Lewis