New Church is now a new building type, placement editor can now render 32bit images.

This commit is contained in:
Justin Marshall
2020-06-17 13:36:18 -07:00
parent d098540971
commit 07f6df5f5b
5 changed files with 62 additions and 8 deletions
+1 -1
View File
@@ -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})
+24 -7
View File
@@ -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));
}
}
+34
View File
@@ -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.
);
+3
View File
@@ -1472,6 +1472,9 @@ typedef enum StructType : char {
STRUCT_LARVA2,
#endif
#ifdef RA_AF
STRUCT_AFV01,
#endif
STRUCT_COUNT,
STRUCT_FIRST=0
} StructType;

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB