Commits

Anonymous committed ae84a33

Converted C++ style comments in to C style comments, some compilers will complain otherwise.

Comments (0)

Files changed (2)

    Bpp = Surface->format->BytesPerPixel;
    bits = ((Uint8 *)Surface->pixels)+Y*Surface->pitch+X*Bpp;
 
-   // Get the pixel
+   /* Get the pixel */
    switch(Bpp) {
       case 1:
          return *((Uint8 *)Surface->pixels + Y * Surface->pitch + X);
       case 2:
          return *((Uint16 *)Surface->pixels + Y * Surface->pitch/2 + X);
          break;
-      case 3: { // Format/endian independent 
+      case 3: { /* Format/endian independent  */
          Uint8 r, g, b;
          r = *((bits)+Surface->format->Rshift/8);
          g = *((bits)+Surface->format->Gshift/8);
     if(text == NULL)
 	return;
 
-    // these values won't change in the loop
+    /* these values won't change in the loop */
     srcrect.y = 1;
     dstrect.y = y;
     srcrect.h = dstrect.h = Font->Surface->h - 1;
 
     for(c = text; *c != '\0' && x <= Surface->w ; c++) {
 	charoffset = ((int) (*c - 33)) * 2 + 1;
-	// skip spaces and nonprintable characters
+	/* skip spaces and nonprintable characters */
 	if (*c == ' ' || charoffset < 0 || charoffset > Font->MaxPos) {
 	    x += Font->CharPos[2]-Font->CharPos[1];
 	    continue;
 
     for(c = text; *c != '\0'; c++) {
 	charoffset = ((int) *c - 33) * 2 + 1;
-	// skip spaces and nonprintable characters
+	/* skip spaces and nonprintable characters */
         if (*c == ' ' || charoffset < 0 || charoffset > Font->MaxPos) {
             width += Font->CharPos[2]-Font->CharPos[1];
 	    continue;
 extern "C" {
 #endif
 
-// Delcare one variable of this type for each font you are using.
-// To load the fonts, load the font image into YourFont->Surface
-// and call InitFont( YourFont );
+/*
+** Delcare one variable of this type for each font you are using.
+** To load the fonts, load the font image into YourFont->Surface
+** and call InitFont( YourFont );
+*/
 typedef struct {
 	SDL_Surface *Surface;	
 	int CharPos[512];
 	int MaxPos;
 } SFont_Font;
 
-// Initializes the font
-// Font: this contains the suface with the font.
-//       The Surface must be loaded before calling this function
+/*
+** Initializes the font
+** Font: this contains the suface with the font.
+**       The Surface must be loaded before calling this function
+*/
 SFont_Font* SFont_InitFont (SDL_Surface *Font);
-
-// Frees the font
-// Font: The font to free
-//       The font must be loaded before using this function.
+
+/*
+** Frees the font
+** Font: The font to free
+**       The font must be loaded before using this function.
+*/
 void SFont_FreeFont(SFont_Font* Font);
 
-// Blits a string to a surface
-// Destination: the suface you want to blit to
-// text: a string containing the text you want to blit.
+/*
+** Blits a string to a surface
+** Destination: the suface you want to blit to
+** text: a string containing the text you want to blit.
+*/
 void SFont_Write(SDL_Surface *Surface, const SFont_Font *Font, int x, int y,
 				 const char *text);
 
-// Returns the width of "text" in pixels
+/* Returns the width of "text" in pixels */
 int SFont_TextWidth(const SFont_Font* Font, const char *text);
-// Returns the height of "text" in pixels (which is always equal to Font->Surface->h)
+/* Returns the height of "text" in pixels (which is always equal to Font->Surface->h) */
 int SFont_TextHeight(const SFont_Font* Font);
 
-// Blits a string to Surface with centered x position
+/* Blits a string to Surface with centered x position */
 void SFont_WriteCenter(SDL_Surface *Surface, const SFont_Font* Font, int y,
 					   const char *text);