• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Tuan

compiled bitmap's format

1 post in this topic

Do you actually mean 'compiled bitmaps' or 'Runtime Length Encoded' (RLE) bitmaps?

- An RLE bitmap, is a form of compression, but I believe that when using them, you can speed up your bliting (i think). It gets its compression by only storing pixels that are different from the one next to it.

- A compiled bitmap, is one that you converted to pure code and is including into your make file. It will usually be an ASM file for greater speed. This function will work only in 8bit mode I believe. You can download the read the original article for this at
http://www.xgames3d.com/articles/csprite/areadcsp.htm

Hope this helped.

code:

int Compile_Sprite_WASM (sprite_ptr the_sprite, char *spritename) {
int i, x, y, offset, offset1, offset2, offset3, bitmap_offset;

FILE *outfile;
char byte1, byte2, byte3, byte4;
char *filename;
unsigned char *bitmap;
filename = strdup(spritename);
strcat(filename, ".ASM");

if((outfile = fopen(filename,"wt")) == NULL){
printf("Could not open output file %s\n", filename);
return(1);
};

fprintf(outfile,".386p\n");
fprintf(outfile," NAME %s\n", spritename);
fprintf(outfile,"DGROUP GROUP CONST,CONST2,_DATA,_BSS\n");
fprintf(outfile,"_TEXT SEGMENT PARA PUBLIC USE32 'CODE'\n");
fprintf(outfile," ASSUME CS:_TEXT ,DS : DGROUP,SS : DGROUP\n");

for (i=0; i < the_sprite->num_frames; i++) fprintf(outfile," PUBLIC %s_%d_\n", spritename, i);
for (i=0; i < the_sprite->num_frames; i++) {
fprintf(outfile,"%s_%d_: push ECX\n", spritename, i);
fprintf(outfile," mov ECX,EDX\n");
fprintf(outfile," shl ECX,08H\n");
fprintf(outfile," shl EDX,06H\n");
fprintf(outfile," add EBX,ECX\n");
fprintf(outfile," add EDX,EBX\n");
fprintf(outfile," add EAX,EDX\n");
bitmap_offset = 0;
bitmap = the_sprite->frames[i];

for (y = 0; y < the_sprite->height; y++) {
offset = y * 320;
x = 0;

while (x < the_sprite->width) {
if (*(bitmap + bitmap_offset) != 0) {
byte1 = *(bitmap + bitmap_offset);
offset1 = offset;
bitmap_offset++;
offset++;
x++;
if ((*(bitmap + bitmap_offset) != 0) && (x < the_sprite->width)) {
byte2 = *(bitmap + bitmap_offset);
offset2 = offset;
bitmap_offset++;
offset++;
x++;
if ((*(bitmap + bitmap_offset) != 0) && (x < the_sprite->width)) {
byte3 = *(bitmap + bitmap_offset);
offset3 = offset;
bitmap_offset++;
offset++;
x++;
if ((*(bitmap + bitmap_offset) != 0) && (x < the_sprite->width)) {
byte4 = *(bitmap + bitmap_offset);
fprintf(outfile," mov dword ptr +0x%x[EAX],0x%02x%02x%02x%02xH\n", offset1, byte4, byte3, byte2, byte1);
}
else {
fprintf(outfile," mov word ptr +0x%x[EAX],0x%02x%02xH\n", offset1, byte2, byte1);
fprintf(outfile," mov byte ptr +0x%x[EAX],0x%02xH\n", offset3, byte3);
}
}
else {
fprintf(outfile," mov word ptr +0x%x[EAX],0x%02x%02xH\n", offset1, byte2, byte1);
}
}
else {
fprintf(outfile," mov byte ptr +0x%x[EAX],0x%02xH\n", offset1, byte1);
}
}
else {
bitmap_offset++;
offset++;
x++;
}
}; // end while x
}; // end for y
fprintf(outfile," pop ECX\n");
fprintf(outfile," ret\n");
fprintf(outfile," nop\n");
}; // end for frames

fprintf(outfile,"_TEXT ENDS\n\n");
fprintf(outfile,"CONST SEGMENT DWORD PUBLIC USE32 'DATA'\n");
fprintf(outfile,"CONST ENDS\n\n");
fprintf(outfile,"CONST2 SEGMENT DWORD PUBLIC USE32 'DATA'\n");
fprintf(outfile,"CONST2 ENDS\n\n");
fprintf(outfile,"_DATA SEGMENT DWORD PUBLIC USE32 'DATA'\n");
fprintf(outfile,"_DATA ENDS\n\n");
fprintf(outfile,"_BSS SEGMENT DWORD PUBLIC USE32 'BSS'\n");
fprintf(outfile,"_BSS ENDS\n\n");
fprintf(outfile," END");
fclose(outfile);
return(0);
};


[This message has been edited by Gromit (edited December 03, 1999).]

0

Share this post


Link to post
Share on other sites
Could anyone show me what is the compiled bitmap's format to get the fastest blitting?
Thanx.
0

Share this post


Link to post
Share on other sites