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
+35 -6
View File
@@ -1,6 +1,6 @@
############################################################################# #############################################################################
# Makefile for building: aliendefender # 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 # Project: aliendefender.pro
# Template: app # Template: app
# Command: /usr/bin/qmake -Wall -spec ../../share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug -o Makefile aliendefender.pro # 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 \ aliens.cpp \
udpsender.cpp \ udpsender.cpp \
towers.cpp moc_mainwindow.cpp \ towers.cpp moc_mainwindow.cpp \
moc_udpsender.cpp moc_udpsender.cpp \
qrc_res.cpp
OBJECTS = main.o \ OBJECTS = main.o \
mainwindow.o \ mainwindow.o \
adpainter.o \ adpainter.o \
@@ -56,7 +57,8 @@ OBJECTS = main.o \
udpsender.o \ udpsender.o \
towers.o \ towers.o \
moc_mainwindow.o \ moc_mainwindow.o \
moc_udpsender.o moc_udpsender.o \
qrc_res.o
DIST = ../../share/qt4/mkspecs/common/g++.conf \ DIST = ../../share/qt4/mkspecs/common/g++.conf \
../../share/qt4/mkspecs/common/unix.conf \ ../../share/qt4/mkspecs/common/unix.conf \
../../share/qt4/mkspecs/common/linux.conf \ ../../share/qt4/mkspecs/common/linux.conf \
@@ -163,7 +165,7 @@ qmake: FORCE
dist: dist:
@$(CHK_DIR_EXISTS) .tmp/aliendefender1.0.0 || $(MKDIR) .tmp/aliendefender1.0.0 @$(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 clean:compiler_clean
@@ -195,8 +197,32 @@ moc_mainwindow.cpp: adpainter.h \
moc_udpsender.cpp: udpsender.h moc_udpsender.cpp: udpsender.h
/usr/bin/moc $(DEFINES) $(INCPATH) udpsender.h -o moc_udpsender.cpp /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: 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_make_all: qmake_image_collection.cpp
compiler_image_collection_clean: compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp -$(DEL_FILE) qmake_image_collection.cpp
@@ -214,7 +240,7 @@ compiler_yacc_impl_make_all:
compiler_yacc_impl_clean: compiler_yacc_impl_clean:
compiler_lex_make_all: compiler_lex_make_all:
compiler_lex_clean: 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 ####### Compile
@@ -254,6 +280,9 @@ moc_mainwindow.o: moc_mainwindow.cpp
moc_udpsender.o: moc_udpsender.cpp moc_udpsender.o: moc_udpsender.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o 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
install: FORCE install: FORCE
+216
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
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:
+5 -20
View File
@@ -3,28 +3,11 @@
adpainter::adpainter(int width, int height, int adpcellsize) adpainter::adpainter(int width, int height, int adpcellsize)
{ {
QString str;
QPixmap tmpAlPixmap;
int i=1;
cellsize = adpcellsize; cellsize = adpcellsize;
buff = new QPixmap(width,height); buff = new QPixmap(width,height);
background = new QPixmap(width,height); background = new QPixmap(width,height);
pen = new QPen(); pen = new QPen();
brush = new QBrush(); 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; //float tmpdx,tmpdy,arctg,tmpdx1,tmpdy1;
//arctg = 0; //arctg = 0;
QRectF rect;
painter.begin(buff); painter.begin(buff);
pen->setColor(QColor::fromRgb(qRgb(80,200,100))); pen->setColor(QColor::fromRgb(qRgb(80,200,100)));
brush->setColor(QColor::fromRgb(qRgb(230,10,10))); brush->setColor(QColor::fromRgb(qRgb(230,10,10)));
@@ -68,7 +52,8 @@ void adpainter::drawAliens(Alien * al,AlienImages * pixmaps)
painter.setBrush(*brush); painter.setBrush(*brush);
painter.drawPixmap(0,0,*background); painter.drawPixmap(0,0,*background);
for (int i = 0; i < al->path.size(); i++){ 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; //tmpdx = position->pnt.x() - path.at(StepAlien).x()*cellsize;
//tmpdy = position->pnt.y() - path.at(StepAlien).y()*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.translate(al->Position.pnt.x()+cellsize/2, al->Position.pnt.y()+cellsize/2);
painter.rotate(al->Position.angle); 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++; //AnimAlien++;
//if (AnimAlien >= AlienPix.size()) AnimAlien = 0; //if (AnimAlien >= AlienPix.size()) AnimAlien = 0;
/*if (StepAlien >= path.size()) { /*if (StepAlien >= path.size()) {
+1 -3
View File
@@ -24,15 +24,13 @@ public:
void clearcell(QPoint pnt); void clearcell(QPoint pnt);
void clear(); void clear();
QPixmap * getPixmap(); QPixmap * getPixmap();
void drawAliens(Alien * al, AlienImages * pixmaps);//int xa, int ya); void drawAliens(Alien * al, QVector<QPixmap> * pixmaps);
int AnimAlien, StepAlien;
private: private:
QPixmap * buff; QPixmap * buff;
QPixmap * background; QPixmap * background;
QPainter painter; QPainter painter;
QPen * pen; QPen * pen;
QBrush * brush; QBrush * brush;
QVector<QPixmap> AlienPix;
int cellsize; int cellsize;
}; };
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+21 -20
View File
@@ -1,20 +1,21 @@
# ------------------------------------------------- # -------------------------------------------------
# Project created by QtCreator 2009-08-17T19:38:55 # Project created by QtCreator 2009-08-17T19:38:55
# ------------------------------------------------- # -------------------------------------------------
QT += network \ QT += network \
opengl opengl
TARGET = aliendefender TARGET = aliendefender
TEMPLATE = app TEMPLATE = app
SOURCES += main.cpp \ SOURCES += main.cpp \
mainwindow.cpp \ mainwindow.cpp \
adpainter.cpp \ adpainter.cpp \
aliens.cpp \ aliens.cpp \
udpsender.cpp \ udpsender.cpp \
towers.cpp towers.cpp
HEADERS += mainwindow.h \ HEADERS += mainwindow.h \
adpainter.h \ adpainter.h \
aliens.h \ aliens.h \
basestruct.h \ basestruct.h \
udpsender.h \ udpsender.h \
towers.h towers.h
FORMS += mainwindow.ui FORMS += mainwindow.ui
RESOURCES += res.qrc
+45 -61
View File
@@ -78,7 +78,8 @@
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Debug</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Debug</value>
<value key="QtVersionId" type="int" >0</value> <value key="QtVersionId" type="int" >0</value>
<value key="addQDumper" type="" ></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> </valuemap>
</data> </data>
<data> <data>
@@ -97,7 +98,7 @@
<value type="QString" >ANT_HOME=/usr/share/ant</value> <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" >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" >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_SESSION=gnome</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value> <value type="QString" >DESKTOP_STARTUP_ID=</value>
<value type="QString" >DISPLAY=:0.0</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_LANG=ru_RU.UTF-8</value>
<value type="QString" >GDM_XSERVER_LOCATION=local</value> <value type="QString" >GDM_XSERVER_LOCATION=local</value>
<value type="QString" >GNOME_DESKTOP_SESSION_ID=this-is-deprecated</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" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value>
<value type="QString" >HOME=/home/andrey</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" >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" >PWD=/home/andrey</value>
<value type="QString" >QMAKESPEC=linux-g++</value> <value type="QString" >QMAKESPEC=linux-g++</value>
<value type="QString" >QTDIR=/usr</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" >SHELL=/bin/bash</value>
<value type="QString" >SHLVL=0</value> <value type="QString" >SHLVL=0</value>
<value type="QString" >SSH_AGENT_PID=26858</value> <value type="QString" >SSH_AGENT_PID=9952</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-QdwkGk/socket.ssh</value> <value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-ngsecP/socket.ssh</value>
<value type="QString" >USER=andrey</value> <value type="QString" >USER=andrey</value>
<value type="QString" >USERNAME=andrey</value> <value type="QString" >USERNAME=andrey</value>
<value type="QString" >WINDOWPATH=7</value> <value type="QString" >WINDOWPATH=7</value>
<value type="QString" >XAUTHORITY=/home/andrey/.Xauthority</value> <value type="QString" >XAUTHORITY=/home/andrey/.Xauthority</value>
<value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</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_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> <value type="QString" >XSESSION=icewm</value>
</valuelist> </valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" > <valuelist key="abstractProcess.arguments" type="QVariantList" >
@@ -166,7 +167,7 @@
<value type="QString" >ANT_HOME=/usr/share/ant</value> <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" >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" >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_SESSION=gnome</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value> <value type="QString" >DESKTOP_STARTUP_ID=</value>
<value type="QString" >DISPLAY=:0.0</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_LANG=ru_RU.UTF-8</value>
<value type="QString" >GDM_XSERVER_LOCATION=local</value> <value type="QString" >GDM_XSERVER_LOCATION=local</value>
<value type="QString" >GNOME_DESKTOP_SESSION_ID=this-is-deprecated</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" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value>
<value type="QString" >HOME=/home/andrey</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" >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" >PWD=/home/andrey</value>
<value type="QString" >QMAKESPEC=linux-g++</value> <value type="QString" >QMAKESPEC=linux-g++</value>
<value type="QString" >QTDIR=/usr</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" >SHELL=/bin/bash</value>
<value type="QString" >SHLVL=0</value> <value type="QString" >SHLVL=0</value>
<value type="QString" >SSH_AGENT_PID=26858</value> <value type="QString" >SSH_AGENT_PID=9952</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-QdwkGk/socket.ssh</value> <value type="QString" >SSH_AUTH_SOCK=/tmp/keyring-ngsecP/socket.ssh</value>
<value type="QString" >USER=andrey</value> <value type="QString" >USER=andrey</value>
<value type="QString" >USERNAME=andrey</value> <value type="QString" >USERNAME=andrey</value>
<value type="QString" >WINDOWPATH=7</value> <value type="QString" >WINDOWPATH=7</value>
<value type="QString" >XAUTHORITY=/home/andrey/.Xauthority</value> <value type="QString" >XAUTHORITY=/home/andrey/.Xauthority</value>
<value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</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_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> <value type="QString" >XSESSION=icewm</value>
</valuelist> </valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" > <valuelist key="abstractProcess.arguments" type="QVariantList" >
@@ -227,60 +228,43 @@
<valuemap type="QVariantMap" > <valuemap type="QVariantMap" >
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Debug</value> <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList" > <valuelist key="abstractProcess.Environment" type="QVariantList" >
<value type="QString" >ANT_HOME=/usr/share/ant</value> <value type="QString" >ALLUSERSPROFILE=C:\Documents and Settings\All Users</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" >APPDATA=C:\Documents and Settings\Andrey\Application Data</value>
<value type="QString" >CVS_RSH=ssh</value> <value type="QString" >COMMONPROGRAMFILES=C:\Program Files\Common Files</value>
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-iS6sKMEKdx,guid=d594cb8104679cd3cf55dd174a8fe9e9</value> <value type="QString" >COMPUTERNAME=COMP</value>
<value type="QString" >DESKTOP_SESSION=gnome</value> <value type="QString" >COMSPEC=C:\WINDOWS\system32\cmd.exe</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value> <value type="QString" >FP_NO_HOST_CHECK=NO</value>
<value type="QString" >DISPLAY=:0.0</value> <value type="QString" >HOMEDRIVE=C:</value>
<value type="QString" >EDITOR=/bin/nano</value> <value type="QString" >HOMEPATH=\Documents and Settings\Andrey</value>
<value type="QString" >GCC_SPECS=</value> <value type="QString" >LOGONSERVER=\\COMP</value>
<value type="QString" >GDK_USE_XFT=1</value> <value type="QString" >NUMBER_OF_PROCESSORS=2</value>
<value type="QString" >GDMSESSION=gnome</value> <value type="QString" >OS=Windows_NT</value>
<value type="QString" >GDM_LANG=ru_RU.UTF-8</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" >GDM_XSERVER_LOCATION=local</value> <value type="QString" >PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH</value>
<value type="QString" >GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value> <value type="QString" >PROCESSOR_ARCHITECTURE=x86</value>
<value type="QString" >GNOME_KEYRING_SOCKET=/tmp/keyring-FOm1wP/socket</value> <value type="QString" >PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 6, GenuineIntel</value>
<value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/andrey/.gtkrc-1.2-gnome2</value> <value type="QString" >PROCESSOR_LEVEL=6</value>
<value type="QString" >HOME=/home/andrey</value> <value type="QString" >PROCESSOR_REVISION=1706</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" >PROGRAMFILES=C:\Program Files</value>
<value type="QString" >JAVAC=/home/andrey/.gentoo/java-config-2/current-user-vm/bin/javac</value> <value type="QString" >QTDIR=D:/Qt/2009.03/qt</value>
<value type="QString" >JAVA_HOME=/home/andrey/.gentoo/java-config-2/current-user-vm</value> <value type="QString" >SESSIONNAME=Console</value>
<value type="QString" >JDK_HOME=/home/andrey/.gentoo/java-config-2/current-user-vm</value> <value type="QString" >SYSTEMDRIVE=C:</value>
<value type="QString" >LANG=ru_RU.UTF-8</value> <value type="QString" >SYSTEMROOT=C:\WINDOWS</value>
<value type="QString" >LESS=-R -M --shift 5</value> <value type="QString" >TEMP=C:\DOCUME~1\Andrey\LOCALS~1\Temp</value>
<value type="QString" >LESSOPEN=|lesspipe.sh %s</value> <value type="QString" >TMP=C:\DOCUME~1\Andrey\LOCALS~1\Temp</value>
<value type="QString" >LOGNAME=andrey</value> <value type="QString" >USERDOMAIN=COMP</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" >USERNAME=Andrey</value>
<value type="QString" >OPENGL_PROFILE=xorg-x11</value> <value type="QString" >USERPROFILE=C:\Documents and Settings\Andrey</value>
<value type="QString" >ORBIT_SOCKETDIR=/tmp/orbit-andrey</value> <value type="QString" >VS90COMNTOOLS=D:\Programming\Microsoft Visual Studio 9.0\Common7\Tools\</value>
<value type="QString" >PAGER=/usr/bin/less</value> <value type="QString" >WINDIR=C:\WINDOWS</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>
</valuelist> </valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" > <valuelist key="abstractProcess.arguments" type="QVariantList" >
<value type="QString" >clean</value> <value type="QString" >clean</value>
<value type="QString" >-w</value> <value type="QString" >-w</value>
</valuelist> </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.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> </valuemap>
</data> </data>
<data> <data>
+115 -102
View File
@@ -8,21 +8,23 @@ Aliens::Aliens(int TmpDestx, int TmpDesty, int afw, int afh, int alcellsize)
DestPoint.setX(TmpDestx - 1); DestPoint.setX(TmpDestx - 1);
DestPoint.setY(TmpDesty); DestPoint.setY(TmpDesty);
fw = afw; fw = afw;
fh = afh; fh = afh;
//AliensCnt = -1; //AliensCnt = -1;
CurWave = -1; CurWave = -1;
Cells = new int*[fw]; Cells = new int*[fw];
TmpCells = new int*[fw]; TmpCells = new int*[fw];
for (int i = 0; i < fw; i++) { for (int i = 0; i < fw; i++) {
Cells[i] = new int[fh]; Cells[i] = new int[fh];
TmpCells[i] = new int[fh]; TmpCells[i] = new int[fh];
} }
clearCells(); clearCells();
Alien al; Alien al;
al.PicType = 0; al.PicType = 0;
al.PathIndex = 1; al.PathIndex = 1;
al.PicIndex = 0;
al.PicFrame = 0; al.PicFrame = 0;
al.Speed = 0.1; al.Speed = 0.1;
loadPixmaps(&al);
srcAliens.push_back(al); srcAliens.push_back(al);
CurWave = 0; CurWave = 0;
} }
@@ -30,24 +32,23 @@ Aliens::Aliens(int TmpDestx, int TmpDesty, int afw, int afh, int alcellsize)
bool Aliens::loadPixmaps(Alien * al) bool Aliens::loadPixmaps(Alien * al)
{ {
if (AliensPixmaps.size() != 0) { bool load = true;
for (int i = 0; i < AliensPixmaps.size(); i++) { int i = 0;
if (AliensPixmaps[i].type == al->PicType) { while(load) {
qDebug() << "Pictures exist!"; QVector<QPixmap> pixmaps;
return true; if (loadPixmap(i,&pixmaps) > 0) {
} AliensPixmaps.push_back(pixmaps);
i++;
} }
else load = false;
} }
AlienImages * pixmaps; qDebug() << "Pictures loaded for" << AliensPixmaps.size() << "alien types!";
pixmaps = new AlienImages; if (AliensPixmaps.size() > 0) return true;
if (loadPixmap(al->PicType,pixmaps) > 0) AliensPixmaps.push_back(* pixmaps);
else return false; 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; int i = 1;
QString str1,str2; QString str1,str2;
@@ -56,20 +57,17 @@ int Aliens::loadPixmap(int PicType, AlienImages * pixmaps)
str2.setNum(PicType); str2.setNum(PicType);
qDebug() << PicType; qDebug() << PicType;
while (i != 0) { while (i != 0) {
str1.setNum(i); str1.setNum(i-1);
tmpAlPixmap.load("./images/Aliens/Al_" + str2 + "_" + str1 + ".png"); tmpAlPixmap.load(":/images/Aliens/Al_" + str2 + "_" + str1 + ".png");
//qDebug() << tmpAlPixmap.isNull();
if (!tmpAlPixmap.isNull()) { if (!tmpAlPixmap.isNull()) {
//AlienPix.push_back(tmpAlPixmap); pixmaps->push_back(tmpAlPixmap);
pixmaps->pix.push_back(tmpAlPixmap);
pixmaps->type = PicType;
tmpAlPixmap = 0; tmpAlPixmap = 0;
i++; i++;
} }
else i = 0; else i = 0;
} }
qDebug() << "pictures:" << pixmaps->pix.size(); qDebug() << "pictures:" << pixmaps->size();
return pixmaps->pix.size(); return pixmaps->size();
} }
@@ -81,12 +79,7 @@ void Aliens::clearCells()
bool Aliens::AddAlien() bool Aliens::AddAlien()
{ {
//bool ok;
//Alien al;
//AliensCnt++;
//if (CurWave < 0) CurWave = 0; //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.push_back(srcAliens.at(CurWave));
//curAliens[AliensCnt].Level = CurWave + 1; //curAliens[AliensCnt].Level = CurWave + 1;
curAliens[curAliens.size()-1].Position.pnt.setX(0*cellsize); curAliens[curAliens.size()-1].Position.pnt.setX(0*cellsize);
@@ -94,12 +87,10 @@ bool Aliens::AddAlien()
//DestPoint.setX(fw - 1); //DestPoint.setX(fw - 1);
//DestPoint.setY(fh / 2); //curAliens[AliensCnt].Position.pnt.y(); //DestPoint.setY(fh / 2); //curAliens[AliensCnt].Position.pnt.y();
curAliens[curAliens.size()-1].DestPnt = DestPoint; 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 i = 0; i < fw; i++) {
for (int j = 0; j < fh; j++) TmpCells[i][j] = Cells[i][j]; 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,19 +108,19 @@ bool Aliens::CreatePath(Alien * al)
tmpPnt.push_back(tp); tmpPnt.push_back(tp);
for (int i = 0; i < al->path.size() - 1; i++) for (int i = 0; i < al->path.size() - 1; i++)
{ {
tp.setX((al->path[i].x() + al->path[i + 1].x()) / 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); tp.setY((al->path[i].y() + al->path[i + 1].y()) / 2.0);
tmpPnt.push_back(tp); tmpPnt.push_back(tp);
} }
tp = al->path[al->path.size() - 1]; tp = al->path[al->path.size() - 1];
tmpPnt.push_back(tp); tmpPnt.push_back(tp);
//qDebug() << tmpPnt.size(); //qDebug() << tmpPnt.size();
al->path = tmpPnt; 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(); tmpPnt.clear();
return true; al->Position.pnt.setX(al->path[0].x()*cellsize);
al->Position.pnt.setY(al->path[0].y()*cellsize);
return true;
} }
return false; return false;
} }
@@ -137,6 +128,8 @@ bool Aliens::CreatePath(Alien * al)
void Aliens::updateAliens() void Aliens::updateAliens()
{ {
qDebug("=========");
//qDebug() << curAliens[0].path;
for (int i = 0; i < curAliens.size(); i++) updateAlienPos(&curAliens[i]); for (int i = 0; i < curAliens.size(); i++) updateAlienPos(&curAliens[i]);
} }
@@ -144,16 +137,22 @@ void Aliens::updateAliens()
void Aliens::updateAlienPos(Alien * al) void Aliens::updateAlienPos(Alien * al)
{ {
float arctg = 0; float arctg = 0;
qreal dx,dy,fdx,fdy; float px,py;
dx = (al->path[al->PathIndex - 1].x() - al->path.at(al->PathIndex).x()); float dx,dy,fdx,fdy;
dy = (al->path[al->PathIndex - 1].y() - al->path.at(al->PathIndex).y()); //qDebug() << cellsize;
qDebug("========="); 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() << dx << ";" << dy;
qDebug() << al->path[al->PathIndex]; qDebug() << px << ";" << py;
qDebug() << al->path[al->PathIndex-1]; //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()) { if (al->PathIndex + 1 < al->path.size()) {
fdx = al->Position.pnt.x() - al->path.at(al->PathIndex+1).x()*cellsize; fdx = al->Position.pnt.x() - al->path[al->PathIndex+1].x() * cellsize;
fdy = al->Position.pnt.y() - al->path.at(al->PathIndex+1).y()*cellsize; fdy = al->Position.pnt.y() - al->path[al->PathIndex+1].y() * cellsize;
if (fdy != 0) arctg = atanf(fdx/fdy); if (fdy != 0) arctg = atanf(fdx/fdy);
else if (fdx < 0) arctg = -3.1415/2; else if (fdx < 0) arctg = -3.1415/2;
else arctg = 3.1415/2; else arctg = 3.1415/2;
@@ -161,21 +160,30 @@ void Aliens::updateAlienPos(Alien * al)
//qDebug() << fdx << ";" << fdy; //qDebug() << fdx << ";" << fdy;
al->Position.angle = 180*(-arctg)/3.1415; al->Position.angle = 180*(-arctg)/3.1415;
if (fdy < 0) al->Position.angle = 180 + al->Position.angle; if (fdy < 0) al->Position.angle = 180 + al->Position.angle;
qDebug() << al->Position.angle; //qDebug() << al->Position.angle;
if (qAbs(dx) < 1 && qAbs(dy) < 1) al->PathIndex++; 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 { else {
al->Position.pnt.setX(al->Position.pnt.x()-dx*al->Speed); qDebug("go");
al->Position.pnt.setY(al->Position.pnt.y()-dy*al->Speed); 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; qDebug() << al->Position.pnt;
al->PicIndex++; al->PicIndex++;
qDebug() << "PicIndex" << al->PicIndex;
if (al->PicIndex >= AliensPixmaps[al->PicType].pix.size()) al->PicIndex = 0; 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()) { if (al->PathIndex >= al->path.size()) {
qDebug() << "run agan"; qDebug() << "run agan";
al->PathIndex = 1; al->PathIndex = 1;
al->Position.pnt.setX(al->path.at(0).x()*cellsize); al->Position.pnt.setX(al->path.value(0).x()*cellsize);
al->Position.pnt.setY(al->path.at(0).y()*cellsize); al->Position.pnt.setY(al->path.value(0).y()*cellsize);
} }
} }
@@ -193,107 +201,112 @@ void Aliens::updateAlienPos(Alien * al)
bool Aliens::recreatePath() bool Aliens::recreatePath()
{ {
//QPointF ap; QVector <QPointF> tmpPath;
bool trace; bool trace;
for (int i = 0; i < fw; i++) for (int i = 0; i < fw; i++)
for (int j = 0; j < fh; j++) TmpCells[i][j] = Cells[i][j]; for (int j = 0; j < fh; j++) TmpCells[i][j] = Cells[i][j];
for (int i = 0; i < curAliens.size(); i++) { 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; 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(); curAliens[i].path.clear();
trace = CreatePath(&curAliens[i]); trace = CreatePath(&curAliens[i]);
if (!trace) return false; if (!trace) {
//curAliens[i].Position.pnt = ap; curAliens[i].path = tmpPath;
tmpPath.clear();
return false;
}
} }
qDebug() << trace;
return true; return true;
} }
bool Aliens::WaveTrace(Alien * al) bool Aliens::WaveTrace(Alien * al)
{ {
bool stop = false; bool stop = false;
int step = 2; int step = 2;
QPoint cp, tp; QPoint cp, tp;
QRect fr(0, 0, fw, fh); QRect fr(0, 0, fw, fh);
QVector<QPoint> tmpp, curp; QVector<QPoint> tmpp, curp;
cp.setX(al->Position.pnt.x()/cellsize); cp.setX(al->Position.pnt.x()/cellsize);
cp.setY(al->Position.pnt.y()/cellsize); cp.setY(al->Position.pnt.y()/cellsize);
curp.push_back(cp); curp.push_back(cp);
TmpCells[cp.x()][cp.y()] = 1; TmpCells[cp.x()][cp.y()] = 1;
while (!stop) { while (!stop) {
//qDebug() << "trace"; //qDebug() << "trace";
tmpp = curp; tmpp = curp;
curp.clear(); curp.clear();
qDebug() << tmpp.size(); //qDebug() << tmpp.size();
stop = true; stop = true;
for (int i = 0; i < tmpp.size(); i++) { for (int i = 0; i < tmpp.size(); i++) {
cp = tmpp[i]; cp = tmpp[i];
if (cp == al->DestPnt) { if (cp == al->DestPnt) {
TmpCells[cp.x()][cp.y()] = step; TmpCells[cp.x()][cp.y()] = step;
qDebug() << "Wawe trace done"; qDebug() << "Wawe trace done";
InvWaveTrace(cp, step, al); InvWaveTrace(cp, step, al);
qDebug() << al->path.size(); qDebug() << al->path.size();
return true; return true;
} }
tp.setX(cp.x() - 1); tp.setX(cp.x() - 1);
tp.setY(cp.y()); tp.setY(cp.y());
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) { if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step; TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp); curp.push_back(tp);
stop = false; stop = false;
} }
tp.setX(cp.x() + 1); tp.setX(cp.x() + 1);
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) { if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step; TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp); curp.push_back(tp);
stop = false; stop = false;
} }
tp.setX(cp.x()); tp.setX(cp.x());
tp.setY(cp.y() - 1); tp.setY(cp.y() - 1);
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) { if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step; TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp); curp.push_back(tp);
stop = false; stop = false;
} }
tp.setY(cp.y() + 1); tp.setY(cp.y() + 1);
if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) { if (fr.contains(tp) && TmpCells[tp.x()][tp.y()] == 0) {
TmpCells[tp.x()][tp.y()] = step; TmpCells[tp.x()][tp.y()] = step;
curp.push_back(tp); curp.push_back(tp);
stop = false; stop = false;
} }
} }
step++; step++;
} }
qDebug() << "false wawetrace"; qDebug() << "false wawetrace";
return false; return false;
} }
void Aliens::InvWaveTrace(QPoint cp, int cnt, Alien * al) void Aliens::InvWaveTrace(QPoint cp, int cnt, Alien * al)
{ {
QPoint wp, Ppnt; QPoint wp, Ppnt;
int Ind, c, AliensTmpDestX, AliensTmpDestY, xpp, ypp, xnn, ynn; int Ind, c, AliensTmpDestX, AliensTmpDestY, xpp, ypp, xnn, ynn;
unsigned char chk; unsigned char chk;
Ppnt = wp = cp; Ppnt = wp = cp;
xnn=0; xnn=0;
xpp=0; xpp=0;
ynn=0; ynn=0;
ypp=0; ypp=0;
cnt--; cnt--;
al->path.push_front(Ppnt); al->path.push_front(Ppnt);
AliensTmpDestX = al->Position.pnt.x(); AliensTmpDestX = al->Position.pnt.x();
AliensTmpDestY = al->Position.pnt.y(); AliensTmpDestY = al->Position.pnt.y();
while (cnt > 1) while (cnt > 1)
{ {
cnt--; cnt--;
chk = 0; chk = 0;
Ind = 0; Ind = 0;
c = 0; c = 0;
if (wp.x() - 1 >= 0 && TmpCells[wp.x()-1][wp.y()] == cnt) if (wp.x() - 1 >= 0 && TmpCells[wp.x()-1][wp.y()] == cnt)
{ {
chk = chk | 0x01; chk = chk | 0x01;
c++; c++;
} }
if (wp.x() + 1 < fw && TmpCells[wp.x()+1][wp.y()] == cnt) if (wp.x() + 1 < fw && TmpCells[wp.x()+1][wp.y()] == cnt)
@@ -394,7 +407,7 @@ void Aliens::InvWaveTrace(QPoint cp, int cnt, Alien * al)
ypp++; ypp++;
} }
} }
Ppnt = wp; Ppnt = wp;
al->path.push_front(Ppnt); al->path.push_front(Ppnt);
} }
} }
+2 -2
View File
@@ -20,7 +20,7 @@ class Aliens
void clearCells(); void clearCells();
bool recreatePath(); bool recreatePath();
void updateAliens(); void updateAliens();
QVector<AlienImages> AliensPixmaps; QVector<QVector<QPixmap> > AliensPixmaps;
private: private:
int cellsize; int cellsize;
int ** TmpCells; int ** TmpCells;
@@ -30,7 +30,7 @@ class Aliens
bool CreatePath(Alien* al); bool CreatePath(Alien* al);
void InvWaveTrace(QPoint cp, int cnt, Alien* al); void InvWaveTrace(QPoint cp, int cnt, Alien* al);
void updateAlienPos(Alien * al); void updateAlienPos(Alien * al);
int loadPixmap(int PicType, AlienImages * pixmaps); int loadPixmap(int PicType, QVector<QPixmap> * pixmaps);
bool loadPixmaps(Alien * al); bool loadPixmaps(Alien * al);
}; };
BIN
View File
Binary file not shown.
+4 -4
View File
@@ -10,10 +10,10 @@
#include <QDebug> #include <QDebug>
#include <cmath> #include <cmath>
#include <deque> //#include <deque>
using std::atan; using std::atan;
using std::deque; //using std::deque;
struct FPVector struct FPVector
{ {
@@ -59,8 +59,8 @@ struct Alien
float PicFrame; float PicFrame;
//float PicI; //float PicI;
//float Regeneration; //float Regeneration;
deque<QPointF> path;//path() As Point QVector<QPointF> path;//path() As Point
QPoint DestPnt; QPoint DestPnt;
// Effect Effects; // Effect Effects;
}; };
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
+73
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
Binary file not shown.
+73
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
Binary file not shown.
+11970
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
+11970
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+9 -9
View File
@@ -8,7 +8,7 @@ MainWindow::MainWindow(QWidget *parent)
qDebug() << "Load START!"; qDebug() << "Load START!";
ui->setupUi(this); ui->setupUi(this);
sndr = new UdpSender("127.0.0.1",10101); sndr = new UdpSender("127.0.0.1",10101);
//sndr->connectSend("hellow"); sndr->connectSend("hellow");
cellsize = 16; cellsize = 16;
destx = this->width() / cellsize; destx = this->width() / cellsize;
desty = this->height() / cellsize / 2; desty = this->height() / cellsize / 2;
@@ -21,7 +21,6 @@ MainWindow::MainWindow(QWidget *parent)
if (!aliens->AddAlien()) qDebug() << "Error Loading"; if (!aliens->AddAlien()) qDebug() << "Error Loading";
this->setGeometry(100,100,this->width(),this->height()); this->setGeometry(100,100,this->width(),this->height());
//qDebug() << "QT version" << qVersion(); //qDebug() << "QT version" << qVersion();
//AnimAlien = 0;
timer->start(50); timer->start(50);
qDebug() << "Load DONE!"; qDebug() << "Load DONE!";
} }
@@ -31,7 +30,7 @@ void MainWindow::ADrender()
{ {
//aliens->AddAlien(); //aliens->AddAlien();
aliens->updateAliens(); aliens->updateAliens();
adp->drawAliens(&aliens->curAliens[0], &aliens->AliensPixmaps[aliens->curAliens[0].PicType]); adp->drawAliens(&aliens->curAliens[0], &aliens->AliensPixmaps[0]);
this->repaint(); this->repaint();
} }
@@ -75,10 +74,13 @@ void MainWindow::SetCell(int x, int y)
aliens->Cells[cp.x()][cp.y()] = - 1; aliens->Cells[cp.x()][cp.y()] = - 1;
adp->drawcell(cp); adp->drawcell(cp);
//aliens->recreatePath(); //aliens->recreatePath();
adp->StepAlien=0;
//adp->AnimAlien=0; //adp->AnimAlien=0;
//aliens->curAliens[aliens->CurWave].Position.pnt = aliens->curAliens[aliens->CurWave-1].path[adp->StepAlien]; //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(); //qDebug() << "click: " << cp.x() << ";" << cp.y();
aliens->Cells[cp.x()][cp.y()] = 0; aliens->Cells[cp.x()][cp.y()] = 0;
adp->clearcell(cp); adp->clearcell(cp);
adp->StepAlien=0; aliens->recreatePath();
qDebug() << aliens->recreatePath();
//aliens->clearAliens(); //aliens->clearAliens();
//aliens->AddAlien(); //aliens->AddAlien();
} }
} }
@@ -105,6 +105,6 @@ void MainWindow::ClearCell(int x, int y)
MainWindow::~MainWindow() MainWindow::~MainWindow()
{ {
delete ui; delete ui;
delete aliens; delete aliens;
delete adp; delete adp;
} }
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
** Meta object code from reading C++ file 'mainwindow.h' ** 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) ** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2)
** **
** WARNING! All changes made in this file will be lost! ** WARNING! All changes made in this file will be lost!
BIN
View File
Binary file not shown.
+11970
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+24
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>
+8 -8
View File
@@ -3,12 +3,12 @@
UdpSender::UdpSender(QString IP, quint16 Port) UdpSender::UdpSender(QString IP, quint16 Port)
{ {
sock = new QUdpSocket(); sock = new QUdpSocket();
qDebug() << sock->state(); qDebug() << sock->state();
//cout << sock->socketDescriptor() << endl; //cout << sock->socketDescriptor() << endl;
//qDebug() << sock->socketDescriptor(); //qDebug() << sock->socketDescriptor();
addr = QHostAddress(IP); addr = QHostAddress(IP);
port = Port; port = Port;
connect(sock, SIGNAL(readyRead()),this, SLOT(slotRead())); connect(sock, SIGNAL(readyRead()),this, SLOT(slotRead()));
} }
@@ -16,7 +16,7 @@ UdpSender::UdpSender(QString IP, quint16 Port)
UdpSender::~UdpSender() UdpSender::~UdpSender()
{ {
sock->close(); sock->close();
delete sock; delete sock;
} }
@@ -36,10 +36,10 @@ void UdpSender::slotRead()
void UdpSender::connectSend(QString s) void UdpSender::connectSend(QString s)
{ {
sz = s.length(); sz = s.length();
sock->connectToHost(addr,port); sock->connectToHost(addr,port);
qDebug() << sock->error(); //qDebug() << sock->error();
qDebug() << sock->state(); qDebug() << sock->state();
qDebug() << sock->socketDescriptor(); //qDebug() << sock->socketDescriptor();
if (sock->write(s.toUtf8())>0) qDebug() << "writen!"; qDebug() << sock->write(s.toUtf8()) << "writen!";
} }
BIN
View File
Binary file not shown.
+67 -67
View File
@@ -1,67 +1,67 @@
/******************************************************************************** /********************************************************************************
** Form generated from reading ui file 'mainwindow.ui' ** 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 ** by: Qt User Interface Compiler version 4.5.2
** **
** WARNING! All changes made in this file will be lost when recompiling ui file! ** WARNING! All changes made in this file will be lost when recompiling ui file!
********************************************************************************/ ********************************************************************************/
#ifndef UI_MAINWINDOW_H #ifndef UI_MAINWINDOW_H
#define UI_MAINWINDOW_H #define UI_MAINWINDOW_H
#include <QtCore/QVariant> #include <QtCore/QVariant>
#include <QtGui/QAction> #include <QtGui/QAction>
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include <QtGui/QButtonGroup> #include <QtGui/QButtonGroup>
#include <QtGui/QHeaderView> #include <QtGui/QHeaderView>
#include <QtGui/QMainWindow> #include <QtGui/QMainWindow>
#include <QtGui/QWidget> #include <QtGui/QWidget>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class Ui_MainWindow class Ui_MainWindow
{ {
public: public:
QWidget *widget; QWidget *widget;
QWidget *paintWidget; QWidget *paintWidget;
void setupUi(QMainWindow *MainWindow) void setupUi(QMainWindow *MainWindow)
{ {
if (MainWindow->objectName().isEmpty()) if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QString::fromUtf8("MainWindow")); MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
MainWindow->resize(800, 400); MainWindow->resize(800, 400);
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0); sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0); sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(MainWindow->sizePolicy().hasHeightForWidth()); sizePolicy.setHeightForWidth(MainWindow->sizePolicy().hasHeightForWidth());
MainWindow->setSizePolicy(sizePolicy); MainWindow->setSizePolicy(sizePolicy);
MainWindow->setMinimumSize(QSize(800, 400)); MainWindow->setMinimumSize(QSize(800, 400));
MainWindow->setBaseSize(QSize(800, 400)); MainWindow->setBaseSize(QSize(800, 400));
widget = new QWidget(MainWindow); widget = new QWidget(MainWindow);
widget->setObjectName(QString::fromUtf8("widget")); widget->setObjectName(QString::fromUtf8("widget"));
paintWidget = new QWidget(widget); paintWidget = new QWidget(widget);
paintWidget->setObjectName(QString::fromUtf8("paintWidget")); paintWidget->setObjectName(QString::fromUtf8("paintWidget"));
paintWidget->setGeometry(QRect(40, 20, 361, 181)); paintWidget->setGeometry(QRect(40, 20, 361, 181));
MainWindow->setCentralWidget(widget); MainWindow->setCentralWidget(widget);
retranslateUi(MainWindow); retranslateUi(MainWindow);
QMetaObject::connectSlotsByName(MainWindow); QMetaObject::connectSlotsByName(MainWindow);
} // setupUi } // setupUi
void retranslateUi(QMainWindow *MainWindow) void retranslateUi(QMainWindow *MainWindow)
{ {
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8)); MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8));
Q_UNUSED(MainWindow); Q_UNUSED(MainWindow);
} // retranslateUi } // retranslateUi
}; };
namespace Ui { namespace Ui {
class MainWindow: public Ui_MainWindow {}; class MainWindow: public Ui_MainWindow {};
} // namespace Ui } // namespace Ui
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // UI_MAINWINDOW_H #endif // UI_MAINWINDOW_H