diff --git a/data/caixes.gif b/data/caixes.gif index 200413a..c3c3084 100644 Binary files a/data/caixes.gif and b/data/caixes.gif differ diff --git a/data/rooms/08.txt b/data/rooms/08.txt index 3ab1bf0..7e89b2b 100644 --- a/data/rooms/08.txt +++ b/data/rooms/08.txt @@ -1,11 +1,13 @@ width: 0 height: 3 +door-height-yp: 0 door-height-yn: 5 color: CYAN floor-texture: 1 wall-texture: 0 door-texture: 0 under-door-texture: 0 +exit-yp: 9 exit-yn: 7 actor{ diff --git a/data/rooms/09.txt b/data/rooms/09.txt new file mode 100644 index 0000000..0eb59dc --- /dev/null +++ b/data/rooms/09.txt @@ -0,0 +1,39 @@ +width: 2 +height: 2 +door-height-xp: 0 +door-height-xn: 0 +door-height-yp: 0 +door-height-yn: 0 +color: WHITE +floor-texture: 0 +wall-texture: 7 +door-texture: 2 +under-door-texture: 0 +exit-xp: 12 +exit-xn: 10 +exit-yp: 17 +exit-yn: 8 + +actor{ + name: NEVERA1 + bmp: caixes.gif + bmp-rect: 0 96 32 32 + bmp-offset: 2 33 + pos: 8 8 0 + size: 8 8 8 + orient: YP + flags: ORIENTABLE + movement: CW +} + +actor{ + name: NEVERA2 + bmp: caixes.gif + bmp-rect: 32 96 32 32 + bmp-offset: 2 33 + pos: 8 8 8 + size: 8 8 8 + orient: YP + flags: ORIENTABLE + movement: CW +} diff --git a/data/rooms/10.txt b/data/rooms/10.txt new file mode 100644 index 0000000..cb33220 --- /dev/null +++ b/data/rooms/10.txt @@ -0,0 +1,11 @@ +width: 2 +height: 2 +door-height-xp: 0 +door-height-yn: 0 +color: PURPLE +floor-texture: 0 +wall-texture: 0 +door-texture: 0 +under-door-texture: 0 +exit-xp: 9 +exit-yn: 11 diff --git a/data/rooms/11.txt b/data/rooms/11.txt new file mode 100644 index 0000000..dc20fee --- /dev/null +++ b/data/rooms/11.txt @@ -0,0 +1,9 @@ +width: 2 +height: 2 +door-height-yp: 0 +color: YELLOW +floor-texture: 0 +wall-texture: 0 +door-texture: 0 +under-door-texture: 0 +exit-yp: 10 diff --git a/data/rooms/12.txt b/data/rooms/12.txt new file mode 100644 index 0000000..891a54d --- /dev/null +++ b/data/rooms/12.txt @@ -0,0 +1,13 @@ +width: 2 +height: 2 +door-height-xp: 0 +door-height-xn: 0 +door-height-yn: 0 +color: GREEN +floor-texture: 3 +wall-texture: 3 +door-texture: 1 +under-door-texture: 3 +exit-xp: 13 +exit-xn: 9 +exit-yn: 15 diff --git a/data/rooms/13.txt b/data/rooms/13.txt new file mode 100644 index 0000000..d0d9d71 --- /dev/null +++ b/data/rooms/13.txt @@ -0,0 +1,232 @@ +width: 2 +height: 2 +door-height-xn: 1 +door-height-yn: 1 +color: CYAN +floor-texture: 0 +wall-texture: 0 +door-texture: 0 +under-door-texture: 0 +exit-xn: 12 +exit-yn: 14 +exit-zn: 18 + +actor{ + name: LIFT18 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 8 8 0 + size: 8 8 4 + orient: ZP + movement: Z +} + +actor{ + name: LIFT17 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 8 16 0 + size: 8 8 4 + orient: ZP + movement: Z +} + +actor{ + name: LIFT19 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 16 8 0 + size: 8 8 4 + orient: ZP + movement: Z +} + +actor{ + name: LIFT31 + bmp: caixes.gif + bmp-rect: 96 160 32 32 + bmp-offset: 0 32 + pos: 16 16 0 + size: 8 8 8 + orient: ZP + movement: Z +} + +actor{ + name: LIFT20 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 24 8 0 + size: 8 8 4 + orient: ZP + movement: Z +} + +actor{ + name: LIFT32 + bmp: caixes.gif + bmp-rect: 96 160 32 32 + bmp-offset: 0 32 + pos: 24 16 0 + size: 8 8 8 + orient: ZP + movement: Z +} + +actor{ + name: LIFT21 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 32 8 0 + size: 8 8 4 + orient: ZP + movement: Z +} + +actor{ + name: LIFT33 + bmp: caixes.gif + bmp-rect: 96 160 32 32 + bmp-offset: 0 32 + pos: 32 16 0 + size: 8 8 8 + orient: ZP + movement: Z +} + +actor{ + name: LIFT22 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 40 8 0 + size: 8 8 4 + orient: ZP + movement: Z +} + +actor{ + name: LIFT34 + bmp: caixes.gif + bmp-rect: 96 160 32 32 + bmp-offset: 0 32 + pos: 40 16 0 + size: 8 8 8 + orient: ZP + movement: Z +} + +actor{ + name: LIFT23 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 48 8 0 + size: 8 8 4 + orient: ZP + movement: Z +} + +actor{ + name: LIFT35 + bmp: caixes.gif + bmp-rect: 96 160 32 32 + bmp-offset: 0 32 + pos: 48 16 0 + size: 8 8 8 + orient: ZP + movement: Z +} + +actor{ + name: LIFT16 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 8 24 0 + size: 8 8 4 + orient: ZP + movement: Z +} + +actor{ + name: LIFT30 + bmp: caixes.gif + bmp-rect: 96 160 32 32 + bmp-offset: 0 32 + pos: 16 24 0 + size: 8 8 8 + orient: ZP + movement: Z +} + +actor{ + name: LIFT13 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 8 32 0 + size: 8 8 4 + orient: ZP + movement: Z +} + +actor{ + name: LIFT29 + bmp: caixes.gif + bmp-rect: 96 160 32 32 + bmp-offset: 0 32 + pos: 16 32 0 + size: 8 8 8 + orient: ZP + movement: Z +} + +actor{ + name: LIFT14 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 8 40 0 + size: 8 8 4 + orient: ZP + movement: Z +} + +actor{ + name: LIFT28 + bmp: caixes.gif + bmp-rect: 96 160 32 32 + bmp-offset: 0 32 + pos: 16 40 0 + size: 8 8 8 + orient: ZP + movement: Z +} + +actor{ + name: LIFT15 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 8 48 0 + size: 8 8 4 + orient: ZP + movement: Z +} + +actor{ + name: LIFT27 + bmp: caixes.gif + bmp-rect: 96 160 32 32 + bmp-offset: 0 32 + pos: 16 48 0 + size: 8 8 8 + orient: ZP + movement: Z +} diff --git a/data/rooms/14.txt b/data/rooms/14.txt new file mode 100644 index 0000000..58ae2d4 --- /dev/null +++ b/data/rooms/14.txt @@ -0,0 +1,11 @@ +width: 2 +height: 2 +door-height-xn: 0 +door-height-yp: 0 +color: WHITE +floor-texture: 0 +wall-texture: 0 +door-texture: 0 +under-door-texture: 0 +exit-xn: 15 +exit-yp: 13 diff --git a/data/rooms/15.txt b/data/rooms/15.txt new file mode 100644 index 0000000..b3f83f0 --- /dev/null +++ b/data/rooms/15.txt @@ -0,0 +1,13 @@ +width: 2 +height: 2 +door-height-xp: 0 +door-height-yp: 0 +door-height-yn: 0 +color: YELLOW +floor-texture: 0 +wall-texture: 0 +door-texture: 0 +under-door-texture: 0 +exit-xp: 14 +exit-yp: 12 +exit-yn: 16 diff --git a/data/rooms/16.txt b/data/rooms/16.txt new file mode 100644 index 0000000..1763138 --- /dev/null +++ b/data/rooms/16.txt @@ -0,0 +1,9 @@ +width: 2 +height: 2 +door-height-yp: 0 +color: PURPLE +floor-texture: 0 +wall-texture: 0 +door-texture: 0 +under-door-texture: 0 +exit-yp: 15 diff --git a/data/rooms/17.txt b/data/rooms/17.txt new file mode 100644 index 0000000..d9b5389 --- /dev/null +++ b/data/rooms/17.txt @@ -0,0 +1,9 @@ +width: 2 +height: 2 +door-height-yn: 0 +color: CYAN +floor-texture: 0 +wall-texture: 0 +door-texture: 0 +under-door-texture: 0 +exit-yn: 9 diff --git a/data/rooms/18.txt b/data/rooms/18.txt new file mode 100644 index 0000000..ec60e56 --- /dev/null +++ b/data/rooms/18.txt @@ -0,0 +1,8 @@ +width: 2 +height: 2 +color: CYAN +floor-texture: 0 +wall-texture: 0 +door-texture: 0 +under-door-texture: 0 +exit-zp: 13 diff --git a/data/walls.gif b/data/walls.gif index 08be7a5..cb54960 100644 Binary files a/data/walls.gif and b/data/walls.gif differ diff --git a/source/jdraw.cpp b/source/jdraw.cpp index 27b18b8..54acf7f 100644 --- a/source/jdraw.cpp +++ b/source/jdraw.cpp @@ -504,6 +504,17 @@ namespace draw sel_color = col; } + void isoline(int x, int y, const int dx, const int dy, const int len) + { + for (int i=0; i=-32) && (x<520) && (y>=-16) && (y<240) ) + { + draw::color(RED); + if (minirooms[room].exits[XN] != 255) { draw::isoline(x,y,-1,-1,14); /*draw::isoline(x,y-1,-1,-1,14);*/ draw::isoline(x,y+1,-1,-1,14); } + if (minirooms[room].exits[YN] != 255) { draw::isoline(x,y,+1,-1,14); /*draw::isoline(x,y-1,+1,-1,14);*/ draw::isoline(x,y+1,+1,-1,14); } + if (minirooms[room].exits[XP] != 255) { draw::isoline(x,y,+1,+1,14); /*draw::isoline(x,y-1,+1,+1,14);*/ draw::isoline(x,y+1,+1,+1,14); } + if (minirooms[room].exits[YP] != 255) { draw::isoline(x,y,-1,+1,14); /*draw::isoline(x,y-1,-1,+1,14);*/ draw::isoline(x,y+1,-1,+1,14); } + } + if (minirooms[room].exits[XN] != 255) drawLines(minirooms[room].exits[XN], x-24, y-12); + if (minirooms[room].exits[XP] != 255) drawLines(minirooms[room].exits[XP], x+24, y+12); + if (minirooms[room].exits[YN] != 255) drawLines(minirooms[room].exits[YN], x+24, y-12); + if (minirooms[room].exits[YP] != 255) drawLines(minirooms[room].exits[YP], x-24, y+12); + } + + void drawRoom(const int room, const int x, const int y, const bool shadow=false) + { + if (drawn[room]) return; + drawn[room] = true; + if ( (x>=-32) && (x<520) && (y>=-16) && (y<240) ) + { + draw::stencil::set(room); + draw::swapcol(1, !shadow ? minirooms[room].color : 2); + draw::draw(x-16, y-8, 32, 16, minirooms[room].w*32, minirooms[room].h*16); + + if (!shadow) + { + char num[] = "00"; num[0] = 48+(room/10); num[1] = 48+(room%10); + draw::print(num, x-4, y-3, LIGHT+(room==current_room?YELLOW:WHITE), BLACK); + } + } + if (minirooms[room].exits[XN] != 255) drawRoom(minirooms[room].exits[XN], x-24, y-12, shadow); + if (minirooms[room].exits[XP] != 255) drawRoom(minirooms[room].exits[XP], x+24, y+12, shadow); + if (minirooms[room].exits[YN] != 255) drawRoom(minirooms[room].exits[YN], x+24, y-12, shadow); + if (minirooms[room].exits[YP] != 255) drawRoom(minirooms[room].exits[YP], x-24, y+12, shadow); + } + void loadMiniRoom() { const int room = room::getCurrent(); @@ -53,45 +93,31 @@ namespace modules current_room = room::getCurrent(); loadMiniRoom(); room::load(current_room); + + for (int i=0;i<64;++i) drawn[i]=false; + draw::cls(2); + draw::setSource(surf); + + drawLines(room::getCurrent(), scroll.x, scroll.y); + + for (int y=-1; y<=1; ++y) + for (int x=-1; x<=1; ++x) + { + for (int i=0;i<64;++i) drawn[i]=false; + drawRoom(room::getCurrent(), scroll.x+x, scroll.y+y, true); + } + } - void drawRoom(const int room, const int x, const int y) - { - if (drawn[room]) return; - drawn[room] = true; - if ( (x>=-32) && (x<520) && (y>=-16) && (y<240) ) - { - draw::stencil::set(room); - draw::swapcol(1, minirooms[room].color); - draw::draw(x-16, y-8, 32, 16, minirooms[room].w*32, minirooms[room].h*16); - - draw::swapcol(1, RED); - if (minirooms[room].exits[XN] != 255) draw::draw(x-4-(minirooms[room].w*2), y-5-(minirooms[room].w),4,5,0,64); - if (minirooms[room].exits[YN] != 255) draw::draw(x+(minirooms[room].h*2), y-5-(minirooms[room].h),4,5,3,64); - if (minirooms[room].exits[XP] != 255) draw::draw(x+(minirooms[room].w*2), y-3+(minirooms[room].w),4,5,0,64); - if (minirooms[room].exits[YP] != 255) draw::draw(x-4-(minirooms[room].h*2), y-3+(minirooms[room].h),4,5,3,64); - - char num[] = "00"; num[0] = 48+(room/10); num[1] = 48+(room%10); - draw::print(num, x-4, y-3, LIGHT+(room==current_room?YELLOW:WHITE), BLACK); - } - if (minirooms[room].exits[XN] != 255) drawRoom(minirooms[room].exits[XN], x-24, y-12); - if (minirooms[room].exits[XP] != 255) drawRoom(minirooms[room].exits[XP], x+24, y+12); - if (minirooms[room].exits[YN] != 255) drawRoom(minirooms[room].exits[YN], x+24, y-12); - if (minirooms[room].exits[YP] != 255) drawRoom(minirooms[room].exits[YP], x-24, y+12); - } bool loop() { - for (int i=0;i<64;++i) drawn[i]=false; - if (input::keyPressed(SDL_SCANCODE_ESCAPE) || input::keyPressed(SDL_SCANCODE_TAB)) return false; - draw::cls(2); - draw::setSource(surf); - draw::stencil::enable(); draw::stencil::clear(255); + for (int i=0;i<64;++i) drawn[i]=false; drawRoom(room::getCurrent(), scroll.x, scroll.y); draw::render();