Ver código fonte

Nicer console output

Thomas Buck 11 anos atrás
pai
commit
52dd6cd0af
4 arquivos alterados com 17 adições e 23 exclusões
  1. 1
    1
      src/Render.cpp
  2. 1
    1
      src/SDLSystem.cpp
  3. 8
    8
      src/Sound.cpp
  4. 7
    13
      src/Texture.cpp

+ 1
- 1
src/Render.cpp Ver arquivo

219
 		mTexture.setFlag(Texture::fUseMipmaps);
219
 		mTexture.setFlag(Texture::fUseMipmaps);
220
 	}
220
 	}
221
 
221
 
222
-	printf("Processing textures: ");
222
+	printf("Processing Textures:\n");
223
 
223
 
224
 	color[0] = 0xff;
224
 	color[0] = 0xff;
225
 	color[1] = 0xff;
225
 	color[1] = 0xff;

+ 1
- 1
src/SDLSystem.cpp Ver arquivo

218
 
218
 
219
 	// Create GL context
219
 	// Create GL context
220
 	SDL_Init(SDL_INIT_VIDEO);
220
 	SDL_Init(SDL_INIT_VIDEO);
221
-	printf("@ Created OpenGL Context...\n");
221
+	printf("Created OpenGL Context\n");
222
 	atexit(SDL_Quit);
222
 	atexit(SDL_Quit);
223
 
223
 
224
 	m_width = width;
224
 	m_width = width;

+ 8
- 8
src/Sound.cpp Ver arquivo

79
 	alutInit(NULL, 0);
79
 	alutInit(NULL, 0);
80
 
80
 
81
 	mInit = true;
81
 	mInit = true;
82
-	printf("@Created OpenAL Context...\n");
82
+	printf("Created OpenAL Context\n");
83
 #else
83
 #else
84
-	printf("*Couldn't create sound Context...\n");
84
+	printf("Couldn't create sound Context!\n");
85
 #endif
85
 #endif
86
 
86
 
87
 	return 0;
87
 	return 0;
124
 
124
 
125
 	if (!mInit || !filename || !source)
125
 	if (!mInit || !filename || !source)
126
 	{
126
 	{
127
-		printf("Sound::Add> ERROR pre condition assertion failed\n");
127
+		printf("Sound::AddFile> ERROR pre condition assertion failed\n");
128
 		return -1000;
128
 		return -1000;
129
 	}
129
 	}
130
 
130
 
137
 
137
 
138
 	if (alGetError() != AL_NO_ERROR)
138
 	if (alGetError() != AL_NO_ERROR)
139
    {
139
    {
140
-		fprintf(stderr, "Sound::Init> alGenBuffers call failed\n");
140
+		fprintf(stderr, "Sound::AddFile> alGenBuffers call failed\n");
141
 		return -1;
141
 		return -1;
142
 	}
142
 	}
143
 
143
 
147
 
147
 
148
 	if (alGetError() != AL_NO_ERROR)
148
 	if (alGetError() != AL_NO_ERROR)
149
    {
149
    {
150
-		fprintf(stderr, "Sound::Init> alGenSources call failed\n");
150
+		fprintf(stderr, "Sound::AddFile> alGenSources call failed\n");
151
 		return -2;
151
 		return -2;
152
 	}
152
 	}
153
 
153
 
192
 
192
 
193
 	if (!mInit || !wav || !source)
193
 	if (!mInit || !wav || !source)
194
 	{
194
 	{
195
-		printf("Sound::Add> ERROR pre condition assertion failed\n");
195
+		printf("Sound::AddWave> ERROR pre condition assertion failed\n");
196
 		return -1000;
196
 		return -1000;
197
 	}
197
 	}
198
 
198
 
207
 
207
 
208
 	if (alGetError() != AL_NO_ERROR)
208
 	if (alGetError() != AL_NO_ERROR)
209
    {
209
    {
210
-		fprintf(stderr, "Sound::Init> alGenBuffers call failed\n");
210
+		fprintf(stderr, "Sound::AddWave> alGenBuffers call failed\n");
211
 		return -1;
211
 		return -1;
212
 	}
212
 	}
213
 
213
 
217
 
217
 
218
 	if (alGetError() != AL_NO_ERROR)
218
 	if (alGetError() != AL_NO_ERROR)
219
    {
219
    {
220
-		fprintf(stderr, "Sound::Init> alGenSources call failed\n");
220
+		fprintf(stderr, "Sound::AddWave> alGenSources call failed\n");
221
 		return -2;
221
 		return -2;
222
 	}
222
 	}
