void Main() { wnd.Create("てすと", 0, 0, 500, 500, WindowOption::StandardStyle| WindowOption::ClientSize| WindowOption::BGWhite| WindowOption::Centering); wnd.Show(); // Initialize backBuf.Create(500, 500); rect[0] = Vector2(-50.0, -50.0); rect[1] = Vector2(-50.0, 50.0); rect[2] = Vector2(50.0, 50.0); rect[3] = Vector2(50.0, -50.0); //Vector3 v(20, 30, 1); //Matrix3 m; //Matrix3Translation4V2(m, 100, 200); //v = v * m; // Application Loop MainLoop(Run); // Finalize backBuf.Release(); }
void TileCell::Draw(Bitmap* bitmap, GFX::rect *rect, bool advanceFrame, bool full) { MapOverlay* overlayZero = fOverlays[0]; if (overlayZero == NULL) return; TileMap* tileMapZero = overlayZero->TileMapForTileCell(fNumber); if (tileMapZero == NULL) { std::cerr << "Tilemap Zero is NULL!" << std::endl; return; } const int8 mask = tileMapZero->Mask(); int maxOverlay = full ? fNumOverlays : 1; for (int i = maxOverlay - 1; i >= 0; i--) { if (!ShouldDrawOverlay(i, mask)) continue; MapOverlay *overlay = fOverlays[i]; TileMap *map = overlay->TileMapForTileCell(i == 0 ? fNumber : 0); if (map == NULL) continue; int16 index = map->TileIndex(advanceFrame); if (fDoor != NULL && !fDoor->Opened()) { int16 secondaryIndex = map->SecondaryTileIndex(); if (secondaryIndex != -1) index = secondaryIndex; else std::cerr << "TileCell::Draw(): secondary index is -1. BUG?." << std::endl; } TISResource *tis = gResManager->GetTIS(overlay->TileSet()); Bitmap *cell = tis->TileAt(index); assert(cell != NULL); gResManager->ReleaseResource(tis); GFX::Color *color = NULL; if (i == 0 && mask != 0) { color = &sTransparentColor; //color = &cell->format->palette->colors[255]; } _DrawOverlay(bitmap, cell, *rect, color); cell->Release(); } }