Updated MapEditor so it can be compiled and runned again.
This commit is contained in:
parent
3f0a5fd4e3
commit
524feafdb1
2 changed files with 15 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
SDL_CFLAGS = `sdl-config --cflags` `freetype-config --cflags`
|
||||
SDL_LIBS = `sdl-config --libs` -lSDL_ttf -lSDL_mixer -lSDL_image -lSDL_net `freetype-config --libs`
|
||||
OBJS= editor.o ../actions.o ../ai.o ../ai_attack.o ../ai_move.o ../config.o ../dialogs.o ../display.o ../events.o ../filesystem.o ../font.o ../game_config.o ../game_events.o ../gamestatus.o ../hotkeys.o ../intro.o ../key.o ../language.o ../log.o ../map.o ../show_dialog.o ../mouse.o ../network.o ../pathfind.o ../playlevel.o ../playturn.o ../preferences.o ../replay.o ../sdl_utils.o ../sound.o ../team.o ../terrain.o ../tooltips.o ../unit.o ../unit_types.o ../video.o ../widgets/button.o ../widgets/menu.o ../widgets/textbox.o ../widgets/slider.o
|
||||
OBJS= editor.o ../actions.o ../ai.o ../ai_attack.o ../ai_move.o ../config.o ../dialogs.o ../display.o ../events.o ../filesystem.o ../font.o ../game_config.o ../game_events.o ../gamestatus.o ../hotkeys.o ../image.o ../intro.o ../key.o ../language.o ../log.o ../map.o ../show_dialog.o ../mouse.o ../network.o ../pathfind.o ../playlevel.o ../playturn.o ../preferences.o ../replay.o ../sdl_utils.o ../sound.o ../team.o ../terrain.o ../tooltips.o ../unit.o ../unit_types.o ../video.o ../widgets/button.o ../widgets/menu.o ../widgets/textbox.o ../widgets/slider.o
|
||||
|
||||
editor: $(OBJS)
|
||||
gcc -lstdc++ ${SDL_CFLAGS} -o $@ ${OBJS} ${SDL_LIBS}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
*/
|
||||
|
||||
#include "SDL.h"
|
||||
#include "SDL_keysym.h"
|
||||
|
||||
#include "../actions.hpp"
|
||||
#include "../ai.hpp"
|
||||
|
@ -36,6 +37,15 @@
|
|||
#include <map>
|
||||
#include <string>
|
||||
|
||||
|
||||
// I just not have time now to search if there are any versions
|
||||
// of SDL that needs uppercase. So both is supported... --Sofronius
|
||||
#ifndef SDLK_X
|
||||
#define SDLK_X SDLK_x
|
||||
#define SDLK_D SDLK_d
|
||||
#define SDLK_Z SDLK_z
|
||||
#endif
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
const double scroll_speed = 30.0;
|
||||
|
@ -73,7 +83,7 @@ int main(int argc, char** argv)
|
|||
|
||||
std::map<gamemap::location,unit> units;
|
||||
display gui(units,video,map,status,teams);
|
||||
gui.draw_terrain_palette(gui.mapx()+10,150,0);
|
||||
gui.draw_terrain_palette(gui.mapx()+10,142,0);
|
||||
|
||||
gamemap::TERRAIN selected_terrain = 0;
|
||||
|
||||
|
@ -115,10 +125,10 @@ int main(int argc, char** argv)
|
|||
gui.highlight_hex(gui.hex_clicked_on(mousex,mousey));
|
||||
if(new_left_button) {
|
||||
const gamemap::TERRAIN terrain_on =
|
||||
gui.get_terrain_on(gui.mapx()+10,150,mousex,mousey);
|
||||
gui.get_terrain_on(gui.mapx()+10,142,mousex,mousey);
|
||||
if(terrain_on && terrain_on != selected_terrain) {
|
||||
selected_terrain = terrain_on;
|
||||
gui.draw_terrain_palette(gui.mapx()+10,150,selected_terrain);
|
||||
gui.draw_terrain_palette(gui.mapx()+10,142,selected_terrain);
|
||||
}
|
||||
|
||||
const gamemap::location hex = gui.hex_clicked_on(mousex,mousey);
|
||||
|
@ -142,7 +152,7 @@ int main(int argc, char** argv)
|
|||
|
||||
if(first_time) {
|
||||
std::cerr << "drawing terrain pallette...\n";
|
||||
gui.draw_terrain_palette(gui.mapx()+10,150,0);
|
||||
gui.draw_terrain_palette(gui.mapx()+10,142,0);
|
||||
first_time = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue