Skip to content

Commit

Permalink
added screenshots to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakz committed Jan 9, 2019
1 parent e661562 commit be6c418
Show file tree
Hide file tree
Showing 31 changed files with 118 additions and 1 deletion.
84 changes: 84 additions & 0 deletions README.md
Expand Up @@ -27,7 +27,91 @@ Given that anyone willing to contribute is welcome and I can provide any insight

These screenshots are generated automatically for each view of the game, they don't respect the realtime status since, for example, intro view requires some timing to actually show something but they're here to showcase the status:

main view
![main view](docs/screenshots/screenshot-main.png)

city view
![city view](docs/screenshots/screenshot-city.png)

unit view
![unit view](docs/screenshots/screenshot-unit.png)

spellbook view
![spellbook view](docs/screenshots/screenshot-spellbook.png)

magic view
![magic view](docs/screenshots/screenshot-magic.png)

research view
![research view](docs/screenshots/screenshot-research.png)

alchemy view
![alchemy view](docs/screenshots/screenshot-alchemy.png)

armies view
![armies view](docs/screenshots/screenshot-armies.png)

armies-items view
![armies-items view](docs/screenshots/screenshot-armies-items.png)

item-craft view
![item-craft view](docs/screenshots/screenshot-item-craft.png)

item-craft-charges view
![item-craft-charges view](docs/screenshots/screenshot-item-craft-charges.png)

merchant view
![merchant view](docs/screenshots/screenshot-merchant.png)

army view
![army view](docs/screenshots/screenshot-army.png)

message view
![message view](docs/screenshots/screenshot-message.png)

cities view
![cities view](docs/screenshots/screenshot-cities.png)

mirror view
![mirror view](docs/screenshots/screenshot-mirror.png)

info-menu view
![info-menu view](docs/screenshots/screenshot-info-menu.png)

cartographer view
![cartographer view](docs/screenshots/screenshot-cartographer.png)

diplomacy view
![diplomacy view](docs/screenshots/screenshot-diplomacy.png)

astrologer view
![astrologer view](docs/screenshots/screenshot-astrologer.png)

historian view
![historian view](docs/screenshots/screenshot-historian.png)

combat view
![combat view](docs/screenshots/screenshot-combat.png)

production view
![production view](docs/screenshots/screenshot-production.png)

outpost view
![outpost view](docs/screenshots/screenshot-outpost.png)

new-game view
![new-game view](docs/screenshots/screenshot-new-game.png)

load view
![load view](docs/screenshots/screenshot-load.png)

options view
![options view](docs/screenshots/screenshot-options.png)

start view
![start view](docs/screenshots/screenshot-start.png)

intro view
![intro view](docs/screenshots/screenshot-intro.png)


Binary file modified docs/screenshots/screenshot-alchemy.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-armies-items.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-armies.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-army.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-astrologer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-cartographer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-cities.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-city.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-combat.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-diplomacy.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-historian.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-info-menu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-intro.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-item-craft-charges.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-item-craft.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-load.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-magic.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-main.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-merchant.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-message.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-mirror.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-new-game.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-options.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-outpost.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-production.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screenshot-research.png
Binary file modified docs/screenshots/screenshot-spellbook.png
Binary file modified docs/screenshots/screenshot-start.png
Binary file modified docs/screenshots/screenshot-unit.png
35 changes: 34 additions & 1 deletion src/gfx/Gfx.cpp
Expand Up @@ -503,9 +503,42 @@ void Gfx::mergeBufferDownScaled(u16 xf, u16 yf, u16 xt, u16 yt, u16 w, u16 h)
}
}


#define PIXEL(s, w, x, y) s[(y)*(w) + x]
void Gfx::saveScreenshot(const char* path)
{
IMG_SavePNG(canvas->data, path);
auto* surface = Gfx::createSurface(canvas->data->w*2, canvas->data->h*2);

auto src = canvas->data;
auto dst = surface;
auto w = canvas->data->w, h = canvas->data->h;
constexpr auto sx = 0, sy = 0, dx = 0, dy = 0;
auto f = 2;

SDL_LockSurface(src);
SDL_LockSurface(dst);

u32 *sp = (u32*)src->pixels;
u32 *dp = (u32*)dst->pixels;

// for each pixel in source
for (u16 x = sx; x < sx+w; ++x)
for (u16 y = sy; y < sy+h; ++y)
{
u32 color = PIXEL(sp, src->w, x, y);
// for each dest pixel according to scale factor
for (u16 ix = 0; ix < f; ++ix)
for (u16 iy = 0; iy < f; ++iy)
{
PIXEL(dp, dst->w, dx + x*f + ix, dy + y*f + iy) = color;
}
}

SDL_UnlockSurface(src);
SDL_UnlockSurface(dst);

IMG_SavePNG(surface, path);
SDL_FreeSurface(surface);
}

void CursorManager::hideCursor()
Expand Down

0 comments on commit be6c418

Please sign in to comment.