Skip to content

Commit

Permalink
x64 compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lgt2x committed Jun 9, 2024
1 parent bcca927 commit 698e0fb
Show file tree
Hide file tree
Showing 39 changed files with 95 additions and 61 deletions.
2 changes: 1 addition & 1 deletion Descent3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ add_executable(Descent3
${HEADERS} ${CPPS} ${PLATFORM_CPPS} ${INCS}
)
target_link_libraries(Descent3
2dlib AudioEncode bitmap cfile czip d3music dd_video ddio libmve libacm
2dlib AudioEncode bitmap cfile czip d3music dd_video ddebug ddio libmve libacm
fix grtext manage mem misc model module movie stream_audio
music networking physics renderer rtperformance sndlib ui unzip vecmat md5
${PLATFORM_LIBS})
Expand Down
2 changes: 1 addition & 1 deletion Descent3/SLEW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void SlewControlInit() {
}
#endif

int SlewStop(object *obj) {
int SlewStop(object *obj) {
if (!obj)
return 0;

Expand Down
2 changes: 1 addition & 1 deletion Descent3/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ void InitGraphics(bool editor) {

// Init our renderer
grSurface::init_system();
rend_Init(RENDERER_SOFTWARE_16BIT, Descent, NULL);
rend_Init(RENDERER_OPENGL, Descent, NULL);
Desktop_surf = new grSurface(0, 0, 0, SURFTYPE_VIDEOSCREEN, 0);
#else
strcpy(App_ddvid_subsystem, "GDIX");
Expand Down
4 changes: 2 additions & 2 deletions Descent3/objinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const char *Static_object_names[] = {TBL_GENERIC("GuideBot"), TBL_GENERIC("Chaff
#define NUM_STATIC_OBJECTS (sizeof(Static_object_names) / sizeof(*Static_object_names))

#ifdef EDITOR
extern char *Movement_class_names[] = {"Standing", "Flying", "Rolling", "Walking", "Jumping"};
extern char *Anim_state_names[] = {"Alert",
const char * const Movement_class_names[] = {"Standing", "Flying", "Rolling", "Walking", "Jumping"};
const char * const Anim_state_names[] = {"Alert",
"Death",
"Fire Missile 1",
"Missile Recoil 1",
Expand Down
4 changes: 2 additions & 2 deletions Descent3/objinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@
// The number of ids of each type in the list
extern int Num_object_ids[];

extern char *Movement_class_names[];
extern char *Anim_state_names[];
extern const char * const Movement_class_names[];
extern const char * const Anim_state_names[];

// These defines must correspond to the Static_object_names array
#define GENOBJ_GUIDEBOT 0 // NOTE: This must match ROBOT_GUIDEBOT
Expand Down
4 changes: 2 additions & 2 deletions Descent3/robot.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

extern int Num_robots;
extern object_info Robots[MAX_ROBOTS];
extern char *Movement_class_names[];
extern char *Anim_state_names[];
extern const char * const Movement_class_names[];
extern const char * const Anim_state_names[];

// Sets all robots to unused
void InitRobots();
Expand Down
2 changes: 1 addition & 1 deletion editor/AnimStatesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
* $NoKeywords: $
*/

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "AnimStatesDialog.h"
#include "polymodel.h"
Expand Down
3 changes: 2 additions & 1 deletion editor/BriefEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// BriefEdit.cpp : implementation file
//

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "BriefEdit.h"
#include "mono.h"
Expand Down Expand Up @@ -112,6 +112,7 @@ BEGIN_MESSAGE_MAP(CBriefEdit, CDialog)
ON_CBN_SELCHANGE(IDC_BRIEF_SCREEN_LIST, OnSelchangeBriefScreenList)
ON_BN_CLICKED(IDC_BRIEF_SAVE, OnBriefSave)
ON_BN_CLICKED(IDC_LOAD, OnLoad)
ON_WM_TIMER()
ON_BN_CLICKED(IDC_MANAGE, OnManage)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
Expand Down
2 changes: 1 addition & 1 deletion editor/BriefScreenEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// BriefScreenEdit.cpp : implementation file
//

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "BriefScreenEdit.h"
#include "BriefEdit.h"
Expand Down
1 change: 1 addition & 0 deletions editor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ set(HEADERS
matcenkeypad.h
MegacellDialog.h
MegacellKeypad.h
mfc_compatibility.h
moveworld.h
ObjCScript.h
ObjectClipboard.h
Expand Down
6 changes: 3 additions & 3 deletions editor/DallasMainDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ void CDallasMainDlg::OnKeydownEventTree(NMHDR* pNMHDR, LRESULT* pResult)
/////////////////////////////////////////////////////////////////////////////


LONG CDallasMainDlg::OnHighlightScripts(UINT, LONG)
LRESULT CDallasMainDlg::OnHighlightScripts(WPARAM, LPARAM)
{
HighlightAllScripts();

Expand All @@ -1208,7 +1208,7 @@ LONG CDallasMainDlg::OnHighlightScripts(UINT, LONG)
}


LONG CDallasMainDlg::OnAddScript(UINT, LONG)
LRESULT CDallasMainDlg::OnAddScript(WPARAM, LPARAM)
{
HTREEITEM new_node;

Expand Down Expand Up @@ -1258,7 +1258,7 @@ LONG CDallasMainDlg::OnAddScript(UINT, LONG)
}


LONG CDallasMainDlg::OnAddScriptAndHighlight(UINT, LONG)
LRESULT CDallasMainDlg::OnAddScriptAndHighlight(WPARAM, LPARAM)
{
HTREEITEM new_node;

Expand Down
6 changes: 3 additions & 3 deletions editor/DallasMainDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1555,9 +1555,9 @@ class CDallasMainDlg : public CDialog
afx_msg void OnSelchangeEventCombo();
//}}AFX_MSG
afx_msg void OnActivate( UINT nState, CWnd* pWndOther, BOOL bMinimized );
afx_msg LONG OnHighlightScripts(UINT, LONG);
afx_msg LONG OnAddScript(UINT, LONG);
afx_msg LONG OnAddScriptAndHighlight(UINT, LONG);
afx_msg LRESULT OnHighlightScripts(WPARAM, LPARAM);
afx_msg LRESULT OnAddScript(WPARAM, LPARAM);
afx_msg LRESULT OnAddScriptAndHighlight(WPARAM, LPARAM);
afx_msg void OnMenuSelectionOfTypeAssign(UINT nID);
afx_msg void OnMenuSelectionOfTypeAdd(UINT nID);
afx_msg void OnMenuSelectionOfTypeReplace(UINT nID);
Expand Down
2 changes: 1 addition & 1 deletion editor/LightingStatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// LightingStatus.cpp : implementation file
//

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "LightingStatus.h"
#include "radiosity.h"
Expand Down
1 change: 1 addition & 0 deletions editor/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_COMMAND(ID_TOOLS_WORLD_OBJECTS_POWERUPS, OnToolsWorldObjectsPowerups)
ON_COMMAND(ID_TOOLS_WORLD_OBJECTS_ROBOTS, OnToolsWorldObjectsRobots)
ON_COMMAND(ID_SUBEDITORS_FONT, OnSubeditorsFont)

ON_COMMAND(ID_FILE_PLAY640X480, OnFilePlayin640x480)
ON_UPDATE_COMMAND_UI(ID_VIEW_KEYPAD_TOGGLE, OnUpdateViewKeypadToggle)
ON_COMMAND(ID_VIEW_KEYPAD_TOGGLE, OnViewKeypadToggle)
Expand Down
10 changes: 5 additions & 5 deletions editor/ObjCScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ char *LoadScript(const char *filename)
memset(buffer,0,MAX_SCRIPT_LINE_SIZE);

ddio_MakePath(file_path,LocalLevelsDir,filename,NULL);
// mprintf((0,"Loading script from %s\n",file_path));
// mprintf(0,"Loading script from %s\n",file_path);
if(!cfexist(file_path))
{
return false;
Expand Down Expand Up @@ -266,7 +266,7 @@ void SaveScript(const char *filename, char *script)

file=cfopen(file_path,"wt");
cf_WriteString(file,script);
// mprintf((0,"Saving script to %s\n",file_path));
// mprintf(0,"Saving script to %s\n",file_path);
cfclose(file);
}

Expand All @@ -287,17 +287,17 @@ bool CompileScript(tD3XProgram *program, char *script)
tD3XPMap *map; // temporary holder for map

if (!script) {
mprintf((1, "Unable to compile null script!\n"));
mprintf(1, "Unable to compile null script!\n");
return false;
}

if (program == NULL) {
mprintf((1, "You can't compile an uninitialized script!\n"));
mprintf(1, "You can't compile an uninitialized script!\n");
return false;
}

if(!osi_Compile(script, &d3xlen, &ins, &nscr, &map, &nstr, &strbuf)) {
mprintf((1, "Script failed to compile.\n"));
mprintf(1, "Script failed to compile.\n");
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion editor/ObjCScript.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

struct tD3XProgram;

#define MAX_SCRPARAMS 256 // icecoldduke - getting to compile, not correct.
#define MAX_SCRPARAMS 256 // icecoldduke fix - getting to compile, not correct.

// Data structure for a default script name.
// There exists a list of these names too.
Expand Down
4 changes: 2 additions & 2 deletions editor/ObjectListDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ void CObjectListDialog::MakeInfoStr(object *obj, char *str)
char tempstr[128];

if (obj->type == OBJ_POWERUP || obj->type == OBJ_ROBOT || obj->type == OBJ_BUILDING || obj->type == OBJ_CLUTTER)
sprintf(tempstr, "%d-(0x%x)[%s](%s) ", OBJNUM(obj), obj->handle, Object_info[obj->id].name, (obj->name)?obj->name:"No Name Given");
sprintf(tempstr, "%d-(0x%x)[%s](%s) ", static_cast<int>(OBJNUM(obj)), obj->handle, Object_info[obj->id].name, (obj->name)?obj->name:"No Name Given");
else {
char *obj_type_name = (obj->type >=0 && obj->type < MAX_OBJECT_TYPES) ? Object_type_names[obj->type] : "Unnamed type";
sprintf(tempstr, "%d-(0x%x)[%s](%s) ", OBJNUM(obj), obj->handle, obj_type_name, (obj->name)?obj->name:"No Name Given");
sprintf(tempstr, "%d-(0x%x)[%s](%s) ", static_cast<int>(OBJNUM(obj)), obj->handle, obj_type_name, (obj->name)?obj->name:"No Name Given");
}

strcpy(str, tempstr);
Expand Down
2 changes: 1 addition & 1 deletion editor/OsirisStatusDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void COsirisStatusDlg::SetScript(char *script, tD3XProgram *d3x)
m_Script=script;
}

int COsirisStatusDlg::DoModal()
INT_PTR COsirisStatusDlg::DoModal()
{
// TODO: Add your specialized code here and/or call the base class

Expand Down
2 changes: 1 addition & 1 deletion editor/OsirisStatusDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class COsirisStatusDlg : public CDialog
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(COsirisStatusDlg)
public:
virtual int DoModal();
virtual INT_PTR DoModal();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
Expand Down
2 changes: 1 addition & 1 deletion editor/ProceduralDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// ProceduralDialog.cpp : implementation file
//

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "ProceduralDialog.h"
#include "bitmap.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/QuickCompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void CQuickCompile::OnDestroy()
quick_compile_string = "";
}

int CQuickCompile::DoModal()
INT_PTR CQuickCompile::DoModal()
{

return CDialog::DoModal();
Expand Down
2 changes: 1 addition & 1 deletion editor/QuickCompile.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class CQuickCompile : public CDialog
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CQuickCompile)
public:
virtual int DoModal();
virtual INT_PTR DoModal();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
Expand Down
1 change: 1 addition & 0 deletions editor/ScriptEditorDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
// ScriptEditorDlg.cpp : implementation file
//

#include "mfc_compatibility.h"
#include "stdafx.h"
#include "editor.h"
#include "ddio.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/ScriptStudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
// ScriptStudio.cpp : implementation file
//

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "ScriptStudio.h"
#include "OsirisStatusDlg.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/ScriptSyncDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// ScriptSyncDialog.cpp : implementation file
//

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "ScriptSyncDialog.h"
#include "ddio.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/WaterProceduralDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// WaterProceduralDialog.cpp : implementation file
//

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "game.h"
#include "manage.h"
Expand Down
17 changes: 4 additions & 13 deletions editor/WireframeGrWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,19 +795,10 @@ void CWireframeGrWnd::DrawTerrainWorld(grViewport *vp,vector *view_target,matrix
int bm_handle=GameTextures[Terrain_seg[y*TERRAIN_WIDTH+x].tex_index].bm_handle;
lightval=(Terrain_seg[y*TERRAIN_WIDTH+x].light)*(MAX_TEXTURE_SHADES-1);

if (Renderer_type==RENDERER_SOFTWARE_8BIT)
{
uint8_t pixval;
pixval=*bm_data8(bm_handle,0);
fadepixel=BitmapFadePalettes[bm_pal_index(bm_handle)][lightval*256+pixval];
}
else
{
uint16_t pix;

pix=*bm_data(bm_handle,0);
fadepixel=(TexShadeTable16[lightval][pix>>8])+TexShadeTable8[lightval][pix & 0xFF];
}
uint16_t pix;

pix=*bm_data(bm_handle,0);
fadepixel=(TexShadeTable16[lightval][pix>>8])+TexShadeTable8[lightval][pix & 0xFF];


if (TerrainSelected[y*TERRAIN_WIDTH+x])
Expand Down
2 changes: 1 addition & 1 deletion editor/WorldObjectsDoorDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
* $NoKeywords: $
*/

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "WorldObjectsDoorDialog.h"
#include "manage.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/WorldObjectsGenericDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// WorldObjectsGenericDialog.cpp : implementation file
//

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "WorldObjectsGenericDialog.h"
#include "PhysicsDlg.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/WorldObjectsPlayerDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
* $NoKeywords: $
*/

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "WorldObjectsPlayerDialog.h"
#include "shippage.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/WorldObjectsPowerupDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* $NoKeywords: $
*/

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "WorldObjectsPowerupDialog.h"
#include "powerup.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/WorldObjectsRobotDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* $NoKeywords: $
*/

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "WorldObjectsRobotDialog.h"
#include "AnimStatesDialog.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/WorldTexturesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@

#include <algorithm>

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "WorldTexturesDialog.h"
#include "bitmap.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/WorldWeaponsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
* $NoKeywords: $
*/

#include "stdafx.h"
#include "mfc_compatibility.h"
#include "editor.h"
#include "WorldWeaponsDialog.h"
#include "manage.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/editorView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ void CEditorView::OnReinitOpengl()
{
EditorStatus("Reinitting OpenGL");
rend_Close();
rend_Init (RENDERER_SOFTWARE_16BIT,Descent,&Render_preferred_state);
rend_Init (RENDERER_OPENGL,Descent,&Render_preferred_state);
}
else
{
Expand Down
Loading

0 comments on commit 698e0fb

Please sign in to comment.