1 /* Project 16 Source Code~
\r
2 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
\r
4 * This file is part of Project 16.
\r
6 * Project 16 is free software; you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation; either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * Project 16 is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with this program. If not, see <http://www.gnu.org/licenses/>, or
\r
18 * write to the Free Software Foundation, Inc., 51 Franklin Street,
\r
19 * Fifth Floor, Boston, MA 02110-1301 USA.
\r
24 #include "src/lib/modex16.h"
\r
26 global_game_variables_t gvar;
\r
31 byte *pal, *pal2=NULL;
\r
33 /* load our palette */
\r
34 modexLoadPalFile("data/default.pal", &pal2);
\r
36 /* save the palette */
\r
37 pal = modexNewPal();
\r
39 modexFadeOff(1, pal);
\r
45 /* set up the page, but with 16 pixels on all borders in offscreen mem */
\r
46 gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]);
\r
47 gvar.video.page[1] = modexNextPage(&gvar.video.page[0]);
\r
48 gvar.video.page[0].width += 32;
\r
49 gvar.video.page[0].height += 32;
\r
52 /* fill the page with one color, but with a black border */
\r
53 modexShowPage(&gvar.video.page[1]);
\r
54 modexClearRegion(&gvar.video.page[0], 16, 16, gvar.video.page[0].sw, gvar.video.page[0].sh, 128);
\r
55 modexClearRegion(&gvar.video.page[0], 32, 32, gvar.video.page[0].sw-32, gvar.video.page[0].sh-32, 42);
\r
56 modexClearRegion(&gvar.video.page[0], 48, 48, gvar.video.page[0].sw-64, gvar.video.page[0].sh-64, 128);
\r
57 modexShowPage(&gvar.video.page[0]);
\r
60 modexFadeOn(1, pal2);
\r
64 for(i=0; i<5; i++) {
\r
66 for(j=0; j<32; j++) {
\r
67 gvar.video.page[0].dx++;
\r
68 modexShowPage(&gvar.video.page[0]);
\r
71 for(j=0; j<32; j++) {
\r
72 gvar.video.page[0].dx--;
\r
73 modexShowPage(&gvar.video.page[0]);
\r
76 for(j=0; j<32; j++) {
\r
77 gvar.video.page[0].dy++;
\r
78 modexShowPage(&gvar.video.page[0]);
\r
82 for(j=0; j<32; j++) {
\r
83 gvar.video.page[0].dy--;
\r
84 modexShowPage(&gvar.video.page[0]);
\r
90 /* fade back to text mode */
\r
91 modexFadeOff(1, pal2);
\r
95 modexFadeOn(1, pal);
\r