From 50c8f9ec7fc2e58e8b68883f3418e33417bccf1c Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 25 Nov 2021 14:17:44 +0100 Subject: [PATCH] hopalong orbit viewer; also bezier patches in playground --- premake5.lua | 9 + tools/hopalong/main.cpp | 448 +++++++++++++++++++++++++++++++++ tools/hopalong/particle.inc | 467 +++++++++++++++++++++++++++++++++++ tools/hopalong/particle.png | Bin 0 -> 5564 bytes tools/hopalong/vfs.cpp | 133 ++++++++++ tools/hopalong/vfs.h | 15 ++ tools/playground/main.cpp | 10 +- tools/playground/splines.cpp | 250 ++++++++++++++++++- 8 files changed, 1317 insertions(+), 15 deletions(-) create mode 100644 tools/hopalong/main.cpp create mode 100644 tools/hopalong/particle.inc create mode 100644 tools/hopalong/particle.png create mode 100644 tools/hopalong/vfs.cpp create mode 100644 tools/hopalong/vfs.h diff --git a/premake5.lua b/premake5.lua index 323aa41..e9e7839 100755 --- a/premake5.lua +++ b/premake5.lua @@ -275,3 +275,12 @@ project "ps2test" -- includedirs { "." } -- libdirs { Libdir } -- links { "librw" } + +project "hopalong" + kind "WindowedApp" + characterset ("MBCS") + skeltool("hopalong") + entrypoint("WinMainCRTStartup") + removeplatforms { "*null" } + removeplatforms { "ps2" } + diff --git a/tools/hopalong/main.cpp b/tools/hopalong/main.cpp new file mode 100644 index 0000000..0085418 --- /dev/null +++ b/tools/hopalong/main.cpp @@ -0,0 +1,448 @@ +#include +#include +#include + +rw::V3d zero = { 0.0f, 0.0f, 0.0f }; +struct SceneGlobals { + rw::World *world; + rw::Camera *camera; +} Scene; +rw::EngineOpenParams engineOpenParams; + +rw::Texture *ParticleTex; +rw::Raster *ParticleRaster; + +static rw::RWDEVICE::Im2DVertex im2dVerts[1024]; +static int numImVerts; +static rw::uint16 imIndices[1024*2]; +static int numImIndices; +static rw::PrimitiveType imPrim; + +void +BeginIm2D(rw::PrimitiveType prim) +{ + numImVerts = 0; + numImIndices = 0; + imPrim = prim; +} + +void +EndIm2D(void) +{ + rw::im2d::RenderIndexedPrimitive(imPrim, &im2dVerts, numImVerts, &imIndices, numImIndices); +} + +void +RenderParticle(float x, float y, float sz, rw::RGBA col) +{ + using namespace rw; + using namespace RWDEVICE; + + if(numImVerts+4 > nelem(im2dVerts) || + numImIndices+6 > nelem(imIndices)){ + EndIm2D(); + numImVerts = 0; + numImIndices = 0; + } + + float recipZ = 1.0f/Scene.camera->nearPlane; + rw::RWDEVICE::Im2DVertex *verts = &im2dVerts[numImVerts]; + + x += sk::globals.width/2; + y += sk::globals.height/2; + + verts[0].setScreenX(x-sz); + verts[0].setScreenY(y-sz); + verts[0].setScreenZ(rw::im2d::GetNearZ()); + verts[0].setCameraZ(Scene.camera->nearPlane); + verts[0].setRecipCameraZ(recipZ); + verts[0].setColor(col.red, col.green, col.blue, col.alpha); + verts[0].setU(0.0f, recipZ); + verts[0].setV(0.0f, recipZ); + + verts[1].setScreenX(x+sz); + verts[1].setScreenY(y-sz); + verts[1].setScreenZ(rw::im2d::GetNearZ()); + verts[1].setCameraZ(Scene.camera->nearPlane); + verts[1].setRecipCameraZ(recipZ); + verts[1].setColor(col.red, col.green, col.blue, col.alpha); + verts[1].setU(1.0f, recipZ); + verts[1].setV(0.0f, recipZ); + + verts[2].setScreenX(x+sz); + verts[2].setScreenY(y+sz); + verts[2].setScreenZ(rw::im2d::GetNearZ()); + verts[2].setCameraZ(Scene.camera->nearPlane); + verts[2].setRecipCameraZ(recipZ); + verts[2].setColor(col.red, col.green, col.blue, col.alpha); + verts[2].setU(1.0f, recipZ); + verts[2].setV(1.0f, recipZ); + + verts[3].setScreenX(x-sz); + verts[3].setScreenY(y+sz); + verts[3].setScreenZ(rw::im2d::GetNearZ()); + verts[3].setCameraZ(Scene.camera->nearPlane); + verts[3].setRecipCameraZ(recipZ); + verts[3].setColor(col.red, col.green, col.blue, col.alpha); + verts[3].setU(0.0f, recipZ); + verts[3].setV(1.0f, recipZ); + + imIndices[numImIndices+0] = numImVerts+0; + imIndices[numImIndices+1] = numImVerts+1; + imIndices[numImIndices+2] = numImVerts+2; + imIndices[numImIndices+3] = numImVerts+0; + imIndices[numImIndices+4] = numImVerts+2; + imIndices[numImIndices+5] = numImVerts+3; + + numImVerts += 4; + numImIndices += 6; +} + +float sgn(float f) { return f < 0.0f ? -1.0f : f > 0.0f ? 1.0f : 0.0f; } + +struct Orbit +{ + ImVec4 color; + float StartX; + float StartY; + float PointSz; + int numIterations; + bool used; +}; + +Orbit orbits[100]; +int curOrbit = 0; + +float A = 0.0f; +float B = 0.0f; +float C = 0.0f; +float Scale = 50.0f; +bool textured = true; +bool animateX; +bool animateY; +bool animateA; +bool animateB; +bool animateC; + +void +ResetOrbit(Orbit *o) +{ + o->color = ImVec4(1.0f, 0.0f, 0.0f, 1.00f); + o->StartX = 1.0f; + o->StartY = 0.0f; + o->PointSz = 3.0f; + o->numIterations = 1000; + o->used = false; +} + +void +RenderOrbit(Orbit *o) +{ + rw::RGBA red = { 0xFF, 0, 0, 0xFF }; + rw::RGBA color = rw::makeRGBA(o->color.x*255, o->color.y*255, o->color.z*255, o->color.w*255); + + float x1, y1; + float x0 = o->StartX; + float y0 = o->StartY; + int n = o->numIterations; + + if(textured){ + rw::SetRenderStatePtr(rw::TEXTURERASTER, ParticleRaster); + rw::SetRenderState(rw::TEXTUREFILTER, rw::Texture::LINEAR); + }else + rw::SetRenderStatePtr(rw::TEXTURERASTER, nil); + BeginIm2D(rw::PRIMTYPETRILIST); + while(n--){ + x1 = y0 - sgn(x0)*sqrtf(fabs(B*x0 - C)); +// x1 = y0 - sgn(x0)*logf(fabs(B*x0 - C)); + y1 = A - x0; + RenderParticle(x1*Scale, y1*Scale, o->PointSz, color); + x0 = x1; + y0 = y1; + } + EndIm2D(); +} + +void +RenderHopalong(void) +{ + int i; + for(i = 0; i < nelem(orbits); i++) + if(orbits[i].used) + RenderOrbit(&orbits[i]); +} + +void +Init(void) +{ + sk::globals.windowtitle = "Hopalong map"; + sk::globals.width = 1280; + sk::globals.height = 800; + sk::globals.quit = 0; +} + +bool +attachPlugins(void) +{ + rw::ps2::registerPDSPlugin(40); + rw::ps2::registerPluginPDSPipes(); + + rw::registerMeshPlugin(); + rw::registerNativeDataPlugin(); + rw::registerAtomicRightsPlugin(); + rw::registerMaterialRightsPlugin(); + rw::xbox::registerVertexFormatPlugin(); + rw::registerSkinPlugin(); + rw::registerUserDataPlugin(); + rw::registerHAnimPlugin(); + rw::registerMatFXPlugin(); + rw::registerUVAnimPlugin(); + rw::ps2::registerADCPlugin(); + return true; +} + +#include "particle.inc" + +#include "vfs.h" +VFS_file files[] = { + { "particle.png", particle_png, particle_png_len } +}; +VFS vfs = { + files, nelem(files) +}; + +bool +InitRW(void) +{ + if(!sk::InitRW()) + return false; + installVFS(&vfs); + + Scene.world = rw::World::create(); + + ParticleTex = rw::Texture::read("particle", nil); + if(ParticleTex) + ParticleRaster = ParticleTex->raster; + + rw::Light *ambient = rw::Light::create(rw::Light::AMBIENT); + ambient->setColor(0.2f, 0.2f, 0.2f); + Scene.world->addLight(ambient); + + rw::V3d xaxis = { 1.0f, 0.0f, 0.0f }; + rw::Light *direct = rw::Light::create(rw::Light::DIRECTIONAL); + direct->setColor(0.8f, 0.8f, 0.8f); + direct->setFrame(rw::Frame::create()); + direct->getFrame()->rotate(&xaxis, 180.0f, rw::COMBINEREPLACE); + Scene.world->addLight(direct); + + Scene.camera = sk::CameraCreate(sk::globals.width, sk::globals.height, 1); + Scene.world->addCamera(Scene.camera); + + + for(int i = 0; i < nelem(orbits); i++) + ResetOrbit(&orbits[i]); + orbits[0].used = true; + + ImGui_ImplRW_Init(); + ImGui::StyleColorsClassic(); + + return true; +} + +void +orbitGUI(Orbit *o) +{ + ImGui::SliderFloat("x0", &o->StartX, -10.0f, 10.0f); + ImGui::SliderFloat("y0", &o->StartY, -10.0f, 10.0f); + ImGui::SliderFloat("Point Size", &o->PointSz, 0.5f, 10.0f); + ImGui::SliderInt("NumPoints", &o->numIterations, 1, 10000); + ImGui::ColorEdit3("color", (float*)&o->color); + +/* + ImGui::Checkbox("Textured", &textured); + ImGui::Checkbox("AnimateX", &animateX); + ImGui::Checkbox("AnimateY", &animateY); + ImGui::Checkbox("AnimateA", &animateA); + ImGui::Checkbox("AnimateB", &animateB); + ImGui::Checkbox("AnimateC", &animateC); +*/ +} + +void +hopalongGUI(void) +{ + int i; + static char tmp[128]; + if(curOrbit >= 0) + orbitGUI(&orbits[curOrbit]); + ImGui::SliderFloat("A", &A, -10.0f, 10.0f); + ImGui::SliderFloat("B", &B, -10.0f, 10.0f); + ImGui::SliderFloat("C", &C, -10.0f, 10.0f); + ImGui::SliderFloat("Scale", &Scale, 1.0f, 100.0f); + for(i = 0; i < nelem(orbits); i++){ + if(orbits[i].used){ + sprintf(tmp, "Orbit %d\n", i); + if(ImGui::Button(tmp)) + curOrbit = i; + } + } + if( ImGui::Button("Add Orbit")) + for(i = 0; i < nelem(orbits); i++) + if(!orbits[i].used){ + ResetOrbit(&orbits[i]); + orbits[i].used = true; + curOrbit = i; + break; + } + if(curOrbit >= 0 && ImGui::Button("Remove Orbit")){ + orbits[curOrbit].used = false; + curOrbit = -1; + for(i = 0; i < nelem(orbits); i++) + if(orbits[i].used){ + curOrbit = i; + break; + } + } +} + +#ifdef __unix__ +#include +#endif + +void +Draw(float timeDelta) +{ + static bool show_demo_window = false; + + rw::RGBA clearcol = { 0, 0, 0, 255 }; + Scene.camera->clear(&clearcol, rw::Camera::CLEARIMAGE|rw::Camera::CLEARZ); + Scene.camera->beginUpdate(); + + ImGui_ImplRW_NewFrame(timeDelta); + + RenderHopalong(); + +/* + if(animateX) StartX += timeDelta/10000.0f; + if(animateY) StartY += timeDelta/10000.0f; + if(animateA) A += timeDelta/10000.0f; + if(animateB) B += timeDelta/10000.0f; + if(animateC) C += timeDelta/10000.0f; +*/ + + hopalongGUI(); + + if(show_demo_window){ + ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver); + ImGui::ShowDemoWindow(&show_demo_window); + } + + + ImGui::EndFrame(); + ImGui::Render(); + + ImGui_ImplRW_RenderDrawLists(ImGui::GetDrawData()); + + Scene.camera->endUpdate(); + Scene.camera->showRaster(0); + +#ifdef __unix__ + usleep(10000); +#endif +} + + +void +KeyUp(int key) +{ +} + +void +KeyDown(int key) +{ + switch(key){ + case sk::KEY_ESC: + sk::globals.quit = 1; + break; + } +} + +int MouseX, MouseY; +int MouseDeltaX, MouseDeltaY; +int MouseButtons; + +void +MouseBtn(sk::MouseState *mouse) +{ + MouseButtons = mouse->buttons; +} + +void +MouseMove(sk::MouseState *mouse) +{ + MouseDeltaX = mouse->posx - MouseX; + MouseDeltaY = mouse->posy - MouseY; + MouseX = mouse->posx; + MouseY = mouse->posy; + if(MouseButtons&1){ + int mx = MouseX - sk::globals.width/2; + int my = MouseY - sk::globals.height/2; + if(curOrbit >= 0){ + orbits[curOrbit].StartX = mx/Scale; + orbits[curOrbit].StartY = my/Scale; + } + } +} + +sk::EventStatus +AppEventHandler(sk::Event e, void *param) +{ + using namespace sk; + Rect *r; + MouseState *ms; + + ImGuiEventHandler(e, param); + ImGuiIO &io = ImGui::GetIO(); + + switch(e){ + case INITIALIZE: + Init(); + return EVENTPROCESSED; + case RWINITIALIZE: + return ::InitRW() ? EVENTPROCESSED : EVENTERROR; + case PLUGINATTACH: + return attachPlugins() ? EVENTPROCESSED : EVENTERROR; + case KEYDOWN: + KeyDown(*(int*)param); + return EVENTPROCESSED; + case KEYUP: + KeyUp(*(int*)param); + return EVENTPROCESSED; + case MOUSEBTN: + if(!io.WantCaptureMouse){ + ms = (MouseState*)param; + MouseBtn(ms); + }else + MouseButtons = 0; + return EVENTPROCESSED; + case MOUSEMOVE: + MouseMove((MouseState*)param); + return EVENTPROCESSED; + case RESIZE: + r = (Rect*)param; + // TODO: register when we're minimized + if(r->w == 0) r->w = 1; + if(r->h == 0) r->h = 1; + + sk::globals.width = r->w; + sk::globals.height = r->h; + // TODO: set aspect ratio + if(Scene.camera) + sk::CameraSize(Scene.camera, r); + break; + case IDLE: + Draw(*(float*)param); + return EVENTPROCESSED; + } + return sk::EVENTNOTPROCESSED; +} diff --git a/tools/hopalong/particle.inc b/tools/hopalong/particle.inc new file mode 100644 index 0000000..5eeabe0 --- /dev/null +++ b/tools/hopalong/particle.inc @@ -0,0 +1,467 @@ +unsigned char particle_png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x08, 0x03, 0x00, 0x00, 0x00, 0x6b, 0xac, 0x58, 0x54, 0x00, 0x00, 0x02, + 0xfd, 0x50, 0x4c, 0x54, 0x45, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x52, 0x92, 0xc4, 0x9b, 0x00, 0x00, 0x00, 0xfe, 0x74, 0x52, + 0x4e, 0x53, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, + 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, + 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, + 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, + 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, + 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, + 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, + 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, + 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, + 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, + 0x8f, 0x90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+ 0x73, 0xa3, 0x2b, 0xff, 0x10, 0x01, 0x51, 0x56, 0x32, 0xe3, 0x2b, 0xeb, + 0x9f, 0x20, 0x20, 0xb4, 0x90, 0x88, 0x9f, 0x44, 0xcb, 0x9b, 0x0a, 0x88, + 0x41, 0xd4, 0xae, 0x42, 0x56, 0x7c, 0x27, 0x01, 0xa6, 0x0f, 0x92, 0xe1, + 0x9e, 0x62, 0xef, 0x25, 0x21, 0xbe, 0x8f, 0x80, 0x10, 0x7c, 0x91, 0x30, + 0x68, 0x83, 0x82, 0xe7, 0x26, 0xbc, 0x83, 0x00, 0x81, 0xdb, 0x81, 0xcf, + 0xc4, 0xce, 0xaa, 0x5b, 0x22, 0x2e, 0x2e, 0x00, 0x7c, 0xe8, 0x99, 0xae, + 0x82, 0x4c, 0xa0, 0x82, 0xb1, 0x6b, 0xe6, 0x92, 0xeb, 0x95, 0x05, 0x0c, + 0xb0, 0x65, 0x20, 0xea, 0xe6, 0x50, 0x75, 0xf1, 0x0f, 0x54, 0x5c, 0x52, + 0x80, 0xca, 0xbe, 0x06, 0x4c, 0xa0, 0xa7, 0x6e, 0x0d, 0x15, 0x88, 0xf0, + 0xe7, 0x42, 0xc0, 0xd0, 0x25, 0x05, 0x40, 0x57, 0xc1, 0x49, 0x55, 0x07, + 0x75, 0xb8, 0xf6, 0xa1, 0xaf, 0xe9, 0x19, 0x65, 0x10, 0xe7, 0xe0, 0xfb, + 0x92, 0x02, 0x57, 0x80, 0xf0, 0x7d, 0xed, 0x57, 0x10, 0x3b, 0xf1, 0xa1, + 0x84, 0x98, 0x04, 0x7e, 0x1b, 0x78, 0xe0, 0xc7, 0x00, 0xd0, 0x24, 0xb8, + 0xd9, 0xa8, 0x20, 0x76, 0xe3, 0x17, 0x5e, 0x56, 0xc2, 0x1f, 0x05, 0x80, + 0x4d, 0xa8, 0x22, 0xac, 0xe0, 0xb5, 0x02, 0x54, 0xf9, 0x20, 0x93, 0x57, + 0x09, 0x2d, 0x83, 0xba, 0x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 0x50, 0xf9, 0x25, 0xa0, 0x37, + 0xe1, 0xa3, 0x80, 0x4a, 0x48, 0x53, 0xa9, 0xef, 0x7c, 0x01, 0x7e, 0xfc, + 0x95, 0xbf, 0x18, 0x20, 0xc2, 0x3f, 0x27, 0x00, 0x03, 0xe0, 0x57, 0xfe, + 0x6a, 0xe0, 0xc9, 0x22, 0x88, 0x75, 0xfe, 0x68, 0x82, 0xc7, 0x00, 0xbf, + 0x34, 0x2c, 0xe4, 0xfc, 0x9b, 0x80, 0x9c, 0x39, 0x1a, 0xa8, 0xf0, 0x4b, + 0x42, 0xeb, 0xcb, 0x06, 0x62, 0x85, 0xdf, 0x4f, 0xff, 0x26, 0x03, 0x8c, + 0x83, 0x3e, 0x78, 0xd0, 0x05, 0x19, 0xe6, 0xbf, 0xbb, 0x0a, 0x30, 0x70, + 0x9a, 0x00, 0x9f, 0xfd, 0x89, 0x2d, 0x03, 0x19, 0x76, 0x08, 0x00, 0x5f, + 0xfc, 0x99, 0xba, 0x1f, 0x9c, 0x28, 0x00, 0xfe, 0x14, 0x70, 0x43, 0xc0, + 0x6f, 0x03, 0xdc, 0xe2, 0xff, 0x93, 0x80, 0x62, 0x40, 0x1d, 0xb0, 0xf2, + 0x23, 0xe0, 0x9e, 0x02, 0x96, 0x0c, 0xc4, 0x12, 0x3f, 0x83, 0x87, 0x2f, + 0x03, 0x19, 0xe0, 0x1f, 0x08, 0x68, 0xd1, 0x7a, 0x1b, 0x08, 0xc8, 0x00, + 0xbe, 0xf9, 0x29, 0x03, 0x06, 0x06, 0xce, 0x11, 0x30, 0xaa, 0xfe, 0xc2, + 0xaf, 0x46, 0x00, 0xff, 0x8a, 0x80, 0x8c, 0x6a, 0x01, 0xc5, 0xc0, 0xe8, + 0x3d, 0xd8, 0x2f, 0xc0, 0xc7, 0x1f, 0xf8, 0x19, 0x6d, 0x60, 0xf4, 0x35, + 0x8c, 0x83, 0x32, 0xa0, 0x1f, 0x7e, 0x07, 0x9b, 0x3f, 0x03, 0x0a, 0x16, + 0x8f, 0xc2, 0x98, 0xe5, 0xe7, 0xed, 0x07, 0x3f, 0xe7, 0x81, 0x01, 0xf5, + 0x41, 0x0b, 0x70, 0x17, 0x1c, 0xf2, 0x63, 0xa0, 0x28, 0xe0, 0x24, 0x98, + 0x33, 0x10, 0x2b, 0xfc, 0xe0, 0x3f, 0x18, 0x18, 0x36, 0x02, 0x7d, 0x0d, + 0x6b, 0x67, 0x7d, 0x06, 0x54, 0x03, 0x6a, 0x01, 0x0f, 0xfc, 0x28, 0x58, + 0x30, 0x10, 0x93, 0xfc, 0xd1, 0xc0, 0xff, 0xa1, 0x47, 0x41, 0x06, 0x19, + 0x80, 0x7f, 0x5a, 0x00, 0x06, 0xc4, 0x9f, 0xc8, 0xe0, 0xff, 0x04, 0x14, + 0xb4, 0x3e, 0x67, 0x20, 0x66, 0xf8, 0x19, 0xbf, 0xe9, 0xf5, 0x1a, 0x60, + 0x20, 0xe3, 0xb8, 0x0d, 0x30, 0x46, 0x4d, 0x20, 0xc9, 0xe1, 0x57, 0xf9, + 0x3f, 0x38, 0x60, 0x60, 0x60, 0x9f, 0x00, 0xf8, 0xeb, 0xe3, 0x2f, 0x1a, + 0x64, 0x40, 0xc7, 0xe0, 0x8c, 0x00, 0x1f, 0x81, 0xe2, 0x2f, 0xe8, 0xb5, + 0x08, 0x30, 0xb0, 0x53, 0x80, 0xf8, 0x13, 0xb9, 0x2a, 0x38, 0x68, 0x04, + 0x6a, 0x03, 0x6c, 0x0d, 0xbf, 0x9a, 0xc0, 0x41, 0x0b, 0x28, 0xf8, 0xb9, + 0xac, 0x19, 0x88, 0x55, 0x7e, 0xe0, 0xd3, 0x86, 0x0d, 0x1c, 0x9f, 0x82, + 0x33, 0x67, 0xa0, 0xf8, 0xa9, 0x7e, 0xe2, 0x9a, 0x81, 0x58, 0xe0, 0x47, + 0x80, 0x14, 0xfc, 0x63, 0xdd, 0x8e, 0x76, 0xe4, 0xb6, 0x62, 0x18, 0x0c, + 0xe3, 0xcc, 0xbc, 0xff, 0x23, 0x4f, 0x50, 0x60, 0x4a, 0x44, 0x10, 0x3e, + 0x2f, 0xed, 0x62, 0xeb, 0x38, 0xf6, 0xf6, 0x52, 0x7f, 0x25, 0x92, 0x3a, + 0xde, 0x68, 0x04, 0xaa, 0xa0, 0x33, 0xe0, 0x26, 0x60, 0x0c, 0xd4, 0x02, + 0x28, 0x3f, 0x54, 0x20, 0xf0, 0x5b, 0x00, 0xa5, 0x7e, 0x67, 0xe0, 0x27, + 0x19, 0x54, 0x05, 0xf9, 0x36, 0xa8, 0x06, 0xfe, 0x24, 0x81, 0x4c, 0xc0, + 0x6f, 0x08, 0x9c, 0x87, 0xf5, 0x8f, 0xfd, 0x6d, 0x00, 0x78, 0xc1, 0x7d, + 0x16, 0x8a, 0x08, 0xf0, 0x65, 0x28, 0x08, 0xee, 0x52, 0x10, 0xfa, 0xbf, + 0x01, 0x8c, 0x1d, 0x76, 0x02, 0x00, 0xe8, 0xf5, 0x27, 0xfe, 0x58, 0xfb, + 0x42, 0xd0, 0x09, 0x44, 0x05, 0x6d, 0x81, 0xd5, 0x00, 0xd1, 0xc0, 0x5e, + 0xff, 0x2a, 0x5f, 0x0a, 0x89, 0x44, 0x85, 0xc0, 0x63, 0x00, 0x73, 0xf8, + 0x67, 0xfd, 0xca, 0x00, 0x32, 0x98, 0x87, 0x2a, 0xe8, 0x3a, 0xbc, 0x25, + 0x80, 0x14, 0x84, 0x04, 0x22, 0x00, 0x12, 0xc8, 0x51, 0xe1, 0x2f, 0x01, + 0xa4, 0xfe, 0xc9, 0xbe, 0xef, 0x2b, 0x04, 0x74, 0x40, 0x15, 0x81, 0x92, + 0x03, 0x8a, 0x04, 0xd0, 0x01, 0x57, 0xe5, 0x7f, 0x26, 0x19, 0x87, 0xc0, + 0x73, 0x00, 0x5d, 0x00, 0x5f, 0x27, 0xf2, 0xb7, 0x00, 0x20, 0x03, 0xc1, + 0x74, 0x5e, 0x8e, 0x40, 0xdd, 0x86, 0xd6, 0x04, 0x28, 0x01, 0xb1, 0x80, + 0x10, 0x98, 0x16, 0x10, 0x40, 0xa4, 0x30, 0x04, 0xee, 0x87, 0xe0, 0xdc, + 0xd6, 0xbf, 0xe4, 0x7f, 0x01, 0x78, 0x8f, 0x08, 0x60, 0x85, 0x73, 0x3b, + 0x03, 0xdd, 0x06, 0x4d, 0x01, 0x73, 0x63, 0x81, 0xf9, 0xe1, 0x33, 0x00, + 0xb6, 0x19, 0x74, 0x02, 0x00, 0xe8, 0xf5, 0x9f, 0x94, 0xbd, 0x5e, 0xa9, + 0x5d, 0x2b, 0x44, 0x07, 0x4b, 0x12, 0x2a, 0x39, 0x68, 0x14, 0x50, 0x0b, + 0xcc, 0x2b, 0x95, 0xe7, 0x45, 0x24, 0xea, 0x04, 0x3a, 0x00, 0xf5, 0x3f, + 0x95, 0x33, 0x08, 0xc7, 0x9d, 0x20, 0xb7, 0x33, 0xd0, 0x5d, 0xc0, 0x09, + 0x48, 0xfd, 0xee, 0x00, 0x36, 0x7f, 0x9e, 0x7a, 0x41, 0x07, 0xd0, 0x1b, + 0x20, 0x00, 0xfe, 0xea, 0xdf, 0x9b, 0xfa, 0xcd, 0x43, 0x1a, 0x21, 0xdb, + 0x40, 0x92, 0xc0, 0xa4, 0x00, 0x37, 0x01, 0x4c, 0xd0, 0x04, 0xb4, 0x08, + 0xe4, 0x11, 0x25, 0x0c, 0x80, 0xda, 0x02, 0x02, 0xa0, 0xfe, 0xdd, 0xff, + 0x6f, 0x01, 0x6c, 0x04, 0xcf, 0x67, 0x00, 0x0d, 0x78, 0x3e, 0x01, 0xbb, + 0x7c, 0x01, 0x7c, 0xf6, 0x14, 0x74, 0x02, 0x1d, 0x40, 0xae, 0x94, 0x2f, + 0x80, 0x37, 0x2a, 0x50, 0x67, 0xe0, 0xb9, 0x06, 0xdc, 0x4f, 0x40, 0x5e, + 0x29, 0x1a, 0x00, 0x41, 0x90, 0xab, 0x03, 0xa8, 0x02, 0xb0, 0xfd, 0x2f, + 0x00, 0xa6, 0x7e, 0x47, 0xa0, 0xce, 0x40, 0xee, 0xa6, 0x01, 0xb9, 0xcb, + 0x04, 0x38, 0x02, 0x43, 0x20, 0x7f, 0xb7, 0x1b, 0x56, 0x19, 0x38, 0x7d, + 0x00, 0xec, 0xff, 0xbc, 0x8a, 0x10, 0xd2, 0x01, 0xaf, 0x16, 0x05, 0x6b, + 0x10, 0xfc, 0x43, 0x07, 0xdc, 0x09, 0xe0, 0xc7, 0x29, 0x28, 0x43, 0x50, + 0x00, 0x60, 0x80, 0xef, 0xb9, 0x9b, 0x10, 0x0e, 0x81, 0x40, 0x70, 0x04, + 0x4a, 0x0e, 0xa0, 0x01, 0x58, 0x84, 0x55, 0x00, 0xda, 0x3f, 0x37, 0x66, + 0x78, 0x0f, 0x80, 0x01, 0x58, 0x06, 0xf8, 0xde, 0xb7, 0x00, 0xcc, 0xc3, + 0xaa, 0x60, 0x1f, 0x01, 0x35, 0xd0, 0x3d, 0xa8, 0x0b, 0xe0, 0xdc, 0xcb, + 0x0c, 0xcb, 0x10, 0x9c, 0x87, 0x03, 0xf0, 0xb6, 0x05, 0x10, 0x42, 0x09, + 0x14, 0x15, 0xd4, 0x06, 0x9b, 0x06, 0x52, 0x3f, 0x02, 0x48, 0x03, 0x7c, + 0x9e, 0x0d, 0xc1, 0xa9, 0x03, 0xc0, 0xff, 0x7f, 0x01, 0xbc, 0x9f, 0x47, + 0x01, 0x17, 0xe2, 0x5c, 0x2e, 0xc3, 0xcf, 0x43, 0xc0, 0x47, 0x00, 0xf4, + 0x40, 0x1b, 0x82, 0x53, 0x1b, 0x60, 0x04, 0x70, 0xca, 0x57, 0x08, 0x7a, + 0x14, 0x08, 0xc7, 0xf5, 0x81, 0x90, 0x11, 0x40, 0x02, 0xf2, 0x7b, 0x11, + 0x2d, 0x04, 0x94, 0xf1, 0xcf, 0x63, 0x7a, 0x80, 0x16, 0xe8, 0x00, 0xd6, + 0x0a, 0xbc, 0xcb, 0x2f, 0x00, 0x20, 0x40, 0x07, 0xe0, 0x83, 0xb6, 0x40, + 0x6e, 0x3a, 0x60, 0xd5, 0x5f, 0x01, 0xac, 0xc7, 0x1a, 0x82, 0x0a, 0x40, + 0x05, 0xdc, 0x02, 0x68, 0x0b, 0x0c, 0x00, 0x09, 0x28, 0x02, 0xaf, 0xcc, + 0x14, 0xeb, 0xa0, 0xcb, 0x60, 0x3a, 0x36, 0xad, 0xeb, 0x51, 0xd8, 0xad, + 0xfe, 0xe5, 0xb1, 0x85, 0x50, 0x1d, 0x14, 0x80, 0x03, 0xb0, 0xea, 0x97, + 0x81, 0x00, 0xba, 0x08, 0xd8, 0x01, 0xe4, 0x80, 0xdc, 0x4d, 0x02, 0x3a, + 0x80, 0x3c, 0x16, 0x81, 0x36, 0x04, 0xe7, 0x56, 0x01, 0x53, 0xb6, 0x0c, + 0xb0, 0x02, 0x0f, 0xc7, 0xae, 0x93, 0x40, 0x89, 0xc2, 0xd7, 0x29, 0xc0, + 0x83, 0x30, 0x0d, 0xc0, 0xea, 0x83, 0x04, 0x1d, 0x04, 0x40, 0x57, 0x40, + 0x8a, 0x57, 0x09, 0xf3, 0x1c, 0x02, 0x24, 0x01, 0x82, 0x00, 0x36, 0x48, + 0x0c, 0xa0, 0x01, 0x76, 0xfd, 0x18, 0x40, 0x6e, 0x20, 0x14, 0x1d, 0x2c, + 0x00, 0xe6, 0x0c, 0x28, 0x45, 0xcb, 0x40, 0x00, 0x35, 0x0e, 0x97, 0x28, + 0x58, 0x82, 0x60, 0x89, 0xc1, 0x02, 0xa0, 0xfa, 0xfc, 0xe7, 0x9c, 0x0f, + 0x15, 0x00, 0x34, 0x80, 0x02, 0xb0, 0x28, 0xe4, 0x1e, 0x00, 0x10, 0xe0, + 0x70, 0x38, 0x5c, 0xab, 0x0b, 0x8c, 0x09, 0x72, 0x1c, 0x4c, 0xfd, 0x03, + 0x20, 0x37, 0xb5, 0x23, 0x03, 0x57, 0x2d, 0x70, 0x6a, 0x03, 0x5c, 0xd7, + 0xdf, 0xcc, 0xd0, 0x16, 0x30, 0x0c, 0x8f, 0x08, 0x28, 0x01, 0x06, 0x61, + 0x1b, 0xa0, 0x18, 0xe0, 0x35, 0x81, 0xd6, 0x02, 0xe7, 0xb6, 0x01, 0xfe, + 0xd6, 0x5c, 0xbd, 0xa0, 0xb4, 0x00, 0x33, 0x50, 0x92, 0x20, 0x13, 0x50, + 0x1a, 0xa0, 0xea, 0xff, 0xfc, 0x60, 0x0b, 0x08, 0xa0, 0x37, 0xc0, 0xaa, + 0x1f, 0x06, 0xbd, 0x05, 0xcc, 0x82, 0x6e, 0x43, 0xee, 0x42, 0xe6, 0xc0, + 0xdb, 0x06, 0xc8, 0x03, 0x02, 0xb7, 0x2d, 0x70, 0x7a, 0x03, 0x4c, 0xe9, + 0x45, 0x08, 0x24, 0xc0, 0x0c, 0x70, 0x2a, 0xa8, 0x08, 0x7a, 0x22, 0xe8, + 0x04, 0x50, 0x7f, 0x19, 0xff, 0x79, 0xd4, 0x16, 0x38, 0x37, 0x0d, 0x00, + 0x81, 0xd5, 0x00, 0xbd, 0x05, 0xf0, 0x81, 0x10, 0x28, 0x23, 0x90, 0xfa, + 0xf1, 0x80, 0xda, 0x00, 0xbb, 0x05, 0xa8, 0x9f, 0x16, 0xe8, 0x00, 0x76, + 0x03, 0xa4, 0x60, 0x06, 0xa1, 0x0c, 0x01, 0x22, 0xa0, 0x06, 0x98, 0x03, + 0x9a, 0x0b, 0x0a, 0xa0, 0x0f, 0xc0, 0xbc, 0xf2, 0xde, 0x2d, 0x20, 0x80, + 0xde, 0x00, 0x9b, 0x40, 0x71, 0x82, 0x3c, 0xcf, 0xab, 0x02, 0x30, 0x0a, + 0x12, 0x04, 0x1b, 0x80, 0x3c, 0x89, 0x00, 0x36, 0xff, 0xbc, 0x7b, 0x0b, + 0x1c, 0x1a, 0x00, 0x05, 0x5c, 0xc5, 0x17, 0x19, 0xf8, 0xbe, 0xe3, 0x1d, + 0x45, 0x05, 0xab, 0x06, 0x74, 0x0d, 0x4c, 0x21, 0x29, 0x1f, 0x01, 0xb0, + 0xf9, 0x73, 0x0f, 0x01, 0x5b, 0xe0, 0xb8, 0x06, 0xbe, 0xce, 0x5f, 0x0b, + 0x84, 0x40, 0x49, 0x03, 0xb9, 0x04, 0x90, 0x24, 0x14, 0x05, 0x20, 0x09, + 0x91, 0x83, 0xf2, 0x48, 0x0e, 0x02, 0x40, 0xae, 0x92, 0x00, 0xa8, 0xff, + 0x5f, 0x00, 0x5f, 0x4d, 0x65, 0x29, 0x04, 0x40, 0x1a, 0x60, 0x00, 0xd8, + 0x06, 0x79, 0x15, 0x02, 0x27, 0xeb, 0xc0, 0x02, 0x10, 0x02, 0x02, 0x70, + 0x15, 0x58, 0x00, 0xe6, 0x73, 0x40, 0xa9, 0x5f, 0xf9, 0xcb, 0x1d, 0x00, + 0xd3, 0x02, 0x02, 0xd0, 0x03, 0xf3, 0x7b, 0x00, 0xa9, 0xbb, 0x0c, 0x02, + 0x04, 0x3a, 0x00, 0xa2, 0x60, 0xd6, 0x61, 0x82, 0x60, 0x07, 0x40, 0xfd, + 0xa5, 0xf9, 0xf3, 0xca, 0xef, 0x0d, 0xe0, 0x84, 0x01, 0x80, 0x04, 0xbe, + 0xce, 0x12, 0x00, 0x21, 0x48, 0x20, 0x0f, 0x36, 0xe2, 0x0a, 0x20, 0x2e, + 0xd0, 0x01, 0x78, 0x16, 0x62, 0x08, 0x2c, 0xff, 0xf3, 0x73, 0xe7, 0x43, + 0x09, 0x2d, 0x00, 0x80, 0x59, 0x83, 0x57, 0xe9, 0x95, 0x00, 0xc7, 0x02, + 0x24, 0x81, 0x0d, 0xe0, 0xc7, 0x24, 0xb8, 0x01, 0x90, 0x02, 0x38, 0x08, + 0xe8, 0xf5, 0xaf, 0x57, 0xd6, 0x62, 0x01, 0x28, 0x81, 0x73, 0x10, 0x5e, + 0x09, 0x10, 0x06, 0x54, 0xc1, 0xff, 0x0b, 0x80, 0x1a, 0x48, 0x04, 0xe8, + 0xf5, 0xcf, 0x21, 0x39, 0x32, 0x78, 0xae, 0x25, 0x70, 0x03, 0x78, 0x42, + 0x20, 0x0f, 0x44, 0x00, 0x1b, 0x70, 0x1d, 0x9c, 0x18, 0x80, 0x09, 0x20, + 0x01, 0x8c, 0x40, 0xad, 0x7f, 0x01, 0x50, 0x06, 0x01, 0x70, 0x22, 0x81, + 0xe7, 0x5b, 0x54, 0x27, 0xc0, 0x5e, 0x18, 0x06, 0x84, 0x41, 0x82, 0x40, + 0xd1, 0x00, 0x62, 0x00, 0x31, 0x90, 0x2d, 0x20, 0x8f, 0x52, 0x7f, 0x7a, + 0xe1, 0xab, 0x83, 0xa6, 0xc1, 0x43, 0x03, 0xa0, 0x00, 0x0c, 0xc2, 0x78, + 0x61, 0xda, 0xa0, 0xce, 0x80, 0x61, 0xb8, 0xb8, 0x80, 0x41, 0xf8, 0x66, + 0x02, 0x42, 0x20, 0x4d, 0x60, 0xf3, 0xa3, 0x02, 0x21, 0xbc, 0x01, 0x38, + 0x01, 0x01, 0x40, 0x0b, 0x28, 0x83, 0x38, 0x21, 0x3e, 0x00, 0x80, 0x92, + 0x03, 0x00, 0x80, 0x07, 0xe0, 0x81, 0x48, 0x20, 0x7f, 0x03, 0xc0, 0x19, + 0x08, 0x00, 0x26, 0x20, 0x21, 0x68, 0x00, 0xa8, 0x87, 0x12, 0x18, 0x23, + 0x38, 0xaf, 0x6d, 0x03, 0x1c, 0x0a, 0x25, 0x0a, 0x6f, 0x00, 0x89, 0xc2, + 0x21, 0xe0, 0x61, 0x48, 0xb2, 0xcc, 0x58, 0x80, 0xf5, 0xab, 0x7c, 0xf3, + 0x48, 0x18, 0x72, 0x06, 0xce, 0xb5, 0x07, 0xa4, 0x4e, 0x1e, 0x4d, 0x06, + 0x54, 0x41, 0x6d, 0x60, 0x54, 0xd0, 0x5d, 0x60, 0x34, 0x10, 0x13, 0x50, + 0x03, 0xef, 0x05, 0x00, 0x00, 0x1f, 0x7d, 0x00, 0x00, 0x07, 0x0f, 0xb4, + 0x05, 0x5c, 0x0a, 0x88, 0x02, 0x97, 0x49, 0x20, 0x97, 0xdb, 0x90, 0xbb, + 0x50, 0x2e, 0x53, 0x00, 0x21, 0xc0, 0x15, 0xc0, 0x06, 0xc8, 0xd3, 0x19, + 0x10, 0xc0, 0x9a, 0x00, 0x00, 0x30, 0x04, 0x8a, 0x00, 0x22, 0xc8, 0x08, + 0xf8, 0x61, 0xc0, 0xcf, 0x02, 0x8c, 0x40, 0x6e, 0x1b, 0xa0, 0x0c, 0x00, + 0x00, 0x66, 0x06, 0x04, 0x30, 0x12, 0xf0, 0xda, 0x13, 0xb0, 0x9f, 0xb6, + 0x80, 0x4e, 0x38, 0x17, 0x61, 0xb8, 0x1c, 0x09, 0x79, 0x20, 0x44, 0x10, + 0xde, 0x97, 0x5b, 0xd0, 0xd5, 0xf4, 0xaf, 0xe7, 0xa4, 0xc1, 0x25, 0x02, + 0x07, 0x13, 0xa4, 0x01, 0x16, 0x80, 0xda, 0x02, 0x79, 0x74, 0x1b, 0xe8, + 0x23, 0xd0, 0x4d, 0x20, 0xc5, 0xf7, 0x06, 0xd8, 0x00, 0x6c, 0x81, 0xcc, + 0x80, 0x00, 0x66, 0x0f, 0x4a, 0x89, 0x02, 0xe8, 0x2a, 0xe0, 0x46, 0x88, + 0x0d, 0x70, 0x26, 0xb6, 0x5a, 0x20, 0xb7, 0x26, 0xe0, 0x26, 0xd8, 0x14, + 0x00, 0x00, 0x79, 0x65, 0x23, 0x12, 0x00, 0x26, 0x48, 0xfd, 0x02, 0xd0, + 0x08, 0x52, 0xbf, 0x2a, 0x68, 0x07, 0x78, 0x24, 0x86, 0x04, 0x14, 0x0d, + 0xcc, 0x53, 0x0b, 0x00, 0x00, 0x04, 0x34, 0xc2, 0x0d, 0x20, 0x26, 0xf8, + 0xad, 0x8a, 0xfa, 0x01, 0x50, 0x64, 0xb0, 0xf8, 0x60, 0x08, 0x20, 0x82, + 0xa9, 0xbf, 0xb9, 0x60, 0x91, 0x40, 0x00, 0x40, 0x20, 0x61, 0x31, 0x47, + 0x4c, 0x02, 0xd0, 0x04, 0x53, 0x6c, 0xde, 0x1d, 0x40, 0x4f, 0x02, 0xb9, + 0x1f, 0x75, 0x00, 0x41, 0xb8, 0xa6, 0x80, 0x0e, 0x20, 0xaf, 0xbc, 0x31, + 0xc2, 0x01, 0xa0, 0x04, 0xa4, 0x5e, 0xea, 0x6f, 0x00, 0xf0, 0x01, 0x46, + 0xe0, 0x95, 0x20, 0x54, 0x35, 0xe0, 0xfb, 0xf8, 0xc3, 0x08, 0xe0, 0x01, + 0x05, 0x00, 0x04, 0xf2, 0x83, 0x22, 0x00, 0x80, 0x0c, 0x2f, 0xe5, 0x33, + 0x06, 0xb9, 0xd7, 0x4a, 0x74, 0xbb, 0x0f, 0xe1, 0x83, 0xae, 0xc3, 0x61, + 0x70, 0xbf, 0x09, 0xa5, 0x74, 0x32, 0xe0, 0x22, 0x00, 0x82, 0x8b, 0x24, + 0x70, 0x4c, 0x01, 0x23, 0x01, 0x9b, 0x43, 0xd1, 0x41, 0xbf, 0x11, 0x1d, + 0x5b, 0xc0, 0x24, 0xd4, 0x76, 0x21, 0x77, 0x61, 0xbf, 0x07, 0x15, 0x05, + 0xdc, 0x95, 0x8f, 0x08, 0x90, 0x04, 0x8e, 0x29, 0x00, 0x09, 0x6c, 0x53, + 0x30, 0x7f, 0x3c, 0x13, 0x98, 0x33, 0x11, 0xb3, 0x30, 0xcb, 0x50, 0xfe, + 0xe4, 0xe2, 0x34, 0xc4, 0xb3, 0x80, 0xf9, 0x53, 0xfa, 0x1f, 0x19, 0x24, + 0x09, 0x1c, 0x35, 0xf0, 0xbd, 0x47, 0xc0, 0x2e, 0x98, 0xbf, 0x00, 0xc8, + 0x63, 0x00, 0xf8, 0x5b, 0x12, 0xaa, 0xe0, 0xd2, 0x40, 0x7f, 0x37, 0x62, + 0x01, 0x48, 0x0b, 0x08, 0x00, 0x02, 0xeb, 0x87, 0xfc, 0x98, 0x30, 0x58, + 0x00, 0xbc, 0xce, 0x7b, 0x3a, 0x80, 0x2e, 0xa0, 0xfe, 0x66, 0x84, 0xfa, + 0xa0, 0x59, 0xb8, 0x26, 0x61, 0x5c, 0xb0, 0x9b, 0xe0, 0xfc, 0xcd, 0x0b, + 0x06, 0xf3, 0x1b, 0x33, 0x97, 0x00, 0x30, 0x41, 0x39, 0xe4, 0x6d, 0x1e, + 0x26, 0x0d, 0x13, 0x86, 0x89, 0x82, 0x00, 0x20, 0x08, 0x2e, 0x09, 0xb0, + 0x01, 0x4c, 0xc1, 0xca, 0x9f, 0x33, 0x80, 0x0a, 0x1e, 0x35, 0x30, 0xd5, + 0x59, 0xbc, 0x4e, 0xe0, 0x46, 0xa4, 0x0a, 0x0a, 0xa0, 0x88, 0xa0, 0x00, + 0xd4, 0x40, 0xf7, 0x20, 0x1d, 0x40, 0x08, 0x61, 0x84, 0x0a, 0x9e, 0x9d, + 0x03, 0xbf, 0x17, 0xa5, 0xd3, 0x04, 0x6d, 0x06, 0x0c, 0xc3, 0xbf, 0x07, + 0x40, 0x10, 0xee, 0x13, 0x90, 0x37, 0x18, 0xe2, 0x83, 0x2b, 0x0b, 0x1e, + 0x4d, 0x60, 0x6a, 0x2d, 0x3a, 0xd8, 0x8c, 0xd0, 0x7d, 0x28, 0xf7, 0x7f, + 0x01, 0x90, 0x9b, 0x18, 0xd8, 0x4d, 0x50, 0x05, 0xdc, 0x20, 0xb4, 0x81, + 0xa3, 0x09, 0xd8, 0x01, 0xca, 0xe0, 0xd4, 0xdf, 0x17, 0x42, 0xfe, 0x1d, + 0x2d, 0xeb, 0x20, 0xcb, 0xa0, 0xff, 0x5a, 0xb6, 0xaf, 0x82, 0xb9, 0x8d, + 0xc0, 0x76, 0x00, 0x36, 0x00, 0x80, 0xd7, 0x41, 0x02, 0x40, 0x61, 0x16, + 0x82, 0x80, 0x0b, 0x71, 0x08, 0x3c, 0x74, 0x81, 0xd4, 0xef, 0x32, 0x6c, + 0xfd, 0xa4, 0x20, 0xca, 0x46, 0x04, 0xb6, 0x0d, 0x1c, 0x83, 0xb0, 0x55, + 0x17, 0x27, 0xbc, 0x55, 0x41, 0x92, 0x60, 0x07, 0x40, 0x12, 0xbc, 0xd3, + 0xc0, 0xea, 0x81, 0xb2, 0x20, 0x0c, 0x0b, 0x80, 0xb2, 0x89, 0x45, 0x79, + 0x60, 0x84, 0x8c, 0x40, 0xcd, 0xc2, 0x49, 0x42, 0x7c, 0x1a, 0x34, 0x09, + 0x2b, 0x01, 0x98, 0xa0, 0x1d, 0x00, 0x07, 0x7c, 0x10, 0x00, 0xaf, 0xc3, + 0x2a, 0x08, 0x86, 0x22, 0x02, 0x20, 0xa8, 0x67, 0x42, 0x17, 0x51, 0xb8, + 0x9e, 0x07, 0x51, 0xbe, 0x12, 0xa0, 0x07, 0xd8, 0x06, 0xe3, 0x83, 0x1b, + 0xc0, 0xc4, 0x80, 0x77, 0x46, 0xa0, 0x0a, 0xa1, 0x1d, 0xc0, 0xd9, 0xf8, + 0x71, 0x1f, 0xdc, 0xfb, 0xf0, 0x10, 0x48, 0xfd, 0xd7, 0xdb, 0x70, 0xee, + 0xfd, 0x4d, 0xa4, 0x74, 0x40, 0x11, 0xc0, 0x8c, 0xc0, 0x67, 0x07, 0x81, + 0x43, 0x0c, 0x98, 0x8a, 0x25, 0xd1, 0x64, 0x50, 0x23, 0x4c, 0xfd, 0xbb, + 0x01, 0xfa, 0x2e, 0xe0, 0xa1, 0x78, 0x6e, 0x4d, 0xb0, 0x4a, 0xe0, 0xd4, + 0xed, 0x08, 0xec, 0x20, 0x10, 0x00, 0xf9, 0x28, 0xc4, 0x61, 0x80, 0x10, + 0xfa, 0x0c, 0xf8, 0x7d, 0x4c, 0x17, 0xa8, 0x39, 0x40, 0x17, 0xf0, 0xab, + 0x58, 0x9f, 0x00, 0x8b, 0xe7, 0x48, 0x20, 0x9f, 0x87, 0x16, 0x80, 0xef, + 0x65, 0x03, 0x6c, 0x12, 0x25, 0x0a, 0x05, 0x01, 0x1a, 0xf0, 0xfb, 0x0e, + 0x50, 0x03, 0x52, 0x7e, 0x8f, 0x41, 0xb9, 0x4c, 0x85, 0x93, 0x84, 0x02, + 0xa0, 0xe4, 0xa0, 0xe2, 0x03, 0x35, 0x0c, 0x33, 0x03, 0xee, 0xc3, 0x76, + 0x80, 0xdb, 0x30, 0x13, 0xd0, 0x83, 0x70, 0xf1, 0x80, 0x92, 0x84, 0x0a, + 0x80, 0xa6, 0x02, 0x10, 0x70, 0x1f, 0xf4, 0xdb, 0xc8, 0xce, 0xc2, 0xb9, + 0x67, 0x19, 0x4c, 0xf9, 0xed, 0xab, 0x88, 0xbb, 0x20, 0x31, 0xa0, 0x14, + 0xff, 0x08, 0xc0, 0x5b, 0x02, 0x3d, 0x0a, 0xf5, 0x28, 0x68, 0x12, 0xba, + 0x0f, 0x42, 0xe6, 0xa0, 0x1e, 0x04, 0x7b, 0x0c, 0xa2, 0xfe, 0x0f, 0x00, + 0x48, 0xc2, 0x0d, 0xc1, 0x22, 0x90, 0x1b, 0x17, 0x28, 0x9f, 0x07, 0xef, + 0x45, 0xb0, 0x7c, 0x18, 0xd4, 0x05, 0x72, 0xaf, 0xfa, 0x5b, 0xf9, 0x66, + 0xe1, 0xe3, 0x79, 0x90, 0xea, 0x27, 0x82, 0x7b, 0x0d, 0xd0, 0x05, 0x0c, + 0x42, 0x93, 0x04, 0x09, 0x42, 0xba, 0xc0, 0xbd, 0x06, 0x58, 0xbe, 0x5a, + 0xc8, 0x99, 0x90, 0x00, 0x2c, 0xf6, 0x19, 0x80, 0xfd, 0x79, 0x2c, 0x3e, + 0x58, 0x34, 0x00, 0x17, 0x68, 0x1a, 0xf0, 0x7d, 0xae, 0xcf, 0x62, 0x0d, + 0x40, 0x71, 0x81, 0x0e, 0xe0, 0x7b, 0x75, 0x07, 0xf0, 0x58, 0x0c, 0x1f, + 0xcc, 0xf3, 0x08, 0x80, 0x73, 0x71, 0x4e, 0xc5, 0xcb, 0xa1, 0xb8, 0xbb, + 0x50, 0x10, 0x70, 0x1c, 0x56, 0x9c, 0x60, 0x7d, 0x22, 0xfe, 0x87, 0xbd, + 0x3b, 0xba, 0x81, 0x30, 0x84, 0x61, 0x18, 0xbc, 0xff, 0xd6, 0x4c, 0x60, + 0x21, 0xf5, 0x35, 0xdf, 0x0a, 0x48, 0x77, 0x3f, 0xb4, 0x89, 0xfd, 0x3f, + 0x80, 0x1e, 0x0d, 0xe5, 0x73, 0x30, 0x06, 0xe3, 0x87, 0x03, 0xa8, 0xa1, + 0x78, 0x3c, 0x06, 0x63, 0x10, 0x14, 0x07, 0xe0, 0x00, 0xfc, 0x04, 0xfc, + 0x09, 0xfa, 0x0c, 0xba, 0x08, 0xb9, 0x0a, 0x7b, 0x0c, 0x79, 0x0e, 0x1b, + 0x88, 0x18, 0x89, 0x19, 0x8a, 0x1a, 0x8b, 0x8f, 0x2e, 0x46, 0xac, 0xc6, + 0x2c, 0x47, 0xad, 0xc7, 0x05, 0x24, 0x44, 0x64, 0x84, 0xa4, 0xc4, 0xe4, + 0x04, 0x25, 0x45, 0x65, 0x85, 0xa5, 0xc5, 0xe5, 0x15, 0x26, 0x54, 0x66, + 0x94, 0xa6, 0xd4, 0xe6, 0x14, 0x27, 0x55, 0x67, 0x95, 0xa7, 0xf7, 0xea, + 0xf3, 0x00, 0x0a, 0x10, 0x1a, 0x20, 0x2a, 0x30, 0x3a, 0x40, 0x4a, 0x50, + 0x5a, 0x60, 0x6a, 0x70, 0x7a, 0x80, 0x8a, 0x90, 0x9a, 0xa0, 0xaa, 0xb0, + 0xba, 0xc0, 0xca, 0xd0, 0xda, 0xe0, 0xea, 0xf0, 0xfa, 0x04, 0x0b, 0x14, + 0x1b, 0x24, 0x2b, 0x34, 0x3b, 0x44, 0x4b, 0xd3, 0xaa, 0x2d, 0xb2, 0x35, + 0xba, 0x3d, 0xc2, 0x45, 0xca, 0x4d, 0xd2, 0x55, 0xda, 0x5d, 0xe2, 0x65, + 0xea, 0x6d, 0xf2, 0x75, 0xfa, 0xfd, 0xd7, 0x9e, 0x1d, 0xe8, 0x26, 0xb2, + 0x03, 0x41, 0x14, 0xf5, 0xfc, 0xff, 0x47, 0xb3, 0x92, 0x66, 0x1b, 0x2a, + 0x3a, 0x56, 0x7b, 0x14, 0x6b, 0x04, 0x48, 0xd9, 0x85, 0x09, 0x49, 0xde, + 0x5b, 0x74, 0x2f, 0x76, 0x55, 0x1b, 0xc6, 0x31, 0x62, 0x13, 0xc4, 0x12, + 0x98, 0x17, 0x40, 0x76, 0x20, 0x11, 0x40, 0x09, 0x34, 0x35, 0x68, 0x0d, + 0x18, 0x02, 0xd9, 0x84, 0xd3, 0x2a, 0x78, 0x69, 0xc8, 0x0d, 0x70, 0x49, + 0x00, 0x39, 0x98, 0x41, 0xb8, 0xcc, 0x3f, 0xf9, 0x1d, 0x84, 0x3d, 0x0b, + 0x0d, 0x4f, 0x43, 0x0e, 0xc3, 0x1a, 0x58, 0x27, 0x61, 0x04, 0x60, 0x26, + 0xa0, 0xa0, 0x8d, 0x81, 0x5c, 0x03, 0xab, 0xed, 0x4f, 0x04, 0xb8, 0x02, + 0x1c, 0x04, 0x97, 0xa3, 0xe0, 0x8b, 0xdf, 0x10, 0x58, 0x04, 0x41, 0xbe, + 0xfe, 0xf2, 0x23, 0x60, 0xbd, 0x09, 0x8a, 0xdc, 0xed, 0xdf, 0x8f, 0xc1, + 0x7e, 0x28, 0xd2, 0xcd, 0x01, 0x7e, 0x38, 0xd2, 0x8f, 0xc3, 0x04, 0x41, + 0x7d, 0x61, 0x03, 0x5c, 0x12, 0xe0, 0x26, 0x38, 0x31, 0x6a, 0x0d, 0xb0, + 0xfd, 0xc1, 0x6f, 0x22, 0xd0, 0x16, 0x74, 0x0b, 0xb8, 0x04, 0x8c, 0x41, + 0x14, 0x10, 0x04, 0xf5, 0xfa, 0x9f, 0xea, 0x9a, 0x0d, 0x80, 0x00, 0x0c, + 0x64, 0x15, 0x24, 0xbc, 0x01, 0xf8, 0xe2, 0xb7, 0x04, 0xcd, 0xc0, 0xf9, + 0x28, 0x4c, 0x0a, 0x5a, 0x84, 0x2f, 0x03, 0x06, 0x61, 0x4a, 0xc8, 0x02, + 0x90, 0xff, 0xb2, 0x80, 0x91, 0x31, 0xa0, 0x80, 0x7e, 0x08, 0x9a, 0x67, + 0x20, 0xfc, 0x61, 0xa0, 0x49, 0xc1, 0x7e, 0x18, 0x52, 0x40, 0x06, 0xc0, + 0x58, 0x0b, 0x58, 0xc6, 0xc0, 0x09, 0x57, 0xec, 0x0a, 0xe8, 0x87, 0x00, + 0xdf, 0x11, 0xb4, 0x06, 0x7d, 0x57, 0x70, 0x3d, 0x0a, 0x20, 0xa0, 0x2e, + 0xa7, 0x24, 0x03, 0xe0, 0xba, 0x00, 0x63, 0xa0, 0x76, 0x41, 0x1f, 0x80, + 0xee, 0x00, 0xb7, 0x40, 0x9f, 0x01, 0x6e, 0x01, 0xf7, 0x40, 0x1f, 0x84, + 0x59, 0x80, 0x7d, 0x00, 0xac, 0x05, 0x50, 0x86, 0x6e, 0xff, 0x4c, 0x80, + 0x7e, 0x07, 0xac, 0x33, 0xe0, 0xfa, 0x1e, 0xc8, 0x14, 0x20, 0x08, 0x28, + 0xc0, 0xdf, 0x09, 0xd0, 0x40, 0xcd, 0x84, 0xb9, 0x16, 0x0e, 0x12, 0xe0, + 0xbc, 0x84, 0x02, 0x0c, 0x34, 0x73, 0x00, 0xfc, 0x81, 0x7f, 0xf2, 0x93, + 0x02, 0x8f, 0x7c, 0xdd, 0x6b, 0xfe, 0x83, 0x7f, 0x25, 0x60, 0x6d, 0x20, + 0xdb, 0xd0, 0x3f, 0x47, 0xdd, 0xf3, 0x43, 0xe1, 0xa6, 0x04, 0x3c, 0x0d, + 0xf6, 0x35, 0x10, 0x1f, 0x13, 0x17, 0xfe, 0x34, 0x08, 0xb3, 0xff, 0xe4, + 0xbf, 0x2e, 0xc0, 0x18, 0x38, 0x0a, 0x0d, 0x01, 0x9e, 0x02, 0x32, 0x04, + 0xeb, 0x3a, 0xda, 0x41, 0xd0, 0x51, 0xb0, 0x2c, 0xc4, 0x91, 0x70, 0x7a, + 0x22, 0x50, 0x40, 0x69, 0x7a, 0x64, 0x00, 0xec, 0x08, 0x28, 0x03, 0x91, + 0x84, 0x73, 0x7c, 0xf9, 0x0b, 0xbf, 0x1b, 0x04, 0x47, 0x3b, 0x0a, 0x96, + 0x02, 0x0d, 0xcc, 0x14, 0x64, 0xfe, 0x15, 0xff, 0x5a, 0xc0, 0xd2, 0x80, + 0x5d, 0x60, 0xfe, 0xf5, 0xe7, 0xa0, 0x30, 0xb0, 0x6e, 0x81, 0xe4, 0xef, + 0x4f, 0x44, 0x26, 0xa1, 0xf9, 0x2f, 0xff, 0x45, 0x01, 0xc4, 0xc0, 0xf8, + 0x4f, 0x54, 0xd4, 0x04, 0x40, 0xc7, 0xef, 0x51, 0xe8, 0x18, 0x29, 0xe0, + 0xbc, 0x78, 0x1c, 0x6a, 0x0c, 0x10, 0x03, 0xe5, 0xe2, 0xff, 0x7f, 0x3d, + 0x2a, 0x00, 0x36, 0x04, 0x10, 0x84, 0x59, 0x06, 0x4e, 0x40, 0x69, 0xa0, + 0x89, 0x00, 0x16, 0x40, 0x2c, 0x81, 0x3e, 0x04, 0x92, 0xdf, 0x79, 0x28, + 0xe3, 0x9f, 0x00, 0xec, 0xe8, 0xb6, 0x0c, 0x1c, 0xd3, 0x0a, 0x24, 0x02, + 0xc2, 0xc0, 0xb2, 0x06, 0x93, 0x9f, 0x10, 0xb0, 0x0a, 0xeb, 0xda, 0xf3, + 0x6f, 0x09, 0xd0, 0xc0, 0x21, 0xbe, 0x11, 0x98, 0xf8, 0xfd, 0x1c, 0xd4, + 0x4e, 0x42, 0xa5, 0xc0, 0x18, 0x54, 0xc1, 0x43, 0xfe, 0x3d, 0x01, 0x8d, + 0x81, 0xcc, 0xbf, 0x9e, 0xdf, 0x93, 0x40, 0x23, 0x80, 0xd3, 0xc0, 0xca, + 0x40, 0x26, 0xa1, 0xfc, 0xdb, 0x02, 0x1a, 0x03, 0x87, 0x67, 0x80, 0x86, + 0xdf, 0x08, 0x60, 0x0e, 0x30, 0x04, 0x1a, 0x03, 0x9e, 0x09, 0x1e, 0x3d, + 0xff, 0xbe, 0x80, 0x34, 0xf0, 0x14, 0x70, 0xb0, 0x03, 0x8c, 0x40, 0x33, + 0xb0, 0x11, 0x60, 0x0a, 0x1a, 0x83, 0xec, 0x81, 0xc7, 0x53, 0x40, 0xf2, + 0x8f, 0x7d, 0x01, 0x1a, 0xa8, 0x3a, 0x2c, 0x54, 0x02, 0x90, 0x08, 0x34, + 0x03, 0x8d, 0x00, 0x43, 0x20, 0xf8, 0x8d, 0xc1, 0x0c, 0xc2, 0xa0, 0xaf, + 0xfa, 0x83, 0x7f, 0x43, 0x80, 0x06, 0x4e, 0x94, 0x52, 0x10, 0xf8, 0x56, + 0xc0, 0xf5, 0x0c, 0xbc, 0x96, 0x82, 0x14, 0x41, 0x28, 0x28, 0xfc, 0xf3, + 0x7f, 0x83, 0x7f, 0x57, 0x80, 0x06, 0x42, 0x41, 0xf0, 0xaf, 0xa7, 0x20, + 0xcf, 0x42, 0x9e, 0x86, 0xfa, 0x59, 0xc8, 0x20, 0x0c, 0x7c, 0xf9, 0xf7, + 0x05, 0x68, 0x60, 0x54, 0x0e, 0x84, 0x82, 0x65, 0x05, 0x58, 0x02, 0x0a, + 0xa0, 0x06, 0x96, 0x45, 0xf0, 0xc2, 0x8f, 0xd3, 0xaf, 0xfc, 0xfb, 0x02, + 0x3c, 0x17, 0xfc, 0x54, 0x20, 0xbf, 0x63, 0xa0, 0x19, 0x98, 0x6f, 0x8b, + 0x4f, 0x53, 0x90, 0x61, 0x50, 0x03, 0x3f, 0xf1, 0x9d, 0xff, 0xf7, 0x05, + 0x68, 0xa0, 0x04, 0x44, 0x23, 0x96, 0x81, 0x52, 0xe2, 0x18, 0xf8, 0x3b, + 0x01, 0x0c, 0x83, 0x85, 0x5b, 0xfc, 0xd1, 0x7d, 0x25, 0x00, 0xfe, 0x4d, + 0x01, 0x1a, 0x20, 0x09, 0xe4, 0x77, 0x0c, 0x54, 0x00, 0xc7, 0x61, 0x05, + 0x38, 0x0c, 0x6a, 0x80, 0xdd, 0x2f, 0xff, 0xbe, 0x00, 0x0d, 0xb8, 0x0f, + 0xa6, 0x15, 0xa8, 0x81, 0x4b, 0x02, 0xe4, 0x9f, 0x56, 0xa1, 0xab, 0xbf, + 0xf8, 0xef, 0x11, 0x60, 0x14, 0xe2, 0x80, 0x08, 0xdc, 0x10, 0xd0, 0xc6, + 0x20, 0xf4, 0xc6, 0xdf, 0x4d, 0x02, 0xca, 0x40, 0x11, 0x95, 0x00, 0xf8, + 0xeb, 0x37, 0x63, 0xde, 0x82, 0x53, 0x01, 0xf3, 0x1e, 0x1c, 0x85, 0x89, + 0x81, 0x12, 0x50, 0xbe, 0x8a, 0xff, 0x0e, 0x01, 0x1a, 0x70, 0x15, 0x50, + 0x01, 0xc5, 0x5e, 0x97, 0x71, 0x4d, 0x40, 0xf6, 0x60, 0x59, 0xa0, 0x08, + 0x7c, 0xf5, 0xe5, 0xbf, 0x4b, 0x40, 0x15, 0x79, 0xae, 0x82, 0x02, 0xb7, + 0x02, 0xb2, 0x04, 0xae, 0x0b, 0x48, 0x7e, 0x8a, 0xe0, 0x07, 0x7f, 0xc9, + 0x1a, 0x6e, 0xff, 0xbb, 0x04, 0xb8, 0x08, 0x46, 0xf1, 0xae, 0x23, 0xd0, + 0xf7, 0x44, 0x7d, 0x57, 0x74, 0x19, 0x83, 0xf5, 0xed, 0xf0, 0xe5, 0xbf, + 0x53, 0x80, 0x06, 0xd8, 0x08, 0x36, 0xa0, 0x2d, 0xb8, 0x10, 0x60, 0x0f, + 0xda, 0x85, 0x2e, 0x7e, 0xf9, 0xef, 0x14, 0xe0, 0x22, 0x18, 0x38, 0xd0, + 0xc0, 0x98, 0x8f, 0x01, 0xf3, 0x41, 0x60, 0xc6, 0x0f, 0xfd, 0xf0, 0xe5, + 0xbf, 0x57, 0x80, 0x06, 0x70, 0x80, 0x85, 0xb1, 0x6a, 0xc1, 0x65, 0x0f, + 0x0e, 0xd8, 0xa1, 0x97, 0x7f, 0x5f, 0xc0, 0xbe, 0x02, 0x23, 0xf0, 0xba, + 0x00, 0xa7, 0xe1, 0x25, 0xfe, 0x1b, 0x04, 0x14, 0x48, 0xd1, 0x9d, 0xac, + 0x9a, 0x18, 0x1b, 0x02, 0x86, 0xdc, 0x85, 0x1e, 0x93, 0x8f, 0xfc, 0xb7, + 0x0b, 0x70, 0x11, 0x84, 0x82, 0x51, 0xe4, 0x94, 0xc0, 0x65, 0x01, 0xc9, + 0x9f, 0x5f, 0x03, 0x9f, 0x97, 0xff, 0x2d, 0x02, 0x0a, 0xa7, 0x14, 0x14, + 0x2d, 0x17, 0xc7, 0x00, 0x3f, 0x19, 0x9a, 0xf5, 0x20, 0x97, 0xc0, 0x2f, + 0x65, 0xef, 0x14, 0xa0, 0x82, 0x17, 0x6e, 0xde, 0x7f, 0x27, 0x60, 0x3c, + 0xa1, 0xe3, 0x5b, 0xf0, 0xdf, 0x2a, 0x40, 0x05, 0xe3, 0x48, 0x0f, 0x79, + 0x9b, 0x8f, 0x01, 0x0e, 0x02, 0x85, 0x98, 0xb7, 0xf8, 0x09, 0xf8, 0xef, + 0x17, 0x30, 0x8e, 0x91, 0x0a, 0x0a, 0x35, 0xb9, 0x8d, 0x00, 0x3e, 0x1b, + 0x24, 0x04, 0xf2, 0x52, 0x5f, 0x13, 0x1f, 0xfe, 0x37, 0x09, 0x50, 0xc1, + 0x93, 0x96, 0x07, 0x17, 0x05, 0x3c, 0x0d, 0xf0, 0x00, 0xfc, 0xb7, 0x0b, + 0x50, 0xc1, 0x38, 0x9a, 0xbf, 0xf2, 0x6b, 0x20, 0xa3, 0xc0, 0xbf, 0xe0, + 0x7f, 0x86, 0x00, 0x15, 0x04, 0x35, 0xf8, 0x3c, 0x6f, 0x39, 0x40, 0x41, + 0x90, 0x83, 0xff, 0x19, 0x02, 0x54, 0x50, 0x1a, 0xe2, 0x92, 0x5e, 0x88, + 0x40, 0x46, 0x81, 0x22, 0x2d, 0xf0, 0xbc, 0x80, 0xff, 0x59, 0x02, 0x92, + 0x3f, 0x6e, 0xf9, 0xb0, 0xee, 0xb6, 0x40, 0xf2, 0x85, 0x81, 0xb8, 0x41, + 0xff, 0x81, 0x02, 0xa2, 0xe1, 0x55, 0xe1, 0x00, 0x50, 0x6f, 0x88, 0x30, + 0x0e, 0x88, 0x1d, 0xbf, 0xfe, 0x4c, 0x01, 0x2a, 0x48, 0x07, 0xdc, 0x6d, + 0x81, 0xa0, 0x8f, 0x7b, 0x3c, 0xac, 0xcb, 0x07, 0x0b, 0xd0, 0x01, 0xe4, + 0x2c, 0xff, 0xc1, 0x36, 0xc0, 0x41, 0x5c, 0x3e, 0x5a, 0x00, 0xff, 0x32, + 0x12, 0x4c, 0x3f, 0x2c, 0x20, 0x21, 0x7f, 0xf6, 0x1d, 0x02, 0x74, 0xc0, + 0xd5, 0x67, 0x65, 0x11, 0x78, 0xfd, 0x46, 0x01, 0x22, 0x67, 0xfa, 0x89, + 0xaf, 0x07, 0xe1, 0xbf, 0x4e, 0xc0, 0x20, 0xf5, 0xe2, 0x91, 0x06, 0xc8, + 0xc4, 0xf1, 0xdd, 0x02, 0x78, 0x22, 0x1e, 0xab, 0xc0, 0xc7, 0x5f, 0x25, + 0x60, 0xff, 0xe9, 0x44, 0xff, 0x7e, 0x01, 0xfd, 0x13, 0x8b, 0xfd, 0x25, + 0x02, 0xbe, 0xff, 0xcf, 0x9f, 0x80, 0x3f, 0x01, 0x7f, 0x02, 0xfe, 0x01, + 0x75, 0xe2, 0x8b, 0x93, 0x95, 0x3a, 0x44, 0x8f, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; +unsigned int particle_png_len = 5564; diff --git a/tools/hopalong/particle.png b/tools/hopalong/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I;#zN@+#uK~4uy3L@a$4Hhd&N(f@!qR4_$GV}xylU5$X8J%4=r}- zZX>m{;4fG0mEQx?qms=t$3CgwD@Zg@Gu`!0GE?MR-n&lS<&2Sg zL-hBaDundl?2?-rx@Opv|Lb7}!?W%XSZwKljD&A8veA0cg^fp!Q%%XfY&DoJC2aIQ zsTkRgo*@(}$pK)DcxrqT7hr;-Or1F#DYWP*-k6I8OYL0L^|)>gTG3K@wOC?ddsq19DR6`Tzg` literal 0 HcmV?d00001 diff --git a/tools/hopalong/vfs.cpp b/tools/hopalong/vfs.cpp new file mode 100644 index 0000000..c54d241 --- /dev/null +++ b/tools/hopalong/vfs.cpp @@ -0,0 +1,133 @@ +#include +#include + +#include "vfs.h" + +struct FILE_VFS +{ + int used; + rw::uint8 *data; + int pos; + int size; +}; +FILE_VFS vfsfiles[64]; +VFS *globalVFS; + +void* +vfs_fopen(const char *path, const char *mode) +{ + int flags = 0; + int i, j; + char *r, *w, *plus; + +// printf("trying to open <%s> mode <%s>\n", path, mode); + const char *file = strrchr((char*)path, '/'); + if(file) + file++; + else + file = path; + for(i = 0; i < nelem(vfsfiles); i++){ + if(!vfsfiles[i].used) + goto found; + } + // no file pointer available + return nil; +found: + + // why can't we pass const char*? urghhh.... + r = strchr((char*)mode, 'r'); + w = strchr((char*)mode, 'w'); + plus = strchr((char*)mode, '+'); + // cannot write files + if(w || plus) + return nil; + + for(j = 0; j < globalVFS->numFiles; j++){ + if(strcmp(globalVFS->files[j].name, file) == 0) + goto found2; + } + // file not found + return nil; +found2: + + vfsfiles[i].used = 1; + vfsfiles[i].data = globalVFS->files[j].data; + vfsfiles[i].pos = 0; + vfsfiles[i].size = globalVFS->files[j].length; + return &vfsfiles[i]; +} + +int +vfs_fclose(void *fp) +{ + FILE_VFS *f = (FILE_VFS*)fp; + if(!f->used) + return EOF; + f->used = 0; + f->data = nil; + return 0; +} + +int +vfs_fseek(void *fp, long offset, int whence) +{ + FILE_VFS *f = (FILE_VFS*)fp; + switch(whence){ + case 0: + f->pos = offset; + break; + case 1: + f->pos += offset; + break; + case 2: + f->pos = f->size - offset; + break; + } + if(f->pos > f->size) f->pos = f->size; + return f->pos; +} + +long +vfs_ftell(void *fp) +{ + FILE_VFS *f = (FILE_VFS*)fp; + return f->pos; +} + +size_t +vfs_fread(void *ptr, size_t size, size_t nmemb, void *fp) +{ + FILE_VFS *f = (FILE_VFS*)fp; + size_t sz = size*nmemb; + if(sz > f->size-f->pos) + sz = f->size-f->pos; + memcpy(ptr, f->data+f->pos, sz); + f->pos += sz; + return sz/size; +} + +size_t +vfs_fwrite(const void *ptr, size_t size, size_t nmemb, void *fp) +{ + return 0; +} + +int +vfs_feof(void *fp) +{ + FILE_VFS *f = (FILE_VFS*)fp; + return f->pos >= f->size; +} + +void +installVFS(VFS *vfs) +{ + globalVFS = vfs; + rw::engine->filefuncs.rwfopen = vfs_fopen; + rw::engine->filefuncs.rwfclose = vfs_fclose; + rw::engine->filefuncs.rwfseek = vfs_fseek; + rw::engine->filefuncs.rwftell = vfs_ftell; + rw::engine->filefuncs.rwfread = vfs_fread; + rw::engine->filefuncs.rwfwrite = vfs_fwrite; + rw::engine->filefuncs.rwfeof = vfs_feof; +} diff --git a/tools/hopalong/vfs.h b/tools/hopalong/vfs.h new file mode 100644 index 0000000..768b193 --- /dev/null +++ b/tools/hopalong/vfs.h @@ -0,0 +1,15 @@ +struct VFS_file +{ + const char *name; + rw::uint8 *data; + rw::uint32 length; +}; + +struct VFS +{ + // TODO: directories? + VFS_file *files; + int numFiles; +}; + +void installVFS(VFS *vfs); diff --git a/tools/playground/main.cpp b/tools/playground/main.cpp index ba396b6..043b3c6 100644 --- a/tools/playground/main.cpp +++ b/tools/playground/main.cpp @@ -302,8 +302,8 @@ InitRW(void) camera->m_aspectRatio = 640.0f/448.0f; // camera->m_near = 0.5f; camera->m_near = 1.5f; -// camera->m_far = 450.0f; - camera->m_far = 15.0f; + camera->m_far = 450.0f; +// camera->m_far = 15.0f; camera->m_target.set(0.0f, 0.0f, 0.0f); camera->m_position.set(0.0f, -10.0f, 0.0f); // camera->setPosition(Vec3(0.0f, 5.0f, 0.0f)); @@ -497,7 +497,7 @@ Draw(float timeDelta) getFrontBuffer(); rw::SetRenderState(rw::FOGCOLOR, 0xFF0000FF); - rw::SetRenderState(rw::FOGENABLE, 1); +// rw::SetRenderState(rw::FOGENABLE, 1); camera->m_rwcam->fogPlane = camera->m_rwcam->nearPlane; static rw::RGBA clearcol = { 161, 161, 161, 0xFF }; @@ -517,7 +517,7 @@ extern void endSoftras(void); endSoftras(); } //im2dtest(); - im2dtest2(); + //im2dtest2(); // Scene.clump->render(); // im3dtest(); @@ -525,7 +525,7 @@ extern void endSoftras(void); // testfont->print("foo ABC", 200, 200, true); -// rendersplines(); + rendersplines(); camera->m_rwcam->endUpdate(); diff --git a/tools/playground/splines.cpp b/tools/playground/splines.cpp index 73d32eb..00a3f79 100644 --- a/tools/playground/splines.cpp +++ b/tools/playground/splines.cpp @@ -59,6 +59,20 @@ AddVertex(const rw::V3d &vert) float epsilon = 0.000001; +class BezierSurf +{ +public: + // hardcoded 4x4 for now + V3d verts[16]; + + void mirrorX(void); + void mirrorY(void); + + V3d eval(float u, float v); + void drawHull(void); + void drawShaded(void); +}; + class RBCurve { public: @@ -126,6 +140,113 @@ evalBasisFast(int i, int d, float u, float knots[]) return tmp[0]; } +void +BezierSurf::mirrorX(void) +{ + int i; + for(i = 0; i < 16; i++) + verts[i].x = -verts[i].x; +} + +void +BezierSurf::mirrorY(void) +{ + int i; + for(i = 0; i < 16; i++) + verts[i].y = -verts[i].y; +} + +V3d +BezierSurf::eval(float u, float v) +{ + int i, j; + V3d out = { 0.0f, 0.0f, 0.0f }; + float us[4], vs[4]; + float iu = 1.0f-u; + float iv = 1.0f-v; + us[0] = iu*iu*iu; + us[1] = 3.0f*u*iu*iu; + us[2] = 3.0f*u*u*iu; + us[3] = u*u*u; + vs[0] = iv*iv*iv; + vs[1] = 3.0f*v*iv*iv; + vs[2] = 3.0f*v*v*iv; + vs[3] = v*v*v; + for(i = 0; i < 4; i++) + for(j = 0; j < 4; j++) + out = add(out, scale(verts[j+i*4],us[j]*vs[i])); + return out; +} + +void +BezierSurf::drawHull(void) +{ + rw::SetRenderStatePtr(rw::TEXTURERASTER, nil); + rw::SetRenderState(rw::FOGENABLE, 0); + + imVert.setU(0.0f); + imVert.setV(0.0f); + imVert.setColor(138, 72, 51, 255); +// imVert.setColor(228, 172, 121, 255); + + int iu, iv; + for(iv = 0; iv < 4; iv++){ + BeginIm3D(rw::PRIMTYPEPOLYLINE); + for(iu = 0; iu < 4; iu++) + AddVertex(verts[iu + iv*4]); + EndIm3D(); + } + + for(iu = 0; iu < 4; iu++){ + BeginIm3D(rw::PRIMTYPEPOLYLINE); + for(iv = 0; iv < 4; iv++) + AddVertex(verts[iu + iv*4]); + EndIm3D(); + } +} + +void +BezierSurf::drawShaded(void) +{ + V3d vert; + int iu, iv; + float u, v; + + rw::SetRenderStatePtr(rw::TEXTURERASTER, nil); + rw::SetRenderState(rw::FOGENABLE, 0); + + imVert.setU(0.0f); + imVert.setV(0.0f); + imVert.setColor(0, 128, 240, 255); + + float endu = 1.0f - epsilon; + float endv = 1.0f - epsilon; + float uinc = (endu-0.0f)/40.0f; + float vinc = (endv-0.0f)/40.0f; + + float vnext; + for(v = 0.0f;; v = vnext){ + if(v > endv) + v = endv; + vnext = v + vinc; + + BeginIm3D(rw::PRIMTYPETRISTRIP); + for(u = 0.0f;; u += uinc){ + if(u > endu) + u = endu; + + AddVertex(eval(u, v)); + AddVertex(eval(u, vnext)); + + if(u >= endu) + break; + } + EndIm3D(); + if(vnext >= endv) + break; + } +} + V3d RBCurve::eval(float u) { @@ -153,7 +274,7 @@ RBCurve::drawHull(void) { int i; - rw::SetRenderState(rw::TEXTURERASTER, nil); + rw::SetRenderStatePtr(rw::TEXTURERASTER, nil); rw::SetRenderState(rw::FOGENABLE, 0); BeginIm3D(rw::PRIMTYPEPOLYLINE); @@ -173,7 +294,7 @@ RBCurve::drawSpline(void) float u, endu; V3d vert; - rw::SetRenderState(rw::TEXTURERASTER, nil); + rw::SetRenderStatePtr(rw::TEXTURERASTER, nil); rw::SetRenderState(rw::FOGENABLE, 0); BeginIm3D(rw::PRIMTYPEPOLYLINE); imVert.setU(0.0f); @@ -238,7 +359,7 @@ RBSurf::eval(float u, float v) void RBSurf::drawHull(void) { - rw::SetRenderState(rw::TEXTURERASTER, nil); + rw::SetRenderStatePtr(rw::TEXTURERASTER, nil); rw::SetRenderState(rw::FOGENABLE, 0); imVert.setU(0.0f); @@ -269,7 +390,7 @@ RBSurf::drawIsoparms(void) int iu, iv; float u, v; - rw::SetRenderState(rw::TEXTURERASTER, nil); + rw::SetRenderStatePtr(rw::TEXTURERASTER, nil); rw::SetRenderState(rw::FOGENABLE, 0); imVert.setU(0.0f); @@ -323,7 +444,7 @@ RBSurf::drawShaded(void) int iu, iv; float u, v; - rw::SetRenderState(rw::TEXTURERASTER, nil); + rw::SetRenderStatePtr(rw::TEXTURERASTER, nil); rw::SetRenderState(rw::FOGENABLE, 0); imVert.setU(0.0f); @@ -362,6 +483,92 @@ RBSurf::drawShaded(void) RBCurve testspline1, testspline2; RBSurf testsurf; +V3d teapotVerts[] = { + { 0.2000, 0.0000, 2.70000 }, { 0.2000, -0.1120, 2.70000 }, + { 0.1120, -0.2000, 2.70000 }, { 0.0000, -0.2000, 2.70000 }, + { 1.3375, 0.0000, 2.53125 }, { 1.3375, -0.7490, 2.53125 }, + { 0.7490, -1.3375, 2.53125 }, { 0.0000, -1.3375, 2.53125 }, + { 1.4375, 0.0000, 2.53125 }, { 1.4375, -0.8050, 2.53125 }, + { 0.8050, -1.4375, 2.53125 }, { 0.0000, -1.4375, 2.53125 }, + { 1.5000, 0.0000, 2.40000 }, { 1.5000, -0.8400, 2.40000 }, + { 0.8400, -1.5000, 2.40000 }, { 0.0000, -1.5000, 2.40000 }, + { 1.7500, 0.0000, 1.87500 }, { 1.7500, -0.9800, 1.87500 }, + { 0.9800, -1.7500, 1.87500 }, { 0.0000, -1.7500, 1.87500 }, + { 2.0000, 0.0000, 1.35000 }, { 2.0000, -1.1200, 1.35000 }, + { 1.1200, -2.0000, 1.35000 }, { 0.0000, -2.0000, 1.35000 }, + { 2.0000, 0.0000, 0.90000 }, { 2.0000, -1.1200, 0.90000 }, + { 1.1200, -2.0000, 0.90000 }, { 0.0000, -2.0000, 0.90000 }, + { -2.0000, 0.0000, 0.90000 }, { 2.0000, 0.0000, 0.45000 }, + { 2.0000, -1.1200, 0.45000 }, { 1.1200, -2.0000, 0.45000 }, + { 0.0000, -2.0000, 0.45000 }, { 1.5000, 0.0000, 0.22500 }, + { 1.5000, -0.8400, 0.22500 }, { 0.8400, -1.5000, 0.22500 }, + { 0.0000, -1.5000, 0.22500 }, { 1.5000, 0.0000, 0.15000 }, + { 1.5000, -0.8400, 0.15000 }, { 0.8400, -1.5000, 0.15000 }, + { 0.0000, -1.5000, 0.15000 }, { -1.6000, 0.0000, 2.02500 }, + { -1.6000, -0.3000, 2.02500 }, { -1.5000, -0.3000, 2.25000 }, + { -1.5000, 0.0000, 2.25000 }, { -2.3000, 0.0000, 2.02500 }, + { -2.3000, -0.3000, 2.02500 }, { -2.5000, -0.3000, 2.25000 }, + { -2.5000, 0.0000, 2.25000 }, { -2.7000, 0.0000, 2.02500 }, + { -2.7000, -0.3000, 2.02500 }, { -3.0000, -0.3000, 2.25000 }, + { -3.0000, 0.0000, 2.25000 }, { -2.7000, 0.0000, 1.80000 }, + { -2.7000, -0.3000, 1.80000 }, { -3.0000, -0.3000, 1.80000 }, + { -3.0000, 0.0000, 1.80000 }, { -2.7000, 0.0000, 1.57500 }, + { -2.7000, -0.3000, 1.57500 }, { -3.0000, -0.3000, 1.35000 }, + { -3.0000, 0.0000, 1.35000 }, { -2.5000, 0.0000, 1.12500 }, + { -2.5000, -0.3000, 1.12500 }, { -2.6500, -0.3000, 0.93750 }, + { -2.6500, 0.0000, 0.93750 }, { -2.0000, -0.3000, 0.90000 }, + { -1.9000, -0.3000, 0.60000 }, { -1.9000, 0.0000, 0.60000 }, + { 1.7000, 0.0000, 1.42500 }, { 1.7000, -0.6600, 1.42500 }, + { 1.7000, -0.6600, 0.60000 }, { 1.7000, 0.0000, 0.60000 }, + { 2.6000, 0.0000, 1.42500 }, { 2.6000, -0.6600, 1.42500 }, + { 3.1000, -0.6600, 0.82500 }, { 3.1000, 0.0000, 0.82500 }, + { 2.3000, 0.0000, 2.10000 }, { 2.3000, -0.2500, 2.10000 }, + { 2.4000, -0.2500, 2.02500 }, { 2.4000, 0.0000, 2.02500 }, + { 2.7000, 0.0000, 2.40000 }, { 2.7000, -0.2500, 2.40000 }, + { 3.3000, -0.2500, 2.40000 }, { 3.3000, 0.0000, 2.40000 }, + { 2.8000, 0.0000, 2.47500 }, { 2.8000, -0.2500, 2.47500 }, + { 3.5250, -0.2500, 2.49375 }, { 3.5250, 0.0000, 2.49375 }, + { 2.9000, 0.0000, 2.47500 }, { 2.9000, -0.1500, 2.47500 }, + { 3.4500, -0.1500, 2.51250 }, { 3.4500, 0.0000, 2.51250 }, + { 2.8000, 0.0000, 2.40000 }, { 2.8000, -0.1500, 2.40000 }, + { 3.2000, -0.1500, 2.40000 }, { 3.2000, 0.0000, 2.40000 }, + { 0.0000, 0.0000, 3.15000 }, { 0.8000, 0.0000, 3.15000 }, + { 0.8000, -0.4500, 3.15000 }, { 0.4500, -0.8000, 3.15000 }, + { 0.0000, -0.8000, 3.15000 }, { 0.0000, 0.0000, 2.85000 }, + { 1.4000, 0.0000, 2.40000 }, { 1.4000, -0.7840, 2.40000 }, + { 0.7840, -1.4000, 2.40000 }, { 0.0000, -1.4000, 2.40000 }, + { 0.4000, 0.0000, 2.55000 }, { 0.4000, -0.2240, 2.55000 }, + { 0.2240, -0.4000, 2.55000 }, { 0.0000, -0.4000, 2.55000 }, + { 1.3000, 0.0000, 2.55000 }, { 1.3000, -0.7280, 2.55000 }, + { 0.7280, -1.3000, 2.55000 }, { 0.0000, -1.3000, 2.55000 }, + { 1.3000, 0.0000, 2.40000 }, { 1.3000, -0.7280, 2.40000 }, + { 0.7280, -1.3000, 2.40000 }, { 0.0000, -1.3000, 2.40000 } +}; +int teapotPatches[10][16] = { + { 118, 118, 118, 118, 124, 122, 119, 121, + 123, 126, 125, 120, 40, 39, 38, 37 }, + { 102, 103, 104, 105, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15 }, + { 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27 }, + { 24, 25, 26, 27, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40 }, + { 96, 96, 96, 96, 97, 98, 99, 100, + 101, 101, 101, 101, 0, 1, 2, 3 }, + { 0, 1, 2, 3, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117 }, + { 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56 }, + { 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 28, 65, 66, 67 }, + { 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83 }, + { 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95 }, +}; + +BezierSurf teapotSurfs[32]; + void initsplines(void) { @@ -412,6 +619,7 @@ initsplines(void) V(-61.9913, 9.158239, 0); V(-32.32231, 27.23371, 0); V(25.80961, -4.820126, 0); +#undef V testspline2.knots.clear(); testspline2.knots.push_back(0); testspline2.knots.push_back(0); @@ -479,6 +687,7 @@ initsplines(void) V(25.75483, 70.07219, 31.27717); V(56.61724, 70.07219, -2.498198); V(86.35364, 70.07219, 12.53265); +#undef V testsurf.knotsU.clear(); testsurf.knotsU.push_back(0); testsurf.knotsU.push_back(0); @@ -503,18 +712,39 @@ initsplines(void) testsurf.knotsV.push_back(1); testsurf.update(); + + int i, j; + for(i = 0; i < 10; i++) + for(j = 0; j < 16; j++) + teapotSurfs[i].verts[j] = teapotVerts[teapotPatches[i][j]]; + for(i = 0; i < 10; i++){ + teapotSurfs[i+10] = teapotSurfs[i]; + teapotSurfs[i+10].mirrorY(); + } + for(i = 0; i < 6; i++){ + teapotSurfs[i+20] = teapotSurfs[i]; + teapotSurfs[i+20].mirrorX(); + teapotSurfs[i+20+6] = teapotSurfs[i+10]; + teapotSurfs[i+20+6].mirrorX(); + } } void rendersplines(void) { - testspline1.drawHull(); - testspline1.drawSpline(); +// testspline1.drawHull(); +// testspline1.drawSpline(); // testspline2.drawHull(); // testspline2.drawSpline(); - testsurf.drawHull(); - testsurf.drawShaded(); - testsurf.drawIsoparms(); +// testsurf.drawHull(); +// testsurf.drawShaded(); +// testsurf.drawIsoparms(); + + int i; + for(i = 0; i < 32; i++){ + teapotSurfs[i].drawHull(); + teapotSurfs[i].drawShaded(); + } }