Mercurial > otakunoraifu
diff music2/movie.cc @ 52:15a18fbe6f21
* Known bugs added to the README
* Code cleaning (0 -> NULL when needed, indentation, spaces, ...)
author | thib |
---|---|
date | Sat, 18 Apr 2009 18:35:39 +0000 |
parents | 223b71206888 |
children | ddbcbd000206 |
line wrap: on
line diff
--- a/music2/movie.cc +++ b/music2/movie.cc @@ -30,18 +30,18 @@ * */ -#include<stdio.h> -#include"music.h" -#include<SDL.h> -#include<SDL_mixer.h> -#include<string.h> -#include<ctype.h> -#include<stdlib.h> -#include"system/file.h" -#include"window/system.h" +#include <stdio.h> +#include "music.h" +#include <SDL.h> +#include <SDL_mixer.h> +#include <string.h> +#include <ctype.h> +#include <stdlib.h> +#include "system/file.h" +#include "window/system.h" #if USE_SMPEG -#include<smpeg/smpeg.h> +#include <smpeg/smpeg.h> static SMPEG* smpeg_handle = 0; const char* FindMovieFile(const char* path); @@ -50,7 +50,7 @@ void MuSys::PlayMovie(const char* path, FinalizeMusic(); SMPEG_Info info; const char* find_path = FindMovieFile(path); - if (find_path == 0) return; + if (find_path == NULL) return; smpeg_handle = SMPEG_new(find_path, &info, true); //SMPEG_enableaudio(smpeg_handle, true); //SMPEG_enablevideo(smpeg_handle, true); @@ -58,7 +58,7 @@ void MuSys::PlayMovie(const char* path, SMPEG_enablevideo(smpeg_handle, true); SDL_Surface* surface = SDL_GetVideoSurface(); System::Main::DisableVideo(); - SMPEG_setdisplay(smpeg_handle,surface,0,0); + SMPEG_setdisplay(smpeg_handle, surface, 0, 0); // if (loop_c > 1) SMPEG_loop(smpeg_handle, true); //if (x1 != 0 || x2 != 0) SMPEG_setdisplayregion(smpeg_handle,x1, y1, x2-x1, y1-y2); SMPEG_play(smpeg_handle); @@ -68,15 +68,13 @@ void MuSys::PlayMovie(const char* path, } #endif return; -err: - StopMovie(); - return; } + const char* FindMovieFile(const char* path) { - ARCINFO* info = file_searcher.Find(FILESEARCH::MOV,path,"avi"); - if (info == 0) + ARCINFO* info = file_searcher.Find(FILESEARCH::MOV, path, "avi"); + if (info == NULL) info = file_searcher.Find(FILESEARCH::MOV,path,"mpg"); - if (info == 0) return 0; + if (info == NULL) return NULL; const char* file = info->Path(); delete info; return file;