work on winXp

This commit is contained in:
2009-09-07 14:45:31 +04:00
parent 4e723909e7
commit d3064428c3
38 changed files with 36825 additions and 303 deletions

View File

@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: aliendefender
# Generated by qmake (2.01a) (Qt 4.5.2) on: ?? ????. 5 00:15:00 2009
# Generated by qmake (2.01a) (Qt 4.5.2) on: ?? ????. 7 13:03:43 2009
# Project: aliendefender.pro
# Template: app
# Command: /usr/bin/qmake -Wall -spec ../../share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro
@@ -48,7 +48,8 @@ SOURCES = main.cpp \
aliens.cpp \
udpsender.cpp \
towers.cpp moc_mainwindow.cpp \
moc_udpsender.cpp
moc_udpsender.cpp \
qrc_res.cpp
OBJECTS = main.o \
mainwindow.o \
adpainter.o \
@@ -56,7 +57,8 @@ OBJECTS = main.o \
udpsender.o \
towers.o \
moc_mainwindow.o \
moc_udpsender.o
moc_udpsender.o \
qrc_res.o
DIST = ../../share/qt4/mkspecs/common/g++.conf \
../../share/qt4/mkspecs/common/unix.conf \
../../share/qt4/mkspecs/common/linux.conf \
@@ -163,7 +165,7 @@ qmake: FORCE
dist:
@$(CHK_DIR_EXISTS) .tmp/aliendefender1.0.0 || $(MKDIR) .tmp/aliendefender1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents mainwindow.h adpainter.h aliens.h basestruct.h udpsender.h towers.h .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp adpainter.cpp aliens.cpp udpsender.cpp towers.cpp .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents mainwindow.ui .tmp/aliendefender1.0.0/ && (cd `dirname .tmp/aliendefender1.0.0` && $(TAR) aliendefender1.0.0.tar aliendefender1.0.0 && $(COMPRESS) aliendefender1.0.0.tar) && $(MOVE) `dirname .tmp/aliendefender1.0.0`/aliendefender1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/aliendefender1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents mainwindow.h adpainter.h aliens.h basestruct.h udpsender.h towers.h .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents res.qrc .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp adpainter.cpp aliens.cpp udpsender.cpp towers.cpp .tmp/aliendefender1.0.0/ && $(COPY_FILE) --parents mainwindow.ui .tmp/aliendefender1.0.0/ && (cd `dirname .tmp/aliendefender1.0.0` && $(TAR) aliendefender1.0.0.tar aliendefender1.0.0 && $(COMPRESS) aliendefender1.0.0.tar) && $(MOVE) `dirname .tmp/aliendefender1.0.0`/aliendefender1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/aliendefender1.0.0
clean:compiler_clean
@@ -195,8 +197,32 @@ moc_mainwindow.cpp: adpainter.h \
moc_udpsender.cpp: udpsender.h
/usr/bin/moc $(DEFINES) $(INCPATH) udpsender.h -o moc_udpsender.cpp
compiler_rcc_make_all:
compiler_rcc_make_all: qrc_res.cpp
compiler_rcc_clean:
-$(DEL_FILE) qrc_res.cpp
qrc_res.cpp: res.qrc \
images/Aliens/Al_0_5.png \
images/Aliens/Al_0_1.png \
images/Aliens/Al_0_9.png \
images/Aliens/Al_0_19.png \
images/Aliens/Al_0_15.png \
images/Aliens/Al_0_11.png \
images/Aliens/Al_0_4.png \
images/Aliens/Al_0_0.png \
images/Aliens/Al_0_8.png \
images/Aliens/Al_0_16.png \
images/Aliens/Al_0_12.png \
images/Aliens/Al_0_3.png \
images/Aliens/Al_0_7.png \
images/Aliens/Al_0_17.png \
images/Aliens/Al_0_13.png \
images/Aliens/Al_0_2.png \
images/Aliens/Al_0_6.png \
images/Aliens/Al_0_18.png \
images/Aliens/Al_0_14.png \
images/Aliens/Al_0_10.png
/usr/bin/rcc -name res res.qrc -o qrc_res.cpp
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
@@ -214,7 +240,7 @@ compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_uic_clean
compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
####### Compile
@@ -254,6 +280,9 @@ moc_mainwindow.o: moc_mainwindow.cpp
moc_udpsender.o: moc_udpsender.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_udpsender.o moc_udpsender.cpp
qrc_res.o: qrc_res.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_res.o qrc_res.cpp
####### Install
install: FORCE

216
Makefile.Debug Normal file
View File

@@ -0,0 +1,216 @@
#############################################################################
# Makefile for building: aliendefender
# Generated by qmake (2.01a) (Qt 4.5.2) on: ?? 6. ??? 19:08:54 2009
# Project: aliendefender.pro
# Template: app
#############################################################################
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
CFLAGS = -g -Wall $(DEFINES)
CXXFLAGS = -g -frtti -fexceptions -mthreads -Wall $(DEFINES)
INCPATH = -I"..\Qt\2009.03\qt\include\QtCore" -I"..\Qt\2009.03\qt\include\QtNetwork" -I"..\Qt\2009.03\qt\include\QtGui" -I"..\Qt\2009.03\qt\include\QtOpenGL" -I"..\Qt\2009.03\qt\include" -I"..\Qt\2009.03\qt\include\ActiveQt" -I"debug" -I"." -I"..\Qt\2009.03\qt\mkspecs\win32-g++"
LINK = g++
LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows
LIBS = -L"d:\Qt\2009.03\qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmaind -lQtOpenGLd4 -lQtGuid4 -lQtNetworkd4 -lQtCored4
QMAKE = d:\Qt\2009.03\qt\bin\qmake.exe
IDC = d:\Qt\2009.03\qt\bin\idc.exe
IDL = midl
ZIP = zip -r -9
DEF_FILE =
RES_FILE =
COPY = copy /y
COPY_FILE = $(COPY)
COPY_DIR = xcopy /s /q /y /i
DEL_FILE = del
DEL_DIR = rmdir
MOVE = move
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
####### Output directory
OBJECTS_DIR = debug
####### Files
SOURCES = main.cpp \
mainwindow.cpp \
adpainter.cpp \
aliens.cpp \
udpsender.cpp \
towers.cpp debug\moc_mainwindow.cpp \
debug\moc_udpsender.cpp \
debug\qrc_res.cpp
OBJECTS = debug/main.o \
debug/mainwindow.o \
debug/adpainter.o \
debug/aliens.o \
debug/udpsender.o \
debug/towers.o \
debug/moc_mainwindow.o \
debug/moc_udpsender.o \
debug/qrc_res.o
DIST =
QMAKE_TARGET = aliendefender
DESTDIR = debug\ #avoid trailing-slash linebreak
TARGET = aliendefender.exe
DESTDIR_TARGET = debug\aliendefender.exe
####### Implicit rules
.SUFFIXES: .cpp .cc .cxx .c
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
####### Build rules
first: all
all: Makefile.Debug $(DESTDIR_TARGET)
$(DESTDIR_TARGET): ui_mainwindow.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(DESTDIR_TARGET) $(OBJECTS) $(LIBS)
qmake: FORCE
@$(QMAKE) -Wall -spec ..\Qt\2009.03\qt\mkspecs\win32-g++ -win32 -o Makefile.Debug aliendefender.pro
dist:
$(ZIP) aliendefender.zip $(SOURCES) $(DIST) aliendefender.pro ..\Qt\2009.03\qt\mkspecs\qconfig.pri ..\Qt\2009.03\qt\mkspecs\features\qt_functions.prf ..\Qt\2009.03\qt\mkspecs\features\qt_config.prf ..\Qt\2009.03\qt\mkspecs\features\exclusive_builds.prf ..\Qt\2009.03\qt\mkspecs\features\default_pre.prf ..\Qt\2009.03\qt\mkspecs\features\win32\default_pre.prf ..\Qt\2009.03\qt\mkspecs\features\debug.prf ..\Qt\2009.03\qt\mkspecs\features\debug_and_release.prf ..\Qt\2009.03\qt\mkspecs\features\default_post.prf ..\Qt\2009.03\qt\mkspecs\features\win32\default_post.prf ..\Qt\2009.03\qt\mkspecs\features\build_pass.prf ..\Qt\2009.03\qt\mkspecs\features\win32\rtti.prf ..\Qt\2009.03\qt\mkspecs\features\win32\exceptions.prf ..\Qt\2009.03\qt\mkspecs\features\win32\stl.prf ..\Qt\2009.03\qt\mkspecs\features\shared.prf ..\Qt\2009.03\qt\mkspecs\features\warn_on.prf ..\Qt\2009.03\qt\mkspecs\features\qt.prf ..\Qt\2009.03\qt\mkspecs\features\win32\opengl.prf ..\Qt\2009.03\qt\mkspecs\features\win32\thread.prf ..\Qt\2009.03\qt\mkspecs\features\moc.prf ..\Qt\2009.03\qt\mkspecs\features\win32\windows.prf ..\Qt\2009.03\qt\mkspecs\features\resources.prf ..\Qt\2009.03\qt\mkspecs\features\uic.prf ..\Qt\2009.03\qt\mkspecs\features\yacc.prf ..\Qt\2009.03\qt\mkspecs\features\lex.prf ..\Qt\2009.03\qt\mkspecs\features\include_source_dir.prf d:\Qt\2009.03\qt\lib\qtmaind.prl HEADERS RESOURCES IMAGES SOURCES OBJECTIVE_SOURCES FORMS YACCSOURCES YACCSOURCES LEXSOURCES
clean: compiler_clean
-$(DEL_FILE) debug\main.o debug\mainwindow.o debug\adpainter.o debug\aliens.o debug\udpsender.o debug\towers.o debug\moc_mainwindow.o debug\moc_udpsender.o debug\qrc_res.o
distclean: clean
-$(DEL_FILE) $(DESTDIR_TARGET)
-$(DEL_FILE) Makefile.Debug
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
compiler_moc_header_make_all: debug/moc_mainwindow.cpp debug/moc_udpsender.cpp
compiler_moc_header_clean:
-$(DEL_FILE) debug\moc_mainwindow.cpp debug\moc_udpsender.cpp
debug/moc_mainwindow.cpp: adpainter.h \
basestruct.h \
aliens.h \
udpsender.h \
mainwindow.h
D:/Qt/2009.03/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 mainwindow.h -o debug\moc_mainwindow.cpp
debug/moc_udpsender.cpp: udpsender.h
D:/Qt/2009.03/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 udpsender.h -o debug\moc_udpsender.cpp
compiler_rcc_make_all: debug/qrc_res.cpp
compiler_rcc_clean:
-$(DEL_FILE) debug\qrc_res.cpp
debug/qrc_res.cpp: res.qrc \
images/Aliens/Al_0_5.png \
images/Aliens/Al_0_1.png \
images/Aliens/Al_0_9.png \
images/Aliens/Al_0_19.png \
images/Aliens/Al_0_15.png \
images/Aliens/Al_0_11.png \
images/Aliens/Al_0_4.png \
images/Aliens/Al_0_0.png \
images/Aliens/Al_0_8.png \
images/Aliens/Al_0_16.png \
images/Aliens/Al_0_12.png \
images/Aliens/Al_0_3.png \
images/Aliens/Al_0_7.png \
images/Aliens/Al_0_17.png \
images/Aliens/Al_0_13.png \
images/Aliens/Al_0_2.png \
images/Aliens/Al_0_6.png \
images/Aliens/Al_0_18.png \
images/Aliens/Al_0_14.png \
images/Aliens/Al_0_10.png
d:\Qt\2009.03\qt\bin\rcc.exe -name res res.qrc -o debug\qrc_res.cpp
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_mainwindow.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
ui_mainwindow.h: mainwindow.ui
d:\Qt\2009.03\qt\bin\uic.exe mainwindow.ui -o ui_mainwindow.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
####### Compile
debug/main.o: main.cpp mainwindow.h \
adpainter.h \
basestruct.h \
aliens.h \
udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\main.o main.cpp
debug/mainwindow.o: mainwindow.cpp mainwindow.h \
adpainter.h \
basestruct.h \
aliens.h \
udpsender.h \
ui_mainwindow.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\mainwindow.o mainwindow.cpp
debug/adpainter.o: adpainter.cpp adpainter.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\adpainter.o adpainter.cpp
debug/aliens.o: aliens.cpp aliens.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\aliens.o aliens.cpp
debug/udpsender.o: udpsender.cpp udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\udpsender.o udpsender.cpp
debug/towers.o: towers.cpp towers.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\towers.o towers.cpp
debug/moc_mainwindow.o: debug/moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp
debug/moc_udpsender.o: debug/moc_udpsender.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_udpsender.o debug\moc_udpsender.cpp
debug/qrc_res.o: debug/qrc_res.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\qrc_res.o debug\qrc_res.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:

216
Makefile.Release Normal file
View File

@@ -0,0 +1,216 @@
#############################################################################
# Makefile for building: aliendefender
# Generated by qmake (2.01a) (Qt 4.5.2) on: ?? 6. ??? 19:08:54 2009
# Project: aliendefender.pro
# Template: app
#############################################################################
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
CFLAGS = -O2 -Wall $(DEFINES)
CXXFLAGS = -O2 -frtti -fexceptions -mthreads -Wall $(DEFINES)
INCPATH = -I"..\Qt\2009.03\qt\include\QtCore" -I"..\Qt\2009.03\qt\include\QtNetwork" -I"..\Qt\2009.03\qt\include\QtGui" -I"..\Qt\2009.03\qt\include\QtOpenGL" -I"..\Qt\2009.03\qt\include" -I"..\Qt\2009.03\qt\include\ActiveQt" -I"release" -I"." -I"..\Qt\2009.03\qt\mkspecs\win32-g++"
LINK = g++
LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows
LIBS = -L"d:\Qt\2009.03\qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain -lQtOpenGL4 -lQtGui4 -lQtNetwork4 -lQtCore4
QMAKE = d:\Qt\2009.03\qt\bin\qmake.exe
IDC = d:\Qt\2009.03\qt\bin\idc.exe
IDL = midl
ZIP = zip -r -9
DEF_FILE =
RES_FILE =
COPY = copy /y
COPY_FILE = $(COPY)
COPY_DIR = xcopy /s /q /y /i
DEL_FILE = del
DEL_DIR = rmdir
MOVE = move
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
####### Output directory
OBJECTS_DIR = release
####### Files
SOURCES = main.cpp \
mainwindow.cpp \
adpainter.cpp \
aliens.cpp \
udpsender.cpp \
towers.cpp release\moc_mainwindow.cpp \
release\moc_udpsender.cpp \
release\qrc_res.cpp
OBJECTS = release/main.o \
release/mainwindow.o \
release/adpainter.o \
release/aliens.o \
release/udpsender.o \
release/towers.o \
release/moc_mainwindow.o \
release/moc_udpsender.o \
release/qrc_res.o
DIST =
QMAKE_TARGET = aliendefender
DESTDIR = release\ #avoid trailing-slash linebreak
TARGET = aliendefender.exe
DESTDIR_TARGET = release\aliendefender.exe
####### Implicit rules
.SUFFIXES: .cpp .cc .cxx .c
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
####### Build rules
first: all
all: Makefile.Release $(DESTDIR_TARGET)
$(DESTDIR_TARGET): ui_mainwindow.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(DESTDIR_TARGET) $(OBJECTS) $(LIBS)
qmake: FORCE
@$(QMAKE) -Wall -spec ..\Qt\2009.03\qt\mkspecs\win32-g++ -win32 -o Makefile.Release aliendefender.pro
dist:
$(ZIP) aliendefender.zip $(SOURCES) $(DIST) aliendefender.pro ..\Qt\2009.03\qt\mkspecs\qconfig.pri ..\Qt\2009.03\qt\mkspecs\features\qt_functions.prf ..\Qt\2009.03\qt\mkspecs\features\qt_config.prf ..\Qt\2009.03\qt\mkspecs\features\exclusive_builds.prf ..\Qt\2009.03\qt\mkspecs\features\default_pre.prf ..\Qt\2009.03\qt\mkspecs\features\win32\default_pre.prf ..\Qt\2009.03\qt\mkspecs\features\release.prf ..\Qt\2009.03\qt\mkspecs\features\debug_and_release.prf ..\Qt\2009.03\qt\mkspecs\features\default_post.prf ..\Qt\2009.03\qt\mkspecs\features\win32\default_post.prf ..\Qt\2009.03\qt\mkspecs\features\build_pass.prf ..\Qt\2009.03\qt\mkspecs\features\win32\rtti.prf ..\Qt\2009.03\qt\mkspecs\features\win32\exceptions.prf ..\Qt\2009.03\qt\mkspecs\features\win32\stl.prf ..\Qt\2009.03\qt\mkspecs\features\shared.prf ..\Qt\2009.03\qt\mkspecs\features\warn_on.prf ..\Qt\2009.03\qt\mkspecs\features\qt.prf ..\Qt\2009.03\qt\mkspecs\features\win32\opengl.prf ..\Qt\2009.03\qt\mkspecs\features\win32\thread.prf ..\Qt\2009.03\qt\mkspecs\features\moc.prf ..\Qt\2009.03\qt\mkspecs\features\win32\windows.prf ..\Qt\2009.03\qt\mkspecs\features\resources.prf ..\Qt\2009.03\qt\mkspecs\features\uic.prf ..\Qt\2009.03\qt\mkspecs\features\yacc.prf ..\Qt\2009.03\qt\mkspecs\features\lex.prf ..\Qt\2009.03\qt\mkspecs\features\include_source_dir.prf d:\Qt\2009.03\qt\lib\qtmain.prl HEADERS RESOURCES IMAGES SOURCES OBJECTIVE_SOURCES FORMS YACCSOURCES YACCSOURCES LEXSOURCES
clean: compiler_clean
-$(DEL_FILE) release\main.o release\mainwindow.o release\adpainter.o release\aliens.o release\udpsender.o release\towers.o release\moc_mainwindow.o release\moc_udpsender.o release\qrc_res.o
distclean: clean
-$(DEL_FILE) $(DESTDIR_TARGET)
-$(DEL_FILE) Makefile.Release
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
compiler_moc_header_make_all: release/moc_mainwindow.cpp release/moc_udpsender.cpp
compiler_moc_header_clean:
-$(DEL_FILE) release\moc_mainwindow.cpp release\moc_udpsender.cpp
release/moc_mainwindow.cpp: adpainter.h \
basestruct.h \
aliens.h \
udpsender.h \
mainwindow.h
D:/Qt/2009.03/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 mainwindow.h -o release\moc_mainwindow.cpp
release/moc_udpsender.cpp: udpsender.h
D:/Qt/2009.03/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 udpsender.h -o release\moc_udpsender.cpp
compiler_rcc_make_all: release/qrc_res.cpp
compiler_rcc_clean:
-$(DEL_FILE) release\qrc_res.cpp
release/qrc_res.cpp: res.qrc \
images/Aliens/Al_0_5.png \
images/Aliens/Al_0_1.png \
images/Aliens/Al_0_9.png \
images/Aliens/Al_0_19.png \
images/Aliens/Al_0_15.png \
images/Aliens/Al_0_11.png \
images/Aliens/Al_0_4.png \
images/Aliens/Al_0_0.png \
images/Aliens/Al_0_8.png \
images/Aliens/Al_0_16.png \
images/Aliens/Al_0_12.png \
images/Aliens/Al_0_3.png \
images/Aliens/Al_0_7.png \
images/Aliens/Al_0_17.png \
images/Aliens/Al_0_13.png \
images/Aliens/Al_0_2.png \
images/Aliens/Al_0_6.png \
images/Aliens/Al_0_18.png \
images/Aliens/Al_0_14.png \
images/Aliens/Al_0_10.png
d:\Qt\2009.03\qt\bin\rcc.exe -name res res.qrc -o release\qrc_res.cpp
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_mainwindow.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
ui_mainwindow.h: mainwindow.ui
d:\Qt\2009.03\qt\bin\uic.exe mainwindow.ui -o ui_mainwindow.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean
####### Compile
release/main.o: main.cpp mainwindow.h \
adpainter.h \
basestruct.h \
aliens.h \
udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\main.o main.cpp
release/mainwindow.o: mainwindow.cpp mainwindow.h \
adpainter.h \
basestruct.h \
aliens.h \
udpsender.h \
ui_mainwindow.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\mainwindow.o mainwindow.cpp
release/adpainter.o: adpainter.cpp adpainter.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\adpainter.o adpainter.cpp
release/aliens.o: aliens.cpp aliens.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\aliens.o aliens.cpp
release/udpsender.o: udpsender.cpp udpsender.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\udpsender.o udpsender.cpp
release/towers.o: towers.cpp towers.h \
basestruct.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\towers.o towers.cpp
release/moc_mainwindow.o: release/moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_mainwindow.o release\moc_mainwindow.cpp
release/moc_udpsender.o: release/moc_udpsender.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_udpsender.o release\moc_udpsender.cpp
release/qrc_res.o: release/qrc_res.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\qrc_res.o release\qrc_res.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:

View File

