summaryrefslogtreecommitdiff
path: root/src/win95
diff options
context:
space:
mode:
Diffstat (limited to 'src/win95')
-rw-r--r--src/win95/animchnk.cpp2
-rw-r--r--src/win95/animobs.cpp4
-rw-r--r--src/win95/animobs.hpp4
-rw-r--r--src/win95/chnkload.cpp10
-rw-r--r--src/win95/fragchnk.cpp6
-rw-r--r--src/win95/hash_tem.hpp2
-rw-r--r--src/win95/hierchnk.cpp6
-rw-r--r--src/win95/hierchnk.hpp4
-rw-r--r--src/win95/mishchnk.cpp2
-rw-r--r--src/win95/obchunk.cpp4
-rw-r--r--src/win95/shpchunk.cpp9
11 files changed, 29 insertions, 24 deletions
diff --git a/src/win95/animchnk.cpp b/src/win95/animchnk.cpp
index f6802cb..adaecaa 100644
--- a/src/win95/animchnk.cpp
+++ b/src/win95/animchnk.cpp
@@ -218,7 +218,7 @@ FrameList::FrameList(TEXANIM* p,FrameList* fl,int* conv)
FrameList::~FrameList()
{
delete [] Textures;
- delete UVCoords;
+ delete [] UVCoords;
}
TEXANIM::TEXANIM()
diff --git a/src/win95/animobs.cpp b/src/win95/animobs.cpp
index 56539f5..f1c00ee 100644
--- a/src/win95/animobs.cpp
+++ b/src/win95/animobs.cpp
@@ -153,9 +153,9 @@ void Object_Animation_Sequence_Header_Chunk::fill_data_block (char *data_start)
Object_Animation_Sequence_Header_Chunk::~Object_Animation_Sequence_Header_Chunk()
{
if (sequence_name)
- delete sequence_name;
+ delete[] sequence_name;
if(extra_data)
- delete extra_data;
+ delete[] extra_data;
}
Object_Animation_Sequence_Header_Chunk::Object_Animation_Sequence_Header_Chunk (Chunk_With_Children * parent,const char * data_start, size_t)
diff --git a/src/win95/animobs.hpp b/src/win95/animobs.hpp
index 727df47..ee93efb 100644
--- a/src/win95/animobs.hpp
+++ b/src/win95/animobs.hpp
@@ -246,7 +246,9 @@ struct Object_Animation_Frame
{
ChunkQuat orientation;
ChunkVectorInt transform;
- signed long at_frame_no; //frame start time (0-65535)
+
+ // SBF: 64HACK - changed long to int32_t as this structure isn't serialized correctly
+ int32_t at_frame_no; //frame start time (0-65535)
int flags;
int get_sound_index(){return ((flags & HierarchyFrame_SoundIndexMask )>>24);}
diff --git a/src/win95/chnkload.cpp b/src/win95/chnkload.cpp
index 1d450c2..99bc0a5 100644
--- a/src/win95/chnkload.cpp
+++ b/src/win95/chnkload.cpp
@@ -91,7 +91,7 @@ Shape_Fragment_Type::~Shape_Fragment_Type()
#endif
}
- if(name) delete name;
+ if(name) delete[] name;
}
void Shape_Fragment_Type::AddShape(SHAPEHEADER* shp)
@@ -2403,7 +2403,7 @@ BOOL copy_to_shapeheader (
uv_imnums[item_list[i*9+3]>>16]=local_tex_index_nos[texno];
item_list[i*9 + 3] += local_tex_index_nos[texno];
- shphd->sh_textures[UVIndex] = (int *) PoolAllocateMem (sizeof(int) * cshp_ptr->uv_list[UVIndex].num_verts * 2);
+ shphd->sh_textures[UVIndex] = (int *) PoolAllocateMem (sizeof(int *) * cshp_ptr->uv_list[UVIndex].num_verts * 2);
for (j=0; j<cshp_ptr->uv_list[UVIndex].num_verts; j++) {
(shphd->sh_textures[UVIndex])[(j*2)] = ProcessUVCoord(h,UVC_POLY_U,(int)cshp_ptr->uv_list[UVIndex].vert[j].u,uv_imnums[UVIndex]);
(shphd->sh_textures[UVIndex])[(j*2)+1] = ProcessUVCoord(h,UVC_POLY_V,(int)cshp_ptr->uv_list[UVIndex].vert[j].v,uv_imnums[UVIndex]);
@@ -3444,7 +3444,7 @@ BOOL copy_to_mainshpl (Shape_Chunk * shp, int list_pos)
if (cshp.num_uvs)
{
for (i=0; i<cshp.num_uvs; i++) {
- shphd->sh_textures[i] = (int *) AllocateMem (sizeof(int) * cshp.uv_list[i].num_verts * 2);
+ shphd->sh_textures[i] = (int *) AllocateMem (sizeof(int *) * cshp.uv_list[i].num_verts * 2);
for (j=0; j<cshp.uv_list[i].num_verts; j++) {
(shphd->sh_textures[i])[(j*2)] = (int)cshp.uv_list[i].vert[j].u;
(shphd->sh_textures[i])[(j*2)+1] = (int)cshp.uv_list[i].vert[j].v;
@@ -3738,7 +3738,7 @@ BOOL copy_to_mainshpl (Shape_Sub_Shape_Chunk * shp, int list_pos)
if (cshp.num_uvs)
{
for (i=0; i<cshp.num_uvs; i++) {
- shphd->sh_textures[i] = (int *) AllocateMem (sizeof(int) * cshp.uv_list[i].num_verts * 2);
+ shphd->sh_textures[i] = (int *) AllocateMem (sizeof(int *) * cshp.uv_list[i].num_verts * 2);
for (j=0; j<cshp.uv_list[i].num_verts; j++) {
(shphd->sh_textures[i])[(j*2)] = (int)cshp.uv_list[i].vert[j].u;
(shphd->sh_textures[i])[(j*2)+1] = (int)cshp.uv_list[i].vert[j].v;
@@ -3957,7 +3957,7 @@ BOOL copy_to_mainshpl (Shape_Sub_Shape_Chunk * shp, int list_pos)
if (cshp.num_uvs)
{
for (i=0; i<cshp.num_uvs; i++) {
- shphd->sh_textures[i] = (int *) AllocateMem (sizeof(int) * cshp.uv_list[i].num_verts * 2);
+ shphd->sh_textures[i] = (int *) AllocateMem (sizeof(int *) * cshp.uv_list[i].num_verts * 2);
for (j=0; j<cshp.uv_list[i].num_verts; j++) {
(shphd->sh_textures[i])[(j*2)] = (int)cshp.uv_list[i].vert[j].u;
(shphd->sh_textures[i])[(j*2)+1] = (int)cshp.uv_list[i].vert[j].v;
diff --git a/src/win95/fragchnk.cpp b/src/win95/fragchnk.cpp
index 1affcc7..50af938 100644
--- a/src/win95/fragchnk.cpp
+++ b/src/win95/fragchnk.cpp
@@ -56,7 +56,7 @@ Fragment_Type_Data_Chunk::Fragment_Type_Data_Chunk(Chunk_With_Children* const pa
Fragment_Type_Data_Chunk::~Fragment_Type_Data_Chunk()
{
- if(frag_type_name) delete frag_type_name;
+ if(frag_type_name) delete [] frag_type_name;
}
void Fragment_Type_Data_Chunk::fill_data_block(char* data_start)
@@ -124,7 +124,7 @@ Fragment_Type_Shape_Chunk::Fragment_Type_Shape_Chunk(Chunk_With_Children* const
Fragment_Type_Shape_Chunk::~Fragment_Type_Shape_Chunk()
{
- if(name) delete name;
+ if(name) delete [] name;
}
void Fragment_Type_Shape_Chunk::fill_data_block(char* data_start)
@@ -195,7 +195,7 @@ Fragment_Type_Sound_Chunk::Fragment_Type_Sound_Chunk(Chunk_With_Children* const
Fragment_Type_Sound_Chunk::~Fragment_Type_Sound_Chunk()
{
- if(wav_name) delete wav_name;
+ if(wav_name) delete [] wav_name;
}
void Fragment_Type_Sound_Chunk::fill_data_block(char* data_start)
diff --git a/src/win95/hash_tem.hpp b/src/win95/hash_tem.hpp
index bc25f53..8edda53 100644
--- a/src/win95/hash_tem.hpp
+++ b/src/win95/hash_tem.hpp
@@ -242,7 +242,7 @@
inline unsigned HashFunction(void const * const _vP)
{
// treat as integer
- return HashFunction(reinterpret_cast<unsigned>(_vP));
+ return HashFunction(reinterpret_cast<uintptr_t>(_vP));
}
// a hash function for strings
diff --git a/src/win95/hierchnk.cpp b/src/win95/hierchnk.cpp
index 56d4437..1ebe41e 100644
--- a/src/win95/hierchnk.cpp
+++ b/src/win95/hierchnk.cpp
@@ -323,7 +323,7 @@ Object_Hierarchy_Alternate_Shape_Set_Chunk::Object_Hierarchy_Alternate_Shape_Set
Object_Hierarchy_Alternate_Shape_Set_Chunk::~Object_Hierarchy_Alternate_Shape_Set_Chunk()
{
- if(Shape_Set_Name) delete Shape_Set_Name;
+ if(Shape_Set_Name) delete[] Shape_Set_Name;
while(Replaced_Shape_List.size())
{
@@ -428,7 +428,7 @@ Hierarchy_Shape_Set_Collection_Chunk::Hierarchy_Shape_Set_Collection_Chunk(Chunk
Hierarchy_Shape_Set_Collection_Chunk::~Hierarchy_Shape_Set_Collection_Chunk()
{
- if(Set_Collection_Name) delete Set_Collection_Name;
+ if(Set_Collection_Name) delete[] Set_Collection_Name;
}
void Hierarchy_Shape_Set_Collection_Chunk::fill_data_block(char* data_start)
@@ -521,7 +521,7 @@ Hierarchy_Degradation_Distance_Chunk::Hierarchy_Degradation_Distance_Chunk(Chunk
Hierarchy_Degradation_Distance_Chunk::~Hierarchy_Degradation_Distance_Chunk()
{
- if(distance_array)delete distance_array;
+ if(distance_array)delete[] distance_array;
}
void Hierarchy_Degradation_Distance_Chunk::fill_data_block(char* data_start)
diff --git a/src/win95/hierchnk.hpp b/src/win95/hierchnk.hpp
index 4772196..46dd333 100644
--- a/src/win95/hierchnk.hpp
+++ b/src/win95/hierchnk.hpp
@@ -101,8 +101,8 @@ struct Replaced_Shape_Details
{
~Replaced_Shape_Details()
{
- if(old_object_name) delete old_object_name;
- if(new_object_name) delete new_object_name;
+ if(old_object_name) delete[] old_object_name;
+ if(new_object_name) delete[] new_object_name;
}
//object name of shape to be replaced
diff --git a/src/win95/mishchnk.cpp b/src/win95/mishchnk.cpp
index a0e3795..c170364 100644
--- a/src/win95/mishchnk.cpp
+++ b/src/win95/mishchnk.cpp
@@ -639,7 +639,7 @@ void File_Chunk::post_input_processing()
ol()->assoc_with_shape(shape_array[ol()->get_header()->shape_id_no]);
}
- delete shape_array;
+ delete [] shape_array;
Chunk_With_Children::post_input_processing();
diff --git a/src/win95/obchunk.cpp b/src/win95/obchunk.cpp
index b062570..2222370 100644
--- a/src/win95/obchunk.cpp
+++ b/src/win95/obchunk.cpp
@@ -1012,7 +1012,7 @@ Object_Track_Chunk2::Object_Track_Chunk2(Object_Chunk * parent)
Object_Track_Chunk2::~Object_Track_Chunk2()
{
- if(sections) delete sections;
+ if(sections) delete [] sections;
}
void Object_Track_Chunk2::fill_data_block (char *data_start)
@@ -1132,7 +1132,7 @@ Object_Track_Sound_Chunk::Object_Track_Sound_Chunk(Chunk_With_Children* const pa
Object_Track_Sound_Chunk::~Object_Track_Sound_Chunk()
{
- if(wav_name) delete wav_name;
+ if(wav_name) delete [] wav_name;
}
void Object_Track_Sound_Chunk::fill_data_block(char* data_start)
diff --git a/src/win95/shpchunk.cpp b/src/win95/shpchunk.cpp
index 332ff39..779045b 100644
--- a/src/win95/shpchunk.cpp
+++ b/src/win95/shpchunk.cpp
@@ -1523,7 +1523,7 @@ Shape_Merge_Data_Chunk::Shape_Merge_Data_Chunk (Shape_Sub_Shape_Chunk * parent,
Shape_Merge_Data_Chunk::~Shape_Merge_Data_Chunk()
{
- if (num_polys) delete merge_data;
+ if (num_polys) delete [] merge_data;
}
void Shape_Merge_Data_Chunk::fill_data_block(char * data_start)
@@ -2575,7 +2575,7 @@ Shape_Fragment_Type_Chunk::Shape_Fragment_Type_Chunk(Chunk_With_Children* const
Shape_Fragment_Type_Chunk::~Shape_Fragment_Type_Chunk()
{
- if(frag_type_name) delete frag_type_name;
+ if(frag_type_name) delete [] frag_type_name;
}
void Shape_Fragment_Type_Chunk::fill_data_block(char* data_start)
@@ -3337,6 +3337,9 @@ void* Shape_Preprocessed_Data_Chunk::GetMemoryBlock()
{
void* retval=memory_block;
+// 64HACK
+#pragma message ("64HACK")
+#if 0
unsigned int* current=(unsigned int*)&first_pointer;
unsigned int* next;
while((*current>>16)!=0xffff)
@@ -3346,7 +3349,7 @@ void* Shape_Preprocessed_Data_Chunk::GetMemoryBlock()
current=next;
}
*current=(unsigned int)&memory_block[(*current)&0xffff];
-
+#endif
memory_block=0;
block_size=0;
return retval;