Skip to content

Commit

Permalink
[RA] 320x200: Fix Radar position
Browse files Browse the repository at this point in the history
  • Loading branch information
giulianobelinassi committed Jan 11, 2022
1 parent 0ad3ad9 commit 884428f
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 47 deletions.
2 changes: 1 addition & 1 deletion common/ww_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ typedef enum
WINDOWPADDING = 0x1000
} WindowIndexType;

extern int WindowList[][9];
extern int WindowList[9][9];
extern int WindowColumns;
extern int WindowLines;
extern int WindowWidth;
Expand Down
35 changes: 3 additions & 32 deletions redalert/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,36 +618,7 @@ int Seed = 0;
*/
int CustomSeed = 0;

int WindowList[][9] = {
/* xbyte, ypixel, bytewid, pixelht, cursor color, bkgd color, cursor x, cursor y */

/* do not change the first 2 entries!! they are necc. to the system */

{0, 0, 40 * 8 * RESFACTOR, 200 * RESFACTOR, WHITE, BLACK, 0, 0}, /* screen window */
{1 * 8, 75, 38 * 8, 100, WHITE, BLACK, 0, 0}, /* DOS Error window */

// Tactical map.
{0, 0, 40 * 8 * RESFACTOR, 200 * RESFACTOR, WHITE, LTGREY, 0, 0},

// Initial menu window.
{12 * 8, 199 - 42, 16 * 8, 42, LTGREY, DKGREY, 0, 0},

// Sidebar clipping window.
{0, 0, 0, 0, 0, 0, 0, 0},

// Scenario editor window.
{5 * 8, 30, 30 * 8, 140, 0, 0, 0, 0},

// Partial object draw sub-window.
{0, 0, 0, 0, WHITE, BLACK, 0, 0},

// Custom window.
{0, 0, 0, 0, 0, 0, 0, 0},

// Virtual window for external rendering. ST - 1/15/2019 3:02PM
{0, 0, 0, 0, 0, 0, 0, 0}

};
int WindowList[9][9];

