Skip to content

Commit 716f786

Browse files
committed
Format ultramodern
1 parent 9c95b2e commit 716f786

20 files changed

+461
-454
lines changed

ultramodern/include/ultramodern/config.hpp

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,71 @@
55
#include "common/rt64_user_configuration.h"
66

77
namespace ultramodern {
8-
enum class Resolution {
9-
Original,
10-
Original2x,
11-
Auto,
12-
OptionCount
13-
};
14-
enum class WindowMode {
15-
Windowed,
16-
Fullscreen,
17-
OptionCount
18-
};
19-
enum class HUDRatioMode {
20-
Original,
21-
Clamp16x9,
22-
Full,
23-
OptionCount
24-
};
25-
enum class GraphicsApi {
26-
Auto,
27-
D3D12,
28-
Vulkan,
29-
OptionCount
30-
};
8+
enum class Resolution {
9+
Original,
10+
Original2x,
11+
Auto,
12+
OptionCount
13+
};
14+
enum class WindowMode {
15+
Windowed,
16+
Fullscreen,
17+
OptionCount
18+
};
19+
enum class HUDRatioMode {
20+
Original,
21+
Clamp16x9,
22+
Full,
23+
OptionCount
24+
};
25+
enum class GraphicsApi {
26+
Auto,
27+
D3D12,
28+
Vulkan,
29+
OptionCount
30+
};
3131

32-
struct GraphicsConfig {
33-
Resolution res_option;
34-
WindowMode wm_option;
35-
HUDRatioMode hr_option;
36-
GraphicsApi api_option;
37-
// TODO make custom enums that map to the RT64 ones to remove the direct dependency on RT64 in this file.
38-
RT64::UserConfiguration::AspectRatio ar_option;
39-
RT64::UserConfiguration::Antialiasing msaa_option;
40-
RT64::UserConfiguration::RefreshRate rr_option;
41-
int rr_manual_value;
42-
int ds_option;
43-
bool developer_mode;
32+
struct GraphicsConfig {
33+
Resolution res_option;
34+
WindowMode wm_option;
35+
HUDRatioMode hr_option;
36+
GraphicsApi api_option;
37+
// TODO make custom enums that map to the RT64 ones to remove the direct dependency on RT64 in this file.
38+
RT64::UserConfiguration::AspectRatio ar_option;
39+
RT64::UserConfiguration::Antialiasing msaa_option;
40+
RT64::UserConfiguration::RefreshRate rr_option;
41+
int rr_manual_value;
42+
int ds_option;
43+
bool developer_mode;
4444

45-
auto operator<=>(const GraphicsConfig& rhs) const = default;
46-
};
45+
auto operator<=>(const GraphicsConfig& rhs) const = default;
46+
};
4747

48-
void set_graphics_config(const GraphicsConfig& config);
49-
GraphicsConfig get_graphics_config();
48+
void set_graphics_config(const GraphicsConfig& config);
49+
GraphicsConfig get_graphics_config();
5050

51-
NLOHMANN_JSON_SERIALIZE_ENUM(ultramodern::Resolution, {
52-
{ultramodern::Resolution::Original, "Original"},
53-
{ultramodern::Resolution::Original2x, "Original2x"},
54-
{ultramodern::Resolution::Auto, "Auto"},
55-
});
51+
NLOHMANN_JSON_SERIALIZE_ENUM(ultramodern::Resolution, {
52+
{ultramodern::Resolution::Original, "Original"},
53+
{ultramodern::Resolution::Original2x, "Original2x"},
54+
{ultramodern::Resolution::Auto, "Auto"},
55+
});
5656

57-
NLOHMANN_JSON_SERIALIZE_ENUM(ultramodern::WindowMode, {
58-
{ultramodern::WindowMode::Windowed, "Windowed"},
59-
{ultramodern::WindowMode::Fullscreen, "Fullscreen"}
60-
});
57+
NLOHMANN_JSON_SERIALIZE_ENUM(ultramodern::WindowMode, {
58+
{ultramodern::WindowMode::Windowed, "Windowed"},
59+
{ultramodern::WindowMode::Fullscreen, "Fullscreen"}
60+
});
6161

62-
NLOHMANN_JSON_SERIALIZE_ENUM(ultramodern::HUDRatioMode, {
63-
{ultramodern::HUDRatioMode::Original, "Original"},
64-
{ultramodern::HUDRatioMode::Clamp16x9, "Clamp16x9"},
65-
{ultramodern::HUDRatioMode::Full, "Full"},
66-
});
62+
NLOHMANN_JSON_SERIALIZE_ENUM(ultramodern::HUDRatioMode, {
63+
{ultramodern::HUDRatioMode::Original, "Original"},
64+
{ultramodern::HUDRatioMode::Clamp16x9, "Clamp16x9"},
65+
{ultramodern::HUDRatioMode::Full, "Full"},
66+
});
6767

68-
NLOHMANN_JSON_SERIALIZE_ENUM(ultramodern::GraphicsApi, {
69-
{ultramodern::GraphicsApi::Auto, "Auto"},
70-
{ultramodern::GraphicsApi::D3D12, "D3D12"},
71-
{ultramodern::GraphicsApi::Vulkan, "Vulkan"},
72-
});
68+
NLOHMANN_JSON_SERIALIZE_ENUM(ultramodern::GraphicsApi, {
69+
{ultramodern::GraphicsApi::Auto, "Auto"},
70+
{ultramodern::GraphicsApi::D3D12, "D3D12"},
71+
{ultramodern::GraphicsApi::Vulkan, "Vulkan"},
72+
});
7373
};
7474

