File confec.cpp changed (mode: 100644) (index 7420b9a..fa42140) |
... |
... |
int main( int argc, char* argv[] ){ |
1055 |
1055 |
fgl::setPipeline( fgl::colorModPipeline ); |
fgl::setPipeline( fgl::colorModPipeline ); |
1056 |
1056 |
|
|
1057 |
1057 |
// Load UI graphics. |
// Load UI graphics. |
1058 |
|
vnLoadUIButtons( data_path, "ui/button_n.png", "ui/button_p.png", "ui/button_s.png" ); |
|
|
1058 |
|
vnLoadUITextures( data_path, "ui/shade_gradient.png", "ui/button_n.png", "ui/button_p.png", "ui/button_s.png" ); |
1059 |
1059 |
map_overlay = vnLoadImage( data_path + "/ui/map_overlay.png", false, false ); |
map_overlay = vnLoadImage( data_path + "/ui/map_overlay.png", false, false ); |
1060 |
1060 |
|
|
1061 |
1061 |
mt = std::mt19937_64( std::time( nullptr ) ); |
mt = std::mt19937_64( std::time( nullptr ) ); |
File include/vn.h changed (mode: 100644) (index 0a0b203..e33d12b) |
... |
... |
void vnGo( dialogue::Talk &convo, const std::string &id ); |
21 |
21 |
double vn_width = 1366.0, vn_height = 768.0; |
double vn_width = 1366.0, vn_height = 768.0; |
22 |
22 |
|
|
23 |
23 |
// Common VN UI textures. Loaded automatically. |
// Common VN UI textures. Loaded automatically. |
24 |
|
fgl::Texture vn_tex_shade = {}, vn_tex_button_n = {}, vn_tex_button_p = {}, vn_tex_button_s = {}; |
|
|
24 |
|
fgl::Texture vn_tex_shade = {}, vn_tex_gradient = {}, vn_tex_button_n = {}, vn_tex_button_p = {}, vn_tex_button_s = {}; |
25 |
25 |
|
|
26 |
26 |
// VN images. |
// VN images. |
27 |
27 |
std::map<std::string,fgl::Texture> vn_backgrounds, vn_foregrounds, vn_buttons; |
std::map<std::string,fgl::Texture> vn_backgrounds, vn_foregrounds, vn_buttons; |
|
... |
... |
fgl::Texture vnLoadImage( const std::string &fileName, bool mipmap, bool filter |
46 |
46 |
return imgTexture; |
return imgTexture; |
47 |
47 |
} |
} |
48 |
48 |
|
|
49 |
|
// Load not-pressed, pressed, and selected UI buttons. |
|
50 |
|
void vnLoadUIButtons( const std::string &dataPath, const std::string &buttonN, const std::string &buttonP, const std::string &buttonS ){ |
|
|
49 |
|
// Load shade gradient, not-pressed, pressed, and selected UI buttons. |
|
50 |
|
void vnLoadUITextures( |
|
51 |
|
const std::string &dataPath, |
|
52 |
|
const std::string &gradient, |
|
53 |
|
const std::string &buttonN, |
|
54 |
|
const std::string &buttonP, |
|
55 |
|
const std::string &buttonS ){ |
|
56 |
|
vn_tex_gradient = vnLoadImage( dataPath + "/" + gradient, true, true ); |
51 |
57 |
vn_tex_button_n = vnLoadImage( dataPath + "/" + buttonN, true, true ); |
vn_tex_button_n = vnLoadImage( dataPath + "/" + buttonN, true, true ); |
52 |
58 |
vn_tex_button_p = vnLoadImage( dataPath + "/" + buttonP, true, true ); |
vn_tex_button_p = vnLoadImage( dataPath + "/" + buttonP, true, true ); |
53 |
59 |
vn_tex_button_s = vnLoadImage( dataPath + "/" + buttonS, true, true ); |
vn_tex_button_s = vnLoadImage( dataPath + "/" + buttonS, true, true ); |
|
... |
... |
bool vnDraw( |
203 |
209 |
auto noshade_it = convo.numbers.find( "noshade" ); |
auto noshade_it = convo.numbers.find( "noshade" ); |
204 |
210 |
bool noshade = noshade_it != convo.numbers.end() && noshade_it->second; |
bool noshade = noshade_it != convo.numbers.end() && noshade_it->second; |
205 |
211 |
if( convo.screen.ids.size() > 0 && !darken && !noshade ){ |
if( convo.screen.ids.size() > 0 && !darken && !noshade ){ |
206 |
|
// There are buttons and something to draw a shade over. |
|
|
212 |
|
// There are buttons and something to draw a gradient over. |
|
213 |
|
double y = ypos + ( tlines > 0.0f ? tlines : 8.0f ) * vnScale; |
207 |
214 |
vnDrawImage( |
vnDrawImage( |
208 |
|
vn_tex_shade, |
|
|
215 |
|
vn_tex_gradient, |
209 |
216 |
vnOffX, |
vnOffX, |
210 |
|
ypos + ( tlines > 0.0f ? 2.0f - tlines : 8.0f ) * vnScale, |
|
|
217 |
|
y, |
211 |
218 |
0.0f, |
0.0f, |
212 |
|
vn_width * vnScale, |
|
213 |
|
vn_height / 1.2 * vnScale |
|
|
219 |
|
vn_width * vnScale / vn_tex_gradient.width, |
|
220 |
|
( sh - (vn_height * 0.7409 - font.size * 2.57) * vnScale ) / vn_tex_gradient.height |
214 |
221 |
); |
); |
215 |
222 |
} |
} |
216 |
223 |
|
|