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
2 changes: 2 additions & 0 deletions Core/GameEngine/Include/Common/MapObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class MapObject : public MemoryPoolObject
Shadow* m_shadowObj; ///< object that renders shadow in the 3d scene.
RenderObjClass* m_bridgeTowers[ BRIDGE_MAX_TOWERS ]; ///< for bridge towers
Int m_runtimeFlags;
DrawableID m_treeID; ///< tree buffer id, unique per object.

public:
static MapObject *TheMapObjectListPtr;
Expand Down Expand Up @@ -153,6 +154,7 @@ class MapObject : public MemoryPoolObject
RenderObjClass *getRenderObj() const {return m_renderObj;}
void setShadowObj(Shadow *pObj) {m_shadowObj=pObj;}
Shadow *getShadowObj() const {return m_shadowObj;}
DrawableID getTreeID() const {return m_treeID;}

RenderObjClass* getBridgeRenderObject( BridgeTowerType type );
void setBridgeRenderObject( BridgeTowerType type, RenderObjClass* renderObj );
Expand Down
2 changes: 1 addition & 1 deletion Core/GameEngine/Include/GameClient/GameWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ enum { WIN_COLOR_UNDEFINED = GAME_COLOR_UNDEFINED };

// WindowMsgData --------------------------------------------------------------
//-----------------------------------------------------------------------------
typedef UnsignedInt WindowMsgData;
typedef uintptr_t WindowMsgData;

//-----------------------------------------------------------------------------
enum WindowMsgHandledType CPP_11(: Int) { MSG_IGNORED, MSG_HANDLED };
Expand Down
2 changes: 1 addition & 1 deletion Core/GameEngine/Include/GameClient/WindowVideoManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class WindowVideoManager : public SubsystemInterface
size_t operator()(ConstGameWindowPtr p) const
{
std::hash<UnsignedInt> hasher;
return hasher((UnsignedInt)p);
return hasher((UnsignedInt)(uintptr_t)p);
}
};