7575
#endif

ultramodern/include/ultramodern/error_handling.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ namespace ultramodern {
1111
*
1212
* The `msg` parameter is always non-`nullptr`.
1313
*/
14-
message_box_t *message_box;
14+
message_box_t* message_box;
1515
};
1616

1717
void set_callbacks(const callbacks_t& callbacks);
1818

1919
void message_box(const char* msg);
20-
}
21-
}
20+
} // namespace error_handling
21+
} // namespace ultramodern
2222

2323
#endif

ultramodern/include/ultramodern/events.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace ultramodern {
1919
};
2020

2121
void set_callbacks(const callbacks_t& callbacks);
22-
}
23-
}
22+
} // namespace events
23+
} // namespace ultramodern
2424

2525
#endif

ultramodern/include/ultramodern/rsp.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace ultramodern {
2929

3030
void init();
3131
bool run_task(RDRAM_ARG const OSTask* task);
32-
};
32+
}; // namespace rsp
3333
} // namespace ultramodern
3434

3535
#endif

ultramodern/include/ultramodern/rt64_layer.h

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef __RT64_LAYER_H__
22
#define __RT64_LAYER_H__
33

4-
#include "ultramodern.hpp"
54
#include "config.hpp"
5+
#include "ultramodern.hpp"
66

77
namespace RT64 {
88
struct Application;
@@ -19,30 +19,34 @@ namespace ultramodern {
1919

2020
struct WindowHandle;
2121
struct RT64Context {
22-
public:
23-
~RT64Context();
24-
RT64Context(uint8_t* rdram, WindowHandle window_handle, bool developer_mode);
25-
bool valid() { return static_cast<bool>(app); }
26-
RT64SetupResult get_setup_result() { return setup_result; }
27-
28-
void update_config(const GraphicsConfig& old_config, const GraphicsConfig& new_config);
29-
void enable_instant_present();
30-
void send_dl(const OSTask* task);
31-
void update_screen(uint32_t vi_origin);
32-
void shutdown();
33-
void set_dummy_vi();
34-
uint32_t get_display_framerate();
35-
void load_shader_cache(std::span<const char> cache_binary);
36-
private:
37-
RT64SetupResult setup_result;
38-
std::unique_ptr<RT64::Application> app;
22+
public:
23+
~RT64Context();
24+
RT64Context(uint8_t* rdram, WindowHandle window_handle, bool developer_mode);
25+
bool valid() {
26+
return static_cast<bool>(app);
27+
}
28+
RT64SetupResult get_setup_result() {
29+
return setup_result;
30+
}
31+
32+
void update_config(const GraphicsConfig& old_config, const GraphicsConfig& new_config);
33+
void enable_instant_present();
34+
void send_dl(const OSTask* task);
35+
void update_screen(uint32_t vi_origin);
36+
void shutdown();
37+
void set_dummy_vi();
38+
uint32_t get_display_framerate();
39+
void load_shader_cache(std::span<const char> cache_binary);
40+
41+
private:
42+
RT64SetupResult setup_result;
43+
std::unique_ptr<RT64::Application> app;
3944
};
40-
45+
4146
RT64::UserConfiguration::Antialiasing RT64MaxMSAA();
4247
bool RT64SamplePositionsSupported();
43-
}
48+
} // namespace ultramodern
4449

4550
void set_rt64_hooks();
4651

4752
#endif
48-

0 commit comments

Comments
 (0)