[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/tools png2stratagus.cpp
From: |
Martin Renold |
Subject: |
[Stratagus-CVS] stratagus/tools png2stratagus.cpp |
Date: |
Mon, 28 Jul 2003 15:25:23 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Martin Renold <address@hidden> 03/07/28 15:25:23
Modified files:
tools : png2stratagus.cpp
Log message:
small adaptions
Patches:
Index: stratagus/tools/png2stratagus.cpp
diff -u stratagus/tools/png2stratagus.cpp:1.1
stratagus/tools/png2stratagus.cpp:1.2
--- stratagus/tools/png2stratagus.cpp:1.1 Thu Jul 17 05:06:53 2003
+++ stratagus/tools/png2stratagus.cpp Mon Jul 28 15:25:23 2003
@@ -26,7 +26,7 @@
/* To compile this programm:
- % g++ -o png2stratagus png2stratagus.cxx -lpng
+ % g++ -o png2stratagus png2stratagus.cpp -lpng
*/
/* This programm can be used to fix the palette of a indexed png file
@@ -50,6 +50,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <png.h>
+#include <assert.h>
#define MAX_COLORS 228
@@ -166,9 +167,11 @@
if (num_colors > MAX_COLORS)
{
- std::cout << "Image has more than " << MAX_COLORS
- << " colors (" << num_colors << "), bailout" << std::endl;
- exit (EXIT_FAILURE);
+ std::cout << "WARNING: Image has more than " << MAX_COLORS
+ << " colors (" << num_colors << ")" << std::endl;
+ std::cout << "Assuming colors > " << MAX_COLORS
+ << " are unused" << std::endl;
+ num_colors = MAX_COLORS;
}
m_palette.resize (256);