@@ -3,28 +3,11 @@
adpainter::adpainter(int width, int height, int adpcellsize)
{
QString str;
QPixmap tmpAlPixmap;
int i=1;
cellsize = adpcellsize;
buff = new QPixmap(width,height);
background = new QPixmap(width,height);
pen = new QPen();
brush = new QBrush();
str.setNum(i);
while (i != 0) {
str.setNum(i);
tmpAlPixmap.load("./images/Aliens/Al_0_" + str + ".png");
if (!tmpAlPixmap.isNull()) {
AlienPix.push_back(tmpAlPixmap);
tmpAlPixmap = 0;
i++;
}
else i = 0;
}
qDebug() << "pictures:" << AlienPix.size();
AnimAlien = 0;
StepAlien = 0;
}
@@ -56,10 +39,11 @@ void adpainter::drawgrid()
}
void adpainter::drawAliens(Alien * al,AlienImages * pixmaps)
void adpainter::drawAliens(Alien * al,QVector<QPixmap> * pixmaps)
{
//float tmpdx,tmpdy,arctg,tmpdx1,tmpdy1;
//arctg = 0;
QRectF rect;
painter.begin(buff);
pen->setColor(QColor::fromRgb(qRgb(80,200,100)));
brush->setColor(QColor::fromRgb(qRgb(230,10,10)));
@@ -68,7 +52,8 @@ void adpainter::drawAliens(Alien * al,AlienImages * pixmaps)
painter.setBrush(*brush);
painter.drawPixmap(0,0,*background);
for (int i = 0; i < al->path.size(); i++){
painter.drawEllipse(al->path[i].x() * cellsize +1, al->path[i].y() * cellsize +1, cellsize - 2, cellsize - 2);
rect.setRect(al->path[i].x() * cellsize +1, al->path[i].y() * cellsize +1, cellsize - 2, cellsize - 2);
painter.drawEllipse(rect);
}
//tmpdx = position->pnt.x() - path.at(StepAlien).x()*cellsize;
//tmpdy = position->pnt.y() - path.at(StepAlien).y()*cellsize;
@@ -94,7 +79,7 @@ void adpainter::drawAliens(Alien * al,AlienImages * pixmaps)
}*/
painter.translate(al->Position.pnt.x()+cellsize/2, al->Position.pnt.y()+cellsize/2);
painter.rotate(al->Position.angle);
painter.drawPixmap(-cellsize, -cellsize, cellsize*2, cellsize*2, pixmaps->pix.at(al->PicIndex));
painter.drawPixmap(-cellsize, -cellsize, cellsize*2, cellsize*2, pixmaps->at(al->PicIndex));
//AnimAlien++;
//if (AnimAlien >= AlienPix.size()) AnimAlien = 0;
/*if (StepAlien >= path.size()) {

View File

@@ -24,15 +24,13 @@ public:
void clearcell(QPoint pnt);
void clear();
QPixmap * getPixmap();
void drawAliens(Alien * al, AlienImages * pixmaps);//int xa, int ya);
int AnimAlien, StepAlien;
void drawAliens(Alien * al, QVector<QPixmap> * pixmaps);
private:
QPixmap * buff;
QPixmap * background;
QPainter painter;
QPen * pen;
QBrush * brush;
QVector<QPixmap> AlienPix;
int cellsize;
};

Binary file not shown.

Binary file not shown.

View File

@@ -18,3 +18,4 @@ HEADERS += mainwindow.h \
udpsender.h \
towers.h
FORMS += mainwindow.ui
RESOURCES += res.qrc

View File

@@ -78,7 +78,8 @@
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Debug</value>
<value key="QtVersionId" type="int" >0</value>
<value key="addQDumper" type="" ></value>
<value key="buildDirectory" type="QString" >/home/andrey/aliendefender</value>
<value key="buildDirectory" type="QString" ></value>
<value key="useShadowBuild" type="bool" >false</value>
</valuemap>
</data>
<data>
@@ -97,7 +98,7 @@
<value type="QString" >ANT_HOME=/usr/share/ant</value>
<value type="QString" >CONFIG_PROTECT_MASK=/etc/gentoo-release /etc/sandbox.d /etc/env.d/java/ /etc/udev/rules.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/ca-certificates.conf /etc/revdep-rebuild</value>
<value type="QString" >CVS_RSH=ssh</value>
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-eOteATVjzF,guid=b44512b6036a44fadd13f7184a99195c</value>
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-AeC9SnkuDH,guid=58c439d9d488d5b7b47be9744aa39c4d</value>
<value type="QString" >DESKTOP_SESSION=gnome</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value>
<value type="QString" >DISPLAY=:0.0</value>
@@ -108,7 +109,7 @@
<value type="QString" >GDM_LANG=ru_RU.UTF-8</value>
<value type="QString" >GDM_XSERVER_LOCATION=local</value>
<value type="QString" >GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString" >GNOME_KEYRING_SOCKET=/tmp/keyring-QdwkGk/socket</value>
<value type="QString" >GNOME_KEYRING_SOCKET=/tmp/keyring-ngsecP/socket</value>
<value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value>
<value type="QString" >HOME=/home/andrey</value>
<value type="QString" >INFOPATH=/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.19.1/info:/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3/info</value>
@@ -127,18 +128,18 @@
<value type="QString" >PWD=/home/andrey</value>
<value type="QString" >QMAKESPEC=linux-g++</value>
<value type="QString" >QTDIR=/usr</value>
<value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/26832,unix/buull-eeePC:/tmp/.ICE-unix/26832</value>
<value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/9926,unix/buull-eeePC:/tmp/.ICE-unix/9926</value>
<value type="QString" >SHELL=/bin/bash</value>
<value type="QString" >SHLVL=0</value>
<value type="QString" >SSH_AGENT_PID=26858</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-QdwkGk/socket.ssh</value>
<value type="QString" >SSH_AGENT_PID=9952</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-ngsecP/socket.ssh</value>
<value type="QString" >USER=andrey</value>
<value type="QString" >USERNAME=andrey</value>
<value type="QString" >WINDOWPATH=7</value>
<value type="QString" >XAUTHORITY=/home/andrey/.Xauthority</value>
<value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</value>
<value type="QString" >XDG_DATA_DIRS=/usr/local/share:/usr/share:/usr/share/gdm</value>
<value type="QString" >XDG_SESSION_COOKIE=998ded06c94c2e848fb0b05949c4e51c-1251547484.422246-434250397</value>
<value type="QString" >XDG_SESSION_COOKIE=998ded06c94c2e848fb0b05949c4e51c-1252236364.946962-291284020</value>
<value type="QString" >XSESSION=icewm</value>
</valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" >
@@ -166,7 +167,7 @@
<value type="QString" >ANT_HOME=/usr/share/ant</value>
<value type="QString" >CONFIG_PROTECT_MASK=/etc/gentoo-release /etc/sandbox.d /etc/env.d/java/ /etc/udev/rules.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/ca-certificates.conf /etc/revdep-rebuild</value>
<value type="QString" >CVS_RSH=ssh</value>
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-eOteATVjzF,guid=b44512b6036a44fadd13f7184a99195c</value>
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-AeC9SnkuDH,guid=58c439d9d488d5b7b47be9744aa39c4d</value>
<value type="QString" >DESKTOP_SESSION=gnome</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value>
<value type="QString" >DISPLAY=:0.0</value>
@@ -177,7 +178,7 @@
<value type="QString" >GDM_LANG=ru_RU.UTF-8</value>
<value type="QString" >GDM_XSERVER_LOCATION=local</value>
<value type="QString" >GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString" >GNOME_KEYRING_SOCKET=/tmp/keyring-QdwkGk/socket</value>
<value type="QString" >GNOME_KEYRING_SOCKET=/tmp/keyring-ngsecP/socket</value>
<value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value>
<value type="QString" >HOME=/home/andrey</value>
<value type="QString" >INFOPATH=/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.19.1/info:/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3/info</value>
@@ -196,18 +197,18 @@
<value type="QString" >PWD=/home/andrey</value>
<value type="QString" >QMAKESPEC=linux-g++</value>
<value type="QString" >QTDIR=/usr</value>
<value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/26832,unix/buull-eeePC:/tmp/.ICE-unix/26832</value>
<value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/9926,unix/buull-eeePC:/tmp/.ICE-unix/9926</value>
<value type="QString" >SHELL=/bin/bash</value>
<value type="QString" >SHLVL=0</value>
<value type="QString" >SSH_AGENT_PID=26858</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-QdwkGk/socket.ssh</value>
<value type="QString" >SSH_AGENT_PID=9952</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-ngsecP/socket.ssh</value>
<value type="QString" >USER=andrey</value>
<value type="QString" >USERNAME=andrey</value>
<value type="QString" >WINDOWPATH=7</value>
<value type="QString" >XAUTHORITY=/home/andrey/.Xauthority</value>
<value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</value>
<value type="QString" >XDG_DATA_DIRS=/usr/local/share:/usr/share:/usr/share/gdm</value>
<value type="QString" >XDG_SESSION_COOKIE=998ded06c94c2e848fb0b05949c4e51c-1251547484.422246-434250397</value>
<value type="QString" >XDG_SESSION_COOKIE=998ded06c94c2e848fb0b05949c4e51c-1252236364.946962-291284020</value>
<value type="QString" >XSESSION=icewm</value>
</valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" >
@@ -227,60 +228,43 @@
<valuemap type="QVariantMap" >
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList" >
<value type="QString" >ANT_HOME=/usr/share/ant</value>
<value type="QString" >CONFIG_PROTECT_MASK=/etc/gentoo-release /etc/sandbox.d /etc/env.d/java/ /etc/udev/rules.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/ca-certificates.conf /etc/revdep-rebuild</value>
<value type="QString" >CVS_RSH=ssh</value>
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-iS6sKMEKdx,guid=d594cb8104679cd3cf55dd174a8fe9e9</value>
<value type="QString" >DESKTOP_SESSION=gnome</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value>
<value type="QString" >DISPLAY=:0.0</value>
<value type="QString" >EDITOR=/bin/nano</value>
<value type="QString" >GCC_SPECS=</value>
<value type="QString" >GDK_USE_XFT=1</value>
<value type="QString" >GDMSESSION=gnome</value>
<value type="QString" >GDM_LANG=ru_RU.UTF-8</value>
<value type="QString" >GDM_XSERVER_LOCATION=local</value>
<value type="QString" >GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString" >GNOME_KEYRING_SOCKET=/tmp/keyring-FOm1wP/socket</value>
<value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value>
<value type="QString" >HOME=/home/andrey</value>
<value type="QString" >INFOPATH=/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.19.1/info:/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3/info</value>
<value type="QString" >JAVAC=/home/andrey/.gentoo/java-config-2/current-user-vm/bin/javac</value>
<value type="QString" >JAVA_HOME=/home/andrey/.gentoo/java-config-2/current-user-vm</value>
<value type="QString" >JDK_HOME=/home/andrey/.gentoo/java-config-2/current-user-vm</value>
<value type="QString" >LANG=ru_RU.UTF-8</value>
<value type="QString" >LESS=-R -M --shift 5</value>
<value type="QString" >LESSOPEN=|lesspipe.sh %s</value>
<value type="QString" >LOGNAME=andrey</value>
<value type="QString" >MANPATH=/home/andrey/.gentoo/java-config-2/current-user-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.19.1/man:/usr/share/gcc-data/i486-pc-linux-gnu/4.1.2/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.3.3/man:/etc/java-config/system-vm/man/:/usr/qt/3/doc/man:/opt/opera/share/man</value>
<value type="QString" >OPENGL_PROFILE=xorg-x11</value>
<value type="QString" >ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString" >PAGER=/usr/bin/less</value>
<value type="QString" >PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i486-pc-linux-gnu/gcc-bin/4.1.2:/usr/i686-pc-linux-gnu/gcc-bin/4.3.3:/usr/qt/3/bin:/usr/games/bin</value>
<value type="QString" >PWD=/home/andrey</value>
<value type="QString" >QMAKESPEC=linux-g++</value>
<value type="QString" >QTDIR=/usr</value>
<value type="QString" >SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/4700,unix/buull-eeePC:/tmp/.ICE-unix/4700</value>
<value type="QString" >SHELL=/bin/bash</value>
<value type="QString" >SHLVL=0</value>
<value type="QString" >SSH_AGENT_PID=4726</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-FOm1wP/socket.ssh</value>
<value type="QString" >USER=andrey</value>
<value type="QString" >USERNAME=andrey</value>
<value type="QString" >WINDOWPATH=7</value>
<value type="QString" >XAUTHORITY=/home/andrey/.Xauthority</value>
<value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</value>
<value type="QString" >XDG_DATA_DIRS=/usr/local/share:/usr/share:/usr/share/gdm</value>
<value type="QString" >XDG_SESSION_COOKIE=998ded06c94c2e848fb0b05949c4e51c-1250945512.215104-728413348</value>
<value type="QString" >XSESSION=icewm</value>
<value type="QString" >ALLUSERSPROFILE=C:\Documents and Settings\All Users</value>
<value type="QString" >APPDATA=C:\Documents and Settings\Andrey\Application Data</value>
<value type="QString" >COMMONPROGRAMFILES=C:\Program Files\Common Files</value>
<value type="QString" >COMPUTERNAME=COMP</value>
<value type="QString" >COMSPEC=C:\WINDOWS\system32\cmd.exe</value>
<value type="QString" >FP_NO_HOST_CHECK=NO</value>
<value type="QString" >HOMEDRIVE=C:</value>
<value type="QString" >HOMEPATH=\Documents and Settings\Andrey</value>
<value type="QString" >LOGONSERVER=\\COMP</value>
<value type="QString" >NUMBER_OF_PROCESSORS=2</value>
<value type="QString" >OS=Windows_NT</value>
<value type="QString" >PATH=D:\Qt\2009.03\mingw\bin;D:\Qt\2009.03\qt\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem</value>
<value type="QString" >PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH</value>
<value type="QString" >PROCESSOR_ARCHITECTURE=x86</value>
<value type="QString" >PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 6, GenuineIntel</value>
<value type="QString" >PROCESSOR_LEVEL=6</value>
<value type="QString" >PROCESSOR_REVISION=1706</value>
<value type="QString" >PROGRAMFILES=C:\Program Files</value>
<value type="QString" >QTDIR=D:/Qt/2009.03/qt</value>
<value type="QString" >SESSIONNAME=Console</value>
<value type="QString" >SYSTEMDRIVE=C:</value>
<value type="QString" >SYSTEMROOT=C:\WINDOWS</value>
<value type="QString" >TEMP=C:\DOCUME~1\Andrey\LOCALS~1\Temp</value>
<value type="QString" >TMP=C:\DOCUME~1\Andrey\LOCALS~1\Temp</value>
<value type="QString" >USERDOMAIN=COMP</value>
<value type="QString" >USERNAME=Andrey</value>
<value type="QString" >USERPROFILE=C:\Documents and Settings\Andrey</value>
<value type="QString" >VS90COMNTOOLS=D:\Programming\Microsoft Visual Studio 9.0\Common7\Tools\</value>
<value type="QString" >WINDIR=C:\WINDOWS</value>
</valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" >
<value type="QString" >clean</value>
<value type="QString" >-w</value>
</valuelist>
<value key="abstractProcess.command" type="QString" >/usr/bin/make</value>
<value key="abstractProcess.command" type="QString" >D:/Qt/2009.03/mingw/bin/mingw32-make.exe</value>
<value key="abstractProcess.enabled" type="bool" >true</value>
<value key="abstractProcess.workingDirectory" type="QString" >/home/andrey/sm11/Alien Defender/wavetrace</value>
<value key="abstractProcess.workingDirectory" type="QString" >D:/aliendefender</value>
</valuemap>
</data>
<data>

View File

@@ -21,8 +21,10 @@ Aliens::Aliens(int TmpDestx, int TmpDesty, int afw, int afh, int alcellsize)
Alien al;
al.PicType = 0;
al.PathIndex = 1;
al.PicIndex = 0;
al.PicFrame = 0;
al.Speed = 0.1;
loadPixmaps(&al);
srcAliens.push_back(al);
CurWave = 0;
}
@@ -30,24 +32,23 @@ Aliens::Aliens(int TmpDestx, int TmpDesty, int afw, int afh, int alcellsize)
bool Aliens::loadPixmaps(Alien * al)
{
if (AliensPixmaps.size() != 0) {
for (int i = 0; i < AliensPixmaps.size(); i++) {
if (AliensPixmaps[i].type == al->PicType) {
qDebug() << "Pictures exist!";
return true;
bool load = true;
int i = 0;
while(load) {
QVector<QPixmap> pixmaps;
if (loadPixmap(i,&pixmaps) > 0) {
AliensPixmaps.push_back(pixmaps);
i++;
}
else load = false;
}
}
AlienImages * pixmaps;
pixmaps = new AlienImages;
if (loadPixmap(al->PicType,pixmaps) > 0) AliensPixmaps.push_back(* pixmaps);
qDebug() << "Pictures loaded for" << AliensPixmaps.size() << "alien types!";
if (AliensPixmaps.size() > 0) return true;
else return false;
qDebug() << "Pictures loaded!";
return true;
}
int Aliens::loadPixmap(int PicType, AlienImages * pixmaps)
int Aliens::loadPixmap(int PicType, QVector<QPixmap> * pixmaps)
{
int i = 1;
QString str1,str2;
@@ -56,20 +57,17 @@ int Aliens::loadPixmap(int PicType, AlienImages * pixmaps)
str2.setNum(PicType);
qDebug() << PicType;
while (i != 0) {
str1.setNum(i);
tmpAlPixmap.load("./images/Aliens/Al_" + str2 + "_" + str1 + ".png");
//qDebug() << tmpAlPixmap.isNull();
str1.setNum(i-1);
tmpAlPixmap.load(":/images/Aliens/Al_" + str2 + "_" + str1 + ".png");
if (!tmpAlPixmap.isNull()) {
//AlienPix.push_back(tmpAlPixmap);
pixmaps->pix.push_back(tmpAlPixmap);
pixmaps->type = PicType;
pixmaps->push_back(tmpAlPixmap);
tmpAlPixmap = 0;
i++;
}
else i = 0;
}
qDebug() << "pictures:" << pixmaps->pix.size();
return pixmaps->pix.size();
qDebug() << "pictures:" << pixmaps->size();
return pixmaps->size();
}
@@ -81,12 +79,7 @@ void Aliens::clearCells()
bool Aliens::AddAlien()
{
//bool ok;
//Alien al;
//AliensCnt++;
//if (CurWave < 0) CurWave = 0;
//if (AliensCnt > curAliens.size()) ReDim Preserve Aliens(AliensCnt) As Alien
//Aliens(AliensCnt) = SrcAliens(CurWave)
curAliens.push_back(srcAliens.at(CurWave));
//curAliens[AliensCnt].Level = CurWave + 1;
curAliens[curAliens.size()-1].Position.pnt.setX(0*cellsize);
@@ -94,12 +87,10 @@ bool Aliens::AddAlien()
//DestPoint.setX(fw - 1);
//DestPoint.setY(fh / 2); //curAliens[AliensCnt].Position.pnt.y();
curAliens[curAliens.size()-1].DestPnt = DestPoint;
// curAliens[AliensCnt].MaxFrame = 0; //srcAliens[CurWave].MaxFrame;
// curAliens[AliensCnt].PicFrame = 0;
for (int i = 0; i < fw; i++) {
for (int j = 0; j < fh; j++) TmpCells[i][j] = Cells[i][j];
}
return (CreatePath(&curAliens[curAliens.size()-1]) && loadPixmaps(&curAliens[curAliens.size()-1]));
return (CreatePath(&curAliens[curAliens.size()-1]));
}
@@ -117,18 +108,18 @@ bool Aliens::CreatePath(Alien * al)
tmpPnt.push_back(tp);
for (int i = 0; i < al->path.size() - 1; i++)
{
tp.setX((al->path[i].x() + al->path[i + 1].x()) / 2);
tp.setY((al->path[i].y() + al->path[i + 1].y()) / 2);
tp.setX((al->path[i].x() + al->path[i + 1].x()) / 2.0);
tp.setY((al->path[i].y() + al->path[i + 1].y()) / 2.0);
tmpPnt.push_back(tp);
}
tp = al->path[al->path.size() - 1];
tmpPnt.push_back(tp);
//qDebug() << tmpPnt.size();
al->path = tmpPnt;
al->Position.pnt.setX(al->path.at(0).x()*cellsize);
al->Position.pnt.setY(al->path.at(0).y()*cellsize);
}
tmpPnt.clear();
al->Position.pnt.setX(al->path[0].x()*cellsize);
al->Position.pnt.setY(al->path[0].y()*cellsize);
return true;
}
return false;
@@ -137,6 +128,8 @@ bool Aliens::CreatePath(Alien * al)
void Aliens::updateAliens()
{
qDebug("=========");
//qDebug() << curAliens[0].path;
for (int i = 0; i < curAliens.size(); i++) updateAlienPos(&curAliens[i]);
}
@@ -144,16 +137,22 @@ void Aliens::updateAliens()
void Aliens::updateAlienPos(Alien * al)
{
float arctg = 0;
qreal dx,dy,fdx,fdy;
dx = (al->path[al->PathIndex - 1].x() - al->path.at(al->PathIndex).x());
dy = (al->path[al->PathIndex - 1].y() - al->path.at(al->PathIndex).y());
qDebug("=========");
float px,py;
float dx,dy,fdx,fdy;
//qDebug() << cellsize;
px = al->path[al->PathIndex].x() - al->path[al->PathIndex - 1].x();
py = al->path[al->PathIndex].y() - al->path[al->PathIndex - 1].y();
dx = al->Position.pnt.x() - al->path[al->PathIndex].x() * (cellsize);
dy = al->Position.pnt.y() - al->path[al->PathIndex].y() * (cellsize);
qDebug() << dx << ";" << dy;
qDebug() << al->path[al->PathIndex];
qDebug() << al->path[al->PathIndex-1];
qDebug() << px << ";" << py;
//qDebug() << al->path;//[al->PathIndex];
//qDebug() << al->path.size();
qDebug() << "PathIndex" << al->PathIndex;
//qDebug() << al->path[al->PathIndex-1];
if (al->PathIndex + 1 < al->path.size()) {
fdx = al->Position.pnt.x() - al->path.at(al->PathIndex+1).x()*cellsize;
fdy = al->Position.pnt.y() - al->path.at(al->PathIndex+1).y()*cellsize;
fdx = al->Position.pnt.x() - al->path[al->PathIndex+1].x() * cellsize;
fdy = al->Position.pnt.y() - al->path[al->PathIndex+1].y() * cellsize;
if (fdy != 0) arctg = atanf(fdx/fdy);
else if (fdx < 0) arctg = -3.1415/2;
else arctg = 3.1415/2;
@@ -161,21 +160,30 @@ void Aliens::updateAlienPos(Alien * al)
//qDebug() << fdx << ";" << fdy;
al->Position.angle = 180*(-arctg)/3.1415;
if (fdy < 0) al->Position.angle = 180 + al->Position.angle;
qDebug() << al->Position.angle;
if (qAbs(dx) < 1 && qAbs(dy) < 1) al->PathIndex++;
//qDebug() << al->Position.angle;
qDebug() << al->Position.pnt;
if (qAbs(dx) <= al->Speed && qAbs(dy) <= al->Speed) {
qDebug("next");
al->Position.pnt.setX(al->path[al->PathIndex].x() * cellsize);
al->Position.pnt.setY(al->path[al->PathIndex].y() * cellsize);
al->PathIndex++;
}
else {
al->Position.pnt.setX(al->Position.pnt.x()-dx*al->Speed);
al->Position.pnt.setY(al->Position.pnt.y()-dy*al->Speed);
qDebug("go");
al->Position.pnt.setX(al->Position.pnt.x()+px * al->Speed * cellsize);
al->Position.pnt.setY(al->Position.pnt.y()+py * al->Speed * cellsize);
}
qDebug() << al->Position.pnt;
al->PicIndex++;
if (al->PicIndex >= AliensPixmaps[al->PicType].pix.size()) al->PicIndex = 0;
qDebug() << "PicIndex" << al->PicIndex;
qDebug() << "PicType" << al->PicType;
qDebug() << AliensPixmaps[al->PicType].size();
if (al->PicIndex >= AliensPixmaps[al->PicType].size()) al->PicIndex = 0;
if (al->PathIndex >= al->path.size()) {
qDebug() << "run agan";
al->PathIndex = 1;
al->Position.pnt.setX(al->path.at(0).x()*cellsize);
al->Position.pnt.setY(al->path.at(0).y()*cellsize);
al->Position.pnt.setX(al->path.value(0).x()*cellsize);
al->Position.pnt.setY(al->path.value(0).y()*cellsize);
}
}
@@ -193,20 +201,25 @@ void Aliens::updateAlienPos(Alien * al)
bool Aliens::recreatePath()
{
//QPointF ap;
QVector <QPointF> tmpPath;
bool trace;
for (int i = 0; i < fw; i++)
for (int j = 0; j < fh; j++) TmpCells[i][j] = Cells[i][j];
for (int i = 0; i < curAliens.size(); i++) {
//ap = curAliens[i].Position.pnt;
//curAliens[i].Position.pnt.setX(0);
//curAliens[i].Position.pnt.setY(fh/2);
qDebug() << "Alinen N" << i;
curAliens[i].Position.pnt.setX(curAliens[i].path[curAliens[i].PathIndex - 1].x() * cellsize);
curAliens[i].Position.pnt.setY(curAliens[i].path[curAliens[i].PathIndex - 1].y() * cellsize);
curAliens[i].PathIndex = 1;
tmpPath = curAliens[i].path;
curAliens[i].path.clear();
trace = CreatePath(&curAliens[i]);
if (!trace) return false;
//curAliens[i].Position.pnt = ap;
if (!trace) {
curAliens[i].path = tmpPath;
tmpPath.clear();
return false;
}
}
qDebug() << trace;
return true;
}
@@ -226,7 +239,7 @@ bool Aliens::WaveTrace(Alien * al)
//qDebug() << "trace";
tmpp = curp;
curp.clear();
qDebug() << tmpp.size();
//qDebug() << tmpp.size();
stop = true;
for (int i = 0; i < tmpp.size(); i++) {
cp = tmpp[i];

View File

@@ -20,7 +20,7 @@ class Aliens
void clearCells();
bool recreatePath();
void updateAliens();
QVector<AlienImages> AliensPixmaps;
QVector<QVector<QPixmap> > AliensPixmaps;
private:
int cellsize;
int ** TmpCells;
@@ -30,7 +30,7 @@ class Aliens
bool CreatePath(Alien* al);
void InvWaveTrace(QPoint cp, int cnt, Alien* al);
void updateAlienPos(Alien * al);
int loadPixmap(int PicType, AlienImages * pixmaps);
int loadPixmap(int PicType, QVector<QPixmap> * pixmaps);
bool loadPixmaps(Alien * al);
};

BIN
aliens.o

Binary file not shown.

View File

@@ -10,10 +10,10 @@
#include <QDebug>
#include <cmath>
#include <deque>
//#include <deque>
using std::atan;
using std::deque;
//using std::deque;
struct FPVector
{
@@ -59,7 +59,7 @@ struct Alien
float PicFrame;
//float PicI;
//float Regeneration;
deque<QPointF> path;//path() As Point
QVector<QPointF> path;//path() As Point
QPoint DestPnt;
// Effect Effects;
};

BIN
debug/adpainter.o Normal file

Binary file not shown.

BIN
debug/aliendefender.exe Normal file

Binary file not shown.

BIN
debug/aliens.o Normal file

Binary file not shown.

BIN
debug/main.o Normal file

Binary file not shown.

BIN
debug/mainwindow.o Normal file

Binary file not shown.

73
debug/moc_mainwindow.cpp Normal file
View File

@@ -0,0 +1,73 @@
/****************************************************************************
** Meta object code from reading C++ file 'mainwindow.h'
**
** Created: Sun 6. Sep 19:03:09 2009
** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../mainwindow.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'mainwindow.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 61
#error "This file was generated using the moc from 4.5.2. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_MainWindow[] = {
// content:
2, // revision
0, // classname
0, 0, // classinfo
1, 12, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
// slots: signature, parameters, type, tag, flags
12, 11, 11, 11, 0x0a,
0 // eod
};
static const char qt_meta_stringdata_MainWindow[] = {
"MainWindow\0\0ADrender()\0"
};
const QMetaObject MainWindow::staticMetaObject = {
{ &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow,
qt_meta_data_MainWindow, 0 }
};
const QMetaObject *MainWindow::metaObject() const
{
return &staticMetaObject;
}
void *MainWindow::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_MainWindow))
return static_cast<void*>(const_cast< MainWindow*>(this));
return QMainWindow::qt_metacast(_clname);
}
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: ADrender(); break;
default: ;
}
_id -= 1;
}
return _id;
}
QT_END_MOC_NAMESPACE

BIN
debug/moc_mainwindow.o Normal file

Binary file not shown.

73
debug/moc_udpsender.cpp Normal file
View File

@@ -0,0 +1,73 @@
/****************************************************************************
** Meta object code from reading C++ file 'udpsender.h'
**
** Created: Sun 6. Sep 19:03:10 2009
** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../udpsender.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'udpsender.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 61
#error "This file was generated using the moc from 4.5.2. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_UdpSender[] = {
// content:
2, // revision
0, // classname
0, 0, // classinfo
1, 12, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
// slots: signature, parameters, type, tag, flags
11, 10, 10, 10, 0x0a,
0 // eod
};
static const char qt_meta_stringdata_UdpSender[] = {
"UdpSender\0\0slotRead()\0"
};
const QMetaObject UdpSender::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_UdpSender,
qt_meta_data_UdpSender, 0 }
};
const QMetaObject *UdpSender::metaObject() const
{
return &staticMetaObject;
}
void *UdpSender::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_UdpSender))
return static_cast<void*>(const_cast< UdpSender*>(this));
return QObject::qt_metacast(_clname);
}
int UdpSender::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: slotRead(); break;
default: ;
}
_id -= 1;
}
return _id;
}
QT_END_MOC_NAMESPACE

BIN
debug/moc_udpsender.o Normal file

Binary file not shown.

11970
debug/qrc_images.cpp Normal file

File diff suppressed because it is too large Load Diff

BIN
debug/qrc_images.o Normal file

Binary file not shown.

11970
debug/qrc_res.cpp Normal file

File diff suppressed because it is too large Load Diff

BIN
debug/qrc_res.o Normal file

Binary file not shown.

BIN
debug/towers.o Normal file

Binary file not shown.

BIN
debug/udpsender.o Normal file

Binary file not shown.

View File

@@ -8,7 +8,7 @@ MainWindow::MainWindow(QWidget *parent)
qDebug() << "Load START!";
ui->setupUi(this);
sndr = new UdpSender("127.0.0.1",10101);
//sndr->connectSend("hellow");
sndr->connectSend("hellow");
cellsize = 16;
destx = this->width() / cellsize;
desty = this->height() / cellsize / 2;
@@ -21,7 +21,6 @@ MainWindow::MainWindow(QWidget *parent)
if (!aliens->AddAlien()) qDebug() << "Error Loading";
this->setGeometry(100,100,this->width(),this->height());
//qDebug() << "QT version" << qVersion();
//AnimAlien = 0;
timer->start(50);
qDebug() << "Load DONE!";
}
@@ -31,7 +30,7 @@ void MainWindow::ADrender()
{
//aliens->AddAlien();
aliens->updateAliens();
adp->drawAliens(&aliens->curAliens[0], &aliens->AliensPixmaps[aliens->curAliens[0].PicType]);
adp->drawAliens(&aliens->curAliens[0], &aliens->AliensPixmaps[0]);
this->repaint();
}
@@ -75,10 +74,13 @@ void MainWindow::SetCell(int x, int y)
aliens->Cells[cp.x()][cp.y()] = - 1;
adp->drawcell(cp);
//aliens->recreatePath();
adp->StepAlien=0;
//adp->AnimAlien=0;
//aliens->curAliens[aliens->CurWave].Position.pnt = aliens->curAliens[aliens->CurWave-1].path[adp->StepAlien];
if (!aliens->recreatePath()) ClearCell(x,y);
if (!aliens->recreatePath()) {
aliens->Cells[cp.x()][cp.y()] = 0;
adp->clearcell(cp);
qDebug() << "DONT CLOSE THE PATH";
}
}
}
@@ -93,11 +95,9 @@ void MainWindow::ClearCell(int x, int y)
//qDebug() << "click: " << cp.x() << ";" << cp.y();
aliens->Cells[cp.x()][cp.y()] = 0;
adp->clearcell(cp);
adp->StepAlien=0;
qDebug() << aliens->recreatePath();
aliens->recreatePath();
//aliens->clearAliens();
//aliens->AddAlien();
}
}

Binary file not shown.

View File

@@ -1,7 +1,7 @@
/****************************************************************************
** Meta object code from reading C++ file 'mainwindow.h'
**
** Created: Sat Sep 5 17:46:21 2009
** Created: Mon Sep 7 13:03:55 2009
** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2)
**
** WARNING! All changes made in this file will be lost!

Binary file not shown.

11970
qrc_res.cpp Normal file

File diff suppressed because it is too large Load Diff

BIN
qrc_res.o Normal file

Binary file not shown.

24
res.qrc Normal file
View File

@@ -0,0 +1,24 @@
<RCC>
<qresource prefix="/" >
<file>images/Aliens/Al_0_0.png</file>
<file>images/Aliens/Al_0_1.png</file>
<file>images/Aliens/Al_0_2.png</file>
<file>images/Aliens/Al_0_3.png</file>
<file>images/Aliens/Al_0_4.png</file>
<file>images/Aliens/Al_0_5.png</file>
<file>images/Aliens/Al_0_6.png</file>
<file>images/Aliens/Al_0_7.png</file>
<file>images/Aliens/Al_0_8.png</file>
<file>images/Aliens/Al_0_9.png</file>
<file>images/Aliens/Al_0_10.png</file>
<file>images/Aliens/Al_0_11.png</file>
<file>images/Aliens/Al_0_12.png</file>
<file>images/Aliens/Al_0_13.png</file>
<file>images/Aliens/Al_0_14.png</file>
<file>images/Aliens/Al_0_15.png</file>
<file>images/Aliens/Al_0_16.png</file>
<file>images/Aliens/Al_0_17.png</file>
<file>images/Aliens/Al_0_18.png</file>
<file>images/Aliens/Al_0_19.png</file>
</qresource>
</RCC>

View File

@@ -38,8 +38,8 @@ void UdpSender::connectSend(QString s)
{
sz = s.length();
sock->connectToHost(addr,port);
qDebug() << sock->error();
//qDebug() << sock->error();
qDebug() << sock->state();
qDebug() << sock->socketDescriptor();
if (sock->write(s.toUtf8())>0) qDebug() << "writen!";
//qDebug() << sock->socketDescriptor();
qDebug() << sock->write(s.toUtf8()) << "writen!";
}

Binary file not shown.

View File

@@ -1,7 +1,7 @@
/********************************************************************************
** Form generated from reading ui file 'mainwindow.ui'
**
** Created: Fri Sep 4 20:29:58 2009
** Created: Sun 6. Sep 19:03:05 2009
** by: Qt User Interface Compiler version 4.5.2
**
** WARNING! All changes made in this file will be lost when recompiling ui file!