aboutsummaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
Diffstat (limited to 'sources')
-rw-r--r--sources/TZR_DrawEnd.c8
-rw-r--r--sources/TZR_Init.c27
-rw-r--r--sources/TZR_LightBegin.c18
-rw-r--r--sources/TZR_LightEnd.c8
-rw-r--r--sources/TZR_Quit.c4
-rw-r--r--sources/globals.c1
6 files changed, 12 insertions, 54 deletions
diff --git a/sources/TZR_DrawEnd.c b/sources/TZR_DrawEnd.c
index bc3ce95..d40120a 100644
--- a/sources/TZR_DrawEnd.c
+++ b/sources/TZR_DrawEnd.c
@@ -36,14 +36,6 @@ TZR_DrawEnd(void)
if (SDL_RenderCopy(___tzr_renderer, ___tzr_target, NULL, &dest) < 0)
return sdl_error(-1);
- if (___tzr_config.light_system) {
- if (SDL_SetTextureBlendMode(___tzr_target_light,
- SDL_BLENDMODE_MOD) < 0)
- return sdl_error(-1);
- if (SDL_RenderCopy(___tzr_renderer, ___tzr_target_light, NULL,
- &dest) < 0)
- return sdl_error(-1);
- }
if (___tzr_config.target_fps > 0) {
___tzr_next_time += ___tzr_min_dt;
diff --git a/sources/TZR_Init.c b/sources/TZR_Init.c
index 25d0272..b6163c5 100644
--- a/sources/TZR_Init.c
+++ b/sources/TZR_Init.c
@@ -59,21 +59,18 @@ _TZR_Init(const TZR_Config *config)
if (___tzr_renderer == NULL)
return _sdl_error();
- ___tzr_target = SDL_CreateTexture(___tzr_renderer,
- SDL_PIXELFORMAT_RGB888,
- SDL_TEXTUREACCESS_TARGET,
- ___tzr_config.width,
- ___tzr_config.height);
- if (___tzr_target == NULL)
- return _sdl_error();
-
- if (___tzr_config.light_system) {
- ___tzr_target_light = SDL_CreateTexture(___tzr_renderer,
- SDL_PIXELFORMAT_RGB888,
- SDL_TEXTUREACCESS_TARGET,
- ___tzr_config.width,
- ___tzr_config.height);
- if (___tzr_target_light == NULL)
+ if (___tzr_config.hd_render) {
+ if (SDL_RenderSetLogicalSize(___tzr_renderer,
+ ___tzr_config.width,
+ ___tzr_config.height) < 0)
+ return _sdl_error();
+ } else {
+ ___tzr_target = SDL_CreateTexture(___tzr_renderer,
+ SDL_PIXELFORMAT_RGB888,
+ SDL_TEXTUREACCESS_TARGET,
+ ___tzr_config.width,
+ ___tzr_config.height);
+ if (___tzr_target == NULL)
return _sdl_error();
}
diff --git a/sources/TZR_LightBegin.c b/sources/TZR_LightBegin.c
deleted file mode 100644
index 421d4c9..0000000
--- a/sources/TZR_LightBegin.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "TZR_light.h"
-#include "TZR_globals.h"
-#include "sdl_error.h"
-#include <SDL2/SDL_render.h>
-
-int
-TZR_LightBegin(void)
-{
- if (!___tzr_config.light_system) {
- fprintf(stderr, "light system disabled\n");
- return -1;
- }
- if (SDL_SetRenderDrawBlendMode(___tzr_renderer, SDL_BLENDMODE_ADD) < 0)
- return sdl_error(-1);
- if (SDL_SetRenderTarget(___tzr_renderer, ___tzr_target_light) < 0)
- return sdl_error(-1);
- return 0;
-}
diff --git a/sources/TZR_LightEnd.c b/sources/TZR_LightEnd.c
deleted file mode 100644
index ae776b0..0000000
--- a/sources/TZR_LightEnd.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "TZR_light.h"
-#include "TZR_globals.h"
-
-int
-TZR_LightEnd(void)
-{
- return ___tzr_config.light_system ? 0 : -1;
-}
diff --git a/sources/TZR_Quit.c b/sources/TZR_Quit.c
index d316e2f..e11979e 100644
--- a/sources/TZR_Quit.c
+++ b/sources/TZR_Quit.c
@@ -14,10 +14,6 @@ TZR_Quit(void)
___tzr_resources = NULL;
___tzr_resources_size = 0;
___tzr_resources_capacity = 0;
- if (___tzr_target_light != NULL) {
- SDL_DestroyTexture(___tzr_target_light);
- ___tzr_target_light = NULL;
- }
if (___tzr_target != NULL) {
SDL_DestroyTexture(___tzr_target);
___tzr_target = NULL;
diff --git a/sources/globals.c b/sources/globals.c
index 02f9181..0833d28 100644
--- a/sources/globals.c
+++ b/sources/globals.c
@@ -11,7 +11,6 @@ size_t ___tzr_resources_size = 0;
SDL_Window *___tzr_window = NULL;
SDL_Renderer *___tzr_renderer = NULL;
SDL_Texture *___tzr_target = NULL;
-SDL_Texture *___tzr_target_light = NULL;
unsigned long ___tzr_tick = 0;
unsigned long ___tzr_next_time = 0;
unsigned long ___tzr_min_dt = 0;