minimal changes for compilation (including linking) under Windows

This commit is contained in:
Edu Garcia 2024-04-16 14:45:15 +01:00
parent ee8250371f
commit 8e350a6c5d
5 changed files with 13 additions and 6 deletions

View File

@ -40,10 +40,9 @@ ENDIF()
IF (WIN32)
SET(D3_GAMEDIR "c:/games/Descent3/")
set (CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "lib/win" "lib/win/directx")
SET(CMAKE_CXX_FLAGS_DEBUG "/Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /c /ZI /TP /errorReport:prompt")
SET(CMAKE_CXX_FLAGS_RELEASE "/O2 /GL /FD /EHsc /MT /W3 /nologo /c /Zi /TP /errorReport:prompt")
set (CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "lib/win" "lib/win/directx")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Gm /EHsc /RTC1 /W3 /nologo /c /ZI /TP /errorReport:prompt")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL /FD /EHsc /W3 /nologo /c /Zi /TP /errorReport:prompt")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /SUBSYSTEM:WINDOWS /NODEFAULTLIB:LIBC")
SET(CMAKE_MODULE_LINKER_FLAGS "/SAFESEH:NO /SUBSYSTEM:WINDOWS /NODEFAULTLIB:LIBC")

View File

@ -307,3 +307,7 @@ target_link_libraries(Descent3
music networking physics renderer rtperformance sndlib ui unzip vecmat md5
${PLATFORM_LIBS})
install(TARGETS Descent3 DESTINATION ${D3_GAMEDIR})
if (WIN32)
set_target_properties(Descent3 PROPERTIES WIN32_EXECUTABLE ON)
endif()

View File

@ -995,7 +995,7 @@ void FindHitpointUV(float *u,float *v,vector *point,room *rp,int facenum)
vec1.j = pnt[2].j - pnt[1].j;
k1 = -((cross(&checkp,&vec0) + cross(&vec0,&pnt[1])) / cross(&vec0,&vec1));
if (abs(vec0.i) > abs(vec0.j))
if (abs((int)vec0.i) > abs((int)vec0.j))
k0 = ((-k1 * vec1.i) + checkp.i - pnt[1].i) / vec0.i;
else
k0 = ((-k1 * vec1.j) + checkp.j - pnt[1].j) / vec0.j;

View File

@ -166,7 +166,7 @@ void rtp_WriteBufferLog(void)
RTP_CLOCKSECONDS(fi->obj_do_frm,obj_do_frm);
RTP_CLOCKSECONDS(fi->fvi_time,fvi_time);
sprintf(buffer,"%d,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f %d %f",(int)fi->frame_num,fi->frame_time,
sprintf(buffer,"%d,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f %d %lld",(int)fi->frame_num,fi->frame_time,
renderframe_time,multiframe_time,musicframe_time,ambsound_frame_time,weatherframe_time,
playerframe_time,doorframe_time,levelgoal_time,matcenframe_time,objframe_time,aiframeall_time,
processkeys_time,fi->texture_uploads,fi->polys_drawn,ct_flying_time,ct_aidoframe_time,ct_weaponframe_time,

View File

@ -208,6 +208,7 @@ bool Debug_ConsoleInit()
else
Mono_initialized = 0;
}
#ifdef OLD
else {
_outp( 0x3b4, 0x0f );
_outp( 0x3b4+1, 0x55 );
@ -224,6 +225,7 @@ bool Debug_ConsoleInit()
}
Mono_screen = (mono_element (*)[25][80])0xB0000;
}
#endif
if (Mono_initialized)
OPEN=1;
@ -603,10 +605,12 @@ void con_setcursor(int row, int col)
return;
}
#ifdef OLD
_outp( 0x3b4, 15 );
_outp( 0x3b5, pos & 0xFF );
_outp( 0x3b4, 14 );
_outp( 0x3b5, (pos >> 8) & 0xff );
#endif
}