Mercurial > hg > Game > Cerium
changeset 1111:c9d0683c9b39 draft
add non screen mode.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 17 Jan 2011 03:23:09 +0900 |
parents | f80524d00a2c |
children | fa1f4a1c47bf |
files | Renderer/Engine/main.cc Renderer/Engine/viewer.cc Renderer/Engine/viewerNONE.cc Renderer/Engine/viewerNONE.h Renderer/Engine/viewer_types.h TaskManager/Fifo/FifoDmaManager.cc TaskManager/kernel/schedule/SchedTaskArray.cc |
diffstat | 7 files changed, 69 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/main.cc Sun Jan 02 21:09:21 2011 +0900 +++ b/Renderer/Engine/main.cc Mon Jan 17 03:23:09 2011 +0900 @@ -4,6 +4,7 @@ #include "viewerFB.h" #include "viewerGL.h" #include "viewerPS3.h" +#include "viewerNONE.h" #include "Application.h" /* prototype */ @@ -64,6 +65,8 @@ vtype = VTYPE_PS3; } else if (strcmp(argv[i+1], "sdl") == 0) { vtype = VTYPE_SDL; + } else if (strcmp(argv[i+1], "none") == 0) { + vtype = VTYPE_NONE; } i++; } @@ -84,6 +87,9 @@ } else if (vtype == VTYPE_PS3) { ViewerDevice *dev = new ViewerPS3(); screen = new Viewer(manager, dev, bpp, width, height, spenum); + } else if (vtype == VTYPE_NONE) { + ViewerDevice *dev = new ViewerNONE(manager); + screen = new Viewer(manager, dev, bpp, width, height, spenum); } else { ViewerDevice *dev = new ViewerSDL(manager); screen = new Viewer(manager, dev, bpp, width, height, spenum);
--- a/Renderer/Engine/viewer.cc Sun Jan 02 21:09:21 2011 +0900 +++ b/Renderer/Engine/viewer.cc Mon Jan 17 03:23:09 2011 +0900 @@ -332,7 +332,12 @@ //sgroot->checkRemove(); // ここから下は Rendering という関数にする - rendering(task_next); + if (pixels) { + rendering(task_next); + } else { + task_next->set_post(post2runLoop, (void*)this, NULL); + task_next->spawn(); + } } @@ -827,7 +832,6 @@ r[spi].spackList[i-1].reinit(i*split_screen_h); } - if (profile) { if (frames % 50 == 49) { manager->show_profile();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/Engine/viewerNONE.cc Mon Jan 17 03:23:09 2011 +0900 @@ -0,0 +1,30 @@ +#include "viewerNONE.h" +#include "TaskManager.h" + +#define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK + +ViewerNONE::~ViewerNONE() {} + + +Uint32 * +ViewerNONE::video_init(TaskManager *manager, int bpp, int width, int height) +{ + Uint32 sdl_flag = default_sdl_flag | SDL_INIT_VIDEO; + + if (SDL_Init(sdl_flag) < 0) { + fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError()); + exit(1); + } + + this->width = 0; + this->height = 0; + this->bpp = 0; + + return NULL; +} + +uint32_t * +ViewerNONE::flip_screen(uint32_t *old) +{ + return NULL; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/Engine/viewerNONE.h Mon Jan 17 03:23:09 2011 +0900 @@ -0,0 +1,21 @@ +#ifndef INCLUDED_VIEWER_NONE +#define INCLUDED_VIEWER_NONE + +#include "ViewerDevice.h" + +class ViewerNONE : public ViewerDevice { +public: + ViewerNONE(TaskManager* manager) {}; + ViewerNONE() {}; + virtual ~ViewerNONE(); + + /* override function */ + Uint32 *video_init(TaskManager *manager, int bpp, int width, int height); + void clean_pixels(){}; + void clear_screen(){}; + void free_device(){}; + uint32_t* flip_screen(uint32_t *); + +}; + +#endif
--- a/Renderer/Engine/viewer_types.h Sun Jan 02 21:09:21 2011 +0900 +++ b/Renderer/Engine/viewer_types.h Mon Jan 17 03:23:09 2011 +0900 @@ -14,7 +14,8 @@ VTYPE_SDL, VTYPE_FB, VTYPE_PS3, - VTYPE_GL + VTYPE_GL, + VTYPE_NONE }; #if defined(__LITTLE_ENDIAN__)
--- a/TaskManager/Fifo/FifoDmaManager.cc Sun Jan 02 21:09:21 2011 +0900 +++ b/TaskManager/Fifo/FifoDmaManager.cc Mon Jan 17 03:23:09 2011 +0900 @@ -54,7 +54,7 @@ ListElementPtr elm = &list->element[i]; memcpy((void*)elm->addr, (void*)bound, elm->size); bound += elm->size; - } + } } /* end */
--- a/TaskManager/kernel/schedule/SchedTaskArray.cc Sun Jan 02 21:09:21 2011 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskArray.cc Mon Jan 17 03:23:09 2011 +0900 @@ -115,9 +115,11 @@ outListData.size = atask->outData_total_size(); // atask->outData_offset += cur_index + 1 ; // to avoid compiler bug outListData.element = atask->outData(0); + free(outListData.bound); outListData.bound = (int*)manager->allocate(outListData.length*sizeof(int)); bound(&outListData); - + + free(writebuf); writebuf = manager->allocate(outListData.size); //if (outListData.element == inListData.element ) { // printf("bad %x\n",outListData.element);