|
11 | 11 | #include "_lib/jpeglib.h" |
12 | 12 | #include "_lib/tiffio.h" |
13 | 13 | #include "_lib/png.h" |
14 | | -#ifndef __bool_true_false_are_defined |
15 | | -#define __bool_true_false_are_defined |
16 | | -#endif |
17 | 14 | #include "_lib/gif_lib.h" |
18 | 15 |
|
19 | 16 | // ======= |
@@ -61,22 +58,22 @@ void image_c::Free() |
61 | 58 | dat = NULL; |
62 | 59 | } |
63 | 60 |
|
64 | | -bool image_c::Load(char* fileName) |
| 61 | +bool image_c::Load(const char* fileName) |
65 | 62 | { |
66 | 63 | return true; // o_O |
67 | 64 | } |
68 | 65 |
|
69 | | -bool image_c::Save(char* fileName) |
| 66 | +bool image_c::Save(const char* fileName) |
70 | 67 | { |
71 | 68 | return true; // o_O |
72 | 69 | } |
73 | 70 |
|
74 | | -bool image_c::ImageInfo(char* fileName, imageInfo_s* info) |
| 71 | +bool image_c::ImageInfo(const char* fileName, imageInfo_s* info) |
75 | 72 | { |
76 | 73 | return true; // o_O |
77 | 74 | } |
78 | 75 |
|
79 | | -image_c* image_c::LoaderForFile(IConsole* conHnd, char* fileName) |
| 76 | +image_c* image_c::LoaderForFile(IConsole* conHnd, const char* fileName) |
80 | 77 | { |
81 | 78 | fileInputStream_c in; |
82 | 79 | if (in.FileOpen(fileName, true)) { |
@@ -131,7 +128,7 @@ struct tgaHeader_s { |
131 | 128 | }; |
132 | 129 | #pragma pack(pop) |
133 | 130 |
|
134 | | -bool targa_c::Load(char* fileName) |
| 131 | +bool targa_c::Load(const char* fileName) |
135 | 132 | { |
136 | 133 | Free(); |
137 | 134 |
|
@@ -214,7 +211,7 @@ bool targa_c::Load(char* fileName) |
214 | 211 | return false; |
215 | 212 | } |
216 | 213 |
|
217 | | -bool targa_c::Save(char* fileName) |
| 214 | +bool targa_c::Save(const char* fileName) |
218 | 215 | { |
219 | 216 | // Find a suitable image type |
220 | 217 | int ittable[3][3] = { |
@@ -324,7 +321,7 @@ bool targa_c::Save(char* fileName) |
324 | 321 | return false; |
325 | 322 | } |
326 | 323 |
|
327 | | -bool targa_c::ImageInfo(char* fileName, imageInfo_s* info) |
| 324 | +bool targa_c::ImageInfo(const char* fileName, imageInfo_s* info) |
328 | 325 | { |
329 | 326 | // Open the file |
330 | 327 | fileInputStream_c in; |
@@ -432,7 +429,7 @@ struct jpegRead_s: public jpeg_source_mgr { |
432 | 429 | } |
433 | 430 | }; |
434 | 431 |
|
435 | | -bool jpeg_c::Load(char* fileName) |
| 432 | +bool jpeg_c::Load(const char* fileName) |
436 | 433 | { |
437 | 434 | Free(); |
438 | 435 |
|
@@ -525,7 +522,7 @@ struct jpegWrite_s: public jpeg_destination_mgr { |
525 | 522 | } |
526 | 523 | }; |
527 | 524 |
|
528 | | -bool jpeg_c::Save(char* fileName) |
| 525 | +bool jpeg_c::Save(const char* fileName) |
529 | 526 | { |
530 | 527 | // JPEG only supports RGB and grayscale images |
531 | 528 | if (type != IMGTYPE_RGB && type != IMGTYPE_GRAY) { |
@@ -588,7 +585,7 @@ bool jpeg_c::Save(char* fileName) |
588 | 585 |
|
589 | 586 | // JPEG Image Info |
590 | 587 |
|
591 | | -bool jpeg_c::ImageInfo(char* fileName, imageInfo_s* info) |
| 588 | +bool jpeg_c::ImageInfo(const char* fileName, imageInfo_s* info) |
592 | 589 | { |
593 | 590 | // Open the file |
594 | 591 | fileInputStream_c in; |
@@ -677,7 +674,7 @@ static toff_t ITIFF_SizeProc(thandle_t clientData) |
677 | 674 | return cd->io->GetLen(); |
678 | 675 | } |
679 | 676 |
|
680 | | -bool tiff_c::Load(char* fileName) |
| 677 | +bool tiff_c::Load(const char* fileName) |
681 | 678 | { |
682 | 679 | Free(); |
683 | 680 |
|
@@ -712,7 +709,7 @@ bool tiff_c::Load(char* fileName) |
712 | 709 | return ret; |
713 | 710 | } |
714 | 711 |
|
715 | | -bool tiff_c::Save(char* fileName) |
| 712 | +bool tiff_c::Save(const char* fileName) |
716 | 713 | { |
717 | 714 | // Only save RGB or RGBA |
718 | 715 | if (type != IMGTYPE_RGB && type != IMGTYPE_RGBA) { |
@@ -753,7 +750,7 @@ bool tiff_c::Save(char* fileName) |
753 | 750 | return false; |
754 | 751 | } |
755 | 752 |
|
756 | | -bool tiff_c::ImageInfo(char* fileName, imageInfo_s* info) |
| 753 | +bool tiff_c::ImageInfo(const char* fileName, imageInfo_s* info) |
757 | 754 | { |
758 | 755 | // Open the file |
759 | 756 | fileInputStream_c in; |
@@ -804,7 +801,7 @@ static void IPNG_ReadProc(png_structp png, png_bytep data, png_size_t len) |
804 | 801 | } |
805 | 802 | } |
806 | 803 |
|
807 | | -bool png_c::Load(char* fileName) |
| 804 | +bool png_c::Load(const char* fileName) |
808 | 805 | { |
809 | 806 | Free(); |
810 | 807 |
|
@@ -875,7 +872,7 @@ static void IPNG_FlushProc(png_structp png) |
875 | 872 | out->FileFlush(); |
876 | 873 | } |
877 | 874 |
|
878 | | -bool png_c::Save(char* fileName) |
| 875 | +bool png_c::Save(const char* fileName) |
879 | 876 | { |
880 | 877 | if (type != IMGTYPE_RGB && type != IMGTYPE_RGBA) { |
881 | 878 | return true; |
@@ -915,7 +912,7 @@ bool png_c::Save(char* fileName) |
915 | 912 |
|
916 | 913 | // PNG Image Info |
917 | 914 |
|
918 | | -bool png_c::ImageInfo(char* fileName, imageInfo_s* info) |
| 915 | +bool png_c::ImageInfo(const char* fileName, imageInfo_s* info) |
919 | 916 | { |
920 | 917 | // Open file and check signature |
921 | 918 | fileInputStream_c in; |
@@ -973,7 +970,7 @@ static int IGIF_ReadProc(GifFileType* gif, GifByteType* buf, int len) |
973 | 970 | return len; |
974 | 971 | } |
975 | 972 |
|
976 | | -bool gif_c::Load(char* fileName) |
| 973 | +bool gif_c::Load(const char* fileName) |
977 | 974 | { |
978 | 975 | // Open file |
979 | 976 | fileInputStream_c in; |
@@ -1025,13 +1022,13 @@ bool gif_c::Load(char* fileName) |
1025 | 1022 | return false; |
1026 | 1023 | } |
1027 | 1024 |
|
1028 | | -bool gif_c::Save(char* fileName) |
| 1025 | +bool gif_c::Save(const char* fileName) |
1029 | 1026 | { |
1030 | 1027 | // HELL no. |
1031 | 1028 | return true; |
1032 | 1029 | } |
1033 | 1030 |
|
1034 | | -bool gif_c::ImageInfo(char* fileName, imageInfo_s* info) |
| 1031 | +bool gif_c::ImageInfo(const char* fileName, imageInfo_s* info) |
1035 | 1032 | { |
1036 | 1033 | return true; |
1037 | 1034 | } |
@@ -1063,7 +1060,7 @@ struct blpMipmapHeader_s { |
1063 | 1060 | }; |
1064 | 1061 | #pragma pack(pop) |
1065 | 1062 |
|
1066 | | -bool blp_c::Load(char* fileName) |
| 1063 | +bool blp_c::Load(const char* fileName) |
1067 | 1064 | { |
1068 | 1065 | Free(); |
1069 | 1066 |
|
@@ -1134,13 +1131,13 @@ bool blp_c::Load(char* fileName) |
1134 | 1131 | return false; |
1135 | 1132 | } |
1136 | 1133 |
|
1137 | | -bool blp_c::Save(char* fileName) |
| 1134 | +bool blp_c::Save(const char* fileName) |
1138 | 1135 | { |
1139 | 1136 | // No. |
1140 | 1137 | return true; |
1141 | 1138 | } |
1142 | 1139 |
|
1143 | | -bool blp_c::ImageInfo(char* fileName, imageInfo_s* info) |
| 1140 | +bool blp_c::ImageInfo(const char* fileName, imageInfo_s* info) |
1144 | 1141 | { |
1145 | 1142 | // Open the file |
1146 | 1143 | fileInputStream_c in; |
|
0 commit comments