aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--examples/smelt_test.cpp2
-rw-r--r--extensions/smdatapack.cpp2
-rw-r--r--include/smdatapack.hpp1
-rw-r--r--tools/dtputil/anmutil.cpp5
-rw-r--r--tools/dtputil/dtputil.cpp5
-rw-r--r--tools/dtputil/makefile4
7 files changed, 14 insertions, 9 deletions
diff --git a/README.md b/README.md
index 66763a1..db90cb2 100644
--- a/README.md
+++ b/README.md
@@ -11,8 +11,8 @@ A D3D version will be put into construction _soon_.
Building
--------
-Building the SDL version of SMELT is only officially tested
-on debian sid and debian jessie.
+Building the SDL version of SMELT is now officially tested
+on debian sid, debian jessie and Arch Linux.
Theoretically the SDL version should work on Windows
with little modification :)
diff --git a/examples/smelt_test.cpp b/examples/smelt_test.cpp
index 99a9aa9..c1dc8d8 100644
--- a/examples/smelt_test.cpp
+++ b/examples/smelt_test.cpp
@@ -147,7 +147,7 @@ int main()
fonttest.setScale(1.);
//load the truetype font.
- if(!ttftest.loadTTF("/usr/share/fonts/truetype/wqy/wqy-microhei.ttc",18))sm->smLog("ttf load error!");
+ if(!ttftest.loadTTF("/usr/share/fonts/truetype/wqy/wqy-microhei.ttc",18))if(!ttftest.loadTTF("/usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc",18))sm->smLog("ttf load error!");
//load the texture.
tex=sm->smTextureLoad("SpriteSheet.png");
diff --git a/extensions/smdatapack.cpp b/extensions/smdatapack.cpp
index 8b2c12b..fa572da 100644
--- a/extensions/smdatapack.cpp
+++ b/extensions/smdatapack.cpp
@@ -126,6 +126,8 @@ void smDtpFileR::releaseFilePtr(const char* path)
}
DWORD smDtpFileR::getFileSize(const char* path)
{if(m.find(std::string(path))==m.end()){printf("error: file not found in the archive.\n");return 0;}return m[std::string(path)].size;}
+DWORD smDtpFileR::getFileCRC(const char* path)
+{if(m.find(std::string(path))==m.end()){printf("error: file not found in the archive.\n");return 0;}return m[std::string(path)].crc;}
smDtpFileW::smDtpFileW(){fcnt=0;}
bool smDtpFileW::addFile(const char* path,const char* realpath)
diff --git a/include/smdatapack.hpp b/include/smdatapack.hpp
index 2689eb3..95392d3 100644
--- a/include/smdatapack.hpp
+++ b/include/smdatapack.hpp
@@ -42,6 +42,7 @@ public:
char* getFilePtr(const char* path);
void releaseFilePtr(const char* path);
DWORD getFileSize(const char* path);
+ DWORD getFileCRC(const char* path);
};
class smDtpFileW
{
diff --git a/tools/dtputil/anmutil.cpp b/tools/dtputil/anmutil.cpp
index 6636e2c..fd5d376 100644
--- a/tools/dtputil/anmutil.cpp
+++ b/tools/dtputil/anmutil.cpp
@@ -45,7 +45,7 @@ int main(int argc,char** argv)
puts(c);
char *ptr=file.getFilePtr(c);
if(!ptr)printf("error\n");else
- printf("size:%lu, first bytes:%c%c%c\n",file.getFileSize(c),*ptr,*(ptr+1),*(ptr+2));
+ printf("size:%u, CRC 0x%08X\n",file.getFileSize(c),file.getFileCRC(c));
file.releaseFilePtr(c);
}
}
@@ -53,7 +53,8 @@ int main(int argc,char** argv)
for(int i=3;i<argc;++i)
{
char *ptr=file.getFilePtr(argv[i]);
- printf("size:%lu, first bytes:%c%c%c\n",file.getFileSize(argv[i]),*ptr,*(ptr+1),*(ptr+2));
+ if(!ptr)printf("error\n");else
+ printf("size:%u, CRC 0x%08X\n",file.getFileSize(argv[i]),file.getFileCRC(argv[i]));
file.releaseFilePtr(argv[i]);
}
file.closeDtp();
diff --git a/tools/dtputil/dtputil.cpp b/tools/dtputil/dtputil.cpp
index 142a679..6563c56 100644
--- a/tools/dtputil/dtputil.cpp
+++ b/tools/dtputil/dtputil.cpp
@@ -27,7 +27,7 @@ int main(int argc,char** argv)
puts(c);
char *ptr=file.getFilePtr(c);
if(!ptr)printf("error\n");else
- printf("size:%lu, first bytes:%c%c%c\n",file.getFileSize(c),*ptr,*(ptr+1),*(ptr+2));
+ printf("size:%u, CRC: 0x%08X\n",file.getFileSize(c),file.getFileCRC(c));
file.releaseFilePtr(c);
}
}
@@ -35,7 +35,8 @@ int main(int argc,char** argv)
for(int i=3;i<argc;++i)
{
char *ptr=file.getFilePtr(argv[i]);
- printf("size:%lu, first bytes:%c%c%c\n",file.getFileSize(argv[i]),*ptr,*(ptr+1),*(ptr+2));
+ if(!ptr)printf("error\n");else
+ printf("size:%u, CRC: 0x%08X\n",file.getFileSize(argv[i]),file.getFileCRC(argv[i]));
file.releaseFilePtr(argv[i]);
}
file.closeDtp();
diff --git a/tools/dtputil/makefile b/tools/dtputil/makefile
index cb0ed0a..92ed0fb 100644
--- a/tools/dtputil/makefile
+++ b/tools/dtputil/makefile
@@ -4,7 +4,7 @@ LINK= -lz -lsmeltext
LINK_FOLDER= -L../../extensions/
all: anmutil dtputil
-anmutil:
+anmutil: anmutil.cpp
$(CC) anmutil.cpp -o anmutil $(CXXFLAGS) $(LINK_FOLDER) $(LINK)
-dtputil:
+dtputil: dtputil.cpp
$(CC) dtputil.cpp -o dtputil $(CXXFLAGS) $(LINK_FOLDER) $(LINK) \ No newline at end of file