223
 
223
 

+ 7
- 13
src/Texture.cpp Ver arquivo

196
 	glTranslatef(x, y, 0);
196
 	glTranslatef(x, y, 0);
197
 	glScalef(scale, scale, 1);
197
 	glScalef(scale, scale, 1);
198
 
198
 
199
-	/* FIXME:
199
+	/*! \fixme
200
 	 * Add utf-8 dencoding of char* string
200
 	 * Add utf-8 dencoding of char* string
201
 	 *
201
 	 *
202
-	 *	Also this string must be preprocessed to have glyph offsets
202
+	 * Also this string must be preprocessed to have glyph offsets
203
 	 * instead of ASCII text in it and support counts over 256 */
203
 	 * instead of ASCII text in it and support counts over 256 */
204
 	glListBase(font->drawListBase - font->utf8Offset);
204
 	glListBase(font->drawListBase - font->utf8Offset);
205
 	glCallLists(strlen(string), GL_BYTE, string);
205
 	glCallLists(strlen(string), GL_BYTE, string);
264
 	if (texture)
264
 	if (texture)
265
 	{
265
 	{
266
 #ifdef DUMP_TTF_TGA
266
 #ifdef DUMP_TTF_TGA
267
-		FILE *f = fopen("/tmp/font.tga", "wb");
267
+		FILE *f = fopen("font.tga", "wb");
268
 		if (f)
268
 		if (f)
269
 		{
269
 		{
270
 			mtk_image__tga_save(f, texture->texture, 256, 256, 4);
270
 			mtk_image__tga_save(f, texture->texture, 256, 256, 4);
272
 		}
272
 		}
273
 		else
273
 		else
274
 		{
274
 		{
275
-			perror("/tmp/ttf_font.tga");
275
+			perror("ttf_font.tga");
276
 		}
276
 		}
277
 #endif
277
 #endif
278
 
278
 
308
 	if (!texture)
308
 	if (!texture)
309
 		return NULL;
309
 		return NULL;
310
 
310
 
311
-	printf("@ Generating gl font from texture...\n");
311
+	printf("Generating gl font from texture...\n");
312
 
312
 
313
 	font = new gl_font_t;
313
 	font = new gl_font_t;
314
 	font->utf8Offset = texture->utf8Offset;
314
 	font->utf8Offset = texture->utf8Offset;
439
 	TTF_SetFontStyle(font, renderStyle);
439
 	TTF_SetFontStyle(font, renderStyle);
440
 
440
 
441
 	/* Allocate a new TTF font texture */
441
 	/* Allocate a new TTF font texture */
442
-	printf("@ Creating font texture from '%s'...\n", filename);
442
+	printf("Creating font texture from '%s'...\n", filename);
443
 	texture = new ttf_texture_t;
443
 	texture = new ttf_texture_t;
444
 	texture->width = textureWidth;
444
 	texture->width = textureWidth;
445
 	texture->utf8Offset = utf8Offset;
445
 	texture->utf8Offset = utf8Offset;
557
 	{
557
 	{
558
 		mFlags |= fUseSDL_TTF;
558
 		mFlags |= fUseSDL_TTF;
559
 
559
 
560
-		printf("@ Started SDL_TTF subsystem...\n");
560
+		printf("Started SDL_TTF subsystem!\n");
561
 		atexit(TTF_Quit);
561
 		atexit(TTF_Quit);
562
 	}
562
 	}
563
 #endif
563
 #endif
1035
 								 (type == 4) ? RGBA : RGB,
1035
 								 (type == 4) ? RGBA : RGB,
1036
 								 (type == 4) ? 32 : 24);
1036
 								 (type == 4) ? 32 : 24);
1037
 
1037
 
1038
-			printf("%c", (id == -1) ? 'x' : 'o');
1039
-			fflush(stdout);
1040
-
1041
 			delete [] image;
1038
 			delete [] image;
1042
 		}
1039
 		}
1043
 
1040
 
1097
 								 (type == 4) ? RGBA : RGB,
1094
 								 (type == 4) ? RGBA : RGB,
1098
 								 (type == 4) ? 32 : 24);
1095
 								 (type == 4) ? 32 : 24);
1099
 
1096
 
1100
-			printf("%c", (id == -1) ? 'x' : 'o');
1101
-			fflush(stdout);
1102
-
1103
 			delete [] image;
1097
 			delete [] image;
1104
 		}
1098
 		}
1105
 
1099
 

Carregando…
Cancelar
Salvar