3 Commits

Author SHA1 Message Date
Justin Marshall 137f7aa393 Removed placed civi buildings from first soviet mission, need to be replaced. 2020-08-06 16:27:07 -07:00
Justin Marshall e49fa612f7 Placement cells are now based on the width/height of the icon and are now more flush with the assets. 2020-08-06 16:24:01 -07:00
jmarshall23 4be627100d Merge pull request #30 from jmarshall23/master
August Patch Integration
2020-08-06 15:45:32 -07:00
6 changed files with 57 additions and 100 deletions
+20 -60
View File
@@ -474,66 +474,26 @@ HomeCell=2742
37=USSR,E6,256,2231,1,Guard,0,None
[STRUCTURES]
0=Neutral,ABAN01,256,6818,0,None,1,0
1=Neutral,ABAN01,256,6306,0,None,1,0
2=Neutral,ABAN01,256,7842,0,None,1,0
3=Neutral,ABAN01,256,8226,0,None,1,0
4=Neutral,ABAN01,256,8234,0,None,1,0
5=Neutral,ABAN01,256,7722,0,None,1,0
6=Neutral,ABAN02,256,7719,0,None,1,0
7=Neutral,ABAN02,256,8231,0,None,1,0
8=Neutral,ABAN03,256,7074,0,None,1,0
9=Neutral,ABAN03,256,7078,0,None,1,0
10=Neutral,ABAN03,256,7081,0,None,1,0
11=Neutral,ABAN01,256,6826,0,None,1,0
12=Neutral,ABAN01,256,6186,0,None,1,0
13=Neutral,ABAN01,256,5674,0,None,1,0
14=Neutral,ABAN02,256,7090,0,None,1,0
15=Neutral,ABAN02,256,7093,0,None,1,0
16=Neutral,ABAN03,256,7730,0,None,1,0
17=Neutral,ABAN03,256,7733,0,None,1,0
18=Neutral,ABAN03,256,8242,0,None,1,0
19=Neutral,ABAN03,256,8245,0,None,1,0
20=Neutral,ABAN02,256,8248,0,None,1,0
21=Neutral,ABAN01,256,7993,0,None,1,0
22=Neutral,ABAN01,256,6969,0,None,1,0
23=Neutral,ABAN01,256,6457,0,None,1,0
24=Neutral,ABAN01,256,5945,0,None,1,0
25=Neutral,ABAN03,256,6706,0,None,1,0
26=Neutral,ABAN03,256,6193,0,None,1,0
27=Neutral,ABAN03,256,5810,0,None,1,0
28=Neutral,ABAN03,256,5813,0,None,1,0
29=Neutral,ABAN02,256,5169,0,None,1,0
30=Neutral,ABAN02,256,5172,0,None,1,0
31=Neutral,ABAN02,256,5175,0,None,1,0
32=Neutral,ABAN02,256,5178,0,None,1,0
33=Greece,DOME,256,6538,0,None,0,0
34=Greece,HOSP,256,6154,0,None,0,0
35=Greece,APWR,256,6160,0,None,0,0
36=Greece,PROC,256,6800,0,None,0,0
37=Greece,APWR,256,6548,0,None,0,0
38=Greece,APWR,256,6036,0,None,0,0
39=Greece,TENT,256,7571,0,None,0,0
40=Greece,PBOX,256,7704,0,None,0,0
41=Greece,PBOX,256,7192,0,None,0,0
42=Greece,GUN,256,7321,0,None,0,0
43=Greece,GUN,256,7705,0,None,0,0
44=Neutral,ABAN01,256,5924,0,None,1,0
45=Neutral,ABAN01,256,4906,0,None,1,0
46=Neutral,ABAN01,256,4522,0,None,1,0
47=Neutral,ABAN02,256,4017,0,None,1,0
48=Neutral,ABAN02,256,4020,0,None,1,0
49=Neutral,ABAN02,256,4023,0,None,1,0
50=Neutral,ABAN02,256,4026,0,None,1,0
51=USSR,DOME,256,2359,0,None,0,0
52=USSR,POWR,256,2612,0,None,0,0
53=USSR,POWR,256,2747,0,None,0,0
54=USSR,POWR,256,2105,0,None,0,0
55=Greece,PBOX,256,3891,0,None,0,0
56=Greece,PBOX,256,3900,0,None,0,0
57=Greece,PBOX,256,3906,0,None,0,0
58=Greece,PBOX,256,3886,0,None,0,0
59=Greece,APWR,256,6925,0,None,0,0
0=Greece,DOME,256,6538,0,None,0,0
1=Greece,HOSP,256,6154,0,None,0,0
2=Greece,APWR,256,6160,0,None,0,0
3=Greece,PROC,256,6800,0,None,0,0
4=Greece,APWR,256,6548,0,None,0,0
5=Greece,APWR,256,6036,0,None,0,0
6=Greece,TENT,256,7571,0,None,0,0
7=Greece,PBOX,256,7704,0,None,0,0
8=Greece,PBOX,256,7192,0,None,0,0
9=Greece,GUN,256,7321,0,None,0,0
10=Greece,GUN,256,7705,0,None,0,0
11=USSR,DOME,256,2359,0,None,0,0
12=USSR,POWR,256,2612,0,None,0,0
13=USSR,POWR,256,2747,0,None,0,0
14=USSR,POWR,256,2105,0,None,0,0
15=Greece,PBOX,256,3891,0,None,0,0
16=Greece,PBOX,256,3900,0,None,0,0
17=Greece,PBOX,256,3906,0,None,0,0
18=Greece,PBOX,256,3886,0,None,0,0
19=Greece,APWR,256,6925,0,None,0,0
[Base]
Player=USSR
+30 -38
View File
@@ -3283,7 +3283,7 @@ void BuildingTypeClass::One_Time(void)
for (int sindex = STRUCT_FIRST; sindex < STRUCT_COUNT; sindex++) {
char fullname[_MAX_FNAME+_MAX_EXT];
char buffer[_MAX_FNAME];
BuildingTypeClass const & building = As_Reference((StructType)sindex);
BuildingTypeClass & building = As_Reference((StructType)sindex);
/*
** Fetch the sidebar cameo image for this building.
*/
@@ -3351,6 +3351,32 @@ void BuildingTypeClass::One_Time(void)
// building.HDImageData->renderheight[d] = height;
// }
//}
{
short* ptr = &building._occupy[0];
int height = building.Height();
int width = building.Width();
//for (int y = 0; y < height; y++) {
// for (int x = 0; x < width; x++) {
// *ptr++ = y + (x * (MAP_CELL_W - 1));
// }
//}
*ptr++ = MAP_CELL_W;
for (int y = 0; y < width; y++) {
*ptr++ = (MAP_CELL_W) + (y + 1) * (MAP_CELL_W + 1);
}
for (int x = 0; x < height / 2; x++) {
*ptr++ = (MAP_CELL_W)+ (x + 1) * (MAP_CELL_W);
}
for (int x = 0; x < height / 2; x++) {
*ptr++ = (MAP_CELL_W)+ (x + 1);
}
*ptr = REFRESH_EOL;
}
}
int specialNumHDImages = 0;
@@ -3728,41 +3754,7 @@ BuildingTypeClass & BuildingTypeClass::As_Reference(StructType type)
*=============================================================================================*/
short const * BuildingTypeClass::Occupy_List(bool placement) const
{
SmudgeType bib = SMUDGE_NONE;
CELL cell=0;
if (placement && Bib_And_Offset(bib, cell)) {
SmudgeTypeClass const & smudge = SmudgeTypeClass::As_Reference(bib);
static short _list[25];
short * dest = &_list[0];
/*
** Copy the bib overlap list into the working buffer.
*/
short const * src = smudge.Occupy_List();
while (*src != REFRESH_EOL) {
*dest++ = (*src++) + cell;
}
/*
** Append the building occupy list to this working buffer.
*/
src = OccupyList;
while (src && *src != REFRESH_EOL) {
*dest++ = *src++;
}
*dest = REFRESH_EOL;
return(&_list[0]);
}
if (OccupyList != NULL) {
return(OccupyList);
}
static short const _templap[] = {REFRESH_EOL};
return(&_templap[0]);
return &_occupy[0];
}
@@ -3810,7 +3802,7 @@ short const * BuildingTypeClass::Overlap_List(void) const
*=============================================================================================*/
int BuildingTypeClass::Width(void) const
{
return (Get_Build_Frame_Width(Get_Image_Data(), 0) / ICON_PIXEL_W) + 1;
return (ceil((float)Get_Build_Frame_Width(Get_Image_Data(), 0) / (float)ICON_PIXEL_W));
}
@@ -3830,7 +3822,7 @@ int BuildingTypeClass::Width(void) const
*=============================================================================================*/
int BuildingTypeClass::Height(bool bib) const
{
return (Get_Build_Frame_Height(Get_Image_Data(), 0) / ICON_PIXEL_H) + 1;
return (ceil((float)Get_Build_Frame_Height(Get_Image_Data(), 0) / (float)ICON_PIXEL_H));
}
+1 -1
View File
@@ -296,7 +296,7 @@ RadioMessageType BuildingClass::Receive_Message(RadioClass * from, RadioMessageT
break;
case STRUCT_REFINERY:
param = ::As_Target(Coord_Cell(Adjacent_Cell(Center_Coord(), DIR_S)));
param = ::As_Target(Coord_Cell(Center_Coord() + (MAP_CELL_W /*+ 1)*/))); // jmarshall: changed from Adjacent_Cell(Center_Coord(), DIR_S))
break;
}
+1 -1
View File
@@ -1358,7 +1358,7 @@ void CellClass::Draw_It(int x, int y, bool objects)
// ConvertCoordsToIsometric(isox, isoy);
// char tmp[12];
// sprintf(tmp, "%d", cell);
// GL_DrawText(6, isox, isoy, tmp);
// GL_DrawForegroundText(6, isox, isoy, tmp);
//}
BEnd(BENCH_CELL);
+2
View File
@@ -222,6 +222,8 @@ void MissionClass::AI(void)
return;
}
/*
** This is the script AI equivalent processing.
*/
+3
View File
@@ -855,6 +855,9 @@ class BuildingTypeClass : public TechnoTypeClass {
*/
void const * BuildupData;
// Occupy list.
short _occupy[25 * 25];
void Init_Anim(BStateType state, int start, int count, int rate) const;
static Image_t* LoadHDImage(const char* fullname, int &numHDShapes, bool remapHouse);
};