-
Notifications
You must be signed in to change notification settings - Fork 0
/
etcpack_unix.patch
102 lines (94 loc) · 2.67 KB
/
etcpack_unix.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
--- etcpack.cxx 2010-11-30 11:33:58.000000000 -0800
+++ etcpack.cxx 2011-01-09 21:13:12.000000000 -0800
@@ -127,8 +127,8 @@
#define KTX_ENDIAN_REF (0x04030201)
#define KTX_ENDIAN_REF_REV (0x01020304)
-static enum {GL_R=0x1903,GL_RG=0x8227,GL_RGB=0x1907,GL_RGBA=0x1908};
-static enum {GL_ETC1_RGB8_OES=0x8d64};
+enum {GL_R=0x1903,GL_RG=0x8227,GL_RGB=0x1907,GL_RGBA=0x1908};
+enum {GL_ETC1_RGB8_OES=0x8d64};
int ktx_identifier[] = KTX_IDENTIFIER_REF;
@@ -291,7 +291,7 @@
// Delete temp file if it exists.
if(fileExist("tmp.ppm"))
{
- sprintf(str, "del tmp.ppm\n");
+ sprintf(str, "rm tmp.ppm\n");
system(str);
}
@@ -300,7 +300,7 @@
if(!strcmp(&filename[q],".ppm"))
{
// Already a .ppm file. Just copy.
- sprintf(str,"copy %s tmp.ppm \n", filename);
+ sprintf(str,"cp %s tmp.ppm \n", filename);
printf("Copying source file to tmp.ppm\n", filename);
}
else
@@ -334,7 +334,7 @@
{
width=w1;
height=h1;
- system("del tmp.ppm");
+ system("rm tmp.ppm");
// Width must be divisible by 2 and height must be
// divisible by 4. Otherwise, we will not compress
@@ -390,7 +390,7 @@
// Delete temp file if it exists.
if(fileExist("tmp.ppm"))
{
- sprintf(str, "del tmp.ppm\n");
+ sprintf(str, "rm tmp.ppm\n");
system(str);
}
@@ -399,7 +399,7 @@
if(!strcmp(&filename[q],".ppm"))
{
// Already a .ppm file. Just copy.
- sprintf(str,"copy %s tmp.ppm \n", filename);
+ sprintf(str,"cp %s tmp.ppm \n", filename);
printf("Copying source file to tmp.ppm\n", filename);
}
else
@@ -423,7 +423,7 @@
{
width=w1;
height=h1;
- system("del tmp.ppm");
+ system("rm tmp.ppm");
return true;
}
@@ -6937,7 +6937,7 @@
uint8 *srcimg;
int width,height;
int extendedwidth, extendedheight;
- struct _timeb tstruct;
+ //struct _timeb tstruct;
int tstart;
int tstop;
double PSNR;
@@ -6975,12 +6975,12 @@
{
printf("Compressing...\n");
tstart=time(NULL);
- _ftime( &tstruct );
- tstart=tstart*1000+tstruct.millitm;
+ //_ftime( &tstruct );
+ //tstart=tstart*1000+tstruct.millitm;
compressImageFile(srcimg,width,height,dstfile,extendedwidth, extendedheight, action);
tstop = time(NULL);
- _ftime( &tstruct );
- tstop = tstop*1000+tstruct.millitm;
+ //_ftime( &tstruct );
+ //tstop = tstop*1000+tstruct.millitm;
printf( "It took %u milliseconds to compress:\n", tstop - tstart);
PSNR = calculatePSNRfile(dstfile, srcimg);
free(srcimg);
@@ -7187,7 +7187,7 @@
// Delete destination file if it exists
if(fileExist(dstfile))
{
- sprintf(str, "del %s\n",dstfile);
+ sprintf(str, "rm %s\n",dstfile);
system(str);
}