Path: chuka.playstation.co.uk!news From: "Ben James" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Buggery Title Screen!! Date: Wed, 29 Aug 2001 20:25:15 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 120 Message-ID: <9mjfqr$dra4@www.netyaroze-europe.com> References: <9mgsl9$8t81@www.netyaroze-europe.com> NNTP-Posting-Host: du-011-0013.claranet.co.uk X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Could the CLUT be positioned somewhere in the frame buffer? That could make all the sprites appear black. Something I always do during development is clear the screen to mid-grey at the start of a frame. Quite often when something's not quite working it get drawn as black and therefore invisible on a black background. Ben "Max" wrote in message news:9mgsl9$8t81@www.netyaroze-europe.com... Hey all, Now I'm trying to get the title screen in MonkyRegs, and I thought I had it sussed until the Yaroze told me otherwise. I can't honestly see where its going wrong. I have 640 x 512 res and I'm trying to get 4 230 x 222 x 8-bit images on the screen arranged into a (imperfect) square. The code I use for loading and setting up the sprite is below, can someone have a look and tell me whats wrong if anything, I'm in the process of narrowing down the causes. Does anyone else use the gnu debugger? - if so do they have as much damn trouble getting the thing to run as I do? - I have given up on it completely. This code is executed before I go into the game loop, the mode is first 2D to allow the menu to be put up, then when the game starts I switch to 3D. (I will probably will have the title screen overlayed on the 3D arena eventually but just now I want to get this working so that if I come to adding anything before the title screen I will know how to. Thanks all. /*-------------------------------------CODE-------------------------------*/ void InitSprite(u_long *addr, GsSPRITE *sprite, short xPos, short yPos) { RECT rect; // this is a rectangle in which the sprite will be stored GsIMAGE imageInfo; // this holds the actual sprite data GsGetTimInfo((u_long *)(addr+4),&imageInfo); // read the TIM and store its data in imageInfo // set up the rect before we load in the data setRect(&rect,imageInfo.px,imageInfo.py,imageInfo.pw,imageInfo.ph); // set up the rect for texture loading to VRAM LoadImage(&rect, imageInfo.pixel); // load in the data to the rect DrawSync(0); // check to see if the image has a clut i.e. < 16 bit if((imageInfo.pmode>>3)&0x01) { // CLUT exists so load it into the rect setRect(&rect,imageInfo.cx,imageInfo.cy,imageInfo.cw,imageInfo.ch); // set up the rect for texture loading to VRAM LoadImage(&rect, imageInfo.clut); // Loads all of the above into the Frame Buffer DrawSync(0); } sprite->x = xPos; // set up the position within the frame sprite->y = yPos; // check for bit mode if(0) switch(imageInfo.pmode) { case 0x08 /*4 bit*/ : sprite->attribute = 0 << 24; // this tells the yaroze what attributes the image has sprite->w = imageInfo.pw*4; // this is the image data offset in the VRAM sprite->tpage = GetTPage(0,0,imageInfo.px,imageInfo.py); // gets texture page address break; case 0x09 /*8 bit*/ : sprite->attribute = 1 << 24; sprite->w = imageInfo.pw*2; sprite->tpage = GetTPage(1,0,imageInfo.px,imageInfo.py); break; default /*16 bit*/ : sprite->attribute = 1 << 25; sprite->w = imageInfo.pw; sprite->tpage = GetTPage(2,0,imageInfo.px,imageInfo.py); break; } sprite->h = imageInfo.ph; // sets the height of the sprite sprite->u = 0; // sets the texture page offset of the sprite along the x axis sprite->v = 0; // sets the texture page offset of the sprite along the y axis sprite->cx = imageInfo.cx; // sets the x position of the CLUT, if any sprite->cy = imageInfo.cy; sprite->r = 128; // used to apply brightness to the sprite, 128 is normal sprite->g = 128; sprite->b = 128; sprite->mx = sprite->w/2; // sets the center point of the sprite for use with rotation etc sprite->my = sprite->h/2; sprite->scalex = 4096; // sets sprite scaling to default, x axis sprite->scaley = 4096; // sets sprite scaling to default, y axis sprite->rotate = 0; // sets rotation to off } /*-------------------------------------------CODE--------------------------- -----*/ Max