/* X,Y,Item Width,Items High,Selected,Norm Color,Sel Color,zero */
int MenuList[][8] = {
Expand All @@ -656,8 +627,8 @@ int MenuList[][8] = {

GraphicBufferClass VisiblePage;
GraphicBufferClass HiddenPage;
GraphicViewPortClass SeenBuff(&VisiblePage, 0, 0, GBUFF_INIT_WIDTH, GBUFF_INIT_HEIGHT);
GraphicViewPortClass HidPage(&HiddenPage, 0, 0, GBUFF_INIT_WIDTH, GBUFF_INIT_HEIGHT);
GraphicViewPortClass SeenBuff;
GraphicViewPortClass HidPage;

int SoundOn;
CDTimerClass<SystemTimerClass> FrameTimer;
Expand Down
2 changes: 1 addition & 1 deletion redalert/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2350,7 +2350,7 @@ static void Init_Bootstrap_Mixfiles(void)
} else {
new MFCD("LORES1.MIX", &FastKey);
ok1 = MFCD::Cache("LORES1.MIX");
assert(ok1);
//assert(ok1);
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions redalert/radar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ void RadarClass::One_Time(void)
RadPHeight = 64 * RESFACTOR;
RadOffX = 6;
RadOffY = 7;
RadIWidth = 128 + 18; //************
RadIHeight = 128 + 2; //************
RadIWidth = (64 + 9) * RESFACTOR; //************
RadIHeight = (64 + 1) * RESFACTOR; //************

DisplayClass::One_Time();
#ifdef OBSOLETE
Expand Down
8 changes: 6 additions & 2 deletions redalert/sidebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ SidebarClass::SidebarClass(NoInitClass const& x)
*=============================================================================================*/
void SidebarClass::One_Time(void)
{
/* Set RESFACTOR positions. */
SidebarClass::Background.X = (int)((int)SIDE_X + 8) * RESFACTOR;
SidebarClass::Background.Y = (int)SIDE_Y * RESFACTOR;
SidebarClass::Background.Width = (int)((int)SIDE_WIDTH - 1) * RESFACTOR - 1;
SidebarClass::Background.Height = (int)((int)SIDE_HEIGHT - 1) * RESFACTOR;

PowerClass::One_Time();

/*
Expand Down Expand Up @@ -1927,8 +1933,6 @@ SidebarClass::StripClass::SelectClass::SelectClass(void)
, Strip(0)
, Index(0)
{
Width = (OBJECT_WIDTH - 1) * RESFACTOR;
Height = OBJECT_HEIGHT * RESFACTOR;
}

/***********************************************************************************************
Expand Down
6 changes: 1 addition & 5 deletions redalert/sidebar.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,7 @@ class SidebarClass : public PowerClass
{
public:
SBGadgetClass(void)
: GadgetClass((int)((int)SIDE_X + 8) * RESFACTOR,
(int)SIDE_Y * RESFACTOR,
(int)((int)SIDE_WIDTH - 1) * RESFACTOR - 1,
(int)((int)SIDE_HEIGHT - 1) * RESFACTOR,
LEFTUP){};
: GadgetClass(0, 0, 0, 0, LEFTUP){};

protected:
virtual int Action(unsigned flags, KeyNumType& key);
Expand Down
45 changes: 41 additions & 4 deletions redalert/startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,42 @@ extern unsigned int IsTheaterShape;
extern void Free_Heaps(void);
extern void DLL_Shutdown(void);

/* Set global variables that require RESFACTOR value. */
void Set_Resfactor_Globals(int resfactor)
{
int windowlist[9][9] = {/* xbyte, ypixel, bytewid, pixelht, cursor color, bkgd color, cursor x, cursor y */

/* do not change the first 2 entries!! they are necc. to the system */

{0, 0, 40 * 8 * resfactor, 200 * resfactor, WHITE, BLACK, 0, 0}, /* screen window */
{1 * 8, 75, 38 * 8, 100, WHITE, BLACK, 0, 0}, /* DOS Error window */

// Tactical map.
{0, 0, 40 * 8 * resfactor, 200 * resfactor, WHITE, LTGREY, 0, 0},

// Initial menu window.
{12 * 8, 199 - 42, 16 * 8, 42, LTGREY, DKGREY, 0, 0},

// Sidebar clipping window.
{0, 0, 0, 0, 0, 0, 0, 0},

// Scenario editor window.
{5 * 8, 30, 30 * 8, 140, 0, 0, 0, 0},

// Partial object draw sub-window.
{0, 0, 0, 0, WHITE, BLACK, 0, 0},

// Custom window.
{0, 0, 0, 0, 0, 0, 0, 0},

// Virtual window for external rendering. ST - 1/15/2019 3:02PM
{0, 0, 0, 0, 0, 0, 0, 0}

};

memcpy((void*)WindowList, (void*)windowlist, sizeof(windowlist));
}

#if defined REMASTER_BUILD && defined _WIN32
BOOL WINAPI DllMain(HINSTANCE instance, unsigned int fdwReason, void* lpvReserved)
{
Expand Down Expand Up @@ -304,6 +340,7 @@ int main(int argc, char* argv[])
ScreenHeight = 200;
}
#endif
Set_Resfactor_Globals(RESFACTOR);

#if defined(_WIN32) && !defined(SDL2_BUILD)
/* WinMain seems to pass command_show to Create_Main_Window, but since we
Expand Down Expand Up @@ -388,8 +425,8 @@ int main(int argc, char* argv[])
}
#endif

SeenBuff.Attach(&VisiblePage, 0, 0, GBUFF_INIT_WIDTH, GBUFF_INIT_HEIGHT);
HidPage.Attach(&HiddenPage, 0, 0, GBUFF_INIT_WIDTH, GBUFF_INIT_HEIGHT);
SeenBuff.Attach(&VisiblePage, 0, 0, ScreenWidth, ScreenHeight);
HidPage.Attach(&HiddenPage, 0, 0, ScreenWidth, ScreenHeight);

Options.Adjust_Variables_For_Resolution();

Expand Down Expand Up @@ -556,8 +593,8 @@ bool InitDDraw(void)
}
}

SeenBuff.Attach(&VisiblePage, 0, 0, GBUFF_INIT_WIDTH, GBUFF_INIT_HEIGHT);
HidPage.Attach(&HiddenPage, 0, 0, GBUFF_INIT_WIDTH, GBUFF_INIT_HEIGHT);
SeenBuff.Attach(&VisiblePage, 0, 0, ScreenWidth, ScreenHeight);
HidPage.Attach(&HiddenPage, 0, 0, ScreenWidth, ScreenHeight);
#endif
return true;
}
Expand Down

0 comments on commit 884428f

Please sign in to comment.