Example #1
0
PCOL TDBASE::ColDB(PGLOBAL g, PSZ name, int num)
  {
  int     i;
  PCOLDEF cdp;
  PCOL    cp, colp = NULL, cprec = NULL;

  if (trace)
    htrc("ColDB: am=%d colname=%s tabname=%s num=%d\n",
          GetAmType(), SVP(name), Name, num);

  for (cdp = To_Def->GetCols(), i = 1; cdp; cdp = cdp->GetNext(), i++)
    if ((!name && !num) ||
         (name && !stricmp(cdp->GetName(), name)) || num == i) {
      /*****************************************************************/
      /*  Check for existence of desired column.                       */
      /*  Also find where to insert the new block.                     */
      /*****************************************************************/
      for (cp = Columns; cp; cp = cp->GetNext())
        if ((num && cp->GetIndex() == i) || 
            (name && !stricmp(cp->GetName(), name)))
          break;             // Found
        else if (cp->GetIndex() < i)
          cprec = cp;

      if (trace)
        htrc("cdp(%d).Name=%s cp=%p\n", i, cdp->GetName(), cp);

      /*****************************************************************/
      /*  Now take care of Column Description Block.                   */
      /*****************************************************************/
      if (cp)
        colp = cp;
      else if (!(cdp->Flags & U_SPECIAL))
        colp = MakeCol(g, cdp, cprec, i);
      else if (Mode != MODE_INSERT)
        colp = InsertSpcBlk(g, cdp);

      if (trace)
        htrc("colp=%p\n", colp);

      if (name || num)
        break;
      else if (colp && !colp->IsSpecial())
        cprec = colp;

      } // endif Name

  return (colp);
  } // end of ColDB
Example #2
0
void gsw_TextLine(char* text, s16 xp, s16 yp, int z,
				  int alignment, s16 alignPos)
{
	char currentChar; // current character
	u16	*charRect; // current char tex coords	
    u16	x0, y0, x1, y1;	// rectangle for current character
	u16 w, h; // width and height of above rectangle

	currentChar = *text;

	xp += internal_gsw_GetStringPos(text, alignment, alignPos);

	while(currentChar)
	{
		// Read the texture coordinates for current character
		charRect = &gsw_charSizesPointer[currentChar*4];		
		x0 = *charRect++;
		y0 = *charRect++;
		x1 = *charRect++;
		y1 = *charRect++;
		//x0++;
		//x1;
		//y1++;
		w  = x1-x0+1;
		h  = y1-y0+1;

		if (gsw_stretch_font == 1)
		{
			w = w*2;
		}

        PbPrimSpriteTexture( p_texture_font, 
                            xp<<4, yp<<4,  
						    x0<<4, y0<<4, 
                            (int)(xp+(w/1.2f))<<4, (int)(yp+(h/1.2f))<<4,
						    x1<<4, y1<<4,
						    z, MakeCol(0x80,0x80,0x80,CalcTextAlpha(yp)));

		// Advance drawing position
		xp += (int)(w/1.2f) + gsw_font_spacing;	

		// Get next character
		text++;
		currentChar = *text;		
	}
}