mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-15 18:56:41 -04:00
compile and run in windows (improvements needed)
This commit is contained in:
parent
f55f92a88b
commit
f70b29abab
83 changed files with 415 additions and 3747 deletions
|
@ -21,9 +21,9 @@ char game_display_init(const INI_CONFIG_SECTION *display_section, const char *ti
|
|||
}
|
||||
cfg.fullscreen = ini_get_boolean(display_section, "fullscreen", 1) == 1;
|
||||
const char *comp = ini_get_string(display_section, "composer", "auto");
|
||||
if (stricmp(comp, "hardware") == 0 || stricmp(comp, "hw") == 0) {
|
||||
if (istrcmp(comp, "hardware") == 0 || istrcmp(comp, "hw") == 0) {
|
||||
cfg.composer = SDL_RENDERER_ACCELERATED;
|
||||
} else if (stricmp(comp, "software") == 0 || stricmp(comp, "sw") == 0) {
|
||||
} else if (istrcmp(comp, "software") == 0 || istrcmp(comp, "sw") == 0) {
|
||||
cfg.composer = SDL_RENDERER_SOFTWARE;
|
||||
} else {
|
||||
cfg.composer = 0;
|
||||
|
@ -33,11 +33,11 @@ char game_display_init(const INI_CONFIG_SECTION *display_section, const char *ti
|
|||
cfg.window_width = ini_get_int(display_section, "window_width", 640);
|
||||
|
||||
const char *filter = ini_get_string(display_section, "crt_filter", "auto");
|
||||
if (stricmp(filter,"none") == 0) cfg.crt_filter = SDLContext::CrtFilterType::none;
|
||||
else if (stricmp(filter,"scanlines") == 0) cfg.crt_filter = SDLContext::CrtFilterType::scanlines;
|
||||
else if (stricmp(filter,"scanlines_2") == 0) cfg.crt_filter = SDLContext::CrtFilterType::scanlines_2;
|
||||
else if (stricmp(filter,"rgbmatrix_2") == 0) cfg.crt_filter = SDLContext::CrtFilterType::rgb_matrix_2;
|
||||
else if (stricmp(filter,"rgbmatrix_3") == 0) cfg.crt_filter = SDLContext::CrtFilterType::rgb_matrix_3;
|
||||
if (istrcmp(filter,"none") == 0) cfg.crt_filter = SDLContext::CrtFilterType::none;
|
||||
else if (istrcmp(filter,"scanlines") == 0) cfg.crt_filter = SDLContext::CrtFilterType::scanlines;
|
||||
else if (istrcmp(filter,"scanlines_2") == 0) cfg.crt_filter = SDLContext::CrtFilterType::scanlines_2;
|
||||
else if (istrcmp(filter,"rgbmatrix_2") == 0) cfg.crt_filter = SDLContext::CrtFilterType::rgb_matrix_2;
|
||||
else if (istrcmp(filter,"rgbmatrix_3") == 0) cfg.crt_filter = SDLContext::CrtFilterType::rgb_matrix_3;
|
||||
else cfg.crt_filter = SDLContext::CrtFilterType::autoselect;
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
add_subdirectory(tests)
|
||||
#add_subdirectory(tests)
|
||||
|
||||
add_library(skeldal_sdl
|
||||
sdl_context.cpp
|
||||
|
|
|
@ -184,7 +184,7 @@ void SDLContext::init_video(const VideoConfig &config, const char *title) {
|
|||
SDL_RendererInfo rinfo;
|
||||
SDL_GetRendererInfo(renderer, &rinfo);
|
||||
|
||||
if (stricmp(config.scale_quality, "auto") == 0) {
|
||||
if (istrcmp(config.scale_quality, "auto") == 0) {
|
||||
if (rinfo.flags & SDL_RENDERER_ACCELERATED) {
|
||||
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "best");
|
||||
}
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL.h>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <vector>
|
||||
#include <libs/mouse.h>
|
||||
#include <functional>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
#include <array>
|
||||
#include <thread>
|
||||
|
||||
#define countof(array) (sizeof(array)/sizeof(array[0]))
|
||||
|
@ -96,7 +96,7 @@ void set_channel_volume(int channel,int left,int right) {
|
|||
vp.left = l;
|
||||
vp.right = r;
|
||||
sound_mixer.visit_track(channel, [&](WaveMixer<2> &mx){
|
||||
mx.set_channel_volumes_fade(make_channel_volume(vp.left, vp.right), {2e-4,2e-4});
|
||||
mx.set_channel_volumes_fade(make_channel_volume(vp.left, vp.right), {2e-4f,2e-4f});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue