[Supertux-Commit] r5453 - trunk/jnrcol

grumbel at millhouse.dreamhost.com grumbel at millhouse.dreamhost.com
Fri May 9 15:13:51 PDT 2008


Author: grumbel
Date: 2008-05-09 15:13:51 -0700 (Fri, 09 May 2008)
New Revision: 5453

Modified:
   trunk/jnrcol/SDL_tty.c
   trunk/jnrcol/SDL_tty.h
   trunk/jnrcol/jumpnrun.cpp
Log:
Fixed some warnings and made jumprun compile again

Modified: trunk/jnrcol/SDL_tty.c
===================================================================
--- trunk/jnrcol/SDL_tty.c	2008-05-09 14:57:28 UTC (rev 5452)
+++ trunk/jnrcol/SDL_tty.c	2008-05-09 22:13:51 UTC (rev 5453)
@@ -80,7 +80,7 @@
 }
 
 TTY_Font*
-TTY_CreateFont(SDL_Surface* surface, int glyph_width, int glyph_height, char* letters)
+TTY_CreateFont(SDL_Surface* surface, int glyph_width, int glyph_height, const char* letters)
 {
   int i;
   TTY_Font* font = (TTY_Font*)malloc(sizeof(TTY_Font));

Modified: trunk/jnrcol/SDL_tty.h
===================================================================
--- trunk/jnrcol/SDL_tty.h	2008-05-09 14:57:28 UTC (rev 5452)
+++ trunk/jnrcol/SDL_tty.h	2008-05-09 22:13:51 UTC (rev 5453)
@@ -132,7 +132,7 @@
  *  @param glyph_height The height of a glyph
  *  @param letters      The letters that are present in the font
  */
-TTY_Font* TTY_CreateFont(SDL_Surface* surface, int glyph_width, int glyph_height, char* letters);
+TTY_Font* TTY_CreateFont(SDL_Surface* surface, int glyph_width, int glyph_height, const char* letters);
 void      TTY_FreeFont(TTY_Font* font);
 
 /**

Modified: trunk/jnrcol/jumpnrun.cpp
===================================================================
--- trunk/jnrcol/jumpnrun.cpp	2008-05-09 14:57:28 UTC (rev 5452)
+++ trunk/jnrcol/jumpnrun.cpp	2008-05-09 22:13:51 UTC (rev 5453)
@@ -1,9 +1,10 @@
 #include <SDL.h>
+#include <SDL_image.h>
 #include <iostream>
 #include "SDL_tty.h"
 #include "jumpnrun.hpp"
 
-char* level[] = {
+const char* level[] = {
   "                    ",
   "                    ",
   "                    ",
@@ -236,7 +237,16 @@
 
     SDL_SetClipRect(screen, &rect); 
 
-    tty = TTY_Create(40, 30);
+    {
+      //SDL_Surface* temp = TTY_CreateRGBSurface(font8x12);
+      SDL_Surface* temp = IMG_Load("c64_16x16.png");
+      
+      TTY_Font* font = TTY_CreateFont(temp, 16, 16, 
+                                      "\x7f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                                      "[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~");
+      tty = TTY_Create(40, 30, font);
+      SDL_FreeSurface(temp);
+    }
 
     TTY_printf(tty, "\n    **** COMMODORE 64 BASIC V2 ****\n\n");
     TTY_printf(tty, " 64k RAM SYSTEM  38911 BASIC BYTES FREE\n\n");
@@ -255,9 +265,9 @@
           {
             switch(event.type) 
               { 
-              case SDL_QUIT: 
-                quit = true;
-                break;
+                case SDL_QUIT: 
+                  quit = true;
+                  break;
               }
           }
         




More information about the Supertux-Commit mailing list