diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index a8fa477..4bfc44d 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -709,7 +709,7 @@ set(src_external ) -add_definitions(-DCHEAT_KEYS -DIMGUI_IMPL_OPENGL_LOADER_GLEW -DSCENARIO_EDITOR -DWINDOWS_IGNORE_PACKING_MISMATCH -DTRUE_FALSE_DEFINED -DWIN32 -DWINDOWS -DENGLISH -D_USRDLL -DREDALERT_EXPORTS) +add_definitions(-D RA_AF -DCHEAT_KEYS -DIMGUI_IMPL_OPENGL_LOADER_GLEW -DSCENARIO_EDITOR -DWINDOWS_IGNORE_PACKING_MISMATCH -DTRUE_FALSE_DEFINED -DWIN32 -DWINDOWS -DENGLISH -D_USRDLL -DREDALERT_EXPORTS) add_compile_options(/permissive+ /Zc:forScope- /Zp1) add_executable(RedAlert ${src_win32lib} ${src_redalert} ${src_external}) diff --git a/code/REDALERT/BDATA.CPP b/code/REDALERT/BDATA.CPP index 9edc7f4..2aa0319 100644 --- a/code/REDALERT/BDATA.CPP +++ b/code/REDALERT/BDATA.CPP @@ -142,6 +142,9 @@ static short const OComList[] = {1, REFRESH_EOL}; static short const OList12[] = {0, REFRESH_EOL}; static short const OListTmpl[] = {0, 1, 2, REFRESH_EOL}; +#ifdef RA_AF +#include "BDATA_AF.H" +#endif /*************************************************************************** */ @@ -3026,6 +3029,9 @@ void BuildingTypeClass::Init_Heap(void) new BuildingTypeClass(ClassLarva2); // STRUCT_LARVA2 #endif +#ifdef RA_AF + new BuildingTypeClass(ClassAFV01); // STRUCT_AFV01 +#endif } @@ -3206,13 +3212,24 @@ StructType BuildingTypeClass::From_Name(char const * name) *=============================================================================================*/ void BuildingTypeClass::Display(int x, int y, WindowNumberType window, HousesType ) const { - void const * ptr = Get_Cameo_Data(); - if (ptr == NULL) { - IsTheaterShape = IsTheater; - ptr = Get_Image_Data(); +// jmarshall - hd buildings. + Image_t* hdimage = Get_HDImage_Data(); + if (hdimage != NULL) { + //CC_Draw_Shape((Image_t *)Get_HDImage_Data(), 0, x, y, window, SHAPE_CENTER | SHAPE_WIN_REL, NULL, NULL, DIR_N); + x += WindowList[window][WINDOWX]; + y += WindowList[window][WINDOWY]; + GL_RenderImage(hdimage, x, y, hdimage->width, hdimage->height); } - CC_Draw_Shape(ptr, 0, x, y, window, SHAPE_CENTER|SHAPE_WIN_REL); - IsTheaterShape = false; + else { + void const* ptr = Get_Cameo_Data(); + if (ptr == NULL) { + IsTheaterShape = IsTheater; + ptr = Get_Image_Data(); + } + CC_Draw_Shape(ptr, 0, x, y, window, SHAPE_CENTER | SHAPE_WIN_REL); + IsTheaterShape = false; + } +// jmarshall end } @@ -3235,7 +3252,7 @@ void BuildingTypeClass::Display(int x, int y, WindowNumberType window, HousesTyp void BuildingTypeClass::Prep_For_Add(void) { for (StructType index = STRUCT_FIRST; index < STRUCT_COUNT; index++) { - if (As_Reference(index).Get_Image_Data()) { + if (As_Reference(index).Get_Image_Data() || As_Reference(index).Get_HDImage_Data()) { Map.Add_To_List(&As_Reference(index)); } } diff --git a/code/REDALERT/BDATA_AF.H b/code/REDALERT/BDATA_AF.H new file mode 100644 index 0000000..e99510e --- /dev/null +++ b/code/REDALERT/BDATA_AF.H @@ -0,0 +1,34 @@ +// BDAD_AF.H +// + +// Building Data for Red Alert Allied Force. + +static BuildingTypeClass const ClassAFV01( + STRUCT_AFV01, + TXT_CIV1, // NAME: Short name of the structure. + "afV01", // NAME: Short name of the structure. + FACING_S, // Foundation direction from center of building. + XYP_COORD(0, 0), // Exit point for produced units. + REMAP_ALTERNATE, // Sidebar remap logic. + 0x0000, // Vertical offset. + 0x0000, // Primary weapon offset along turret centerline. + 0x0000, // Primary weapon lateral offset along turret centerline. + false, // Is this building a fake (decoy?) + true, // Animation rate is regulated for constant speed? + true, // Always use the given name for the building? + false, // Is this a wall type structure? + true, // Simple (one frame) damage imagery? + true, // Is it invisible to radar? + true, // Can the player select this? + true, // Is this a legal target for attack or move? + true, // Is this an insignificant building? + true, // Theater specific graphic image? + false, // Does it have a rotating turret? + false, // Can the building be color remapped to indicate owner? + RTTI_NONE, // The object type produced at this factory. + DIR_N, // Starting idle frame to match construction. + BSIZE_22, // SIZE: Building size. + NULL, // Preferred exit cell list. + (short const*)List0011, // OCCUPYLIST: List of active foundation squares. + (short const*)List1100 // OVERLAPLIST:List of overlap cell offset. +); \ No newline at end of file diff --git a/code/REDALERT/DEFINES.H b/code/REDALERT/DEFINES.H index d70a67e..cb64fe5 100644 --- a/code/REDALERT/DEFINES.H +++ b/code/REDALERT/DEFINES.H @@ -1472,6 +1472,9 @@ typedef enum StructType : char { STRUCT_LARVA2, #endif +#ifdef RA_AF + STRUCT_AFV01, +#endif STRUCT_COUNT, STRUCT_FIRST=0 } StructType; diff --git a/examples/textures/v01.sno.png b/textures/afv01.sno.png similarity index 100% rename from examples/textures/v01.sno.png rename to textures/afv01.sno.png