mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-22 22:48:08 +03:00
Refactor NightDemonDemo and tDemo to use SDL_Surface
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
#include "music.h"
|
||||
#include "sdl_core.h"
|
||||
#include "input.h"
|
||||
#include "ngraph.h"
|
||||
#include "cg.h"
|
||||
#include "jpeg.h"
|
||||
|
||||
@@ -61,8 +60,10 @@ static void ndd_run(int demonum) {
|
||||
|
||||
cgdata *cg = jpeg_extract(alk->entries[i].data, alk->entries[i].size);
|
||||
if (cg) {
|
||||
gr_drawimage24(sf0, cg, 0, 0);
|
||||
SDL_Surface *sf = SDL_CreateRGBSurfaceWithFormatFrom(cg->pic, cg->width, cg->height, 24, cg->width * 3, SDL_PIXELFORMAT_RGB24);
|
||||
SDL_BlitSurface(sf, NULL, main_surface, NULL);
|
||||
ags_updateFull();
|
||||
SDL_FreeSurface(sf);
|
||||
cgdata_free(cg);
|
||||
} else {
|
||||
WARNING("Cannot decode CG %d in %s", i, alk_path);
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "input.h"
|
||||
#include "bgm.h"
|
||||
#include "sdl_core.h"
|
||||
#include "ngraph.h"
|
||||
#include "cg.h"
|
||||
#include "jpeg.h"
|
||||
|
||||
@@ -81,8 +80,10 @@ static void Run() {
|
||||
|
||||
cgdata *cg = jpeg_extract(alk->entries[i].data, alk->entries[i].size);
|
||||
if (cg) {
|
||||
gr_drawimage24(sf0, cg, 0, 0);
|
||||
SDL_Surface *sf = SDL_CreateRGBSurfaceWithFormatFrom(cg->pic, cg->width, cg->height, 24, cg->width * 3, SDL_PIXELFORMAT_RGB24);
|
||||
SDL_BlitSurface(sf, NULL, main_surface, NULL);
|
||||
ags_updateFull();
|
||||
SDL_FreeSurface(sf);
|
||||
cgdata_free(cg);
|
||||
} else {
|
||||
WARNING("Cannot decode CG %d", i);
|
||||
|
||||
Reference in New Issue
Block a user