mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-10-04 04:38:03 +03:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23667b3e39 |
+11
-15
@@ -35,7 +35,6 @@
|
|||||||
#include "ags.h"
|
#include "ags.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "sactcg.h"
|
#include "sactcg.h"
|
||||||
#include "ald_manager.h"
|
|
||||||
#include "cg.h"
|
#include "cg.h"
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
|
|
||||||
@@ -329,27 +328,24 @@ void scg_free(int no) {
|
|||||||
// CGの種類を取得
|
// CGの種類を取得
|
||||||
int scg_querytype(int wNumCG) {
|
int scg_querytype(int wNumCG) {
|
||||||
if (wNumCG >= (CGMAX -1)) return CG_NOTUSED;
|
if (wNumCG >= (CGMAX -1)) return CG_NOTUSED;
|
||||||
if (cg_store && cg_store[wNumCG])
|
if (!cg_store || !cg_store[wNumCG]) return CG_NOTUSED;
|
||||||
return cg_store[wNumCG]->type;
|
return cg_store[wNumCG]->type;
|
||||||
// Linked CGs are valid even before they are loaded into cg_store.
|
|
||||||
return ald_is_linked(DRIFILE_CG, wNumCG - 1) ? CG_LINKED : CG_NOTUSED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CGの大きさを取得
|
// CGの大きさを取得
|
||||||
bool scg_querysize(int wNumCG, vmvar_t *w, vmvar_t *h) {
|
bool scg_querysize(int wNumCG, vmvar_t *w, vmvar_t *h) {
|
||||||
*w = *h = 0;
|
if (wNumCG >= (CGMAX -1)) goto errexit;
|
||||||
|
if (!cg_store || !cg_store[wNumCG]) goto errexit;
|
||||||
|
if (cg_store[wNumCG]->sf == NULL) goto errexit;
|
||||||
|
|
||||||
if (wNumCG >= (CGMAX - 1))
|
*w = cg_store[wNumCG]->sf->w;
|
||||||
return false;
|
*h = cg_store[wNumCG]->sf->h;
|
||||||
cginfo_t *cg = cg_store ? cg_store[wNumCG] : NULL;
|
|
||||||
if (!cg && ald_is_linked(DRIFILE_CG, wNumCG - 1))
|
|
||||||
cg = scg_get(wNumCG);
|
|
||||||
if (!cg || !cg->sf)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
*w = cg->sf->w;
|
|
||||||
*h = cg->sf->h;
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
errexit:
|
||||||
|
*w = *h = 0;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CGのBPPを取得
|
// CGのBPPを取得
|
||||||
|
|||||||
@@ -191,6 +191,7 @@ static void eff_init(struct effect *eff, SDL_Rect *rect, EffectTexture *old, Eff
|
|||||||
|
|
||||||
if (!eff->is_fullscreen)
|
if (!eff->is_fullscreen)
|
||||||
gfx_updateScreen(); // Flush pending display changes.
|
gfx_updateScreen(); // Flush pending display changes.
|
||||||
|
gfx_setEffectRunning(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void eff_finish(struct effect *eff, bool present) {
|
static void eff_finish(struct effect *eff, bool present) {
|
||||||
@@ -1912,4 +1913,5 @@ void effect_step(struct effect *eff, float progress) {
|
|||||||
|
|
||||||
void effect_finish(struct effect *eff) {
|
void effect_finish(struct effect *eff) {
|
||||||
eff->finish(eff);
|
eff->finish(eff);
|
||||||
|
gfx_setEffectRunning(false);
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-1
@@ -45,6 +45,7 @@
|
|||||||
#include "debugger.h"
|
#include "debugger.h"
|
||||||
|
|
||||||
static bool gfx_dirty;
|
static bool gfx_dirty;
|
||||||
|
static bool gfx_effect_running;
|
||||||
|
|
||||||
static void gfx_pal_check(void) {
|
static void gfx_pal_check(void) {
|
||||||
if (nact->ags.pal_changed) {
|
if (nact->ags.pal_changed) {
|
||||||
@@ -64,7 +65,7 @@ SDL_Color gfx_getPaletteColor(uint8_t color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void gfx_updateScreen(void) {
|
void gfx_updateScreen(void) {
|
||||||
if (!gfx_dirty)
|
if (!gfx_dirty || gfx_effect_running)
|
||||||
return;
|
return;
|
||||||
SDL_RenderClear(gfx_renderer);
|
SDL_RenderClear(gfx_renderer);
|
||||||
SDL_RenderCopy(gfx_renderer, gfx_texture, NULL, NULL);
|
SDL_RenderCopy(gfx_renderer, gfx_texture, NULL, NULL);
|
||||||
@@ -73,6 +74,12 @@ void gfx_updateScreen(void) {
|
|||||||
gfx_dirty = false;
|
gfx_dirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gfx_setEffectRunning(bool running) {
|
||||||
|
gfx_effect_running = running;
|
||||||
|
// Effects present directly. Do not replay pending redraws over their frames.
|
||||||
|
gfx_dirty = false;
|
||||||
|
}
|
||||||
|
|
||||||
void gfx_requestRedraw(void) {
|
void gfx_requestRedraw(void) {
|
||||||
gfx_dirty = true;
|
gfx_dirty = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ extern surface_t *gfx_dibinfo;
|
|||||||
extern int view_w;
|
extern int view_w;
|
||||||
extern int view_h;
|
extern int view_h;
|
||||||
|
|
||||||
|
void gfx_setEffectRunning(bool running);
|
||||||
|
|
||||||
SDL_Surface *gfx_dib_to_surface_with_alpha(int x, int y, int w, int h);
|
SDL_Surface *gfx_dib_to_surface_with_alpha(int x, int y, int w, int h);
|
||||||
SDL_Surface *gfx_dib_to_surface_colorkey(int x, int y, int w, int h, int col);
|
SDL_Surface *gfx_dib_to_surface_colorkey(int x, int y, int w, int h, int col);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user