diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5e453b7..ce403ce4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,7 +78,7 @@ jobs: CC: ${{ matrix.os.cc }} CXX: ${{ matrix.os.cxx }} VCPKG_ROOT: C:/vcpkg - run: cmake --preset ${{ matrix.os.preset }} -DBUILD_TESTING=ON -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON + run: cmake --preset ${{ matrix.os.preset }} -DBUILD_TESTING=ON -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON -DBUILD_EDITOR=ON - name: Build ${{ matrix.build_type }} run: cmake --build --preset ${{ matrix.os.preset }} --config ${{ matrix.build_type }} --verbose @@ -94,4 +94,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: Descent3_${{ matrix.build_type }}_${{ matrix.os.name }} - path: ${{ github.workspace }}/builds/${{ matrix.os.preset }}/installed/ + path: ${{ github.workspace }}/builds/${{ matrix.os.preset }}/installed/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 52944f9b..ca176759 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,10 @@ option(FORCE_PORTABLE_INSTALL "Install all files into local directory defined by option(ENABLE_LOGGER "Enable logging to the terminal" OFF) option(BUILD_TESTING "Enable testing. Requires GTest." OFF) +if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + option(BUILD_EDITOR "Build internal editor" OFF) +endif() + set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -202,9 +206,11 @@ add_subdirectory(libmve) add_subdirectory(md5) add_subdirectory(libacm) -if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + +if(BUILD_EDITOR AND CMAKE_SYSTEM_NAME STREQUAL "Windows") add_subdirectory(editor) endif() + add_subdirectory(Descent3) add_subdirectory(tools) diff --git a/Descent3/Briefing.cpp b/Descent3/Briefing.cpp index dd2acbb1..67846bb1 100644 --- a/Descent3/Briefing.cpp +++ b/Descent3/Briefing.cpp @@ -297,7 +297,7 @@ void ReplaceHotTag(char *string, int tag) { // returns true if there were hot tags and it had to allocate memory for dest (so it needs to be freed) #define MEMORY_BLOCK 50 -bool ParseForHotTags(const char *src, char **dest) { +bool ParseForHotTags(char *src, char **dest) { bool ret = false; const char *curr_ptr = src; char *dest_ptr; @@ -456,7 +456,7 @@ bool PlayBriefing(tTelComInfo *tcs) { return true; } -void PBAddTextEffect(TCTEXTDESC* desc, const char *text, const char *description, int id) { +void PBAddTextEffect(TCTEXTDESC* desc, char *text, char *description, int id) { if (IsMissionMaskOK(desc->mission_mask_set, desc->mission_mask_unset) && ok_to_parse_screen) { char *new_text = NULL; const bool new_stuff = ParseForHotTags(text, &new_text); @@ -469,33 +469,33 @@ void PBAddTextEffect(TCTEXTDESC* desc, const char *text, const char *description } } -void PBAddBmpEffect(TCBMPDESC* desc, const char *description) { +void PBAddBmpEffect(TCBMPDESC* desc, char *description) { if (IsMissionMaskOK(desc->mission_mask_set, desc->mission_mask_unset) && ok_to_parse_screen) CreateBitmapEffect(desc, MONITOR_MAIN, current_screen); } -void PBAddMovieEffect(TCMOVIEDESC* desc, const char *description) { +void PBAddMovieEffect(TCMOVIEDESC* desc, char *description) { if (IsMissionMaskOK(desc->mission_mask_set, desc->mission_mask_unset) && ok_to_parse_screen) CreateMovieEffect(desc, MONITOR_MAIN, current_screen); } -void PBAddBkgEffect(TCBKGDESC* desc, const char *description) { +void PBAddBkgEffect(TCBKGDESC* desc, char *description) { if (IsMissionMaskOK(desc->mission_mask_set, desc->mission_mask_unset) && ok_to_parse_screen) { mprintf(0, "PB: Add Bkg\n"); } } -void PBAddPolyEffect(TCPOLYDESC* desc, const char *description) { +void PBAddPolyEffect(TCPOLYDESC* desc, char *description) { if (IsMissionMaskOK(desc->mission_mask_set, desc->mission_mask_unset) && ok_to_parse_screen) CreatePolyModelEffect(desc, MONITOR_MAIN, current_screen); } -void PBAddSoundEffect(TCSNDDESC* desc, const char *description) { +void PBAddSoundEffect(TCSNDDESC* desc, char *description) { if (IsMissionMaskOK(desc->mission_mask_set, desc->mission_mask_unset) && ok_to_parse_screen) CreateSoundEffect(desc, MONITOR_MAIN, current_screen); } -void PBAddButtonEffect(TCBUTTONDESC* desc, const char *description, int id) { +void PBAddButtonEffect(TCBUTTONDESC* desc, char *description, int id) { if (IsMissionMaskOK(desc->mission_mask_set, desc->mission_mask_unset) && ok_to_parse_screen) { desc->x += osb_xoff; desc->y += osb_yoff; @@ -504,7 +504,7 @@ void PBAddButtonEffect(TCBUTTONDESC* desc, const char *description, int id) { } } -void PBStartScreen(int screen_num, const char *description, const char *layout, uint32_t mask_set, uint32_t mask_unset) { +void PBStartScreen(int screen_num, char *description, char *layout, uint32_t mask_set, uint32_t mask_unset) { if (!IsMissionMaskOK(mask_set, mask_unset)) { ok_to_parse_screen = false; skipped_screens++; @@ -579,7 +579,7 @@ bool PBLoopCallback() { return ret; } -void PBSetTitle(const char *title) { +void PBSetTitle(char *title) { gottitle = true; strcpy(pbtitle, title); } @@ -594,7 +594,7 @@ void PBSetGlitch(float amount) { TelcomEnableGlitch(amount); } -void PBAddVoice(const char *filename, int flags, const char *description) {} +void PBAddVoice(char *filename, int flags,char *description) {} bool ParseBriefing(const char *filename, tTelComInfo *tcs) { if (!cfexist(filename)) { diff --git a/Descent3/BriefingParse.h b/Descent3/BriefingParse.h index 306353c7..e90bd6eb 100644 --- a/Descent3/BriefingParse.h +++ b/Descent3/BriefingParse.h @@ -62,20 +62,20 @@ #define PBERR_NOERR 0 struct tBriefParseCallbacks { - void (*AddTextEffect)(TCTEXTDESC* desc, const char *text, const char *description, int id); - void (*AddBmpEffect)(TCBMPDESC* desc, const char *description); - void (*AddMovieEffect)(TCMOVIEDESC* desc, const char *description); - void (*AddBkgEffect)(TCBKGDESC* desc, const char *description); - void (*AddPolyEffect)(TCPOLYDESC* desc, const char *description); - void (*AddSoundEffect)(TCSNDDESC* desc, const char *description); - void (*AddButtonEffect)(TCBUTTONDESC* desc, const char *description, int id); - void (*StartScreen)(int screen_num, const char *description, const char *layout, uint32_t mask_set, uint32_t mask_unset); + void (*AddTextEffect)(TCTEXTDESC* desc, char *text, char *description, int id); + void (*AddBmpEffect)(TCBMPDESC* desc, char *description); + void (*AddMovieEffect)(TCMOVIEDESC* desc, char *description); + void (*AddBkgEffect)(TCBKGDESC* desc, char *description); + void (*AddPolyEffect)(TCPOLYDESC* desc, char *description); + void (*AddSoundEffect)(TCSNDDESC* desc, char *description); + void (*AddButtonEffect)(TCBUTTONDESC* desc, char *description, int id); + void (*StartScreen)(int screen_num, char *description, char *layout, uint32_t mask_set, uint32_t mask_unset); void (*EndScreen)(); bool (*LoopCallback)(); - void (*SetTitle)(const char *title); + void (*SetTitle)(char *title); void (*SetStatic)(float amount); void (*SetGlitch)(float amount); - void (*AddVoice)(const char *filename, int flags, const char *description); + void (*AddVoice)(char *filename, int flags,char *description); }; struct tTextBufferDesc { @@ -93,20 +93,20 @@ public: int ParseBriefing(const char *filename); private: - void (*AddTextEffect)(TCTEXTDESC* desc, const char *text, const char *description, int id); - void (*AddBmpEffect)(TCBMPDESC* desc, const char *description); - void (*AddMovieEffect)(TCMOVIEDESC* desc, const char *description); - void (*AddBkgEffect)(TCBKGDESC* desc, const char *description); - void (*AddPolyEffect)(TCPOLYDESC* desc, const char *description); - void (*AddSoundEffect)(TCSNDDESC* desc, const char *description); - void (*AddButtonEffect)(TCBUTTONDESC* desc, const char *description, int id); - void (*StartScreen)(int screen_num, const char *desc, const char *layout, uint32_t mask_set, uint32_t mask_unset); + void (*AddTextEffect)(TCTEXTDESC* desc, char *text, char *description, int id); + void (*AddBmpEffect)(TCBMPDESC* desc, char *description); + void (*AddMovieEffect)(TCMOVIEDESC* desc, char *description); + void (*AddBkgEffect)(TCBKGDESC* desc, char *description); + void (*AddPolyEffect)(TCPOLYDESC* desc, char *description); + void (*AddSoundEffect)(TCSNDDESC* desc, char *description); + void (*AddButtonEffect)(TCBUTTONDESC* desc, char *description, int id); + void (*StartScreen)(int screen_num, char *desc, char *layout, uint32_t mask_set, uint32_t mask_unset); void (*EndScreen)(); bool (*LoopCallback)(); - void (*SetTitle)(const char *title); + void (*SetTitle)(char *title); void (*SetStatic)(float amount); void (*SetGlitch)(float amount); - void (*AddVoice)(const char *filename, int flags, const char *description); + void (*AddVoice)(char *filename, int flags, char *description); void ParseError(const char *msg, const char *p = NULL); const char *ParseComma(const char *p); diff --git a/Descent3/CMakeLists.txt b/Descent3/CMakeLists.txt index 14fa3070..d841689a 100644 --- a/Descent3/CMakeLists.txt +++ b/Descent3/CMakeLists.txt @@ -297,7 +297,7 @@ add_executable(Descent3 ${HEADERS} ${CPPS} ${PLATFORM_CPPS} ${INCS} ) target_link_libraries(Descent3 - 2dlib AudioEncode bitmap cfile czip d3music dd_video ddebug ddio libmve libacm + 2dlib AudioEncode bitmap cfile czip d3music dd_video 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}) diff --git a/Descent3/lightmap_info.cpp b/Descent3/lightmap_info.cpp index 19d90fec..6f8703af 100644 --- a/Descent3/lightmap_info.cpp +++ b/Descent3/lightmap_info.cpp @@ -35,8 +35,6 @@ lightmap_info *LightmapInfo = NULL; static uint16_t *Free_lmi_list = NULL; -static void CloseLightmapInfos(); - void CloseLightmapInfos() { bool final_lightmap = true; diff --git a/Descent3/lightmap_info.h b/Descent3/lightmap_info.h index 043b4fef..518502a2 100644 --- a/Descent3/lightmap_info.h +++ b/Descent3/lightmap_info.h @@ -89,6 +89,8 @@ int lmi_w(int handle); // Gets the height of this lightmap_info handle int lmi_h(int handle); +void CloseLightmapInfos(); + // Softens the edges of lightmaps so there are fewer artifaces void ShadeLightmapInfoEdges(int type); void BlurLightmapInfos(int type); diff --git a/editor/BriefTextEdit.cpp b/editor/BriefTextEdit.cpp index f9595819..de82a99e 100644 --- a/editor/BriefTextEdit.cpp +++ b/editor/BriefTextEdit.cpp @@ -317,7 +317,7 @@ BOOL CBriefTextEdit::OnInitDialog() int layout = -1; - for(i=0;i<(*PBnum_layouts);i++){ + for(int i=0;i<(*PBnum_layouts);i++){ if(!stricmp(Briefing_screens[m_Screen].layout,PBlayouts[i].filename)) layout = i; } diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index 7a33b2b4..d8db4866 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -1,4 +1,3 @@ -# Set headers and source files set(HEADERS ../descent3/aiambient.h ../descent3/AIGoal.h @@ -285,6 +284,7 @@ set(HEADERS WorldSoundsDialog.h WorldTexturesDialog.h WorldWeaponsDialog.h + d3x.h ) set(SOURCE @@ -511,6 +511,7 @@ set(SOURCE QuickCompile.cpp rad_cast.cpp rad_init.cpp + rad_hemicube.cpp Read3ds.cpp RobotEditWeaponsDialog.cpp roomkeypaddialog.cpp @@ -561,39 +562,21 @@ set(SOURCE editor.rc ) -# Set platform-specific sources and libraries -if (WIN32) - set(PLATFORM_LIBS dd_sndlib misc libimgui devcon dd_grwin32 dd_vidwin32 ddio_win win32 wsock32.lib winmm.lib Glu32.lib) - set(PLATFORM_SOURCES ../descent3/winmain.cpp) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /SUBSYSTEM:WINDOWS /NODEFAULTLIB:LIBC") -elseif (UNIX AND NOT APPLE) - set(PLATFORM_LIBS linux dd_lnxsound ddvid_lnx lnxcontroller ddio_lnx ${SDL_LIBRARY} caca asound audio esd aa directfb m dl GLU) - set(PLATFORM_SOURCES loki_utils.c lnxmain.cpp) - set(CMAKE_EXE_LINKER_FLAGS "/usr/lib/libpulse-simple.so.0") -elseif (APPLE) - set(PLATFORM_LIBS linux dd_lnxsound ddvid_lnx lnxcontroller ddio_lnx ${SDL_LIBRARY} ncurses) - set(PLATFORM_SOURCES loki_utils.c lnxmain.cpp SDLMain.m) - set(CMAKE_EXE_LINKER_FLAGS "-framework IOKit -framework Cocoa -framework OpenGL -framework Carbon") -endif() +# Editor only works in Windows +set(PLATFORM_LIBS dd_grwin32 win32 wsock32.lib winmm.lib + ${DSOUND_LIBRARY} ${DINPUT_LIBRARY} ${DXGUID_LIBRARY} ${DDRAW_LIBRARY}) +set(PLATFORM_SOURCES ../descent3/winmain.cpp) +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /SUBSYSTEM:WINDOWS /NODEFAULTLIB:LIBC") -# Include directories -include_directories(../lib ../ ../manage/) -# Add executable add_executable(Descent3Editor ${HEADERS} ${SOURCE} ${PLATFORM_SOURCES}) +target_include_directories(Descent3Editor PRIVATE ../lib ../ ../manage/ ${PROJECT_BINARY_DIR}/lib) if(MSVC) - target_compile_definitions(Descent3Editor PUBLIC _CRT_SECURE_NO_WARNINGS _AFXDLL) -endif() - -target_compile_definitions(Descent3Editor PUBLIC EDITOR) - -if (MSVC) + target_compile_definitions(Descent3Editor PUBLIC _CRT_SECURE_NO_WARNINGS _AFXDLL EDITOR) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_STANDARD} /Zc:forScope-") endif() -target_include_directories(Descent3Editor PRIVATE ${PROJECT_BINARY_DIR}/lib) - # Link libraries target_link_libraries(Descent3Editor 2dlib @@ -602,13 +585,16 @@ target_link_libraries(Descent3Editor cfile czip d3music - ddio_common + dd_video + ddio + ddebug libmve libacm fix grtext manage mem + misc model module movie @@ -626,8 +612,8 @@ target_link_libraries(Descent3Editor ${PLATFORM_LIBS} ) -add_definitions(-DEDITOR) - if (WIN32) set_target_properties(Descent3Editor PROPERTIES WIN32_EXECUTABLE ON) -endif() \ No newline at end of file +endif() + +install(TARGETS Descent3Editor RUNTIME) diff --git a/editor/D3XStringEditor.cpp b/editor/D3XStringEditor.cpp index 71fbcc37..291d633a 100644 --- a/editor/D3XStringEditor.cpp +++ b/editor/D3XStringEditor.cpp @@ -89,6 +89,7 @@ END_MESSAGE_MAP() void CD3XStringEditor::OnLoadscript() { +#if 0 // open either a level or a .d3x file char openpath[_MAX_PATH+1]; @@ -125,6 +126,7 @@ void CD3XStringEditor::OnLoadscript() m_pathname = openpath; m_modified = false; } +#endif } void CD3XStringEditor::OnSelchangeStringlist() @@ -165,7 +167,7 @@ void CD3XStringEditor::OnKillfocusStringedit() void CD3XStringEditor::OnSave() { ASSERT(m_modified); - +#if 0 // save program by loading it in first and reconstructin a new program obhect CFILE *fp = cfopen(m_pathname, "rb"); if (fp) { @@ -221,7 +223,7 @@ void CD3XStringEditor::OnSave() m_modified = false; GetDlgItem(IDC_SAVE)->EnableWindow(FALSE); - +#endif } void CD3XStringEditor::OnOK() diff --git a/editor/DallasMainDlg.h b/editor/DallasMainDlg.h index f2779eee..a619fd7e 100644 --- a/editor/DallasMainDlg.h +++ b/editor/DallasMainDlg.h @@ -1322,8 +1322,8 @@ public: HTREEITEM ParseScriptNodeLine_v0(char *line, int linenum, HTREEITEM parent, bool &skip_all_children, HTREEITEM insert_before=TVI_LAST); HTREEITEM ParseScriptNodeLine_v1U(char *line, int linenum, HTREEITEM parent, bool &skip_all_children, int version, HTREEITEM insert_before=TVI_LAST); - void ScriptFileParseError(int error_code, int linenum, int script_ID, char *name); - void SpecialScriptFileParseError(int linenum, int script_ID, char *type_name, char *name); + void ScriptFileParseError(int error_code, int linenum, int script_ID,const char *name); + void SpecialScriptFileParseError(int linenum, int script_ID, char *type_name,const char *name); bool ValidateFunctionNode(HTREEITEM node, int linenum); /////////////////////////////////// diff --git a/editor/MainFrm.cpp b/editor/MainFrm.cpp index 636e1756..f9c4ac27 100644 --- a/editor/MainFrm.cpp +++ b/editor/MainFrm.cpp @@ -826,7 +826,6 @@ #include "drawworld.h" #include "Group.h" #include "moveworld.h" -#include "Osiris.h" #include "worldobjectsgenericdialog.h" #include "objinfo.h" #include "HFile.h" @@ -868,7 +867,6 @@ 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_WM_ACTIVATEAPP() ON_COMMAND(ID_FILE_PLAY640X480, OnFilePlayin640x480) ON_UPDATE_COMMAND_UI(ID_VIEW_KEYPAD_TOGGLE, OnUpdateViewKeypadToggle) ON_COMMAND(ID_VIEW_KEYPAD_TOGGLE, OnViewKeypadToggle) @@ -1566,6 +1564,7 @@ void CMainFrame::OnSize(UINT nType, int cx, int cy) void CMainFrame::OnActivateApp(BOOL bActive, HTASK hTask) { +#if 0 CFrameWnd::OnActivateApp(bActive, hTask); if (bActive) { @@ -1578,6 +1577,7 @@ void CMainFrame::OnActivateApp(BOOL bActive, HTASK hTask) } ((oeWin32Application *)Descent)->run_handler(this->m_hWnd, WM_ACTIVATEAPP, (unsigned)bActive, 0); +#endif } diff --git a/editor/ObjCScript.cpp b/editor/ObjCScript.cpp index a2fe9d77..e792c5b8 100644 --- a/editor/ObjCScript.cpp +++ b/editor/ObjCScript.cpp @@ -123,7 +123,6 @@ #include "d3x.h" #include "manage.h" #include "mission.h" -#include "osiris.h" #include "gamefile.h" #include "pserror.h" #include "mem.h" @@ -144,6 +143,7 @@ char *Level_script_source = NULL; //Table of scripts within script file tScriptName Script_names[MAX_SCRIPTS]; +#if 0 // LGT: MAX_SCREVTS undefined // INCREMENT MAX_SCREVTS in ObjCScript when you add a new event! char *Script_evt_names[MAX_SCREVTS] = { "EVT_AI_FRAME", @@ -180,7 +180,7 @@ uint16_t Script_evt_ids[MAX_SCREVTS] = { EVT_CLIENT_INTERVAL, EVT_CLIENT_DESTROY }; - +#endif // function to find first free slot in script list. int FindFreeScriptSlot(); @@ -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; @@ -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); } @@ -280,23 +280,24 @@ void FreeScript(char *script) // Generates a program from a script bool CompileScript(tD3XProgram *program, char *script) { +#if 0 // LGT: D3XReallocProgram undefined. Legacy scripting system? int nscr, nstr, d3xlen; char *strbuf; // string buffer grabbed from compile tD3XInstruction *ins; // temporary holder for code 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; } @@ -304,6 +305,9 @@ bool CompileScript(tD3XProgram *program, char *script) D3XLoadProgramFromComponents(program, ins, map, strbuf); return true; +#else + return false; +#endif } @@ -315,7 +319,7 @@ void SaveScriptCode(const char *filename, tD3XProgram *program) // write out default script program ddio_MakePath(file_path,LocalLevelsDir,filename,NULL); file = cfopen(file_path, "wb"); - D3XSaveProgram(file, program); + // D3XSaveProgram(file, program); // LGT: function undefined mprintf(0, "Saving %s.\n", filename); cfclose(file); } @@ -352,6 +356,7 @@ void ResetScriptList() bool GenerateScriptWizardInfo(tD3XProgram *prog, bool custom) { +#if 0 // LGT: Legacy scripting system? int i; if (!prog) { @@ -367,6 +372,9 @@ bool GenerateScriptWizardInfo(tD3XProgram *prog, bool custom) } return true; +#else + return false; +#endif } @@ -607,18 +615,20 @@ int FindScriptIDFromName(const char *name) char *FindEventNameFromID(int id) { +#if 0 // LGT: MAX_SCREVTS undefined for (int i = 0; i < MAX_SCREVTS; i++) if (id == Script_evt_ids[i]) return Script_evt_names[i]; - +#endif return NULL; } int FindEventIDFromName(const char *name) { +#if 0 // LGT: MAX_SCREVTS undefined for (int i = 0; i < MAX_SCREVTS; i++) if (strcmp(name, Script_evt_names[i]) == 0) return Script_evt_ids[i]; - +#endif return 0; } diff --git a/editor/ObjCScript.h b/editor/ObjCScript.h index 0d4c5cfb..722d3935 100644 --- a/editor/ObjCScript.h +++ b/editor/ObjCScript.h @@ -103,6 +103,8 @@ struct tD3XProgram; +#define MAX_SCRPARAMS 256 // icecoldduke - getting to compile, not correct. + // Data structure for a default script name. // There exists a list of these names too. struct tScriptName diff --git a/editor/OsirisStatusDlg.cpp b/editor/OsirisStatusDlg.cpp index 0be0bc4a..22ac4963 100644 --- a/editor/OsirisStatusDlg.cpp +++ b/editor/OsirisStatusDlg.cpp @@ -22,7 +22,7 @@ #include "stdafx.h" #include "editor.h" #include "OsirisStatusDlg.h" -#include "osiris.h" +#include "d3x_op.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -85,6 +85,7 @@ int COsirisStatusDlg::DoModal() BOOL COsirisStatusDlg::OnInitDialog() { +#if 0 // LGT: Legacy scripting? CDialog::OnInitDialog(); // TODO: Add extra initialization here @@ -122,7 +123,7 @@ BOOL COsirisStatusDlg::OnInitDialog() SetWindowText("Compiling Status...Done"); - +#endif return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } diff --git a/editor/ScriptLevelInterface.cpp b/editor/ScriptLevelInterface.cpp index 931a5b2a..8d85708e 100644 --- a/editor/ScriptLevelInterface.cpp +++ b/editor/ScriptLevelInterface.cpp @@ -344,7 +344,7 @@ void CScriptLevelInterface::OnCompile() if(MessageBox(buffer,"Congratulations",MB_YESNO)==IDYES){ ddio_MakePath(buffer,LocalScriptDir,filename,NULL); if(!cfexist(buffer)){ - sprintf(buffer,"I can't seem to find %s in your data\\scripts directory...Sorry,\nbut I can't automatically add it for you.\nYou'll have to manually add %s into the manage system.",filename); + sprintf(buffer,"I can't seem to find %s in your data\\scripts directory...Sorry,\nbut I can't automatically add it for you.\nYou'll have to manually add %s into the manage system.",filename, filename); MessageBox(buffer,"Uh Oh!",MB_OK); }else{ if(AddNewGameFile(buffer,"scripts")){ @@ -416,7 +416,7 @@ void CScriptLevelInterface::OnEditscript() strcpy(buffer,"The specified path was not found."); break; case ERROR_BAD_FORMAT: - strcpy(buffer,"The .exe file is invalid (non-Win32® .exe or error in .exe image)."); + strcpy(buffer,"The .exe file is invalid (non-Win32� .exe or error in .exe image)."); break; case SE_ERR_ACCESSDENIED: strcpy(buffer,"The operating system denied access to the specified file."); diff --git a/editor/ScriptParmDialog.cpp b/editor/ScriptParmDialog.cpp index 0e3714ba..d9608546 100644 --- a/editor/ScriptParmDialog.cpp +++ b/editor/ScriptParmDialog.cpp @@ -111,9 +111,10 @@ void CScriptParmDialog::DoDataExchange(CDataExchange* pDX) void CScriptParmDialog::ConvertToScriptParameter(tScriptParm *parm, const char *type, const char *text) { +#if 0 // LGT: ->type and ZERO_SCRIPT_PARM undefined ZERO_SCRIPT_PARM(parm); - if (!type || !text) + if (!type || !text) return; if (strcmp(type, "vector") == 0) { @@ -135,11 +136,13 @@ void CScriptParmDialog::ConvertToScriptParameter(tScriptParm *parm, const char * sscanf(str, "%d",&num); *((int *)&parm->val.x) = num; } +#endif } void CScriptParmDialog::ConvertParamToText(CString& text, tScriptParm *parm) { +#if 0 // LGT: ->type undefined if (parm->type == PARMTYPE_VECTOR) { Int3(); // get samir. } @@ -149,6 +152,7 @@ void CScriptParmDialog::ConvertParamToText(CString& text, tScriptParm *parm) else { text.Format("0x%x",*((int *)&parm->val.x)); } +#endif } diff --git a/editor/ScriptSelect.cpp b/editor/ScriptSelect.cpp index eab1e878..417c58cf 100644 --- a/editor/ScriptSelect.cpp +++ b/editor/ScriptSelect.cpp @@ -88,7 +88,7 @@ BOOL CScriptSelect::OnInitDialog() CDialog::OnInitDialog(); // update names of scripts into listbox - m_ScriptCode = D3XReallocProgram(NULL, 0, 0, 0); + // m_ScriptCode = D3XReallocProgram(NULL, 0, 0, 0); LGT- undefined UpdateScriptListbox(); if (m_ScriptName.IsEmpty()) scrlistbox->SelectString(-1, "null"); @@ -118,7 +118,7 @@ void CScriptSelect::OnDestroy() { CDialog::OnDestroy(); - if (m_ScriptCode) D3XFreeProgram(m_ScriptCode); + // if (m_ScriptCode) D3XFreeProgram(m_ScriptCode); LGT- undefined } diff --git a/editor/ScriptSelect.h b/editor/ScriptSelect.h index 13d3be93..80e85ad3 100644 --- a/editor/ScriptSelect.h +++ b/editor/ScriptSelect.h @@ -91,13 +91,16 @@ private: inline void SETUP_SCRIPTSELECT_OBJECT(CScriptSelect& sel, object *obj) { +#if 0 // LGT: script undefined sel.m_ScriptName = obj->script.name; sel.m_NumParms = obj->script.num_parms; - obj->script.copy_parms(sel.m_Parm); + obj->script.copy_parms(sel.m_Parm); +#endif } inline void RETURN_SCRIPTSELECT_OBJECT(object *obj, CScriptSelect& sel) { +#if 0 // LGT: script undefined obj->script.set_parms(sel.m_NumParms, sel.m_Parm); if (sel.m_ScriptName == "null") obj->script.set_name(NULL); @@ -105,18 +108,22 @@ inline void RETURN_SCRIPTSELECT_OBJECT(object *obj, CScriptSelect& sel) obj->script.set_name(sel.m_ScriptName); obj->script.is_custom = (sel.m_CustomType==CUSTOM_SCRIPT_MASK) ? 1 : 0; - mprintf(0, "Script [%s:custom=%d] assigned.\n", sel.m_ScriptName, obj->script.is_custom); + mprintf((0, "Script [%s:custom=%d] assigned.\n", sel.m_ScriptName, obj->script.is_custom)); +#endif } inline void SETUP_SCRIPTSELECT_TRIGGER(CScriptSelect& sel, trigger *trig) { +#if 0 // LGT: script undefined sel.m_ScriptName = trig->script.name; sel.m_NumParms = trig->script.num_parms; trig->script.copy_parms(sel.m_Parm); +#endif } inline void RETURN_SCRIPTSELECT_TRIGGER(trigger *trig, CScriptSelect& sel) { +#if 0 // LGT: script undefined trig->script.set_parms(sel.m_NumParms, sel.m_Parm); if (sel.m_ScriptName == "null") trig->script.set_name(NULL); @@ -124,7 +131,8 @@ inline void RETURN_SCRIPTSELECT_TRIGGER(trigger *trig, CScriptSelect& sel) trig->script.set_name(sel.m_ScriptName); trig->script.is_custom = (sel.m_CustomType==CUSTOM_SCRIPT_MASK) ? 1 : 0; - mprintf(0, "Script [%s:custom=%d] assigned.\n", sel.m_ScriptName, trig->script.is_custom); + mprintf((0, "Script [%s:custom=%d] assigned.\n", sel.m_ScriptName, trig->script.is_custom)); +#endif } diff --git a/editor/ScriptStudio.cpp b/editor/ScriptStudio.cpp index a548e806..7f7f588c 100644 --- a/editor/ScriptStudio.cpp +++ b/editor/ScriptStudio.cpp @@ -608,7 +608,7 @@ void CScriptStudio::RemoveAllSelections() //Replaces the selected word with the passed word void CScriptStudio::ReplaceSelected(char *replace_word) { - int32_t start_index,end_index; + long start_index,end_index; UpdateData(false); @@ -743,6 +743,7 @@ void CScriptStudio::HandleEditControl(int id, int code) bool InvokeScriptStudio(const char *filename, const char *scrname) { +#if 0 // LGT: D3XReallocProgram undefined char *source; CScriptStudio studio; tD3XProgram *script; @@ -781,6 +782,9 @@ bool InvokeScriptStudio(const char *filename, const char *scrname) D3XFreeProgram(script); return ret; +#else + return false; +#endif } diff --git a/editor/ScriptWizard.cpp b/editor/ScriptWizard.cpp index e87cc62c..e3832afa 100644 --- a/editor/ScriptWizard.cpp +++ b/editor/ScriptWizard.cpp @@ -161,7 +161,7 @@ BOOL CScriptWizard::OnInitDialog() // listbox. CComboBox *modcbox = (CComboBox *)GetDlgItem(IDC_SCRMOD_BOX); - m_ScriptCode = D3XReallocProgram(NULL, 0, 0, 0); + // m_ScriptCode = D3XReallocProgram(NULL, 0, 0, 0); // LGT: undefined ResetScriptList(); // place all filenames of scripts into combo box @@ -197,7 +197,7 @@ void CScriptWizard::OnDestroy() CDialog::OnDestroy(); if (m_ScriptCode) - D3XFreeProgram(m_ScriptCode); + // D3XFreeProgram(m_ScriptCode); // LGT: undefined ResetScriptList(); } @@ -616,8 +616,9 @@ void CScriptWizard::UpdateEventListbox() scrlistbox->GetText(m_CurScriptSel, scrname); id = FindScriptIDFromName(scrname); - for (i = 0; i < MAX_SCREVTS; i++) - listbox->AddString(Script_evt_names[i]); + // LGT- MAX_SCREVTS undefined + // for (i = 0; i < MAX_SCREVTS; i++) + // listbox->AddString(Script_evt_names[i]); listbox->SetCurSel(m_CurEventSel); } diff --git a/editor/StatusDlg.cpp b/editor/StatusDlg.cpp index f367337c..4a610f93 100644 --- a/editor/StatusDlg.cpp +++ b/editor/StatusDlg.cpp @@ -130,31 +130,6 @@ bool CProgress::InitProgress(fix min,fix max,int32_t iterations,CWnd *parent) return true; } -bool CProgress::InitProgress(int min,int max,int32_t iterations,CWnd *parent) -{ - int Step; - - float delta; - delta=(float) ( ((float)(max-min))/((float)iterations)); - while(delta<1.0) - { - delta*=10; - max*=10; - } - Step=(int)delta; - m_Max=max; - m_Min=min; - - if(!iterations) return false; - m_StatusDlg=new CStatusDlg; - if(!m_StatusDlg) return false; - m_StatusDlg->Create(IDD_STATUSDLG,parent); - m_StatusDlg->ShowWindow(SW_SHOW); - m_StatusDlg->Init(min,max,Step); - return true; -} - - //This is a quick way of initializing the progress indicator, with a range 0-100 step size 1. This is what you //should call if you plan on using CProgress::SetProgressPercentage(). Again, parent can be NULL if you want it to //be the main application as the parent diff --git a/editor/StatusDlg.h b/editor/StatusDlg.h index 18d3ba28..4af67aa5 100644 --- a/editor/StatusDlg.h +++ b/editor/StatusDlg.h @@ -70,7 +70,6 @@ class CProgress { public: bool InitProgress(fix min,fix max,int32_t iterations,CWnd *parent=NULL); - bool InitProgress(int min,int max,int32_t iterations,CWnd *parent); bool InitProgress(CWnd *parent=NULL); void DestroyProgress(); bool IncreaseProgress(); diff --git a/editor/StdAfx.h b/editor/StdAfx.h index b8358303..368d670d 100644 --- a/editor/StdAfx.h +++ b/editor/StdAfx.h @@ -1,7 +1,10 @@ /* -* Descent 3 +* Descent 3 * Copyright (C) 2024 Parallax Software * +* Descent 3: Apex +* Copyright (C) 2024 by Justin Marshall +* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -34,3 +37,22 @@ #include // MFC OLE support (ADDED BY SAMIR) #include + +// Various 64bit wrapper functions. +#undef GetWindowLong +#undef SetWindowLong +#undef SetClassLong +#undef LONG + +#define GWL_WNDPROC GWLP_WNDPROC +#define SetClassLong SetClassLongPtr +#define GetWindowLong GetWindowLongPtr +#define SetWindowLong SetWindowLongPtr +#define GWL_USERDATA GWLP_USERDATA +#define GCL_HICON GCLP_HICON +#define DWL_MSGRESULT DWLP_MSGRESULT +#define DWL_DLGPROC DWLP_DLGPROC + +#ifndef GCL_HBRBACKGROUND +#define GCL_HBRBACKGROUND (-10) +#endif \ No newline at end of file diff --git a/editor/TerrainDialog.cpp b/editor/TerrainDialog.cpp index a9288171..ffdab333 100644 --- a/editor/TerrainDialog.cpp +++ b/editor/TerrainDialog.cpp @@ -211,6 +211,8 @@ * $NoKeywords: $ */ +#include + #include "stdafx.h" #include "editor.h" #include "TerrainDialog.h" @@ -445,8 +447,8 @@ void CTerrainDialog::UpdateDialog() DrawSwatch (IDC_FOG_SWATCH,GR_COLOR_RED(Terrain_sky.fog_color),GR_COLOR_GREEN(Terrain_sky.fog_color),GR_COLOR_BLUE(Terrain_sky.fog_color)); // Draw satellite swatch - float maxc=max(Terrain_sky.satellite_r[Current_satellite],Terrain_sky.satellite_g[Current_satellite]); - maxc=max(Terrain_sky.satellite_b[Current_satellite],maxc); + float maxc=std::max(Terrain_sky.satellite_r[Current_satellite],Terrain_sky.satellite_g[Current_satellite]); + maxc=std::max(Terrain_sky.satellite_b[Current_satellite],maxc); float r,g,b; @@ -883,7 +885,7 @@ void CTerrainDialog::OnTerrpadPyramid() xa=FixToInt(xstep*t); ya=FixToInt(ystep*i); - a=min(xa,ya); + a=std::max(xa,ya); int seg=((top+i)*TERRAIN_WIDTH)+(t+left); @@ -904,7 +906,7 @@ void CTerrainDialog::OnTerrpadPyramid() xa=FixToInt(xstep*t); ya=FixToInt(ystep*i); - a=min(xa,ya); + a=std::max(xa,ya); int seg=((top+i)*TERRAIN_WIDTH)+(right-t); @@ -924,7 +926,7 @@ void CTerrainDialog::OnTerrpadPyramid() xa=FixToInt(xstep*t); ya=FixToInt(ystep*i); - a=min(xa,ya); + a=std::max(xa,ya); int seg=((bottom-i)*TERRAIN_WIDTH)+(left+t); @@ -944,7 +946,7 @@ void CTerrainDialog::OnTerrpadPyramid() xa=FixToInt(xstep*t); ya=FixToInt(ystep*i); - a=min(xa,ya); + a=std::max(xa,ya); int seg=((bottom-i)*TERRAIN_WIDTH)+(right-t); @@ -1033,7 +1035,7 @@ void CTerrainDialog::OnTerrpadPancakes() xa=FixToInt(xstep*t); ya=FixToInt(ystep*i); - a=max(xa,ya); + a=std::max(xa,ya); int seg=((top+i)*TERRAIN_WIDTH)+(t+left); @@ -1054,7 +1056,7 @@ void CTerrainDialog::OnTerrpadPancakes() xa=FixToInt(xstep*t); ya=FixToInt(ystep*i); - a=max(xa,ya); + a=std::max(xa,ya); int seg=((top+i)*TERRAIN_WIDTH)+(right-t); @@ -1074,7 +1076,7 @@ void CTerrainDialog::OnTerrpadPancakes() xa=FixToInt(xstep*t); ya=FixToInt(ystep*i); - a=max(xa,ya); + a=std::max(xa,ya); int seg=((bottom-i)*TERRAIN_WIDTH)+(left+t); @@ -1094,7 +1096,7 @@ void CTerrainDialog::OnTerrpadPancakes() xa=FixToInt(xstep*t); ya=FixToInt(ystep*i); - a=max(xa,ya); + a=std::max(xa,ya); int seg=((bottom-i)*TERRAIN_WIDTH)+(right-t); diff --git a/editor/TextureDialog.cpp b/editor/TextureDialog.cpp index 9ff06ac0..c00f199d 100644 --- a/editor/TextureDialog.cpp +++ b/editor/TextureDialog.cpp @@ -148,6 +148,7 @@ * $NoKeywords: $ */ +#include #include "stdafx.h" #include "editor.h" @@ -739,8 +740,8 @@ void CTextureDialog::DrawSwatch(int handle,float r,float g,float b) CWnd *texwnd; RECT rect; int w,h; - float rmax=max(r,g); - rmax=max(rmax,b); + float rmax=std::max(r,g); + rmax=std::max(rmax,b); if (rmax>=.001) { diff --git a/editor/TextureGrWnd.cpp b/editor/TextureGrWnd.cpp index df23ff6a..2d1dada8 100644 --- a/editor/TextureGrWnd.cpp +++ b/editor/TextureGrWnd.cpp @@ -497,7 +497,6 @@ #include "stdafx.h" -#include "ddaccess.h" #include "TextureGrWnd.h" #include "application.h" @@ -600,7 +599,7 @@ END_MESSAGE_MAP() void DrawPlayerOnWireframe(); bool Disable_editor_rendering = 0; -static first_time=1; +static int first_time=1; extern int Just_returned_from_game; extern float Just_returned_time; @@ -615,9 +614,9 @@ void CTextureGrWnd::TexGrStartOpenGL() { app=(oeWin32Application *)Descent; StateLimited=1; - save_wnd = app->m_hWnd; - app->m_hWnd = m_hWnd; - rend_SetOpenGLWindowState (1,Descent,NULL); + save_wnd = (HWND)app->m_hWnd; + app->m_hWnd = (HWnd)m_hWnd; + // rend_SetOpenGLWindowState (1,Descent,NULL); // LGT: not defined anymore rend_ClearScreen(0); StateLimited=1; UseMultitexture=0; @@ -629,8 +628,8 @@ void CTextureGrWnd::TexGrStopOpenGL () { if (DoOpenGL) { - rend_SetOpenGLWindowState (0,Descent,NULL); - app->m_hWnd = save_wnd; + // rend_SetOpenGLWindowState (0,Descent,NULL); // LGT: not defined anymore + app->m_hWnd = (HWnd)save_wnd; } } @@ -823,14 +822,14 @@ void CTextureGrWnd::OnPaint() app=(oeWin32Application *)Descent; - save_wnd = app->m_hWnd; - app->m_hWnd = m_hWnd; - rend_SetOpenGLWindowState (1,Descent,NULL); + save_wnd = (HWND)app->m_hWnd; + app->m_hWnd = (HWnd)m_hWnd; + // rend_SetOpenGLWindowState (1,Descent,NULL); // LGT: not defined anymore rend_Flip(); - rend_SetOpenGLWindowState (0,Descent,NULL); - app->m_hWnd = save_wnd; + // rend_SetOpenGLWindowState (0,Descent,NULL); // LGT: not defined anymore + app->m_hWnd = (HWnd)save_wnd; } else { @@ -1178,7 +1177,7 @@ void CTextureGrWnd::OnLButtonDown(UINT nFlags, CPoint point) //C + Click = Copy uv values from marked face static int last_copy_marked_room=-1,last_copy_marked_face=-1; static int last_copy_room=-1,last_copy_face=-1; - static count; + static int count; if (Markedroomp == NULL) { diff --git a/editor/WireframeGrWnd.cpp b/editor/WireframeGrWnd.cpp index 5d6727b8..c506a184 100644 --- a/editor/WireframeGrWnd.cpp +++ b/editor/WireframeGrWnd.cpp @@ -723,7 +723,7 @@ void CWireframeGrWnd::DrawTerrainCell(int seg) x=segx; y=segz; // flip due to origin difference - uint16_t fadepixel; + uint16_t fadepixel = 0; int bm_handle=GameTextures[Terrain_tex_seg[Terrain_seg[(y*TERRAIN_WIDTH+x)].texseg_index].tex_index].bm_handle; lightval=Ubyte_to_float[Terrain_seg[y*TERRAIN_WIDTH+x].l]*(MAX_TEXTURE_SHADES-1); @@ -731,7 +731,7 @@ void CWireframeGrWnd::DrawTerrainCell(int seg) uint16_t pix; pix=*bm_data(bm_handle,0); - fadepixel=(TexShadeTable16[lightval][pix>>8])+TexShadeTable8[lightval][pix & 0xFF]; + // fadepixel=(TexShadeTable16[lightval][pix>>8])+TexShadeTable8[lightval][pix & 0xFF]; if (TerrainSelected[y*TERRAIN_WIDTH+x]) { @@ -743,9 +743,9 @@ void CWireframeGrWnd::DrawTerrainCell(int seg) green<<=2; blue<<=2; - red=min(255,red); - green=min(255,green); - blue=min(255,blue); + red=std::min(255,red); + green=std::min(255,green); + blue=std::min(255,blue); fadepixel=GR_RGB16(red,green,blue); } @@ -820,9 +820,9 @@ void CWireframeGrWnd::DrawTerrainWorld(grViewport *vp,vector *view_target,matrix green<<=2; blue<<=2; - red=min(255,red); - green=min(255,green); - blue=min(255,blue); + red=std::min(255,red); + green=std::min(255,green); + blue=std::min(255,blue); @@ -901,9 +901,9 @@ void CWireframeGrWnd::DrawTerrainWorld(grViewport *vp,vector *view_target,matrix green<<=2; blue<<=2; - red=min(255,red); - green=min(255,green); - blue=min(255,blue); + red=std::min(255,red); + green=std::min(255,green); + blue=std::min(255,blue); diff --git a/editor/WorldObjectsDoorDialog.cpp b/editor/WorldObjectsDoorDialog.cpp index d0993cac..54cd6e0a 100644 --- a/editor/WorldObjectsDoorDialog.cpp +++ b/editor/WorldObjectsDoorDialog.cpp @@ -461,9 +461,9 @@ void CWorldObjectsDoorDialog::UpdateDoorView(void) RECT rect; int x, y, bm_handle,w,h; static int frame=0,spin_frame=0; - static last_door=-1; - static last_model_handle=-1; - static door_dir=0; + static int last_door=-1; + static int last_model_handle=-1; + static int door_dir=0; if (Num_doors<1) return; diff --git a/editor/WorldObjectsGenericDialog.cpp b/editor/WorldObjectsGenericDialog.cpp index 7f3bfc5f..cc0c7c05 100644 --- a/editor/WorldObjectsGenericDialog.cpp +++ b/editor/WorldObjectsGenericDialog.cpp @@ -1200,8 +1200,8 @@ void CWorldObjectsGenericDialog::UpdateObjectView(void) int x, y, bm_handle,w,h; static int frame=0,spin_frame=0; static int last_object=-1; - static last_render_handle=-1; - static object_dir=0; + static int last_render_handle=-1; + static int object_dir=0; if (m_current == -1) return; diff --git a/editor/WorldObjectsPlayerDialog.cpp b/editor/WorldObjectsPlayerDialog.cpp index 0b1b49a0..3a955910 100644 --- a/editor/WorldObjectsPlayerDialog.cpp +++ b/editor/WorldObjectsPlayerDialog.cpp @@ -928,9 +928,9 @@ void CWorldObjectsPlayerDialog::UpdateShipView(void) RECT rect; int x, y, bm_handle,w,h,render_handle; static int frame=0,spin_frame=0; - static last_ship=-1; - static last_model_handle=-1; - static ship_dir=0; + static int last_ship=-1; + static int last_model_handle=-1; + static int ship_dir=0; if (Num_ships<1) diff --git a/editor/WorldObjectsPowerupDialog.cpp b/editor/WorldObjectsPowerupDialog.cpp index e833f29e..08452831 100644 --- a/editor/WorldObjectsPowerupDialog.cpp +++ b/editor/WorldObjectsPowerupDialog.cpp @@ -59,6 +59,9 @@ static char THIS_FILE[] = __FILE__; #endif +// LGT: missing powerup.cpp +powerup Powerups[MAX_POWERUPS]; + ///////////////////////////////////////////////////////////////////////////// // CWorldObjectsPowerupDialog dialog @@ -115,6 +118,7 @@ END_MESSAGE_MAP() // powerup, and allocs a tracklock to keep track of it void CWorldObjectsPowerupDialog::OnAddNewPowerup() { +#if 0 char filename[255]; char cur_name[100]; int img_handle; @@ -196,12 +200,13 @@ void CWorldObjectsPowerupDialog::OnAddNewPowerup() RemapPowerups(); UpdateDialog (); - +#endif } // This functions saves the current powerup to the net void CWorldObjectsPowerupDialog::OnCheckin() { +#if 0 int n=D3EditState.current_powerup; mngs_Pagelock temp_pl; int r; @@ -276,6 +281,7 @@ void CWorldObjectsPowerupDialog::OnCheckin() } } } +#endif } // Deletes the current powerup @@ -283,6 +289,7 @@ void CWorldObjectsPowerupDialog::OnCheckin() // If its local only, it will get deleted from the local pagefile void CWorldObjectsPowerupDialog::OnDeletePowerup() { +#if 0 int answer,tl; mngs_Pagelock pl; int n=D3EditState.current_powerup; @@ -340,12 +347,13 @@ void CWorldObjectsPowerupDialog::OnDeletePowerup() OutrageMessageBox ("Powerup deleted."); UpdateDialog (); - +#endif } // This functions locks a powerup from the net. void CWorldObjectsPowerupDialog::OnLockPowerup() { +#if 0 int n=D3EditState.current_powerup; mngs_Pagelock temp_pl; mngs_power_page powpage; @@ -421,28 +429,31 @@ void CWorldObjectsPowerupDialog::OnLockPowerup() } mng_EraseLocker(); - +#endif } // Gets the next powerup and sets it as the current one void CWorldObjectsPowerupDialog::OnNextPowerup() { +#if 0 D3EditState.current_powerup=GetNextPowerup(D3EditState.current_powerup); UpdateDialog(); - +#endif } // Gets the previous powerup and sets it as the current one void CWorldObjectsPowerupDialog::OnPrev() { - +#if 0 D3EditState.current_powerup=GetPrevPowerup(D3EditState.current_powerup); UpdateDialog(); +#endif } // This simply gets a list of all the pages we have checked out void CWorldObjectsPowerupDialog::OnPowerupsOut() { +#if 0 char str[10000]; int total=0; @@ -468,7 +479,7 @@ void CWorldObjectsPowerupDialog::OnPowerupsOut() MessageBox (str,"Powerups",MB_OK); } - +#endif } @@ -476,6 +487,7 @@ void CWorldObjectsPowerupDialog::OnPowerupsOut() // what stuff to flag as "checked out" the next time we start up void CWorldObjectsPowerupDialog::SavePowerupsOnClose() { +#if 0 int i,t; @@ -492,21 +504,24 @@ void CWorldObjectsPowerupDialog::SavePowerupsOnClose() mng_ReplacePowPage (Powerups[t].name,t,1); } } +#endif } void CWorldObjectsPowerupDialog::OnPaint() { +#if 0 CPaintDC dc(this); // device context for painting UpdateDialog(); - +#endif } // Redraw the dialog based on our current powerup void CWorldObjectsPowerupDialog::UpdateDialog(void) { +#if 0 CEdit *ebox; CButton *bbox; int n=D3EditState.current_powerup; @@ -591,8 +606,9 @@ void CWorldObjectsPowerupDialog::UpdateDialog(void) bbox = (CButton *)GetDlgItem(IDC_GRAVITY_CHECK); bbox->SetCheck(Powerups[n].phys_info.flags & PF_GRAVITY); - bbox = (CButton *)GetDlgItem(IDC_MAGNETISM_CHECK); - bbox->SetCheck(Powerups[n].phys_info.flags & PF_MAGNETISM); + // FIXME Editor + // bbox = (CButton *)GetDlgItem(IDC_MAGNETISM_CHECK); + // bbox->SetCheck(Powerups[n].phys_info.flags & PF_MAGNETISM); bbox = (CButton *)GetDlgItem(IDC_WIND_CHECK); bbox->SetCheck(Powerups[n].phys_info.flags & PF_WIND); @@ -607,18 +623,19 @@ void CWorldObjectsPowerupDialog::UpdateDialog(void) SendDlgItemMessage( IDC_POWER_PULLDOWN, CB_SELECTSTRING,0,(LPARAM) (LPCTSTR) Powerups[n].name); UpdatePowerupView(); - +#endif } void CWorldObjectsPowerupDialog::UpdatePowerupView(void) { +#if 0 int n=D3EditState.current_powerup; CWnd *powwnd; RECT rect; int x, y, bm_handle,w,h; static int frame=0; - static last_powerup=-1; - static last_image_handle=-1; + static int last_powerup=-1; + static int last_image_handle=-1; if (Num_powerups<1) return; @@ -677,12 +694,14 @@ void CWorldObjectsPowerupDialog::UpdatePowerupView(void) delete vport; m_PowerupSurf.free(); } +#endif } BOOL CWorldObjectsPowerupDialog::OnInitDialog() { + CDialog::OnInitDialog(); CWnd::SetTimer(1,100,NULL); @@ -709,6 +728,7 @@ BOOL CWorldObjectsPowerupDialog::DestroyWindow() void CWorldObjectsPowerupDialog::OnKillfocusPowerNameEdit() { +#if 0 CEdit *ebox; int n=D3EditState.current_powerup; char name[PAGENAME_LEN]; @@ -777,10 +797,12 @@ void CWorldObjectsPowerupDialog::OnKillfocusPowerNameEdit() strcpy (Powerups[n].name,name); UpdateDialog(); mng_EraseLocker(); +#endif } void CWorldObjectsPowerupDialog::OnKillfocusPowerupSizeEdit() { +#if 0 CEdit *ebox; char str[20]; int n=D3EditState.current_powerup; @@ -789,11 +811,12 @@ void CWorldObjectsPowerupDialog::OnKillfocusPowerupSizeEdit() ebox->GetWindowText (str,20); Powerups[n].size=atof (str); - +#endif } void CWorldObjectsPowerupDialog::OnSelendokPowerPulldown() { +#if 0 int i,cur; char name[200]; @@ -810,10 +833,12 @@ void CWorldObjectsPowerupDialog::OnSelendokPowerPulldown() D3EditState.current_powerup=i; UpdateDialog(); +#endif } void CWorldObjectsPowerupDialog::OnLoadImage() { +#if 0 char filename[255]; char curname[255]; int img_handle; @@ -867,11 +892,12 @@ void CWorldObjectsPowerupDialog::OnLoadImage() } UpdateDialog(); - +#endif } void CWorldObjectsPowerupDialog::OnGravityCheck() { +#if 0 // TODO: Add your control notification handler code here int n=D3EditState.current_powerup; CButton *btn; @@ -882,11 +908,13 @@ void CWorldObjectsPowerupDialog::OnGravityCheck() Powerups[n].phys_info.flags |= PF_GRAVITY; else Powerups[n].phys_info.flags &= ~PF_GRAVITY; +#endif } void CWorldObjectsPowerupDialog::OnMagnetismCheck() { +#if 0 // TODO: Add your control notification handler code here int n=D3EditState.current_powerup; CButton *btn; @@ -898,7 +926,7 @@ void CWorldObjectsPowerupDialog::OnMagnetismCheck() else Powerups[n].phys_info.flags &= ~PF_MAGNETISM; - +#endif } void CWorldObjectsPowerupDialog::OnWindCheck() diff --git a/editor/WorldObjectsRobotDialog.cpp b/editor/WorldObjectsRobotDialog.cpp index c80c6b32..3517549d 100644 --- a/editor/WorldObjectsRobotDialog.cpp +++ b/editor/WorldObjectsRobotDialog.cpp @@ -115,6 +115,7 @@ END_MESSAGE_MAP() void CWorldObjectsRobotDialog::OnAddNewRobot() { +#if 0 // LGT: undeclared symbols char filename[255]; char cur_name[100]; int img_handle; @@ -152,7 +153,7 @@ void CWorldObjectsRobotDialog::OnAddNewRobot() while (finding_name) { - sprintf (cur_name,"%s%d",dlg_open.GetFileName(),c); + // sprintf (cur_name,"%s%d",dlg_open.GetFileName(),c); // LGT: CString not char* if (FindRobotName (cur_name)!=-1) c++; else @@ -187,11 +188,12 @@ void CWorldObjectsRobotDialog::OnAddNewRobot() UpdateDialog (); - +#endif } void CWorldObjectsRobotDialog::OnCheckinRobot() { +#if 0 // LGT: undeclared symbols int n=D3EditState.current_robot; mngs_Pagelock temp_pl; int r; @@ -257,12 +259,13 @@ void CWorldObjectsRobotDialog::OnCheckinRobot() } } } - +#endif } void CWorldObjectsRobotDialog::OnDeleteRobot() { +#if 0 // LGT: undeclared symbols int answer,tl; mngs_Pagelock pl; int n=D3EditState.current_robot; @@ -323,12 +326,12 @@ void CWorldObjectsRobotDialog::OnDeleteRobot() RemapRobots(); UpdateDialog (); - - +#endif } void CWorldObjectsRobotDialog::OnLockRobot() { +#if 0 // LGT: undeclared symbols int n=D3EditState.current_robot; mngs_Pagelock temp_pl; mngs_robot_page robotpage; @@ -404,23 +407,28 @@ void CWorldObjectsRobotDialog::OnLockRobot() } } mng_EraseLocker(); +#endif } void CWorldObjectsRobotDialog::OnNextRobot() { +#if 0 // LGT: undeclared symbols D3EditState.current_robot=GetNextRobot(D3EditState.current_robot); UpdateDialog(); - +#endif } void CWorldObjectsRobotDialog::OnPrevRobot() { +#if 0 // LGT: undeclared symbols D3EditState.current_robot=GetPrevRobot(D3EditState.current_robot); UpdateDialog(); +#endif } void CWorldObjectsRobotDialog::OnRobotModel() { +#if 0 // LGT: undeclared symbols char filename[255]; char curname[255]; int img_handle; @@ -458,11 +466,12 @@ void CWorldObjectsRobotDialog::OnRobotModel() cf_CopyFile (curname,filename); UpdateDialog(); - +#endif } void CWorldObjectsRobotDialog::OnKillfocusRobotNameEdit() { +#if 0 // LGT: undeclared symbols CEdit *ebox; int n=D3EditState.current_robot; char name[PAGENAME_LEN]; @@ -534,12 +543,13 @@ void CWorldObjectsRobotDialog::OnKillfocusRobotNameEdit() RemapRobots(); UpdateDialog(); - +#endif } void CWorldObjectsRobotDialog::OnSelendokRobotPulldown() { +#if 0 // LGT: undeclared symbols int i,cur; char name[200]; @@ -556,11 +566,12 @@ void CWorldObjectsRobotDialog::OnSelendokRobotPulldown() D3EditState.current_robot=i; UpdateDialog(); - +#endif } void CWorldObjectsRobotDialog::UpdateDialog() { +#if 0 CEdit *ebox; CButton *bbox; int n=D3EditState.current_robot; @@ -629,12 +640,14 @@ void CWorldObjectsRobotDialog::UpdateDialog() SendDlgItemMessage( IDC_ROBOT_PULLDOWN, CB_SELECTSTRING,0,(LPARAM) (LPCTSTR) Robots[n].name); UpdateRobotView(); +#endif } #define NUM_ANIM_FRAMES 30 void CWorldObjectsRobotDialog::UpdateRobotView(void) { +#if 0 int n=D3EditState.current_robot; CWnd *robotwnd; RECT rect; @@ -716,31 +729,35 @@ void CWorldObjectsRobotDialog::UpdateRobotView(void) delete vport; m_RobotSurf.free(); - +#endif } BOOL CWorldObjectsRobotDialog::OnInitDialog() { +#if 0 // LGT: undeclared symbols CDialog::OnInitDialog(); CWnd::SetTimer(1,50,NULL); UpdateDialog(); - +#endif return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CWorldObjectsRobotDialog::OnTimer(UINT nIDEvent) { +#if 0 // LGT: undeclared symbols UpdateRobotView(); CDialog::OnTimer(nIDEvent); +#endif } void CWorldObjectsRobotDialog::OnKillfocusRobotSizeEdit() { +#if 0 // LGT: undeclared symbols CEdit *ebox; char str[20]; int n=D3EditState.current_robot; @@ -749,10 +766,12 @@ void CWorldObjectsRobotDialog::OnKillfocusRobotSizeEdit() ebox->GetWindowText (str,20); Robots[n].size = atof (str); +#endif } void CWorldObjectsRobotDialog::OnRobotsOut() { +#if 0 // LGT: undeclared symbols char str[10000]; int total=0; @@ -777,12 +796,13 @@ void CWorldObjectsRobotDialog::OnRobotsOut() // Display that string MessageBox (str,"Robots",MB_OK); } - +#endif } // When closing, save all our checked out robots locally so we know // what stuff to flag as "checked out" the next time we start up void CWorldObjectsRobotDialog::SaveRobotsOnClose() { +#if 0 // LGT: undeclared symbols int i,t; @@ -799,6 +819,7 @@ void CWorldObjectsRobotDialog::SaveRobotsOnClose() mng_ReplaceRobotPage (Robots[t].name,t,1); } } +#endif } @@ -811,6 +832,7 @@ BOOL CWorldObjectsRobotDialog::DestroyWindow() void CWorldObjectsRobotDialog::OnDefineAnimstates() { +#if 0 // LGT: used undefined int n=D3EditState.current_robot; if (!Robots[n].used) @@ -820,6 +842,7 @@ void CWorldObjectsRobotDialog::OnDefineAnimstates() if (dlg.DoModal() == IDOK) //Copy back into object dlg.GetAnimData(Robots[n].anim); +#endif } BOOL CWorldObjectsRobotDialog::OnHelpInfo(HELPINFO* pHelpInfo) @@ -832,6 +855,7 @@ BOOL CWorldObjectsRobotDialog::OnHelpInfo(HELPINFO* pHelpInfo) void CWorldObjectsRobotDialog::OnRobotUsesPhysics() { +#if 0 // LGT: undeclared symbols int n=D3EditState.current_robot; CButton *btn; @@ -843,21 +867,24 @@ void CWorldObjectsRobotDialog::OnRobotUsesPhysics() Robots[n].flags &= ~OIF_USES_PHYSICS; ((CButton *)GetDlgItem(IDC_ROBOT_EDIT_PHYSICS))->EnableWindow(Robots[n].flags & OIF_USES_PHYSICS); - +#endif } void CWorldObjectsRobotDialog::OnRobotEditPhysics() { +#if 0 // LGT: CopyPhysicsData undefined CPhysicsDlg dlg; CopyPhysicsData(&dlg,&Robots[D3EditState.current_robot].phys_info); if (dlg.DoModal() == IDOK) CopyPhysicsData(&Robots[D3EditState.current_robot].phys_info,&dlg); +#endif } void CWorldObjectsRobotDialog::OnRobotUsesAI() { +#if 0 // LGT: undeclared symbols int n=D3EditState.current_robot; CButton *btn; @@ -869,24 +896,29 @@ void CWorldObjectsRobotDialog::OnRobotUsesAI() Robots[n].flags &= ~OIF_CONTROL_AI; ((CButton *)GetDlgItem(IDC_ROBOT_EDIT_AI))->EnableWindow(Robots[n].flags & OIF_CONTROL_AI); +#endif } void CWorldObjectsRobotDialog::OnRobotEditAI() { +#if 0 // LGT: CopyAIData undefined CAISettingsDlg dlg; CopyAIData(&dlg,&Robots[D3EditState.current_robot].ai_info); if (dlg.DoModal() == IDOK) CopyAIData(&Robots[D3EditState.current_robot].ai_info,&dlg); +#endif } void CWorldObjectsRobotDialog::OnKillfocusScriptid() { +#if 0 // LGT: script_handle undefined // really all this does is set the script item in memory. CEdit *edit = (CEdit *)GetDlgItem(IDC_SCRIPTID); char buf[8]; edit->GetWindowText(buf, sizeof(buf)); Robots[D3EditState.current_robot].script_handle = atoi(buf); +#endif } diff --git a/editor/WorldObjectsRobotDialog.h b/editor/WorldObjectsRobotDialog.h index 85573f35..b6631d85 100644 --- a/editor/WorldObjectsRobotDialog.h +++ b/editor/WorldObjectsRobotDialog.h @@ -19,6 +19,8 @@ // WorldObjectsRobotDialog.h : header file // +#include "../lib/gr.h" + ///////////////////////////////////////////////////////////////////////////// // CWorldObjectsRobotDialog dialog diff --git a/editor/WorldTexturesDialog.cpp b/editor/WorldTexturesDialog.cpp index 52c5be6b..60560253 100644 --- a/editor/WorldTexturesDialog.cpp +++ b/editor/WorldTexturesDialog.cpp @@ -237,6 +237,8 @@ * $NoKeywords: $ */ +#include + #include "stdafx.h" #include "editor.h" #include "WorldTexturesDialog.h" @@ -752,7 +754,7 @@ void CWorldTexturesDialog::UpdateTextureViews(int frame) int x, y, bm_handle,w,h; static int last_frame=0; static int last_texture=-1; - static last_tex_count=-1; + static int last_tex_count=-1; int update_listbox=0; DrawSwatch (IDC_TEXTURE_SWATCH,GameTextures[n].r,GameTextures[n].g,GameTextures[n].b); @@ -2318,7 +2320,8 @@ void CWorldTexturesDialog::OnSaveAsTga() if (! strchr(filename,'.')) strcat(filename,".tga"); - bm_SaveBitmapTGA (filename,GameTextures[n].bm_handle); + // FIXME: Save as PNG + // bm_SaveBitmapTGA (filename,GameTextures[n].bm_handle); OutrageMessageBox ("TGA saved!"); } @@ -2327,8 +2330,8 @@ void CWorldTexturesDialog::DrawSwatch(int handle,float r,float g,float b) CWnd *texwnd; RECT rect; int w,h; - float rmax=max(r,g); - rmax=max(rmax,b); + float rmax=std::max(r,g); + rmax=std::max(rmax,b); if (rmax>=.001) { diff --git a/editor/WorldWeaponsDialog.cpp b/editor/WorldWeaponsDialog.cpp index b71e3764..f85b84b5 100644 --- a/editor/WorldWeaponsDialog.cpp +++ b/editor/WorldWeaponsDialog.cpp @@ -1375,8 +1375,8 @@ void CWorldWeaponsDialog::UpdateWeaponView() RECT rect; int x, y, bm_handle,w,h; static int frame=0; - static last_weapon=-1; - static last_image_handle=-1; + static int last_weapon=-1; + static int last_image_handle=-1; int clearit=0; if (Num_weapons<1) diff --git a/editor/d3x.h b/editor/d3x.h new file mode 100644 index 00000000..55b02bb1 --- /dev/null +++ b/editor/d3x.h @@ -0,0 +1,35 @@ +/* +* Descent 3 +* Copyright (C) 2024 Parallax Software +* +* Descent 3: Apex +* Copyright (C) 2024 by Justin Marshall +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +// d3x.h +// + +#pragma once + +// THIS ENTIRE FILE WAS MISSING FROM THE SOURCE RELEASE, MODIFIED SO THINGS COMPILE + +struct tD3XProgram { + // UNKNOWN +}; + +struct tScriptParm { + vector val; +}; \ No newline at end of file diff --git a/editor/drawworld.cpp b/editor/drawworld.cpp index 702bff9f..175fa421 100644 --- a/editor/drawworld.cpp +++ b/editor/drawworld.cpp @@ -288,7 +288,7 @@ void DrawTerrainPoints (vector *view_pos,matrix *view_orient) for (i=0;i #include #include "3d.h" #include "texture.h" @@ -1519,9 +1520,9 @@ void AssignRoomSurfaceToLightmap (int roomnum,int facenum,rad_surface *sp) red=green=blue=0; } - fr=min(1.0,sp->elements[i*xres+t].exitance.r+Ambient_red+Room_ambience_r[roomnum]); - fg=min(1.0,sp->elements[i*xres+t].exitance.g+Ambient_green+Room_ambience_g[roomnum]); - fb=min(1.0,sp->elements[i*xres+t].exitance.b+Ambient_blue+Room_ambience_b[roomnum]); + fr=std::min(1.0f,sp->elements[i*xres+t].exitance.r+Ambient_red+Room_ambience_r[roomnum]); + fg=std::min(1.0f,sp->elements[i*xres+t].exitance.g+Ambient_green+Room_ambience_g[roomnum]); + fb=std::min(1.0f,sp->elements[i*xres+t].exitance.b+Ambient_blue+Room_ambience_b[roomnum]); fr=(fr*255)+.5; fg=(fg*255)+.5; @@ -1539,9 +1540,9 @@ void AssignRoomSurfaceToLightmap (int roomnum,int facenum,rad_surface *sp) blue/=2; } - red=min(red,255); - green=min(green,255); - blue=min(blue,255); + red=std::min(red,255); + green=std::min(green,255); + blue=std::min(blue,255); uint16_t texel=OPAQUE_FLAG|GR_RGB16(red,green,blue); @@ -2332,13 +2333,13 @@ void DoRadiosityForTerrain () for (i=0;i. */ +#include #include "3d.h" #include "texture.h" @@ -131,9 +132,9 @@ void ApplyLightmapToObjectSurface (object *obj,int subnum,int facenum,rad_surfac red=green=blue=0; } - fr=min(1.0,sp->elements[i*xres+t].exitance.r+Ambient_red); - fg=min(1.0,sp->elements[i*xres+t].exitance.g+Ambient_green); - fb=min(1.0,sp->elements[i*xres+t].exitance.b+Ambient_blue); + fr=std::min(1.0f,sp->elements[i*xres+t].exitance.r+Ambient_red); + fg=std::min(1.0f,sp->elements[i*xres+t].exitance.g+Ambient_green); + fb=std::min(1.0f,sp->elements[i*xres+t].exitance.b+Ambient_blue); fr=(fr*255)+.5; fg=(fg*255)+.5; @@ -151,9 +152,9 @@ void ApplyLightmapToObjectSurface (object *obj,int subnum,int facenum,rad_surfac blue/=2; } - red=min(red,255); - green=min(green,255); - blue=min(blue,255); + red=std::min(red,255); + green=std::min(green,255); + blue=std::min(blue,255); dest_data[(i+y1)*lw+(t+x1)]=OPAQUE_FLAG|GR_RGB16(red,green,blue); } @@ -678,7 +679,7 @@ void BuildObjectLightmapUVs (object *obj,int *sublist,int *facelist,int count,ve // Figure out lightmap resolution float xdiff=verts[rightmost_point].x-verts[leftmost_point].x; float ydiff=verts[topmost_point].y-verts[bottommost_point].y; - float max_diff=(float)max(xdiff,ydiff); + float max_diff=(float)std::max(xdiff,ydiff); int lightmap_x_res=-1,lightmap_y_res=-1; float xspacing=LightSpacing; diff --git a/editor/rad_hemicube.cpp b/editor/rad_hemicube.cpp index d39fdc71..79fd66da 100644 --- a/editor/rad_hemicube.cpp +++ b/editor/rad_hemicube.cpp @@ -26,7 +26,9 @@ #include "d3edit.h" #include "ddio.h" #include "mem.h" + #include +#include #define TOP_FACE 0 #define LEFT_FACE 1 @@ -38,7 +40,7 @@ float Hemicube_view_zoom=1.0; int rad_Drawing=0; -g3Point Element_points[100]; +g3Point Element_points[100]; rad_element *rad_MaxElement; rad_hemicube rad_Hemicube; @@ -220,9 +222,9 @@ void CalculateFormFactorsHemiCube () float rff; if (rad_MaxSurface->surface_type==ST_SATELLITE) - rff= min (rad_FormFactors[ff_index],1.0); + rff= std::min(rad_FormFactors[ff_index],1.0f); else - rff= (float) min(rad_FormFactors[ff_index] * rad_MaxSurface->area / dest_element->area,1.0); + rff= (float) std::min(rad_FormFactors[ff_index] * rad_MaxSurface->area / dest_element->area,1.0f); // Get shooting patch unsent exitance spectra shoot=rad_MaxSurface->exitance; diff --git a/editor/rad_init.cpp b/editor/rad_init.cpp index e60a2e48..d0c654a1 100644 --- a/editor/rad_init.cpp +++ b/editor/rad_init.cpp @@ -280,7 +280,7 @@ void UpdateUnsentValues () int i; rad_surface *sat_surface; - static last_report_time=-10; + static int last_report_time=-10; rad_TotalUnsent=0.0f; rad_MaxSurface=NULL; @@ -407,8 +407,8 @@ float GetMaxColor (spectra *sp) { float m; - m=(float)max (sp->r,sp->g); - m=(float)max (sp->b,m); + m=std::max(sp->r,sp->g); + m=std::max(sp->b,m); return m; } diff --git a/netgames/dmfc/dmfccfg.cpp b/netgames/dmfc/dmfccfg.cpp index 2bb8631a..8cc30036 100644 --- a/netgames/dmfc/dmfccfg.cpp +++ b/netgames/dmfc/dmfccfg.cpp @@ -48,6 +48,8 @@ * $NoKeywords: $ */ +#include + #include "gamedll_header.h" #include "DMFC.h" #include "dmfcinternal.h"