Code cleanup
This commit is contained in:
parent
3e764d06e0
commit
0a7ad2b28a
3 changed files with 37 additions and 35 deletions
|
@ -15,7 +15,7 @@
|
|||
#include "gensound.h"
|
||||
#include "audio.h"
|
||||
#include "sounddep/sound.h"
|
||||
#include "memory.h"
|
||||
#include "include/memory.h"
|
||||
#include "custom.h"
|
||||
#include "newcpu.h"
|
||||
#include "disk.h"
|
||||
|
@ -37,6 +37,7 @@
|
|||
#include "blkdev.h"
|
||||
#include "uaeresource.h"
|
||||
#include "gfxboard.h"
|
||||
|
||||
#ifdef JIT
|
||||
#include "jit/compemu.h"
|
||||
#endif
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "gui.h"
|
||||
#include "gui_handling.h"
|
||||
#include "memory.h"
|
||||
#include "autoconf.h"
|
||||
#include "pandora_gfx.h"
|
||||
|
||||
bool gui_running = false;
|
||||
|
@ -114,14 +113,14 @@ static int gui_create_rtarea_flag(struct uae_prefs *p)
|
|||
return flag;
|
||||
}
|
||||
|
||||
void gui_force_rtarea_hdchange(void)
|
||||
void gui_force_rtarea_hdchange()
|
||||
{
|
||||
gui_rtarea_flags_onenter |= 2;
|
||||
}
|
||||
|
||||
static void (*refreshFuncAfterDraw)(void) = NULL;
|
||||
static void (*refreshFuncAfterDraw)() = nullptr;
|
||||
|
||||
void RegisterRefreshFunc(void (*func)(void))
|
||||
void RegisterRefreshFunc(void (*func)())
|
||||
{
|
||||
refreshFuncAfterDraw = func;
|
||||
}
|
||||
|
@ -177,7 +176,7 @@ namespace sdl
|
|||
|
||||
SDL_FreeSurface(gui_screen);
|
||||
SDL_DestroyTexture(gui_texture);
|
||||
gui_screen = NULL;
|
||||
gui_screen = nullptr;
|
||||
}
|
||||
|
||||
void checkInput()
|
||||
|
@ -216,7 +215,7 @@ namespace sdl
|
|||
//-------------------------------------------------
|
||||
focusHdl = gui_top->_getFocusHandler();
|
||||
activeWidget = focusHdl->getFocused();
|
||||
if (dynamic_cast<gcn::TextField*>(activeWidget) == NULL)
|
||||
if (dynamic_cast<gcn::TextField*>(activeWidget) == nullptr)
|
||||
{
|
||||
// ...but only if we are not in a Textfield...
|
||||
uae_quit();
|
||||
|
@ -299,16 +298,16 @@ namespace sdl
|
|||
// Finally we update the screen.
|
||||
|
||||
// Update the texture from the surface
|
||||
SDL_UpdateTexture(gui_texture, NULL, gui_screen->pixels, gui_screen->pitch);
|
||||
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
|
||||
// Copy the texture on the renderer
|
||||
SDL_RenderCopy(renderer, gui_texture, NULL, NULL);
|
||||
SDL_RenderCopy(renderer, gui_texture, nullptr, nullptr);
|
||||
// Update the window surface (show the renderer)
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
if(refreshFuncAfterDraw != NULL)
|
||||
if(refreshFuncAfterDraw != nullptr)
|
||||
{
|
||||
void (*currFunc)(void) = refreshFuncAfterDraw;
|
||||
refreshFuncAfterDraw = NULL;
|
||||
refreshFuncAfterDraw = nullptr;
|
||||
currFunc();
|
||||
}
|
||||
}
|
||||
|
@ -396,7 +395,7 @@ namespace widgets
|
|||
void focusGained(const gcn::Event& event)
|
||||
{
|
||||
int i;
|
||||
for(i=0; categories[i].category != NULL; ++i)
|
||||
for(i=0; categories[i].category != nullptr; ++i)
|
||||
{
|
||||
if(event.getSource() == categories[i].selector)
|
||||
{
|
||||
|
@ -501,7 +500,7 @@ void gui_init()
|
|||
int panelStartX = DISTANCE_BORDER + selectors->getWidth() + 2 + 11;
|
||||
|
||||
panelFocusListener = new PanelFocusListener();
|
||||
for(i=0; categories[i].category != NULL; ++i)
|
||||
for(i=0; categories[i].category != nullptr; ++i)
|
||||
{
|
||||
categories[i].selector = new gcn::SelectorEntry(categories[i].category, categories[i].imagepath);
|
||||
categories[i].selector->setActiveColor(colSelectorActive);
|
||||
|
@ -520,9 +519,9 @@ void gui_init()
|
|||
//--------------------------------------------------
|
||||
// Initialize panels
|
||||
//--------------------------------------------------
|
||||
for(i=0; categories[i].category != NULL; ++i)
|
||||
for(i=0; categories[i].category != nullptr; ++i)
|
||||
{
|
||||
if(categories[i].InitFunc != NULL)
|
||||
if(categories[i].InitFunc != nullptr)
|
||||
(*categories[i].InitFunc) (categories[i]);
|
||||
}
|
||||
|
||||
|
@ -535,7 +534,7 @@ void gui_init()
|
|||
gui_top->add(cmdStart, GUI_WIDTH - DISTANCE_BORDER - BUTTON_WIDTH, GUI_HEIGHT - DISTANCE_BORDER - BUTTON_HEIGHT);
|
||||
|
||||
gui_top->add(selectors, DISTANCE_BORDER + 1, DISTANCE_BORDER + 1);
|
||||
for(i=0, yPos=0; categories[i].category != NULL; ++i, yPos += 24)
|
||||
for(i=0, yPos=0; categories[i].category != nullptr; ++i, yPos += 24)
|
||||
{
|
||||
selectors->add(categories[i].selector, 0, yPos);
|
||||
gui_top->add(categories[i].panel, panelStartX, DISTANCE_BORDER + 1);
|
||||
|
@ -552,13 +551,13 @@ void gui_halt()
|
|||
{
|
||||
int i;
|
||||
|
||||
for(i=0; categories[i].category != NULL; ++i)
|
||||
for(i=0; categories[i].category != nullptr; ++i)
|
||||
{
|
||||
if(categories[i].ExitFunc != NULL)
|
||||
if(categories[i].ExitFunc != nullptr)
|
||||
(*categories[i].ExitFunc) ();
|
||||
}
|
||||
|
||||
for(i=0; categories[i].category != NULL; ++i)
|
||||
for(i=0; categories[i].category != nullptr; ++i)
|
||||
delete categories[i].selector;
|
||||
delete panelFocusListener;
|
||||
delete selectors;
|
||||
|
@ -577,19 +576,19 @@ void gui_halt()
|
|||
}
|
||||
|
||||
|
||||
void RefreshAllPanels(void)
|
||||
void RefreshAllPanels()
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i=0; categories[i].category != NULL; ++i)
|
||||
for(i=0; categories[i].category != nullptr; ++i)
|
||||
{
|
||||
if(categories[i].RefreshFunc != NULL)
|
||||
if(categories[i].RefreshFunc != nullptr)
|
||||
(*categories[i].RefreshFunc) ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DisableResume(void)
|
||||
void DisableResume()
|
||||
{
|
||||
if(emulating)
|
||||
{
|
||||
|
@ -603,7 +602,7 @@ void DisableResume(void)
|
|||
}
|
||||
|
||||
|
||||
void run_gui(void)
|
||||
void run_gui()
|
||||
{
|
||||
gui_running = true;
|
||||
gui_rtarea_flags_onenter = gui_create_rtarea_flag(&currprefs);
|
||||
|
@ -619,19 +618,19 @@ void run_gui(void)
|
|||
// Catch all guisan exceptions.
|
||||
catch (gcn::Exception e)
|
||||
{
|
||||
std::cout << e.getMessage() << std::endl;
|
||||
cout << e.getMessage() << endl;
|
||||
uae_quit();
|
||||
}
|
||||
// Catch all Std exceptions.
|
||||
catch (std::exception e)
|
||||
catch (exception e)
|
||||
{
|
||||
std::cout << "Std exception: " << e.what() << std::endl;
|
||||
cout << "Std exception: " << e.what() << endl;
|
||||
uae_quit();
|
||||
}
|
||||
// Catch all unknown exceptions.
|
||||
catch (...)
|
||||
{
|
||||
std::cout << "Unknown exception" << std::endl;
|
||||
cout << "Unknown exception" << endl;
|
||||
uae_quit();
|
||||
}
|
||||
if(quit_program > UAE_QUIT || quit_program < -UAE_QUIT)
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "SDL.h"
|
||||
|
||||
/* SDL variable for output of emulation */
|
||||
SDL_Surface *screen = NULL;
|
||||
SDL_Surface *screen = nullptr;
|
||||
|
||||
/* Possible screen modes (x and y resolutions) */
|
||||
#define MAX_SCREEN_MODES 11
|
||||
|
@ -30,13 +30,13 @@ struct MultiDisplay Displays[MAX_DISPLAYS];
|
|||
|
||||
int screen_is_picasso = 0;
|
||||
|
||||
static SDL_Surface *current_screenshot = NULL;
|
||||
static SDL_Surface *current_screenshot = nullptr;
|
||||
static char screenshot_filename_default[255]=
|
||||
{
|
||||
'/', 't', 'm', 'p', '/', 'n', 'u', 'l', 'l', '.', 'p', 'n', 'g', '\0'
|
||||
};
|
||||
char *screenshot_filename=(char *)&screenshot_filename_default[0];
|
||||
FILE *screenshot_file=NULL;
|
||||
FILE *screenshot_file= nullptr;
|
||||
static void CreateScreenshot(void);
|
||||
static int save_thumb(char *path);
|
||||
int delay_savestate_frame = 0;
|
||||
|
@ -136,6 +136,7 @@ static void open_screen(struct uae_prefs *p)
|
|||
{
|
||||
width = picasso_vidinfo.width;
|
||||
height = picasso_vidinfo.height;
|
||||
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); // make the scaled rendering look smoother.
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -395,7 +396,7 @@ static int get_display_depth (void)
|
|||
int GetSurfacePixelFormat(void)
|
||||
{
|
||||
int depth = get_display_depth();
|
||||
int unit = (depth + 1) & 0xF8;
|
||||
int unit = depth + 1 & 0xF8;
|
||||
|
||||
return (unit == 8 ? RGBFB_CHUNKY
|
||||
: depth == 15 && unit == 16 ? RGBFB_R5G5B5
|
||||
|
@ -635,6 +636,7 @@ static int resolution_compare (const void *a, const void *b)
|
|||
return 1;
|
||||
return ma->depth - mb->depth;
|
||||
}
|
||||
|
||||
static void sortmodes (void)
|
||||
{
|
||||
int i = 0, idx = -1;
|
||||
|
@ -742,9 +744,9 @@ void gfx_set_picasso_state (int on)
|
|||
void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgbfmt)
|
||||
{
|
||||
depth >>= 3;
|
||||
if( ((unsigned)picasso_vidinfo.width == w ) &&
|
||||
( (unsigned)picasso_vidinfo.height == h ) &&
|
||||
( (unsigned)picasso_vidinfo.depth == depth ) &&
|
||||
if( (unsigned(picasso_vidinfo.width) == w ) &&
|
||||
( unsigned(picasso_vidinfo.height) == h ) &&
|
||||
( unsigned(picasso_vidinfo.depth) == depth ) &&
|
||||
( picasso_vidinfo.selected_rgbformat == rgbfmt) )
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue