Skip to content

Commit

Permalink
Switched display to 32-bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy_moonlight committed Sep 15, 2023
1 parent 9c9c5eb commit 8caf9ad
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions src/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void Control::InitGraphics(SDL_Surface *temp, SDL_Surface *tempcontrolscreen)
screen = temp;
controlscreen = tempcontrolscreen;

temp = SDL_CreateRGBSurface(SDL_SWSURFACE, 420, 490, 16,
temp = SDL_CreateRGBSurface(SDL_SWSURFACE, 420, 490, 32,
screen->format->Rmask,
screen->format->Gmask,
screen->format->Bmask,
Expand Down Expand Up @@ -957,7 +957,7 @@ void Control::DLine(SDL_Surface *screen, int X1, int Y1, int X2, int Y2, Uint32
void Control::DPixel(SDL_Surface *screen, int x, int y, Uint32 color)
{
// this only works for 16bpp screens
// this only works for 32bpp screens
// are we outside the screen?????
// If we are bail out now before it's too late!
Expand All @@ -967,8 +967,8 @@ void Control::DPixel(SDL_Surface *screen, int x, int y, Uint32 color)
}
// place the pixel on the screen
Uint16 *pixel_location;
pixel_location = (Uint16 *)screen->pixels + y*screen->pitch/2 + x;
Uint32 *pixel_location;
pixel_location = (Uint32 *)screen->pixels + y*screen->pitch/4 + x;
*pixel_location = color;
}
*/
6 changes: 3 additions & 3 deletions src/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

void DrawPixel(SDL_Surface *screen, int x, int y, Uint32 color)
{
// this only works for 16bpp screens
// this only works for 32bpp screens
// are we outside the screen?????
// If we are bail out now before it's too late!

Expand All @@ -17,8 +17,8 @@ void DrawPixel(SDL_Surface *screen, int x, int y, Uint32 color)
}

// place the pixel on the screen
Uint16 *pixel_location;
pixel_location = (Uint16 *)screen->pixels + y * screen->pitch / 2 + x;
Uint32 *pixel_location;
pixel_location = (Uint32 *)screen->pixels + y * screen->pitch / 4 + x;
*pixel_location = color;
}

Expand Down
8 changes: 4 additions & 4 deletions src/esm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void Esm::InitGraphics(SDL_Surface *temp, SDL_Surface *tempesmscreen)
screen = temp;
esmscreen = tempesmscreen;

temp = SDL_CreateRGBSurface(SDL_SWSURFACE, 420, 490, 16,
temp = SDL_CreateRGBSurface(SDL_SWSURFACE, 420, 490, 32,
screen->format->Rmask,
screen->format->Gmask,
screen->format->Bmask,
Expand Down Expand Up @@ -465,7 +465,7 @@ void Esm::DLine(SDL_Surface *screen, int X1, int Y1, int X2, int Y2, Uint32 Colo

void Esm::DPixel(SDL_Surface *screen, int x, int y, Uint32 color)
{
// this only works for 16bpp screens
// this only works for 32bpp screens
// are we outside the screen?????
// If we are bail out now before it's too late!

Expand All @@ -475,7 +475,7 @@ void Esm::DPixel(SDL_Surface *screen, int x, int y, Uint32 color)
}

// place the pixel on the screen
Uint16 *pixel_location;
pixel_location = (Uint16 *)screen->pixels + y * screen->pitch / 2 + x;
Uint32 *pixel_location;
pixel_location = (Uint32 *)screen->pixels + y * screen->pitch / 4 + x;
*pixel_location = color;
}
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ void SetupScreen(bool full_screen)

if (full_screen) {
// Create main screen surface
screen = SDL_SetVideoMode(1024, 768, 16, SDL_FULLSCREEN);
screen = SDL_SetVideoMode(1024, 768, 32, SDL_FULLSCREEN);
} else {
screen = SDL_SetVideoMode(1024, 768, 16, SDL_SWSURFACE);
screen = SDL_SetVideoMode(1024, 768, 32, SDL_SWSURFACE);
}

if (screen == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion src/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ msg::~msg()
void msg::InitGraphics()
{
screen = SDL_GetVideoSurface();
SDL_Surface *temp = SDL_CreateRGBSurface(SDL_SWSURFACE, 800, 72, 16,
SDL_Surface *temp = SDL_CreateRGBSurface(SDL_SWSURFACE, 800, 72, 32,
screen->format->Rmask,
screen->format->Gmask,
screen->format->Bmask,
Expand Down
8 changes: 4 additions & 4 deletions src/radar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void Radar::InitGraphics(SDL_Surface *temp, SDL_Surface *tempradarscreen)
screen = temp;
radarscreen = tempradarscreen;

temp = SDL_CreateRGBSurface(SDL_SWSURFACE, 420, 490, 16,
temp = SDL_CreateRGBSurface(SDL_SWSURFACE, 420, 490, 32,
screen->format->Rmask,
screen->format->Gmask,
screen->format->Bmask,
Expand Down Expand Up @@ -1158,7 +1158,7 @@ int Radar::ReciprocalBearing(int bearing)

void Radar::DrawPixel(SDL_Surface *screen, int x, int y, Uint32 color)
{
// this only works for 16bpp screens
// this only works for 32bpp screens
// are we outside the screen?????
// If we are bail out now before it's too late!

Expand All @@ -1167,8 +1167,8 @@ void Radar::DrawPixel(SDL_Surface *screen, int x, int y, Uint32 color)
}

// place the pixel on the screen
Uint16 *pixel_location;
pixel_location = (Uint16 *)screen->pixels + y * screen->pitch / 2 + x;
Uint32 *pixel_location;
pixel_location = (Uint32 *)screen->pixels + y * screen->pitch / 4 + x;
*pixel_location = color;
}

Expand Down
8 changes: 4 additions & 4 deletions src/sonar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ AnBqq5::~AnBqq5() {}
void AnBqq5::InitGraphics()
{
screen = SDL_GetVideoSurface();
SDL_Surface *temp = SDL_CreateRGBSurface(SDL_SWSURFACE, 368, 280, 16,
SDL_Surface *temp = SDL_CreateRGBSurface(SDL_SWSURFACE, 368, 280, 32,
screen->format->Rmask,
screen->format->Gmask,
screen->format->Bmask,
Expand Down Expand Up @@ -82,10 +82,10 @@ void AnBqq5::ClearSonarData() // when the display is switched from north center

inline void AnBqq5::DPixel(SDL_Surface *screen, int x, int y, Uint32 color)
{
// this only works for 16bpp screens
// this only works for 32bpp screens
// place the pixel on the screen
Uint16 *pixel_location;
pixel_location = (Uint16 *)screen->pixels + y * screen->pitch / 2 + x;
Uint32 *pixel_location;
pixel_location = (Uint32 *)screen->pixels + y * screen->pitch / 4 + x;
*pixel_location = color;
}

Expand Down
6 changes: 3 additions & 3 deletions src/targetmotionanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void TargetMotionAnalysis::UnLock()
void TargetMotionAnalysis::InitGraphics()
{
SDL_Surface *screen = SDL_GetVideoSurface();
SDL_Surface *temp = SDL_CreateRGBSurface(SDL_SWSURFACE, 500, 500, 16,
SDL_Surface *temp = SDL_CreateRGBSurface(SDL_SWSURFACE, 500, 500, 32,
screen->format->Rmask,
screen->format->Gmask,
screen->format->Bmask,
Expand All @@ -196,8 +196,8 @@ void TargetMotionAnalysis::PlotPixel(int x, int y, Uint32 color)
}

//place the pixel on the screen
Uint16 *pixel_location;
pixel_location = (Uint16 *)GeoPlotScreen->pixels + y * GeoPlotScreen->pitch / 2 + x;
Uint32 *pixel_location;
pixel_location = (Uint32 *)GeoPlotScreen->pixels + y * GeoPlotScreen->pitch / 4 + x;
*pixel_location = color;
}

Expand Down

0 comments on commit 8caf9ad

Please sign in to comment.