Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/micropolis-engine/src/micropolis.h
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ class Micropolis {
/**
* Callback interface.
*/
Callback *callback;
Callback *callback = NULL;


/**
Expand Down Expand Up @@ -1411,8 +1411,8 @@ class Micropolis {
/**
* Memory for map array.
*/
unsigned short *mapBase;
unsigned short *mopBase;
unsigned short *mapBase = NULL;
unsigned short *mopBase = NULL;


void initMapArrays();
Expand Down
4 changes: 4 additions & 0 deletions packages/micropolis-engine/src/sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
////////////////////////////////////////////////////////////////////////


#include <new>

#include "micropolis.h"
#include "text.h"

Expand Down Expand Up @@ -112,6 +114,8 @@ SimSprite *Micropolis::newSprite(const std::string &name, int type, int x, int y
freeSprites = sprite->next;
} else {
sprite = (SimSprite *)newPtr(sizeof (SimSprite));
// newPtr is malloc, so construct the object in place.
new (sprite) SimSprite();
}

sprite->name = name;
Expand Down