#pragma once #pragma pack( 1 ) struct DefaultTextureIconResource { DefaultTextureIconResource() { memset( icon_file, 0, sizeof( icon_file ) ); } int icon_id; char icon_file[256]; }; #pragma pack() struct DefaultTextureIconResourceforGame { DefaultTextureIconResourceforGame() { icon_file = NULL; } ~DefaultTextureIconResourceforGame() { if( icon_file ) { delete [] icon_file ; icon_file = NULL; } } void SetData( DefaultTextureIconResource* pRes ) { icon_id = pRes->icon_id; icon_file = new char[ strlen(pRes->icon_file ) + 1 + 4 ]; icon_file [strlen(pRes->icon_file ) + 4] = '\0'; strcpy( icon_file , pRes->icon_file ); // strcat( icon_file , ".png" ); } int icon_id; char* icon_file; };