- Fixed: CopyPlayer() in p_saveg.cpp should use normal assignment, not
memcpy to copy the player structures. - Fixed compilation with MinGW again and removed most of the new warnings. And following is the log that I forgot to paste in for the previous commit: - Changed the memory management for FString. Instead of using a garbage collected heap, it now uses normal heap calls and reference counting to implement lazy copying. You may now use bitwise operators to move (but not copy!) FStrings around in memory. This means that the CopyForTArray template function is gone, since TArrays can now freely move their contents around without bothering with their specifics. There is one important caveat, however. It is not acceptable to blindly 0 an FString's contents. This necessitated the creation of a proper constructor for player_s so that it can be reset without using memset. I did a quick scan of all memsets in the source and didn't see anything else with a similar problem, but it's possible I missed something. - Fixed: Build tiles were never deallocated. - Fixed: Using Build's palette.dat only got half the palette right. SVN r117 (trunk)
This commit is contained in:
parent
ac53ed6ecd
commit
6cd1e2ce6a
24 changed files with 81 additions and 91 deletions
|
|
@ -122,7 +122,6 @@ static void ReadOnePlayer (FArchive &arc)
|
|||
{
|
||||
didIt = true;
|
||||
player_t playerTemp;
|
||||
memset (&playerTemp, 0, sizeof(playerTemp));
|
||||
playerTemp.Serialize (arc);
|
||||
CopyPlayer (&players[i], &playerTemp, name);
|
||||
}
|
||||
|
|
@ -227,7 +226,7 @@ static void CopyPlayer (player_t *dst, player_t *src, const char *name)
|
|||
// The userinfo needs to be saved for real players, but it
|
||||
// needs to come from the save for bots.
|
||||
userinfo_t uibackup = dst->userinfo;
|
||||
memcpy (dst, src, sizeof(player_t));
|
||||
*dst = *src;
|
||||
|
||||
if (dst->isbot)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue