Path: chuka.playstation.co.uk!news From: Jim Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: Texture Problems Again Date: Tue, 27 May 1997 10:02:39 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 93 Message-ID: <338AA32F.9E1C66C4@micronetics.com> References: <33889736.687B@cobradev.demon.co.uk> NNTP-Posting-Host: jim.micronetics.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.0b4 [en] (Win95; I) X-Priority: 3 (Normal) Hi Colin, Maybe I can be of some assistance. 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. GsGetTimInfo copies the information store in the tim into the GsIMAGE structure. So just supplying a pointer is not enough. Probably a case of poor documentation. This should be ok. I have not had a chance to compile this so there could be an odd glitch or two. Hope it works Regards Jim --------- void InitTexture (u_long *addr){ GsIMAGE Info; RECT rect; // skip header address++; // parse tim header GsGetTimInfo(addr, &Info); // set position of bitmap in vram rect.x = Info.px; rect.y = info.py; // set size of bitmap rect.w = Info.pw; rect.h = Info.ph; // Load the bitmap LoadImage(&rect, Info.pixel); // Wait for it to finish uploading DrawSync(0); // Now load the clut to vram // Check that there is a clut if (Info.pmode & 8){ rect.x = Info.cx; rect.y = Info.cy; rect.w = Info.cw; rect.h = Info.ch; LoadImage(&rect,Info.clut); DrawSync(0); } } > > > void InitTexture (u_long *address) > { > GsIMAGE *Info; // tim info ptr > 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); > }