diff --git a/src/kits/game/DirectWindow.cpp b/src/kits/game/DirectWindow.cpp index 4e7a279d2a..cf1c99d014 100644 --- a/src/kits/game/DirectWindow.cpp +++ b/src/kits/game/DirectWindow.cpp @@ -7,6 +7,10 @@ * Distributed under the terms of the MIT License. */ +#ifdef COMPILE_FOR_R5 +#include "/boot/develop/headers/be/interface/Window.h" +#endif + #include #include @@ -15,6 +19,12 @@ #include #endif +// Compiling for DANO/Zeta is broken as it doesn't have BRegion::set_size() +#ifdef COMPILE_FOR_DANO + #warning "##### Bilding BDirectWindow for TARGET_PLATFORM=dano (DANO/Zeta) is broken #####" +#endif + + // TODO: We'll want to move this to a private header, // accessible by the app server. struct dw_sync_data @@ -253,7 +263,8 @@ BDirectWindow::GetClippingRegion(BRegion *region, BPoint *origin) const originX = (int32)origin->x; originY = (int32)origin->y; } - + +#ifndef COMPILE_FOR_DANO // Since we are friend of BRegion, we can access its private members. // Otherwise, we would need to call BRegion::Include(clipping_rect) // for every clipping_rect in our clip_list, and that would be much @@ -270,6 +281,8 @@ BDirectWindow::GetClippingRegion(BRegion *region, BPoint *origin) const offset_rect(region->data[c], -originX, -originY); } +#endif + UnlockDirect(); return B_OK; diff --git a/src/kits/game/Jamfile b/src/kits/game/Jamfile index 8318ca494e..9d85826688 100644 --- a/src/kits/game/Jamfile +++ b/src/kits/game/Jamfile @@ -4,12 +4,11 @@ UsePrivateHeaders interface ; UsePrivateHeaders input ; if ! $(HAIKU_COMPATIBLE) { - SubDirC++Flags -DCOMPILE_FOR_R5 ; - - # Hack to have DirectWindow.cpp and WindowScreen.cpp - # include the R5 header. - PrependObjectHdrs DirectWindow.cpp : /boot/develop/headers/be/interface ; - PrependObjectHdrs WindowScreen.cpp : /boot/develop/headers/be/interface ; + if $(DANO_COMPATIBLE) { + SubDirC++Flags -DCOMPILE_FOR_DANO ; + } else { + SubDirC++Flags -DCOMPILE_FOR_R5 ; + } } @@ -31,9 +30,16 @@ SharedLibrary game : ; -LinkSharedOSLibs libgame.so : - be libmedia.so -; +if $(HAIKU_COMPATIBLE) { + LinkSharedOSLibs libgame.so : + libbe.so libmedia.so + ; +} else { + LinkSharedOSLibs libgame.so : + be libmedia.so + ; +} + MakeLocate libgame.so : $(OBOS_STLIB_DIR) ; RelSymLink libgame.so : libgame.so ; diff --git a/src/kits/game/WindowScreen.cpp b/src/kits/game/WindowScreen.cpp index 67efdf11f2..9cc5b49b17 100644 --- a/src/kits/game/WindowScreen.cpp +++ b/src/kits/game/WindowScreen.cpp @@ -7,6 +7,10 @@ * Distributed under the terms of the MIT License. */ +#ifdef COMPILE_FOR_R5 +#include "/boot/develop/headers/be/interface/Window.h" +#endif + #include #include #include