Import icculus.org release (2014-12-25)

This commit is contained in:
Steven Fuller 2014-12-25 12:00:00 +01:00 committed by Patryk Obara
parent 819e239f23
commit 22475d6d94
57 changed files with 3039 additions and 374 deletions

View file

@ -218,7 +218,7 @@ FrameList::FrameList(TEXANIM* p,FrameList* fl,int* conv)
FrameList::~FrameList()
{
delete [] Textures;
delete UVCoords;
delete [] UVCoords;
}
TEXANIM::TEXANIM()

View file

@ -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)

View file

@ -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);}

View file

@ -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;

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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();

View file

@ -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)

View file

@ -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;