summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/FileMgr.cpp3
-rw-r--r--src/core/FileMgr.h2
-rw-r--r--src/core/Streaming.cpp5
-rw-r--r--src/core/config.h2
-rw-r--r--src/core/main.cpp2
-rw-r--r--src/core/main.h2
6 files changed, 11 insertions, 5 deletions
diff --git a/src/core/FileMgr.cpp b/src/core/FileMgr.cpp
index 99923ddf..32aa4041 100644
--- a/src/core/FileMgr.cpp
+++ b/src/core/FileMgr.cpp
@@ -241,7 +241,7 @@ CFileMgr::SetDirMyDocuments(void)
}
ssize_t
-CFileMgr::LoadFile(const char *file, uint8 *buf, int unused, const char *mode)
+CFileMgr::LoadFile(const char *file, uint8 *buf, int maxlen, const char *mode)
{
int fd;
ssize_t n, len;
@@ -257,6 +257,7 @@ CFileMgr::LoadFile(const char *file, uint8 *buf, int unused, const char *mode)
return -1;
#endif
len += n;
+ assert(len < maxlen);
}while(n == 0x4000);
buf[len] = 0;
myfclose(fd);
diff --git a/src/core/FileMgr.h b/src/core/FileMgr.h
index 98a78360..f70451b7 100644
--- a/src/core/FileMgr.h
+++ b/src/core/FileMgr.h
@@ -9,7 +9,7 @@ public:
static void ChangeDir(const char *dir);
static void SetDir(const char *dir);
static void SetDirMyDocuments(void);
- static ssize_t LoadFile(const char *file, uint8 *buf, int unused, const char *mode);
+ static ssize_t LoadFile(const char *file, uint8 *buf, int maxlen, const char *mode);
static int OpenFile(const char *file, const char *mode);
static int OpenFile(const char *file) { return OpenFile(file, "rb"); }
static int OpenFileForWriting(const char *file);
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index 81931b40..27d41fca 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -541,7 +541,12 @@ CStreaming::ConvertBufferToObject(int8 *buf, int32 streamId)
// Txd and anim have to be loaded
int animId = mi->GetAnimFileIndex();
+#ifdef FIX_BUGS
+ if(!HasTxdLoaded(mi->GetTxdSlot()) ||
+#else
+ // texDict will exist even if only first part has loaded
if(CTxdStore::GetSlot(mi->GetTxdSlot())->texDict == nil ||
+#endif
animId != -1 && !CAnimManager::GetAnimationBlock(animId)->isLoaded){
RemoveModel(streamId);
ReRequestModel(streamId);
diff --git a/src/core/config.h b/src/core/config.h
index 85657e9c..7eff57a0 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -71,7 +71,7 @@ enum Config {
PATHNODESIZE = 4500,
- NUMWEATHERS = 7,
+ NUMWEATHERS = 8,
NUMHOURS = 24,
NUMEXTRADIRECTIONALS = 4,
diff --git a/src/core/main.cpp b/src/core/main.cpp
index d9579fee..e3217fde 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -76,7 +76,7 @@
GlobalScene Scene;
-uint8 work_buff[55000];
+uint8 work_buff[55000 * 2];
char gString[256];
char gString2[512];
wchar gUString[256];
diff --git a/src/core/main.h b/src/core/main.h
index 37a82fb2..e1d3de9c 100644
--- a/src/core/main.h
+++ b/src/core/main.h
@@ -7,7 +7,7 @@ struct GlobalScene
};
extern GlobalScene Scene;
-extern uint8 work_buff[55000];
+extern uint8 work_buff[55000 * 2];
extern char gString[256];
extern char gString2[512];
extern wchar gUString[256];