Expand Down
2 changes: 1 addition & 1 deletion Core/GameEngine/Source/Common/INI/INI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ void INI::parseBool( INI* ini, void * /*instance*/, void *store, const void* /*u
void INI::parseBitInInt32( INI *ini, void *instance, void *store, const void* userData )
{
UnsignedInt* s = (UnsignedInt*)store;
UnsignedInt mask = (UnsignedInt)userData;
UnsignedInt mask = (UnsignedInt)(uintptr_t)userData;

if (INI::scanBool(ini->getNextToken()))
*s |= mask;
Expand Down
4 changes: 2 additions & 2 deletions Core/GameEngine/Source/Common/Thing/ThingTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const
{
ThingTemplate* self = (ThingTemplate*)instance;
ModuleInfo* mi = (ModuleInfo*)store;
ModuleType type = (ModuleType)(UnsignedInt)userData;
ModuleType type = (ModuleType)(UnsignedInt)(uintptr_t)userData;
const char* token = ini->getNextToken();
AsciiString tokenStr = token;

Expand Down Expand Up @@ -642,7 +642,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const
//-------------------------------------------------------------------------------------------------
void ThingTemplate::parseIntList(INI* ini, void *instance, void* store, const void* userData)
{
Int numberEntries = (Int)userData;
Int numberEntries = (Int)(intptr_t)userData;
Int *intList = (Int*)store;

for( Int intIndex = 0; intIndex < numberEntries; intIndex ++ )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ void CommandSet::parseCommandButton( INI* ini, void *instance, void *store, cons

// get the index to store the command at, and the command array itself
const CommandButton **buttonArray = (const CommandButton **)store;
Int buttonIndex = (Int)userData;
Int buttonIndex = (Int)(intptr_t)userData;

// sanity
DEBUG_ASSERTCRASH( buttonIndex < MAX_COMMANDS_PER_SET, ("parseCommandButton: button index '%d' out of range",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,7 @@ WindowMsgHandledType GadgetListBoxSystem( GameWindow *window, UnsignedInt msg,
{

if( list->multiSelect )
*(Int*)mData2 = (Int)list->selections;
*(Int**)mData2 = list->selections;
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
else
*(Int*)mData2 = list->selectPos;

Expand Down
2 changes: 1 addition & 1 deletion Core/GameEngine/Source/GameClient/GUI/IMEManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ void IMEManager::updateCandidateList( Int candidateFlags )

for( i=0; i < m_candidateCount; i++ )
{
Char *string = (Char*) ((UnsignedInt) clist + (UnsignedInt) clist->dwOffset[i]);
Char *string = (Char*) ((UnsignedByte*) clist + clist->dwOffset[i]);
if ( unicode )
{
m_candidateString[i].set( (WideChar *) string);
Expand Down
2 changes: 1 addition & 1 deletion Core/GameEngine/Source/GameClient/Input/Keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ void Keyboard::initKeyNames()

HKL kLayout = GetKeyboardLayout(0);

Int low = (UnsignedInt)kLayout & 0xFFFF;
Int low = (UnsignedInt)(uintptr_t)kLayout & 0xFFFF;
LanguageID currentLanguage = OurLanguage;
if(low == 0x040c ||
low == 0x080c ||
Expand Down
1 change: 0 additions & 1 deletion Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,6 @@ Bool FirewallHelperClass::detectionBeginUpdate() {
if (!found) {
Int m = m_numManglers++;
memcpy(&mangler_addresses[m][0], &host_info->h_addr_list[0][0], 4);
ntohl((UnsignedInt)mangler_addresses[m]);
DEBUG_LOG(("Found mangler address at %d.%d.%d.%d", mangler_addresses[m][0], mangler_addresses[m][1], mangler_addresses[m][2], mangler_addresses[m][3]));
}

Expand Down
8 changes: 4 additions & 4 deletions Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ static void gameTooltip(GameWindow *window,
return;
}

Int gameID = (Int)GadgetListBoxGetItemData(window, row, 0);
Int gameID = (Int)(intptr_t)GadgetListBoxGetItemData(window, row, 0);
GameSpyStagingRoom *room = TheGameSpyInfo->findStagingRoomByID(gameID);
if (!room)
{
Expand Down Expand Up @@ -696,7 +696,7 @@ void RefreshGameListBox( GameWindow *win, Bool showMap )
GadgetListBoxGetSelected(win, &selectedIndex);
if (selectedIndex != -1 )
{
selectedID = (Int)GadgetListBoxGetItemData(win, selectedIndex);
selectedID = (Int)(intptr_t)GadgetListBoxGetItemData(win, selectedIndex);
}
int prevPos = GadgetListBoxGetTopVisibleEntry( win );

Expand Down Expand Up @@ -887,7 +887,7 @@ void playerTemplateComboBoxTooltip(GameWindow *wndComboBox, WinInstanceData *ins
{
Int index = 0;
GadgetComboBoxGetSelectedPos(wndComboBox, &index);
Int templateNum = (Int)GadgetComboBoxGetItemData(wndComboBox, index);
Int templateNum = (Int)(intptr_t)GadgetComboBoxGetItemData(wndComboBox, index);
UnicodeString ustringTooltip;
if (templateNum == -1)
{
Expand Down Expand Up @@ -918,7 +918,7 @@ void playerTemplateListBoxTooltip(GameWindow *wndListBox, WinInstanceData *instD
if (row == -1 || col == -1)
return;

Int templateNum = (Int)GadgetListBoxGetItemData(wndListBox, row, col);
Int templateNum = (Int)(intptr_t)GadgetListBoxGetItemData(wndListBox, row, col);
UnicodeString ustringTooltip;
if (templateNum == -1)
{
Expand Down
8 changes: 4 additions & 4 deletions Core/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static void queuePatch(Bool mandatory, AsciiString downloadURL)
static GHTTPBool motdCallback( GHTTPRequest request, GHTTPResult result,
char * buffer, GHTTPByteCount bufferLen, void * param )
{
Int run = (Int)param;
Int run = (Int)(intptr_t)param;
if (run != timeThroughOnline)
{
DEBUG_CRASH(("Old callback being called!"));
Expand Down Expand Up @@ -344,7 +344,7 @@ static GHTTPBool motdCallback( GHTTPRequest request, GHTTPResult result,
static GHTTPBool configCallback( GHTTPRequest request, GHTTPResult result,
char * buffer, GHTTPByteCount bufferLen, void * param )
{
Int run = (Int)param;
Int run = (Int)(intptr_t)param;
if (run != timeThroughOnline)
{
DEBUG_CRASH(("Old callback being called!"));
Expand Down Expand Up @@ -406,7 +406,7 @@ static GHTTPBool configCallback( GHTTPRequest request, GHTTPResult result,
static GHTTPBool configHeadCallback( GHTTPRequest request, GHTTPResult result,
char * buffer, GHTTPByteCount bufferLen, void * param )
{
Int run = (Int)param;
Int run = (Int)(intptr_t)param;
if (run != timeThroughOnline)
{
DEBUG_CRASH(("Old callback being called!"));
Expand Down Expand Up @@ -490,7 +490,7 @@ static GHTTPBool configHeadCallback( GHTTPRequest request, GHTTPResult result,

static GHTTPBool gamePatchCheckCallback( GHTTPRequest request, GHTTPResult result, char * buffer, GHTTPByteCount bufferLen, void * param )
{
Int run = (Int)param;
Int run = (Int)(intptr_t)param;
if (run != timeThroughOnline)
{
DEBUG_CRASH(("Old callback being called!"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ enum CallbackType

void callbackWrapper( GPConnection *con, void *arg, void *param )
{
CallbackType info = (CallbackType)(Int)param;
CallbackType info = (CallbackType)(Int)(intptr_t)param;
BuddyThreadClass *thread = MESSAGE_QUEUE->getThread() ? MESSAGE_QUEUE->getThread() : nullptr /*(TheGameSpyBuddyMessageQueue)?TheGameSpyBuddyMessageQueue->getThread():nullptr*/;
if (!thread)
return;
Expand Down
2 changes: 1 addition & 1 deletion Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ void LANAPI::OnPlayerList( LANPlayer *playerList )
GadgetListBoxGetSelected(listboxPlayers, &selectedIndex);

if (selectedIndex != -1 )
selectedIP = (UnsignedInt) GadgetListBoxGetItemData(listboxPlayers, selectedIndex, 0);
selectedIP = (UnsignedInt)(uintptr_t)GadgetListBoxGetItemData(listboxPlayers, selectedIndex, 0);

GadgetListBoxReset(listboxPlayers);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ enum AnimParseType CPP_11(: Int)
//-------------------------------------------------------------------------------------------------
static void parseAnimation(INI* ini, void *instance, void * /*store*/, const void* userData)
{
AnimParseType animType = (AnimParseType)(UnsignedInt)userData;
AnimParseType animType = (AnimParseType)(UnsignedInt)(uintptr_t)userData;

AsciiString animName = ini->getNextAsciiString();
animName.toLower();
Expand Down Expand Up @@ -1447,7 +1447,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void

ModelConditionInfo info;
W3DModelDrawModuleData* self = (W3DModelDrawModuleData*)instance;
ParseCondStateType cst = (ParseCondStateType)(UnsignedInt)userData;
ParseCondStateType cst = (ParseCondStateType)(UnsignedInt)(uintptr_t)userData;
switch (cst)
{
case PARSE_DEFAULT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void W3DGadgetProgressBarDraw( GameWindow *window, WinInstanceData *instData )
{
ICoord2D origin, size, start, end;
Color backColor, backBorder, barColor, barBorder;
Int progress = (Int)window->winGetUserData();
Int progress = (Int)(intptr_t)window->winGetUserData();

// get window size and position
window->winGetScreenPosition( &origin.x, &origin.y );
Expand Down Expand Up @@ -186,7 +186,7 @@ void W3DGadgetProgressBarImageDrawA( GameWindow *window, WinInstanceData *instDa
{
ICoord2D origin, size;
const Image *barCenter, *barRight, *left, *right, *center;
Int progress = (Int)window->winGetUserData();
Int progress = (Int)(intptr_t)window->winGetUserData();
Int xOffset, yOffset;
Int i;
// get window size and position
Expand Down Expand Up @@ -229,7 +229,7 @@ void W3DGadgetProgressBarImageDraw( GameWindow *window, WinInstanceData *instDat
ICoord2D origin, size, start, end;
const Image *backLeft, *backRight, *backCenter,
*barRight, *barCenter;//*backSmallCenter,*barLeft,, *barSmallCenter;
Int progress = (Int)window->winGetUserData();
Int progress = (Int)(intptr_t)window->winGetUserData();
Int xOffset, yOffset;
Int i;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class GDIFileStream : public InputStream
/* ********* MapObject class ****************************/
/*static*/ MapObject *MapObject::TheMapObjectListPtr = nullptr;
/*static*/ Dict MapObject::TheWorldDict;
static Int s_nextTreeID = INVALID_DRAWABLE_ID;

MapObject::MapObject(Coord3D loc, AsciiString name, Real angle, Int flags, const Dict* props,
const ThingTemplate *thingTemplate )
Expand All @@ -96,6 +97,7 @@ MapObject::MapObject(Coord3D loc, AsciiString name, Real angle, Int flags, const
m_renderObj = nullptr;
m_shadowObj = nullptr;
m_runtimeFlags = 0;
m_treeID = (DrawableID)++s_nextTreeID;
// Note - do NOT set TheKey_objectSelectable on creation - allow it to follow the .ini value unless specified by user action. jba. [3/20/2003]
if (props)
{
Expand Down
4 changes: 2 additions & 2 deletions Core/Libraries/Source/Compression/EAC/huffencode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,8 @@ static void HUFF_pack(struct HuffEncodeContext *EC,
if (!i3)
HUFF_writecode(EC,dest,i);

if (((long) bptr1- (long) EC->buffer) >= (long)(EC->plen+curpc))
curpc = (long) bptr1 - (long) EC->buffer - EC->plen;
if ((long)(bptr1 - EC->buffer) >= (long)(EC->plen+curpc))
curpc = (long)(bptr1 - EC->buffer) - EC->plen;
}

/* write EOF ([clue] 0gn [10]) */
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void DX8WebBrowser::CreateBrowser(const char* browsername, const char* url, int
if(pBrowser)
{
_bstr_t brsname(browsername);
pBrowser->CreateBrowser(brsname, _bstr_t(url), reinterpret_cast<long>(hWnd), x, y, w, h, options, gamedispatch);
pBrowser->CreateBrowser(brsname, _bstr_t(url), (long)(intptr_t)hWnd, x, y, w, h, options, gamedispatch);
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
pBrowser->SetUpdateRate(brsname, updateticks);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ void SurfaceClass::FindBB(Vector2i *min,Vector2i*max)
for (x = min->I; x < max->I; x++) {

// HY - this is not endian safe
unsigned char *alpha=(unsigned char*) ((unsigned int)lock_rect.pBits+(y-min->J)*lock_rect.Pitch+(x-min->I)*size);
unsigned char *alpha=(unsigned char*) ((uintptr_t)lock_rect.pBits+(y-min->J)*lock_rect.Pitch+(x-min->I)*size);
unsigned char myalpha=alpha[size-1];
myalpha=(myalpha>>(8-alphabits)) & mask;
if (myalpha) {
Expand Down Expand Up @@ -649,7 +649,7 @@ bool SurfaceClass::Is_Transparent_Column(unsigned int column)
for (y = 0; y < (int) sd.Height; y++)
{
// HY - this is not endian safe
unsigned char *alpha=(unsigned char*) ((unsigned int)lock_rect.pBits+y*lock_rect.Pitch);
unsigned char *alpha=(unsigned char*) ((uintptr_t)lock_rect.pBits+y*lock_rect.Pitch);
unsigned char myalpha=alpha[size-1];
myalpha=(myalpha>>(8-alphabits)) & mask;
if (myalpha) {
Expand Down
8 changes: 4 additions & 4 deletions Core/Libraries/Source/WWVegas/WWLib/Except.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,13 @@ void Dump_Exception_Info(EXCEPTION_POINTERS *e_info)
if (imagehelp != nullptr) {
DebugString ("Exception Handler: Found IMAGEHLP.DLL - linking to required functions\n");
char const *function_name = nullptr;
unsigned long *fptr = (unsigned long*) &_SymCleanup;
uintptr_t *fptr = (uintptr_t*) &_SymCleanup;
int count = 0;

do {
function_name = ImagehelpFunctionNames[count];
if (function_name) {
*fptr = (unsigned long) GetProcAddress(imagehelp, function_name);
*fptr = (uintptr_t) GetProcAddress(imagehelp, function_name);
fptr++;
count++;
}
Expand Down Expand Up @@ -1065,13 +1065,13 @@ void Load_Image_Helper()

if (ImageHelp != nullptr) {
char const *function_name = nullptr;
unsigned long *fptr = (unsigned long *) &_SymCleanup;
uintptr_t *fptr = (uintptr_t *) &_SymCleanup;
int count = 0;

do {
function_name = ImagehelpFunctionNames[count];
if (function_name) {
*fptr = (unsigned long) GetProcAddress(ImageHelp, function_name);
*fptr = (uintptr_t) GetProcAddress(ImageHelp, function_name);
fptr++;
count++;
}
Expand Down
4 changes: 2 additions & 2 deletions Core/Libraries/Source/WWVegas/WWLib/verchk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Get_Image_File_Header (HINSTANCE app_instance, IMAGE_FILE_HEADER *file_header)
//
////////////////////////////////////////////////////////////////////////
int
Compare_EXE_Version (int app_instance, const char *filename)
Compare_EXE_Version (HINSTANCE app_instance, const char *filename)
{
int retval = 0;

Expand All @@ -236,7 +236,7 @@ Compare_EXE_Version (int app_instance, const char *filename)
//
IMAGE_FILE_HEADER header1 = { 0 };
IMAGE_FILE_HEADER header2 = { 0 };
if ( ::Get_Image_File_Header ((HINSTANCE)app_instance, &header1) &&
if ( ::Get_Image_File_Header (app_instance, &header1) &&
::Get_Image_File_Header (filename, &header2))
{
retval = int(header1.TimeDateStamp - header2.TimeDateStamp);
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWLib/verchk.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ bool GetFileCreationTime(char* filename, FILETIME* createTime);
// older, 0 if they are the same, and +1 if the current process is newer.
//
////////////////////////////////////////////////////////////////////////
int Compare_EXE_Version (int app_instance, const char *filename);
int Compare_EXE_Version (HINSTANCE app_instance, const char *filename);
6 changes: 3 additions & 3 deletions Core/Libraries/Source/debug/debug_stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static union
{
#include "debug_stack.inl"
};
unsigned funcPtr[1];
uintptr_t funcPtr[1];
} gDbg;
#undef DBGHELP

Expand Down Expand Up @@ -89,11 +89,11 @@ static void InitDbghelp()
return;

// Get function addresses
unsigned *funcptr=gDbg.funcPtr;
uintptr_t *funcptr=gDbg.funcPtr;
unsigned k=0;
for (;DebughelpFunctionNames[k];++k,++funcptr)
{
*funcptr=(unsigned)GetProcAddress(g_dbghelp,DebughelpFunctionNames[k]);
*funcptr=(uintptr_t)GetProcAddress(g_dbghelp,DebughelpFunctionNames[k]);
if (!*funcptr)
break;
}
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/profile/profile_funclevel.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class ProfileFuncLevel
*/
unsigned GetId() const
{
return unsigned(m_threadID);
return unsigned(uintptr_t(m_threadID));
}

private:
Expand Down
Loading
Loading