Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a define for activating support for 'new' video code. #960

Merged
merged 1 commit into from
Jun 12, 2024
Merged
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
4 changes: 2 additions & 2 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ if(BUILD_VANILLATD OR BUILD_VANILLARA)
target_compile_definitions(commonv PUBLIC OPENAL_BUILD)
endif()
if(SDL2)
target_compile_definitions(commonv PUBLIC SDL_BUILD SDL2_BUILD)
target_compile_definitions(commonv PUBLIC SDL_BUILD SDL2_BUILD NEW_VIDEO_BUILD)
endif()
if(SDL1)
target_compile_definitions(commonv PUBLIC SDL_BUILD SDL1_BUILD)
target_compile_definitions(commonv PUBLIC SDL_BUILD SDL1_BUILD NEW_VIDEO_BUILD)
endif()
if(NETWORKING)
target_compile_definitions(commonv PUBLIC WINSOCK_IPX NETWORKING)
Expand Down
6 changes: 3 additions & 3 deletions common/framelimit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

extern WWMouseClass* WWMouse;

#ifdef SDL_BUILD
#ifdef NEW_VIDEO_BUILD
void Video_Render_Frame();
#endif

void Frame_Limiter(FrameLimitFlags flags)
{
static auto frame_start = std::chrono::steady_clock::now();
#ifdef SDL_BUILD
#ifdef NEW_VIDEO_BUILD
static auto render_avg = 0;

auto render_start = std::chrono::steady_clock::now();
Expand All @@ -43,7 +43,7 @@ void Frame_Limiter(FrameLimitFlags flags)
#endif

if (Settings.Video.FrameLimit > 0 && !(flags & FrameLimitFlags::FL_NO_BLOCK)) {
#ifdef SDL_BUILD
#ifdef NEW_VIDEO_BUILD
auto frame_end = render_end;
#else
auto frame_end = std::chrono::steady_clock::now();
Expand Down
14 changes: 7 additions & 7 deletions common/wwmouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void WWMouseClass::Unblock_Mouse(GraphicBufferClass* buffer)

void WWMouseClass::Process_Mouse(void)
{
#if !defined(REMASTER_BUILD) && !defined(SDL_BUILD)
#if !defined(REMASTER_BUILD) && !defined(NEW_VIDEO_BUILD)
int x, y;

//
Expand Down Expand Up @@ -288,7 +288,7 @@ void* WWMouseClass::Set_Cursor(int xhotspot, int yhotspot, void* cursor)
void WWMouseClass::Low_Hide_Mouse()
{
// ST - 1/3/2019 10:50AM
#if !defined(REMASTER_BUILD) && !defined(SDL_BUILD)
#if !defined(REMASTER_BUILD) && !defined(NEW_VIDEO_BUILD)
if (!State) {
if (MouseBuffX != -1 || MouseBuffY != -1) {
if (Screen->Lock()) {
Expand Down Expand Up @@ -322,7 +322,7 @@ void WWMouseClass::Low_Show_Mouse(int x, int y)
State--;

// ST - 1/3/2019 10:50AM
#if !defined(REMASTER_BUILD) && !defined(SDL_BUILD)
#if !defined(REMASTER_BUILD) && !defined(NEW_VIDEO_BUILD)

//
// If the mouse is completely visible then draw it at its current
Expand Down Expand Up @@ -450,7 +450,7 @@ void WWMouseClass::Conditional_Show_Mouse(void)

void WWMouseClass::Draw_Mouse(GraphicViewPortClass* scr)
{
#if defined(REMASTER_BUILD) || defined(SDL_BUILD)
#if defined(REMASTER_BUILD) || defined(NEW_VIDEO_BUILD)
scr;
return;
// ST - 1/3/2019 10:50AM
Expand Down Expand Up @@ -511,7 +511,7 @@ void WWMouseClass::Draw_Mouse(GraphicViewPortClass* scr)

void WWMouseClass::Erase_Mouse(GraphicViewPortClass* scr, int forced)
{
#if defined(REMASTER_BUILD) || defined(SDL_BUILD)
#if defined(REMASTER_BUILD) || defined(NEW_VIDEO_BUILD)
// ST - 1/3/2019 10:50AM
scr;
forced;
Expand Down Expand Up @@ -618,7 +618,7 @@ int WWMouseClass::Get_Mouse_Y(void)
*=============================================================================================*/
void WWMouseClass::Get_Mouse_XY(int& x, int& y)
{
#if defined(SDL_BUILD)
#ifdef NEW_VIDEO_BUILD
Get_Video_Mouse(x, y);
#elif defined(_WIN32)
POINT pt;
Expand Down Expand Up @@ -854,7 +854,7 @@ void* WWMouseClass::Set_Mouse_Cursor(int hotspotx, int hotspoty, Cursor* cursor)
result = PrevCursor;
PrevCursor = cursor;

#ifdef SDL_BUILD
#ifdef NEW_VIDEO_BUILD
Set_Video_Cursor(MouseCursor, CursorWidth, CursorHeight, MouseXHot, MouseYHot);
#endif

Expand Down
2 changes: 1 addition & 1 deletion redalert/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ int AllDone;
** This is true if the game is the currently in focus windows app
**
*/
#ifdef SDL_BUILD
#ifdef NEW_VIDEO_BUILD
bool GameInFocus = true;
#else
bool GameInFocus = false;
Expand Down
2 changes: 1 addition & 1 deletion redalert/startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ int main(int argc, char* argv[])
HiddenPage.Clear();
Memory_Error_Exit = Print_Error_Exit;

#ifdef SDL_BUILD
#ifdef NEW_VIDEO_BUILD
Reset_Video_Mode();
#endif

Expand Down
2 changes: 1 addition & 1 deletion tiberiandawn/startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ int main(int argc, char** argv)

CCDebugString("C&C95 - About to exit.\n");

#if defined(SDL_BUILD)
#ifdef NEW_VIDEO_BUILD
Reset_Video_Mode();
#endif

Expand Down
Loading