diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..db49656 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,20 @@ +find_package(GLUT REQUIRED) +find_package(OpenGL REQUIRED) +find_package(SDL REQUIRED) +find_package(SDL_image REQUIRED) +find_package(SDL_mixer REQUIRED) + + +if (WANT_GTK) + find_package(GTK REQUIRED) + add_definitions(-DWANT_GTK) + add_subdirectory(src/gtk-gui) +endif(WANT_GTK) + +check_include_files(fcntl.h HAS_FCNTL) +check_include_files(sys/poll.h HAS_POLL) + + +add_subdirectory(enet) +add_subdirectory(src) +add_subdirectory(data) diff --git a/enet/CMakeLists.txt b/enet/CMakeLists.txt new file mode 100644 index 0000000..35c2f39 --- /dev/null +++ b/enet/CMakeLists.txt @@ -0,0 +1,35 @@ +project(enet) + +set(enet_SRCS +host.c +list.c +packet.c +peer.c +protocol.c +unix.c +win32.c +) + +# this is probably will break the compilation on some plataforms. +add_definitions(-DHAS_SOCKLEN_T) + +# This is right? +add_definitions(-Denet_malloc=malloc) +add_definitions(-Denet_free=free) +add_definitions(-Denet_rand=rand) + +include_directories(include) +add_library(enet ${enet_SRCS}) +target_link_libraries(enet) + +install(TARGETS enet DESTINATION lib) +install(FILES include/enet/callbacks.h +include/enet/enet.h +include/enet/list.h +include/enet/protocol.h +include/enet/time.h +include/enet/types.h +include/enet/unix.h +include/enet/utility.h +include/enet/win32.h +DESTINATION include/enet) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..4beaf97 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,241 @@ +project(krackattack) + +set(crackattack_SRCS +ActionRecorder.cxx +Attack.cxx +Block.cxx +BlockManager.cxx +CelebrationManager.cxx +Clock.cxx +ComboManager.cxx +ComboTabulator.cxx +Communicator.cxx +ComputerPlayer.cxx +ComputerPlayerAI.cxx +Controller.cxx +CountDownManager.cxx +Creep.cxx +Displayer.cxx +DrawBlocks.cxx +DrawCandy.cxx +DrawCountDown.cxx +DrawExternalCandy.cxx +DrawGarbage.cxx +DrawLevelLights.cxx +DrawMessages.cxx +DrawScoreRecord.cxx +DrawSwapper.cxx +DrawWinRecord.cxx +Game.cxx +Garbage.cxx +GarbageFlavorImage.cxx +GarbageGenerator.cxx +GarbageManager.cxx +GarbageQueue.cxx +Grid.cxx +LevelLights.cxx +LightManager.cxx +LoseBar.cxx +MessageManager.cxx +MetaState.cxx +Music.cxx +OBJModel.cxx +Primitives.cxx +Random.cxx +Score.cxx +ScoreRecordManager.cxx +SignManager.cxx +Sine.cxx +Sound.cxx +SparkleManager.cxx +Spring.cxx +String.cxx +Swapper.cxx +TextureLoader.cxx +WinRecord.cxx +X.cxx +obj_block.cxx +obj_clock.cxx +obj_external_candy.cxx +obj_garbage.cxx +obj_garbage_small.cxx +obj_garbage_thick_corner.cxx +obj_garbage_thick_edge.cxx +obj_garbage_thick_middle.cxx +obj_garbage_thin_cap.cxx +obj_garbage_thin_middle.cxx +obj_level_lights.cxx +obj_messages.cxx +obj_name.cxx +obj_score_record.cxx +obj_sign.cxx +obj_sparkle.cxx +obj_swapper.cxx +) + +include_directories(../enet/include) +add_executable(crack-attack ${crackattack_SRCS}) +target_link_libraries(crack-attack enet ${OPENGL_gl_LIBRARY} ${GLUT_LIBRARIES} ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${SDLMIXER_LIBRARY} ${GTK_LIBRARIES}) + +install(TARGETS crack-attack DESTINATION bin) +install(FILES +../data/clock_0.tga +../data/clock_1.tga +../data/clock_2.tga +../data/clock_3.tga +../data/clock_4.tga +../data/clock_5.tga +../data/clock_6.tga +../data/clock_7.tga +../data/clock_8.tga +../data/clock_9.tga +../data/clock_extra.tga +../data/font0_0.tga +../data/font0_1.tga +../data/font0_2.tga +../data/font0_3.tga +../data/font0_4.tga +../data/font0_5.tga +../data/font0_6.tga +../data/font0_7.tga +../data/font0_8.tga +../data/font0_9.tga +../data/font0_a.tga +../data/font0_and.tga +../data/font0_at.tga +../data/font0_b.tga +../data/font0_br.tga +../data/font0_c.tga +../data/font0_ca.tga +../data/font0_cb.tga +../data/font0_cc.tga +../data/font0_cd.tga +../data/font0_ce.tga +../data/font0_cf.tga +../data/font0_cg.tga +../data/font0_ch.tga +../data/font0_ci.tga +../data/font0_cj.tga +../data/font0_ck.tga +../data/font0_cl.tga +../data/font0_cln.tga +../data/font0_cm.tga +../data/font0_cma.tga +../data/font0_cn.tga +../data/font0_co.tga +../data/font0_cp.tga +../data/font0_cq.tga +../data/font0_cr.tga +../data/font0_cs.tga +../data/font0_ct.tga +../data/font0_cu.tga +../data/font0_cv.tga +../data/font0_cw.tga +../data/font0_cx.tga +../data/font0_cy.tga +../data/font0_cz.tga +../data/font0_d.tga +../data/font0_ds.tga +../data/font0_e.tga +../data/font0_ep.tga +../data/font0_eq.tga +../data/font0_f.tga +../data/font0_g.tga +../data/font0_gt.tga +../data/font0_h.tga +../data/font0_i.tga +../data/font0_j.tga +../data/font0_k.tga +../data/font0_l.tga +../data/font0_lt.tga +../data/font0_m.tga +../data/font0_mn.tga +../data/font0_n.tga +../data/font0_o.tga +../data/font0_p.tga +../data/font0_pd.tga +../data/font0_pe.tga +../data/font0_pl.tga +../data/font0_pr.tga +../data/font0_ps.tga +../data/font0_pu.tga +../data/font0_q.tga +../data/font0_qm.tga +../data/font0_r.tga +../data/font0_s.tga +../data/font0_sl.tga +../data/font0_t.tga +../data/font0_td.tga +../data/font0_u.tga +../data/font0_v.tga +../data/font0_w.tga +../data/font0_x.tga +../data/font0_y.tga +../data/font0_z.tga +../data/font0_za.tga +../data/font0_zb.tga +../data/font0_zc.tga +../data/font0_zd.tga +../data/sign_10.tga +../data/sign_11.tga +../data/sign_12.tga +../data/sign_4.tga +../data/sign_5.tga +../data/sign_6.tga +../data/sign_7.tga +../data/sign_8.tga +../data/sign_9.tga +../data/sign_bonus.tga +../data/sign_x10.tga +../data/sign_x11.tga +../data/sign_x12.tga +../data/sign_x2.tga +../data/sign_x3.tga +../data/sign_x4.tga +../data/sign_x5.tga +../data/sign_x6.tga +../data/sign_x7.tga +../data/sign_x8.tga +../data/sign_x9.tga + +../data/bjorn.png +../data/count_down_1.png +../data/count_down_2.png +../data/count_down_3.png +../data/count_down_go.png +../data/flavor_1.png +../data/flavor_2.png +../data/garbage_flavor_000.png +../data/garbage_flavor_001.png +../data/garbage_flavor_002.png +../data/garbage_flavor_003.png +../data/garbage_flavor_004.png +../data/garbage_flavor_005.png +../data/garbage_flavor_logo.png +../data/garbage_flavor_logo_x.png +../data/garbage_lightmap_0.png +../data/garbage_lightmap_1.png +../data/garbage_lightmap_2.png +../data/garbage_lightmap_3.png +../data/garbage_lightmap_4.png +../data/garbage_lightmap_5.png +../data/logo.png +../data/logo_x.png +../data/message_anykey.png +../data/message_game_over.png +../data/message_loser.png +../data/message_paused.png +../data/message_waiting.png +../data/message_winner.png +../data/preview_extremely_reduced.png +../data/preview_normal.png +../data/preview_reduced.png + +../data/models/crackattackcubehires.obj +../data/models/crackattackcubehires_simplified.obj +../data/models/crackattackcubehires_tex.obj +../data/models/crackattackcubemedres.obj +../data/models/crackattackcubemedres_tex.obj +../data/models/cube.obj + +DESTINATION share/crack-attack) diff --git a/src/Music.cxx b/src/Music.cxx index 3f0d8ce..0fe3477 100644 --- a/src/Music.cxx +++ b/src/Music.cxx @@ -1,8 +1,8 @@ /* * Music.cxx - * Miguel Ángel Vilela García - 8/29/03 + * Miguel �ngel Vilela Garc�a - 8/29/03 * - * Copyright (C) 2003 Miguel Ángel Vilela García + * Copyright (C) 2003 Miguel �ngel Vilela Garc�a * Copyright (C) 2005 See COPYRIGHT * Crack Attack! is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT file @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Miguel Ángel Vilela García - www.miguev.net + * Miguel �ngel Vilela Garc�a - www.miguev.net */ #include "Music.h" @@ -31,6 +31,8 @@ #include "Random.h" #include "Sound.h" +using namespace std; + Mix_Music *music = NULL; int music_available = 0; int keep_playing = 0; diff --git a/src/Sound.cxx b/src/Sound.cxx index f1dd1dd..05b6b74 100644 --- a/src/Sound.cxx +++ b/src/Sound.cxx @@ -1,8 +1,8 @@ /* * Sound.cxx - * Miguel Ángel Vilela García - 8/29/03 + * Miguel �ngel Vilela Garc�a - 8/29/03 * - * Copyright (C) 2003 Miguel Ángel Vilela García + * Copyright (C) 2003 Miguel �ngel Vilela Garc�a * Copyright (C) 2005 See COPYRIGHT * Crack Attack! is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT file @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Miguel Ángel Vilela García - www.miguev.net + * Miguel �ngel Vilela Garc�a - www.miguev.net */ #include "Sound.h" @@ -33,6 +33,7 @@ #include #include +using namespace std; typedef map ChunkMap; vector sounds; diff --git a/src/gtk-gui/CMakeLists.txt b/src/gtk-gui/CMakeLists.txt new file mode 100644 index 0000000..1c8b23b --- /dev/null +++ b/src/gtk-gui/CMakeLists.txt @@ -0,0 +1,15 @@ +project(gtkgui) + +set(gtkgui_SRCS +callbacks.cxx +gui_main.cxx +interface.cxx +modeparser.cxx +persist.cxx +support.cxx +) + +include_directories(${GTK_INCLUDE_DIR}) +add_library(gtkgui STATIC ${gtkgui_SRCS}) +target_link_libraries(gtkgui ${GTK_LIBRARIES}) +